/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/@babel/runtime/helpers/OverloadYield.js":
/*!**************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/OverloadYield.js ***!
  \**************************************************************/
/***/ ((module) => {

function _OverloadYield(e, d) {
  this.v = e, this.k = d;
}
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  \*****************************************************************/
/***/ ((module) => {

function asyncGeneratorStep(n, t, e, r, o, a, c) {
  try {
    var i = n[a](c),
      u = i.value;
  } catch (n) {
    return void e(n);
  }
  i.done ? t(u) : Promise.resolve(u).then(r, o);
}
function _asyncToGenerator(n) {
  return function () {
    var t = this,
      e = arguments;
    return new Promise(function (r, o) {
      var a = n.apply(t, e);
      function _next(n) {
        asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
      }
      function _throw(n) {
        asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
      }
      _next(void 0);
    });
  };
}
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
/*!***************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  \***************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/toPropertyKey.js");
function _defineProperty(e, r, t) {
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  \**********************************************************************/
/***/ ((module) => {

function _interopRequireDefault(e) {
  return e && e.__esModule ? e : {
    "default": e
  };
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regenerator.js":
/*!************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regenerator.js ***!
  \************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "./node_modules/@babel/runtime/helpers/regeneratorDefine.js");
function _regenerator() {
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
  var e,
    t,
    r = "function" == typeof Symbol ? Symbol : {},
    n = r.iterator || "@@iterator",
    o = r.toStringTag || "@@toStringTag";
  function i(r, n, o, i) {
    var c = n && n.prototype instanceof Generator ? n : Generator,
      u = Object.create(c.prototype);
    return regeneratorDefine(u, "_invoke", function (r, n, o) {
      var i,
        c,
        u,
        f = 0,
        p = o || [],
        y = !1,
        G = {
          p: 0,
          n: 0,
          v: e,
          a: d,
          f: d.bind(e, 4),
          d: function d(t, r) {
            return i = t, c = 0, u = e, G.n = r, a;
          }
        };
      function d(r, n) {
        for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
          var o,
            i = p[t],
            d = G.p,
            l = i[2];
          r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
        }
        if (o || r > 1) return a;
        throw y = !0, n;
      }
      return function (o, p, l) {
        if (f > 1) throw TypeError("Generator is already running");
        for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
          i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
          try {
            if (f = 2, i) {
              if (c || (o = "next"), t = i[o]) {
                if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
                if (!t.done) return t;
                u = t.value, c < 2 && (c = 0);
              } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
              i = e;
            } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
          } catch (t) {
            i = e, c = 1, u = t;
          } finally {
            f = 1;
          }
        }
        return {
          value: t,
          done: y
        };
      };
    }(r, o, i), !0), u;
  }
  var a = {};
  function Generator() {}
  function GeneratorFunction() {}
  function GeneratorFunctionPrototype() {}
  t = Object.getPrototypeOf;
  var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
      return this;
    }), t),
    u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
  function f(e) {
    return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
  }
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
    return this;
  }), regeneratorDefine(u, "toString", function () {
    return "[object Generator]";
  }), (module.exports = _regenerator = function _regenerator() {
    return {
      w: i,
      m: f
    };
  }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorAsync.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
  \*****************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
function _regeneratorAsync(n, e, r, t, o) {
  var a = regeneratorAsyncGen(n, e, r, t, o);
  return a.next().then(function (n) {
    return n.done ? n.value : a.next();
  });
}
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
/*!********************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
  \********************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var regenerator = __webpack_require__(/*! ./regenerator.js */ "./node_modules/@babel/runtime/helpers/regenerator.js");
var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
function _regeneratorAsyncGen(r, e, t, o, n) {
  return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
}
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
/*!*************************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
  \*************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "./node_modules/@babel/runtime/helpers/OverloadYield.js");
var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "./node_modules/@babel/runtime/helpers/regeneratorDefine.js");
function AsyncIterator(t, e) {
  function n(r, o, i, f) {
    try {
      var c = t[r](o),
        u = c.value;
      return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
        n("next", t, i, f);
      }, function (t) {
        n("throw", t, i, f);
      }) : e.resolve(u).then(function (t) {
        c.value = t, i(c);
      }, function (t) {
        return n("throw", t, i, f);
      });
    } catch (t) {
      f(t);
    }
  }
  var r;
  this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
    return this;
  })), regeneratorDefine(this, "_invoke", function (t, o, i) {
    function f() {
      return new e(function (e, r) {
        n(t, i, e, r);
      });
    }
    return r = r ? r.then(f, f) : f();
  }, !0);
}
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorDefine.js":
/*!******************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
  \******************************************************************/
/***/ ((module) => {

function _regeneratorDefine(e, r, n, t) {
  var i = Object.defineProperty;
  try {
    i({}, "", {});
  } catch (e) {
    i = 0;
  }
  module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
    if (r) i ? i(e, r, {
      value: n,
      enumerable: !t,
      configurable: !t,
      writable: !t
    }) : e[r] = n;else {
      var o = function o(r, n) {
        _regeneratorDefine(e, r, function (e) {
          return this._invoke(r, n, e);
        });
      };
      o("next", 0), o("throw", 1), o("return", 2);
    }
  }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
}
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorKeys.js":
/*!****************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
  \****************************************************************/
/***/ ((module) => {

function _regeneratorKeys(e) {
  var n = Object(e),
    r = [];
  for (var t in n) r.unshift(t);
  return function e() {
    for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
    return e.done = !0, e;
  };
}
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  \*******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "./node_modules/@babel/runtime/helpers/OverloadYield.js");
var regenerator = __webpack_require__(/*! ./regenerator.js */ "./node_modules/@babel/runtime/helpers/regenerator.js");
var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsync.js");
var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "./node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "./node_modules/@babel/runtime/helpers/regeneratorKeys.js");
var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "./node_modules/@babel/runtime/helpers/regeneratorValues.js");
function _regeneratorRuntime() {
  "use strict";

  var r = regenerator(),
    e = r.m(_regeneratorRuntime),
    t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
  function n(r) {
    var e = "function" == typeof r && r.constructor;
    return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
  }
  var o = {
    "throw": 1,
    "return": 2,
    "break": 3,
    "continue": 3
  };
  function a(r) {
    var e, t;
    return function (n) {
      e || (e = {
        stop: function stop() {
          return t(n.a, 2);
        },
        "catch": function _catch() {
          return n.v;
        },
        abrupt: function abrupt(r, e) {
          return t(n.a, o[r], e);
        },
        delegateYield: function delegateYield(r, o, a) {
          return e.resultName = o, t(n.d, regeneratorValues(r), a);
        },
        finish: function finish(r) {
          return t(n.f, r);
        }
      }, t = function t(r, _t, o) {
        n.p = e.prev, n.n = e.next;
        try {
          return r(_t, o);
        } finally {
          e.next = n.n;
        }
      }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
      try {
        return r.call(this, e);
      } finally {
        n.p = e.prev, n.n = e.next;
      }
    };
  }
  return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
    return {
      wrap: function wrap(e, t, n, o) {
        return r.w(a(e), t, n, o && o.reverse());
      },
      isGeneratorFunction: n,
      mark: r.m,
      awrap: function awrap(r, e) {
        return new OverloadYield(r, e);
      },
      AsyncIterator: regeneratorAsyncIterator,
      async: function async(r, e, t, o, u) {
        return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
      },
      keys: regeneratorKeys,
      values: regeneratorValues
    };
  }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
}
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/regeneratorValues.js":
/*!******************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
  \******************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]);
function _regeneratorValues(e) {
  if (null != e) {
    var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
      r = 0;
    if (t) return t.call(e);
    if ("function" == typeof e.next) return e;
    if (!isNaN(e.length)) return {
      next: function next() {
        return e && r >= e.length && (e = void 0), {
          value: e && e[r++],
          done: !e
        };
      }
    };
  }
  throw new TypeError(_typeof(e) + " is not iterable");
}
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/toPrimitive.js":
/*!************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  \************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]);
function toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/toPropertyKey.js":
/*!**************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  \**************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var _typeof = (__webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"]);
var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "./node_modules/@babel/runtime/helpers/toPrimitive.js");
function toPropertyKey(t) {
  var i = toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
/*!*******************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  \*******************************************************/
/***/ ((module) => {

function _typeof(o) {
  "@babel/helpers - typeof";

  return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
    return typeof o;
  } : function (o) {
    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ "./node_modules/@babel/runtime/regenerator/index.js":
/*!**********************************************************!*\
  !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  \**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

// TODO(Babel 8): Remove this file.

var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
module.exports = runtime;

// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
try {
  regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
  if (typeof globalThis === "object") {
    globalThis.regeneratorRuntime = runtime;
  } else {
    Function("r", "regeneratorRuntime = r")(runtime);
  }
}


/***/ }),

/***/ "./node_modules/@converse/localforage-getitems/dist/localforage-getitems.es6.js":
/*!**************************************************************************************!*\
  !*** ./node_modules/@converse/localforage-getitems/dist/localforage-getitems.es6.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extendPrototype: () => (/* binding */ extendPrototype),
/* harmony export */   extendPrototypeResult: () => (/* binding */ extendPrototypeResult),
/* harmony export */   getItemsGeneric: () => (/* binding */ getItemsGeneric),
/* harmony export */   localforageGetItems: () => (/* binding */ localforageGetItems)
/* harmony export */ });
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! localforage */ "./node_modules/localforage/dist/localforage.js");
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(localforage__WEBPACK_IMPORTED_MODULE_0__);

function getSerializerPromise(localForageInstance) {
    if (getSerializerPromise.result) {
        return getSerializerPromise.result;
    }
    if (!localForageInstance || typeof localForageInstance.getSerializer !== 'function') {
        return Promise.reject(new Error('localforage.getSerializer() was not available! ' + 'localforage v1.4+ is required!'));
    }
    getSerializerPromise.result = localForageInstance.getSerializer();
    return getSerializerPromise.result;
}
function executeCallback(promise, callback) {
    if (callback) {
        promise.then(function(result) {
            callback(null, result);
        }, function(error) {
            callback(error);
        });
    }
    return promise;
}
function getItemKeyValue(key, callback) {
    var localforageInstance = this;
    var promise = localforageInstance.getItem(key).then(function(value) {
        return {
            key: key,
            value: value
        };
    });
    executeCallback(promise, callback);
    return promise;
}
function getItemsGeneric(keys /*, callback*/ ) {
    var localforageInstance = this;
    var promise = new Promise(function(resolve, reject) {
        var itemPromises = [];
        for(var i = 0, len = keys.length; i < len; i++){
            itemPromises.push(getItemKeyValue.call(localforageInstance, keys[i]));
        }
        Promise.all(itemPromises).then(function(keyValuePairs) {
            var result = {};
            for(var i = 0, len = keyValuePairs.length; i < len; i++){
                var keyValuePair = keyValuePairs[i];
                result[keyValuePair.key] = keyValuePair.value;
            }
            resolve(result);
        }).catch(reject);
    });
    return promise;
}
function getAllItemsUsingIterate() {
    var localforageInstance = this;
    var accumulator = {};
    return localforageInstance.iterate(function(value, key /*, iterationNumber*/ ) {
        accumulator[key] = value;
    }).then(function() {
        return accumulator;
    });
}
function getIDBKeyRange() {
    /* global IDBKeyRange, webkitIDBKeyRange, mozIDBKeyRange */ if (typeof IDBKeyRange !== 'undefined') {
        return IDBKeyRange;
    }
    if (typeof webkitIDBKeyRange !== 'undefined') {
        return webkitIDBKeyRange;
    }
    if (typeof mozIDBKeyRange !== 'undefined') {
        return mozIDBKeyRange;
    }
}
var idbKeyRange = getIDBKeyRange();
function getItemsIndexedDB(keys /*, callback*/ ) {
    keys = keys.slice();
    var localforageInstance = this;
    function comparer(a, b) {
        return a < b ? -1 : a > b ? 1 : 0;
    }
    var promise = new Promise(function(resolve, reject) {
        localforageInstance.ready().then(function() {
            // Thanks https://hacks.mozilla.org/2014/06/breaking-the-borders-of-indexeddb/
            var dbInfo = localforageInstance._dbInfo;
            var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly').objectStore(dbInfo.storeName);
            var set = keys.sort(comparer);
            var keyRangeValue = idbKeyRange.bound(keys[0], keys[keys.length - 1], false, false);
            var req;
            if ('getAll' in store) {
                req = store.getAll(keyRangeValue);
                req.onsuccess = function() {
                    var value = req.result;
                    if (value === undefined) {
                        value = null;
                    }
                    resolve(value);
                };
            } else {
                req = store.openCursor(keyRangeValue);
                var result = {};
                var i = 0;
                req.onsuccess = function() /*event*/ {
                    var cursor = req.result; // event.target.result;
                    if (!cursor) {
                        resolve(result);
                        return;
                    }
                    var key = cursor.key;
                    while(key > set[i]){
                        i++; // The cursor has passed beyond this key. Check next.
                        if (i === set.length) {
                            // There is no next. Stop searching.
                            resolve(result);
                            return;
                        }
                    }
                    if (key === set[i]) {
                        // The current cursor value should be included and we should continue
                        // a single step in case next item has the same key or possibly our
                        // next key in set.
                        var value = cursor.value;
                        if (value === undefined) {
                            value = null;
                        }
                        result[key] = value;
                        // onfound(cursor.value);
                        cursor.continue();
                    } else {
                        // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.
                        cursor.continue(set[i]);
                    }
                };
            }
            req.onerror = function() /*event*/ {
                reject(req.error);
            };
        }).catch(reject);
    });
    return promise;
}
function getItemsWebsql(keys /*, callback*/ ) {
    var localforageInstance = this;
    var promise = new Promise(function(resolve, reject) {
        localforageInstance.ready().then(function() {
            return getSerializerPromise(localforageInstance);
        }).then(function(serializer) {
            var dbInfo = localforageInstance._dbInfo;
            dbInfo.db.transaction(function(t) {
                var queryParts = new Array(keys.length);
                for(var i = 0, len = keys.length; i < len; i++){
                    queryParts[i] = '?';
                }
                t.executeSql('SELECT * FROM ' + dbInfo.storeName + ' WHERE (key IN (' + queryParts.join(',') + '))', keys, function(t, results) {
                    var result = {};
                    var rows = results.rows;
                    for(var i = 0, len = rows.length; i < len; i++){
                        var item = rows.item(i);
                        var value = item.value;
                        // Check to see if this is serialized content we need to
                        // unpack.
                        if (value) {
                            value = serializer.deserialize(value);
                        }
                        result[item.key] = value;
                    }
                    resolve(result);
                }, function(t, error) {
                    reject(error);
                });
            });
        }).catch(reject);
    });
    return promise;
}
function localforageGetItems(keys, callback) {
    var localforageInstance = this;
    var promise;
    if (!arguments.length || keys === null) {
        promise = getAllItemsUsingIterate.apply(localforageInstance);
    } else {
        var currentDriver = localforageInstance.driver();
        if (currentDriver === localforageInstance.INDEXEDDB) {
            promise = getItemsIndexedDB.apply(localforageInstance, arguments);
        } else if (currentDriver === localforageInstance.WEBSQL) {
            promise = getItemsWebsql.apply(localforageInstance, arguments);
        } else {
            promise = getItemsGeneric.apply(localforageInstance, arguments);
        }
    }
    executeCallback(promise, callback);
    return promise;
}
function extendPrototype(localforage$$1) {
    var localforagePrototype = Object.getPrototypeOf(localforage$$1);
    if (localforagePrototype) {
        localforagePrototype.getItems = localforageGetItems;
        localforagePrototype.getItems.indexedDB = function() {
            return getItemsIndexedDB.apply(this, arguments);
        };
        localforagePrototype.getItems.websql = function() {
            return getItemsWebsql.apply(this, arguments);
        };
        localforagePrototype.getItems.generic = function() {
            return getItemsGeneric.apply(this, arguments);
        };
    }
}
var extendPrototypeResult = extendPrototype((localforage__WEBPACK_IMPORTED_MODULE_0___default()));



/***/ }),

/***/ "./node_modules/@converse/openpromise/dist/openpromise.js":
/*!****************************************************************!*\
  !*** ./node_modules/@converse/openpromise/dist/openpromise.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getOpenPromise: () => (/* binding */ getOpenPromise)
/* harmony export */ });
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
function getOpenPromise() {
    const wrapper = {
        isResolved: false,
        isPending: true,
        isRejected: false
    };
    let promise;
    let resolve = ()=>{};
    let reject = ()=>{};
    if (typeof Promise.withResolvers === 'function') {
        const { promise: p, resolve: r, reject: j } = Promise.withResolvers();
        promise = p;
        resolve = r;
        reject = j;
    } else {
        promise = new Promise((r, j)=>{
            resolve = r;
            reject = j;
        });
    }
    Object.assign(promise, _object_spread_props(_object_spread({}, wrapper), {
        resolve,
        reject
    }));
    promise.then((v)=>{
        promise.isResolved = true;
        promise.isPending = false;
        promise.isRejected = false;
        return v;
    }, (e)=>{
        promise.isResolved = false;
        promise.isPending = false;
        promise.isRejected = true;
        throw e;
    });
    return promise;
} //# sourceMappingURL=openpromise.js.map


/***/ }),

/***/ "./node_modules/@converse/skeletor/dist/skeletor.js":
/*!**********************************************************!*\
  !*** ./node_modules/@converse/skeletor/dist/skeletor.js ***!
  \**********************************************************/
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self1 = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self1, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
(function(global1, factory) {
     true ? factory(exports) : 0;
})(this, function(exports1) {
    'use strict';
    var _t;
    /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
    /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
    /** Used as a reference to the global object. */ var root$1 = freeGlobal || freeSelf || Function('return this')();
    /** Built-in value references. */ var Symbol$1 = root$1.Symbol;
    /**
   * A specialized version of `_.map` for arrays without support for iteratee
   * shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns the new mapped array.
   */ function arrayMap(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length, result = Array(length);
        while(++index < length){
            result[index] = iteratee(array[index], index, array);
        }
        return result;
    }
    /**
   * Checks if `value` is classified as an `Array` object.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an array, else `false`.
   * @example
   *
   * _.isArray([1, 2, 3]);
   * // => true
   *
   * _.isArray(document.body.children);
   * // => false
   *
   * _.isArray('abc');
   * // => false
   *
   * _.isArray(_.noop);
   * // => false
   */ var isArray = Array.isArray;
    /** Used for built-in method references. */ var objectProto$l = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$h = objectProto$l.hasOwnProperty;
    /**
   * Used to resolve the
   * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
   * of values.
   */ var nativeObjectToString$2 = objectProto$l.toString;
    /** Built-in value references. */ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
    /**
   * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
   *
   * @private
   * @param {*} value The value to query.
   * @returns {string} Returns the raw `toStringTag`.
   */ function getRawTag(value) {
        var isOwn = hasOwnProperty$h.call(value, symToStringTag$1), tag = value[symToStringTag$1];
        try {
            value[symToStringTag$1] = undefined;
            var unmasked = true;
        } catch (e) {}
        var result = nativeObjectToString$2.call(value);
        if (unmasked) {
            if (isOwn) {
                value[symToStringTag$1] = tag;
            } else {
                delete value[symToStringTag$1];
            }
        }
        return result;
    }
    /** Used for built-in method references. */ var objectProto$k = Object.prototype;
    /**
   * Used to resolve the
   * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
   * of values.
   */ var nativeObjectToString$1 = objectProto$k.toString;
    /**
   * Converts `value` to a string using `Object.prototype.toString`.
   *
   * @private
   * @param {*} value The value to convert.
   * @returns {string} Returns the converted string.
   */ function objectToString(value) {
        return nativeObjectToString$1.call(value);
    }
    /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]';
    /** Built-in value references. */ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
    /**
   * The base implementation of `getTag` without fallbacks for buggy environments.
   *
   * @private
   * @param {*} value The value to query.
   * @returns {string} Returns the `toStringTag`.
   */ function baseGetTag(value) {
        if (value == null) {
            return value === undefined ? undefinedTag : nullTag;
        }
        return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
    }
    /**
   * Checks if `value` is object-like. A value is object-like if it's not `null`
   * and has a `typeof` result of "object".
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
   * @example
   *
   * _.isObjectLike({});
   * // => true
   *
   * _.isObjectLike([1, 2, 3]);
   * // => true
   *
   * _.isObjectLike(_.noop);
   * // => false
   *
   * _.isObjectLike(null);
   * // => false
   */ function isObjectLike(value) {
        return value != null && typeof value == 'object';
    }
    /** `Object#toString` result references. */ var symbolTag$3 = '[object Symbol]';
    /**
   * Checks if `value` is classified as a `Symbol` primitive or object.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
   * @example
   *
   * _.isSymbol(Symbol.iterator);
   * // => true
   *
   * _.isSymbol('abc');
   * // => false
   */ function isSymbol(value) {
        return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
    }
    /** Used to convert symbols to primitives and strings. */ var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : undefined, symbolToString = symbolProto$2 ? symbolProto$2.toString : undefined;
    /**
   * The base implementation of `_.toString` which doesn't convert nullish
   * values to empty strings.
   *
   * @private
   * @param {*} value The value to process.
   * @returns {string} Returns the string.
   */ function baseToString(value) {
        // Exit early for strings to avoid a performance hit in some environments.
        if (typeof value == 'string') {
            return value;
        }
        if (isArray(value)) {
            // Recursively convert values (susceptible to call stack limits).
            return arrayMap(value, baseToString) + '';
        }
        if (isSymbol(value)) {
            return symbolToString ? symbolToString.call(value) : '';
        }
        var result = value + '';
        return result == '0' && 1 / value == -Infinity ? '-0' : result;
    }
    /**
   * Converts `value` to a string. An empty string is returned for `null`
   * and `undefined` values. The sign of `-0` is preserved.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to convert.
   * @returns {string} Returns the converted string.
   * @example
   *
   * _.toString(null);
   * // => ''
   *
   * _.toString(-0);
   * // => '-0'
   *
   * _.toString([1, 2, 3]);
   * // => '1,2,3'
   */ function toString$2(value) {
        return value == null ? '' : baseToString(value);
    }
    /** Used to generate unique IDs. */ var idCounter = 0;
    /**
   * Generates a unique ID. If `prefix` is given, the ID is appended to it.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Util
   * @param {string} [prefix=''] The value to prefix the ID with.
   * @returns {string} Returns the unique ID.
   * @example
   *
   * _.uniqueId('contact_');
   * // => 'contact_104'
   *
   * _.uniqueId();
   * // => '105'
   */ function uniqueId(prefix) {
        var id = ++idCounter;
        return toString$2(prefix) + id;
    }
    /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */ const t = globalThis, i = t.trustedTypes, s = i ? i.createPolicy("lit-html", {
        createHTML: (t)=>t
    }) : void 0, e = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o = "?" + h, n = `<${o}>`, r = document, l = ()=>r.createComment(""), c = (t)=>null === t || "object" != typeof t && "function" != typeof t, a = Array.isArray, u = (t)=>a(t) || "function" == typeof (t === null || t === void 0 ? void 0 : t[Symbol.iterator]), d = "[ \t\n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = new WeakMap(), C = r.createTreeWalker(r, 129);
    function P(t, i) {
        if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
        return void 0 !== s ? s.createHTML(i) : i;
    }
    const V = (t, i)=>{
        const s = t.length - 1, o = [];
        let r, l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "", c = f;
        for(let i = 0; i < s; i++){
            const s = t[i];
            let a, u, d = -1, y = 0;
            for(; y < s.length && (c.lastIndex = y, u = c.exec(s), null !== u);){
                var _r;
                y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = (_r = r) !== null && _r !== void 0 ? _r : f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
            }
            const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
            l += c === f ? s + n : d >= 0 ? (o.push(a), s.slice(0, d) + e + s.slice(d) + h + x) : s + h + (-2 === d ? i : x);
        }
        return [
            P(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")),
            o
        ];
    };
    class N {
        static createElement(t, i) {
            const s = r.createElement("template");
            return s.innerHTML = t, s;
        }
        constructor({ strings: t, _$litType$: s }, n){
            let r;
            this.parts = [];
            let c = 0, a = 0;
            const u = t.length - 1, d = this.parts, [f, v] = V(t, s);
            if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
                const t = this.el.content.firstChild;
                t.replaceWith(...t.childNodes);
            }
            for(; null !== (r = C.nextNode()) && d.length < u;){
                if (1 === r.nodeType) {
                    if (r.hasAttributes()) for (const t of r.getAttributeNames())if (t.endsWith(e)) {
                        const i = v[a++], s = r.getAttribute(t).split(h), e = /([.?@])?(.*)/.exec(i);
                        d.push({
                            type: 1,
                            index: c,
                            name: e[2],
                            strings: s,
                            ctor: "." === e[1] ? H : "?" === e[1] ? I : "@" === e[1] ? L : k
                        }), r.removeAttribute(t);
                    } else t.startsWith(h) && (d.push({
                        type: 6,
                        index: c
                    }), r.removeAttribute(t));
                    if ($.test(r.tagName)) {
                        const t = r.textContent.split(h), s = t.length - 1;
                        if (s > 0) {
                            r.textContent = i ? i.emptyScript : "";
                            for(let i = 0; i < s; i++)r.append(t[i], l()), C.nextNode(), d.push({
                                type: 2,
                                index: ++c
                            });
                            r.append(t[s], l());
                        }
                    }
                } else if (8 === r.nodeType) if (r.data === o) d.push({
                    type: 2,
                    index: c
                });
                else {
                    let t = -1;
                    for(; -1 !== (t = r.data.indexOf(h, t + 1));)d.push({
                        type: 7,
                        index: c
                    }), t += h.length - 1;
                }
                c++;
            }
        }
    }
    function S(t, i, s = t, e) {
        var _s;
        var _s$_$Co, _h, _h2, _h2$_$AO;
        if (i === T) return i;
        let h = void 0 !== e ? (_s$_$Co = s._$Co) === null || _s$_$Co === void 0 ? void 0 : _s$_$Co[e] : s._$Cl;
        const o = c(i) ? void 0 : i._$litDirective$;
        var __$Co;
        return ((_h = h) === null || _h === void 0 ? void 0 : _h.constructor) !== o && ((_h2 = h) !== null && _h2 !== void 0 && (_h2$_$AO = _h2._$AO) !== null && _h2$_$AO !== void 0 && _h2$_$AO.call(_h2, false), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? ((__$Co = (_s = s)._$Co) !== null && __$Co !== void 0 ? __$Co : _s._$Co = [])[e] = h : s._$Cl = h), void 0 !== h && (i = S(t, h._$AS(t, i.values), h, e)), i;
    }
    class M {
        get parentNode() {
            return this._$AM.parentNode;
        }
        get _$AU() {
            return this._$AM._$AU;
        }
        u(t) {
            var _t$creationScope;
            const { el: { content: i }, parts: s } = this._$AD, e = ((_t$creationScope = t === null || t === void 0 ? void 0 : t.creationScope) !== null && _t$creationScope !== void 0 ? _t$creationScope : r).importNode(i, true);
            C.currentNode = e;
            let h = C.nextNode(), o = 0, n = 0, l = s[0];
            for(; void 0 !== l;){
                var _l;
                if (o === l.index) {
                    let i;
                    2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
                }
                o !== ((_l = l) === null || _l === void 0 ? void 0 : _l.index) && (h = C.nextNode(), o++);
            }
            return C.currentNode = r, e;
        }
        p(t) {
            let i = 0;
            for (const s of this._$AV)void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
        }
        constructor(t, i){
            this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
        }
    }
    class R {
        get _$AU() {
            var _this$_$AM$_$AU, _this$_$AM;
            return (_this$_$AM$_$AU = (_this$_$AM = this._$AM) === null || _this$_$AM === void 0 ? void 0 : _this$_$AM._$AU) !== null && _this$_$AM$_$AU !== void 0 ? _this$_$AM$_$AU : this._$Cv;
        }
        get parentNode() {
            var _t;
            let t = this._$AA.parentNode;
            const i = this._$AM;
            return void 0 !== i && 11 === ((_t = t) === null || _t === void 0 ? void 0 : _t.nodeType) && (t = i.parentNode), t;
        }
        get startNode() {
            return this._$AA;
        }
        get endNode() {
            return this._$AB;
        }
        _$AI(t, i = this) {
            t = S(this, t, i), c(t) ? t === E || null == t || "" === t ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u(t) ? this.k(t) : this._(t);
        }
        O(t) {
            return this._$AA.parentNode.insertBefore(t, this._$AB);
        }
        T(t) {
            this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
        }
        _(t) {
            this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r.createTextNode(t)), this._$AH = t;
        }
        $(t) {
            var _this$_$AH;
            const { values: i, _$litType$: s } = t, e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
            if (((_this$_$AH = this._$AH) === null || _this$_$AH === void 0 ? void 0 : _this$_$AH._$AD) === e) this._$AH.p(i);
            else {
                const t = new M(e, this), s = t.u(this.options);
                t.p(i), this.T(s), this._$AH = t;
            }
        }
        _$AC(t) {
            let i = A.get(t.strings);
            return void 0 === i && A.set(t.strings, i = new N(t)), i;
        }
        k(t) {
            a(this._$AH) || (this._$AH = [], this._$AR());
            const i = this._$AH;
            let s, e = 0;
            for (const h of t)e === i.length ? i.push(s = new R(this.O(l()), this.O(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
            e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
        }
        _$AR(t = this._$AA.nextSibling, i) {
            for((_this$_$AP = this._$AP) === null || _this$_$AP === void 0 ? void 0 : _this$_$AP.call(this, false, true, i); t && t !== this._$AB;){
                var _this$_$AP;
                const i = t.nextSibling;
                t.remove(), t = i;
            }
        }
        setConnected(t) {
            var _this$_$AP2;
            void 0 === this._$AM && (this._$Cv = t, (_this$_$AP2 = this._$AP) === null || _this$_$AP2 === void 0 ? void 0 : _this$_$AP2.call(this, t));
        }
        constructor(t, i, s, e){
            var _e$isConnected;
            this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = (_e$isConnected = e === null || e === void 0 ? void 0 : e.isConnected) !== null && _e$isConnected !== void 0 ? _e$isConnected : true;
        }
    }
    class k {
        get tagName() {
            return this.element.tagName;
        }
        get _$AU() {
            return this._$AM._$AU;
        }
        _$AI(t, i = this, s, e) {
            const h = this.strings;
            let o = false;
            if (void 0 === h) t = S(this, t, i, 0), o = !c(t) || t !== this._$AH && t !== T, o && (this._$AH = t);
            else {
                const e = t;
                let n, r;
                for(t = h[0], n = 0; n < h.length - 1; n++){
                    var _r2;
                    r = S(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o || (o = !c(r) || r !== this._$AH[n]), r === E ? t = E : t !== E && (t += ((_r2 = r) !== null && _r2 !== void 0 ? _r2 : "") + h[n + 1]), this._$AH[n] = r;
                }
            }
            o && !e && this.j(t);
        }
        j(t) {
            t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t !== null && t !== void 0 ? t : "");
        }
        constructor(t, i, s, e, h){
            this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = E;
        }
    }
    class H extends k {
        j(t) {
            this.element[this.name] = t === E ? void 0 : t;
        }
        constructor(){
            super(...arguments), this.type = 3;
        }
    }
    class I extends k {
        j(t) {
            this.element.toggleAttribute(this.name, !!t && t !== E);
        }
        constructor(){
            super(...arguments), this.type = 4;
        }
    }
    class L extends k {
        _$AI(t, i = this) {
            var _S;
            if ((t = (_S = S(this, t, i, 0)) !== null && _S !== void 0 ? _S : E) === T) return;
            const s = this._$AH, e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== E && (s === E || e);
            e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
        }
        handleEvent(t) {
            var _this$options$host, _this$options;
            "function" == typeof this._$AH ? this._$AH.call((_this$options$host = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.host) !== null && _this$options$host !== void 0 ? _this$options$host : this.element, t) : this._$AH.handleEvent(t);
        }
        constructor(t, i, s, e, h){
            super(t, i, s, e, h), this.type = 5;
        }
    }
    class z {
        get _$AU() {
            return this._$AM._$AU;
        }
        _$AI(t) {
            S(this, t);
        }
        constructor(t, i, s){
            this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
        }
    }
    const j = t.litHtmlPolyfillSupport;
    var _litHtmlVersions;
    j !== null && j !== void 0 && j(N, R), ((_litHtmlVersions = (_t = t).litHtmlVersions) !== null && _litHtmlVersions !== void 0 ? _litHtmlVersions : _t.litHtmlVersions = []).push("3.2.1");
    const B = (t, i, s)=>{
        var _s$renderBefore;
        const e = (_s$renderBefore = void 0) !== null && _s$renderBefore !== void 0 ? _s$renderBefore : i;
        let h = e._$litPart$;
        if (void 0 === h) {
            var _s$renderBefore2;
            const t = (_s$renderBefore2 = void 0) !== null && _s$renderBefore2 !== void 0 ? _s$renderBefore2 : null;
            e._$litPart$ = h = new R(i.insertBefore(l(), t), t, void 0, {});
        }
        return h._$AI(t), h;
    };
    /** Used for built-in method references. */ var objectProto$j = Object.prototype;
    /**
   * Checks if `value` is likely a prototype object.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
   */ function isPrototype(value) {
        var Ctor = value && value.constructor, proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$j;
        return value === proto;
    }
    /**
   * Creates a unary function that invokes `func` with its argument transformed.
   *
   * @private
   * @param {Function} func The function to wrap.
   * @param {Function} transform The argument transform.
   * @returns {Function} Returns the new function.
   */ function overArg(func, transform) {
        return function(arg) {
            return func(transform(arg));
        };
    }
    /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object);
    /** Used for built-in method references. */ var objectProto$i = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$g = objectProto$i.hasOwnProperty;
    /**
   * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names.
   */ function baseKeys(object) {
        if (!isPrototype(object)) {
            return nativeKeys(object);
        }
        var result = [];
        for(var key in Object(object)){
            if (hasOwnProperty$g.call(object, key) && key != 'constructor') {
                result.push(key);
            }
        }
        return result;
    }
    /**
   * Checks if `value` is the
   * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
   * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an object, else `false`.
   * @example
   *
   * _.isObject({});
   * // => true
   *
   * _.isObject([1, 2, 3]);
   * // => true
   *
   * _.isObject(_.noop);
   * // => true
   *
   * _.isObject(null);
   * // => false
   */ function isObject$1(value) {
        var type = typeof value;
        return value != null && (type == 'object' || type == 'function');
    }
    /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag$2 = '[object Function]', genTag$1 = '[object GeneratorFunction]', proxyTag = '[object Proxy]';
    /**
   * Checks if `value` is classified as a `Function` object.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a function, else `false`.
   * @example
   *
   * _.isFunction(_);
   * // => true
   *
   * _.isFunction(/abc/);
   * // => false
   */ function isFunction(value) {
        if (!isObject$1(value)) {
            return false;
        }
        // The use of `Object#toString` avoids issues with the `typeof` operator
        // in Safari 9 which returns 'object' for typed arrays and other constructors.
        var tag = baseGetTag(value);
        return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
    }
    /** Used to detect overreaching core-js shims. */ var coreJsData = root$1['__core-js_shared__'];
    /** Used to detect methods masquerading as native. */ var maskSrcKey = function() {
        var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
        return uid ? 'Symbol(src)_1.' + uid : '';
    }();
    /**
   * Checks if `func` has its source masked.
   *
   * @private
   * @param {Function} func The function to check.
   * @returns {boolean} Returns `true` if `func` is masked, else `false`.
   */ function isMasked(func) {
        return !!maskSrcKey && maskSrcKey in func;
    }
    /** Used for built-in method references. */ var funcProto$2 = Function.prototype;
    /** Used to resolve the decompiled source of functions. */ var funcToString$2 = funcProto$2.toString;
    /**
   * Converts `func` to its source code.
   *
   * @private
   * @param {Function} func The function to convert.
   * @returns {string} Returns the source code.
   */ function toSource(func) {
        if (func != null) {
            try {
                return funcToString$2.call(func);
            } catch (e) {}
            try {
                return func + '';
            } catch (e) {}
        }
        return '';
    }
    /**
   * Used to match `RegExp`
   * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
   */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/;
    /** Used for built-in method references. */ var funcProto$1 = Function.prototype, objectProto$h = Object.prototype;
    /** Used to resolve the decompiled source of functions. */ var funcToString$1 = funcProto$1.toString;
    /** Used to check objects for own properties. */ var hasOwnProperty$f = objectProto$h.hasOwnProperty;
    /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$f).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
    /**
   * The base implementation of `_.isNative` without bad shim checks.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a native function,
   *  else `false`.
   */ function baseIsNative(value) {
        if (!isObject$1(value) || isMasked(value)) {
            return false;
        }
        var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
        return pattern.test(toSource(value));
    }
    /**
   * Gets the value at `key` of `object`.
   *
   * @private
   * @param {Object} [object] The object to query.
   * @param {string} key The key of the property to get.
   * @returns {*} Returns the property value.
   */ function getValue(object, key) {
        return object == null ? undefined : object[key];
    }
    /**
   * Gets the native function at `key` of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {string} key The key of the method to get.
   * @returns {*} Returns the function if it's native, else `undefined`.
   */ function getNative(object, key) {
        var value = getValue(object, key);
        return baseIsNative(value) ? value : undefined;
    }
    /* Built-in method references that are verified to be native. */ var DataView = getNative(root$1, 'DataView');
    /* Built-in method references that are verified to be native. */ var Map = getNative(root$1, 'Map');
    /* Built-in method references that are verified to be native. */ var Promise$1 = getNative(root$1, 'Promise');
    /* Built-in method references that are verified to be native. */ var Set = getNative(root$1, 'Set');
    /* Built-in method references that are verified to be native. */ var WeakMap$1 = getNative(root$1, 'WeakMap');
    /** `Object#toString` result references. */ var mapTag$6 = '[object Map]', objectTag$4 = '[object Object]', promiseTag = '[object Promise]', setTag$6 = '[object Set]', weakMapTag$2 = '[object WeakMap]';
    var dataViewTag$4 = '[object DataView]';
    /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap$1);
    /**
   * Gets the `toStringTag` of `value`.
   *
   * @private
   * @param {*} value The value to query.
   * @returns {string} Returns the `toStringTag`.
   */ var getTag = baseGetTag;
    // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
    if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$4 || Map && getTag(new Map()) != mapTag$6 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag$6 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$2) {
        getTag = function(value) {
            var result = baseGetTag(value), Ctor = result == objectTag$4 ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : '';
            if (ctorString) {
                switch(ctorString){
                    case dataViewCtorString:
                        return dataViewTag$4;
                    case mapCtorString:
                        return mapTag$6;
                    case promiseCtorString:
                        return promiseTag;
                    case setCtorString:
                        return setTag$6;
                    case weakMapCtorString:
                        return weakMapTag$2;
                }
            }
            return result;
        };
    }
    /** `Object#toString` result references. */ var argsTag$3 = '[object Arguments]';
    /**
   * The base implementation of `_.isArguments`.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an `arguments` object,
   */ function baseIsArguments(value) {
        return isObjectLike(value) && baseGetTag(value) == argsTag$3;
    }
    /** Used for built-in method references. */ var objectProto$g = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$e = objectProto$g.hasOwnProperty;
    /** Built-in value references. */ var propertyIsEnumerable$1 = objectProto$g.propertyIsEnumerable;
    /**
   * Checks if `value` is likely an `arguments` object.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an `arguments` object,
   *  else `false`.
   * @example
   *
   * _.isArguments(function() { return arguments; }());
   * // => true
   *
   * _.isArguments([1, 2, 3]);
   * // => false
   */ var isArguments = baseIsArguments(function() {
        return arguments;
    }()) ? baseIsArguments : function(value) {
        return isObjectLike(value) && hasOwnProperty$e.call(value, 'callee') && !propertyIsEnumerable$1.call(value, 'callee');
    };
    /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER$1 = 9007199254740991;
    /**
   * Checks if `value` is a valid array-like length.
   *
   * **Note:** This method is loosely based on
   * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
   * @example
   *
   * _.isLength(3);
   * // => true
   *
   * _.isLength(Number.MIN_VALUE);
   * // => false
   *
   * _.isLength(Infinity);
   * // => false
   *
   * _.isLength('3');
   * // => false
   */ function isLength(value) {
        return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
    }
    /**
   * Checks if `value` is array-like. A value is considered array-like if it's
   * not a function and has a `value.length` that's an integer greater than or
   * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
   * @example
   *
   * _.isArrayLike([1, 2, 3]);
   * // => true
   *
   * _.isArrayLike(document.body.children);
   * // => true
   *
   * _.isArrayLike('abc');
   * // => true
   *
   * _.isArrayLike(_.noop);
   * // => false
   */ function isArrayLike(value) {
        return value != null && isLength(value.length) && !isFunction(value);
    }
    /**
   * This method returns `false`.
   *
   * @static
   * @memberOf _
   * @since 4.13.0
   * @category Util
   * @returns {boolean} Returns `false`.
   * @example
   *
   * _.times(2, _.stubFalse);
   * // => [false, false]
   */ function stubFalse() {
        return false;
    }
    /** Detect free variable `exports`. */ var freeExports$2 = typeof exports1 == 'object' && exports1 && !exports1.nodeType && exports1;
    /** Detect free variable `module`. */ var freeModule$2 = freeExports$2 && "object" == 'object' && module && !module.nodeType && module;
    /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
    /** Built-in value references. */ var Buffer$1 = moduleExports$2 ? root$1.Buffer : undefined;
    /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
    /**
   * Checks if `value` is a buffer.
   *
   * @static
   * @memberOf _
   * @since 4.3.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
   * @example
   *
   * _.isBuffer(new Buffer(2));
   * // => true
   *
   * _.isBuffer(new Uint8Array(2));
   * // => false
   */ var isBuffer = nativeIsBuffer || stubFalse;
    /** `Object#toString` result references. */ var argsTag$2 = '[object Arguments]', arrayTag$2 = '[object Array]', boolTag$3 = '[object Boolean]', dateTag$3 = '[object Date]', errorTag$2 = '[object Error]', funcTag$1 = '[object Function]', mapTag$5 = '[object Map]', numberTag$3 = '[object Number]', objectTag$3 = '[object Object]', regexpTag$3 = '[object RegExp]', setTag$5 = '[object Set]', stringTag$4 = '[object String]', weakMapTag$1 = '[object WeakMap]';
    var arrayBufferTag$3 = '[object ArrayBuffer]', dataViewTag$3 = '[object DataView]', float32Tag$2 = '[object Float32Array]', float64Tag$2 = '[object Float64Array]', int8Tag$2 = '[object Int8Array]', int16Tag$2 = '[object Int16Array]', int32Tag$2 = '[object Int32Array]', uint8Tag$2 = '[object Uint8Array]', uint8ClampedTag$2 = '[object Uint8ClampedArray]', uint16Tag$2 = '[object Uint16Array]', uint32Tag$2 = '[object Uint32Array]';
    /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {};
    typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
    typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$4] = typedArrayTags[weakMapTag$1] = false;
    /**
   * The base implementation of `_.isTypedArray` without Node.js optimizations.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
   */ function baseIsTypedArray(value) {
        return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }
    /**
   * The base implementation of `_.unary` without support for storing metadata.
   *
   * @private
   * @param {Function} func The function to cap arguments for.
   * @returns {Function} Returns the new capped function.
   */ function baseUnary(func) {
        return function(value) {
            return func(value);
        };
    }
    /** Detect free variable `exports`. */ var freeExports$1 = typeof exports1 == 'object' && exports1 && !exports1.nodeType && exports1;
    /** Detect free variable `module`. */ var freeModule$1 = freeExports$1 && "object" == 'object' && module && !module.nodeType && module;
    /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
    /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports$1 && freeGlobal.process;
    /** Used to access faster Node.js helpers. */ var nodeUtil = function() {
        try {
            // Use `util.types` for Node.js 10+.
            var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
            if (types) {
                return types;
            }
            // Legacy `process.binding('util')` for Node.js < 10.
            return freeProcess && freeProcess.binding && freeProcess.binding('util');
        } catch (e) {}
    }();
    /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    /**
   * Checks if `value` is classified as a typed array.
   *
   * @static
   * @memberOf _
   * @since 3.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
   * @example
   *
   * _.isTypedArray(new Uint8Array);
   * // => true
   *
   * _.isTypedArray([]);
   * // => false
   */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    /** `Object#toString` result references. */ var mapTag$4 = '[object Map]', setTag$4 = '[object Set]';
    /** Used for built-in method references. */ var objectProto$f = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$d = objectProto$f.hasOwnProperty;
    /**
   * Checks if `value` is an empty object, collection, map, or set.
   *
   * Objects are considered empty if they have no own enumerable string keyed
   * properties.
   *
   * Array-like values such as `arguments` objects, arrays, buffers, strings, or
   * jQuery-like collections are considered empty if they have a `length` of `0`.
   * Similarly, maps and sets are considered empty if they have a `size` of `0`.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is empty, else `false`.
   * @example
   *
   * _.isEmpty(null);
   * // => true
   *
   * _.isEmpty(true);
   * // => true
   *
   * _.isEmpty(1);
   * // => true
   *
   * _.isEmpty([1, 2, 3]);
   * // => false
   *
   * _.isEmpty({ 'a': 1 });
   * // => false
   */ function isEmpty(value) {
        if (value == null) {
            return true;
        }
        if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
            return !value.length;
        }
        var tag = getTag(value);
        if (tag == mapTag$4 || tag == setTag$4) {
            return !value.size;
        }
        if (isPrototype(value)) {
            return !baseKeys(value).length;
        }
        for(var key in value){
            if (hasOwnProperty$d.call(value, key)) {
                return false;
            }
        }
        return true;
    }
    /**
   * The base implementation of `_.times` without support for iteratee shorthands
   * or max array length checks.
   *
   * @private
   * @param {number} n The number of times to invoke `iteratee`.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns the array of results.
   */ function baseTimes(n, iteratee) {
        var index = -1, result = Array(n);
        while(++index < n){
            result[index] = iteratee(index);
        }
        return result;
    }
    /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991;
    /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/;
    /**
   * Checks if `value` is a valid array-like index.
   *
   * @private
   * @param {*} value The value to check.
   * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
   * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
   */ function isIndex(value, length) {
        var type = typeof value;
        length = length == null ? MAX_SAFE_INTEGER : length;
        return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
    }
    /** Used for built-in method references. */ var objectProto$e = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$c = objectProto$e.hasOwnProperty;
    /**
   * Creates an array of the enumerable property names of the array-like `value`.
   *
   * @private
   * @param {*} value The value to query.
   * @param {boolean} inherited Specify returning inherited property names.
   * @returns {Array} Returns the array of property names.
   */ function arrayLikeKeys(value, inherited) {
        var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
        for(var key in value){
            if ((inherited || hasOwnProperty$c.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
            (key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
            isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
            isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
            isIndex(key, length)))) {
                result.push(key);
            }
        }
        return result;
    }
    /**
   * Creates an array of the own enumerable property names of `object`.
   *
   * **Note:** Non-object values are coerced to objects. See the
   * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
   * for more details.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Object
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names.
   * @example
   *
   * function Foo() {
   *   this.a = 1;
   *   this.b = 2;
   * }
   *
   * Foo.prototype.c = 3;
   *
   * _.keys(new Foo);
   * // => ['a', 'b'] (iteration order is not guaranteed)
   *
   * _.keys('hi');
   * // => ['0', '1']
   */ function keys$2(object) {
        return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
    }
    /** Used to match a single whitespace character. */ var reWhitespace = /\s/;
    /**
   * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
   * character of `string`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {number} Returns the index of the last non-whitespace character.
   */ function trimmedEndIndex(string) {
        var index = string.length;
        while(index-- && reWhitespace.test(string.charAt(index))){}
        return index;
    }
    /** Used to match leading whitespace. */ var reTrimStart = /^\s+/;
    /**
   * The base implementation of `_.trim`.
   *
   * @private
   * @param {string} string The string to trim.
   * @returns {string} Returns the trimmed string.
   */ function baseTrim(string) {
        return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string;
    }
    /** Used as references for various `Number` constants. */ var NAN = 0 / 0;
    /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
    /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i;
    /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i;
    /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt;
    /**
   * Converts `value` to a number.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to process.
   * @returns {number} Returns the number.
   * @example
   *
   * _.toNumber(3.2);
   * // => 3.2
   *
   * _.toNumber(Number.MIN_VALUE);
   * // => 5e-324
   *
   * _.toNumber(Infinity);
   * // => Infinity
   *
   * _.toNumber('3.2');
   * // => 3.2
   */ function toNumber$1(value) {
        if (typeof value == 'number') {
            return value;
        }
        if (isSymbol(value)) {
            return NAN;
        }
        if (isObject$1(value)) {
            var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
            value = isObject$1(other) ? other + '' : other;
        }
        if (typeof value != 'string') {
            return value === 0 ? value : +value;
        }
        value = baseTrim(value);
        var isBinary = reIsBinary.test(value);
        return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
    }
    /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308;
    /**
   * Converts `value` to a finite number.
   *
   * @static
   * @memberOf _
   * @since 4.12.0
   * @category Lang
   * @param {*} value The value to convert.
   * @returns {number} Returns the converted number.
   * @example
   *
   * _.toFinite(3.2);
   * // => 3.2
   *
   * _.toFinite(Number.MIN_VALUE);
   * // => 5e-324
   *
   * _.toFinite(Infinity);
   * // => 1.7976931348623157e+308
   *
   * _.toFinite('3.2');
   * // => 3.2
   */ function toFinite(value) {
        if (!value) {
            return value === 0 ? value : 0;
        }
        value = toNumber$1(value);
        if (value === INFINITY || value === -Infinity) {
            var sign = value < 0 ? -1 : 1;
            return sign * MAX_INTEGER;
        }
        return value === value ? value : 0;
    }
    /**
   * Converts `value` to an integer.
   *
   * **Note:** This method is loosely based on
   * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to convert.
   * @returns {number} Returns the converted integer.
   * @example
   *
   * _.toInteger(3.2);
   * // => 3
   *
   * _.toInteger(Number.MIN_VALUE);
   * // => 0
   *
   * _.toInteger(Infinity);
   * // => 1.7976931348623157e+308
   *
   * _.toInteger('3.2');
   * // => 3
   */ function toInteger(value) {
        var result = toFinite(value), remainder = result % 1;
        return result === result ? remainder ? result - remainder : result : 0;
    }
    /** Error message constants. */ var FUNC_ERROR_TEXT$3 = 'Expected a function';
    /**
   * Creates a function that invokes `func`, with the `this` binding and arguments
   * of the created function, while it's called less than `n` times. Subsequent
   * calls to the created function return the result of the last `func` invocation.
   *
   * @static
   * @memberOf _
   * @since 3.0.0
   * @category Function
   * @param {number} n The number of calls at which `func` is no longer invoked.
   * @param {Function} func The function to restrict.
   * @returns {Function} Returns the new restricted function.
   * @example
   *
   * jQuery(element).on('click', _.before(5, addContactToList));
   * // => Allows adding up to 4 contacts to the list.
   */ function before(n, func) {
        var result;
        if (typeof func != 'function') {
            throw new TypeError(FUNC_ERROR_TEXT$3);
        }
        n = toInteger(n);
        return function() {
            if (--n > 0) {
                result = func.apply(this, arguments);
            }
            if (n <= 1) {
                func = undefined;
            }
            return result;
        };
    }
    /**
   * Creates a function that is restricted to invoking `func` once. Repeat calls
   * to the function return the value of the first invocation. The `func` is
   * invoked with the `this` binding and arguments of the created function.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Function
   * @param {Function} func The function to restrict.
   * @returns {Function} Returns the new restricted function.
   * @example
   *
   * var initialize = _.once(createApplication);
   * initialize();
   * initialize();
   * // => `createApplication` is invoked once
   */ function once(func) {
        return before(2, func);
    }
    // Regular expression used to split event strings.
    const eventSplitter = /\s+/;
    /**
   * Iterates over the standard `event, callback` (as well as the fancy multiple
   * space-separated events `"change blur", callback` and jQuery-style event
   * maps `{event: callback}`).
   */ function eventsApi(iteratee, events, name, callback, opts) {
        let i = 0, names;
        if (name && typeof name === 'object') {
            // Handle event maps.
            if (callback !== undefined && 'context' in opts && opts.context === undefined) opts.context = callback;
            for(names = keys$2(name); i < names.length; i++){
                events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
            }
        } else if (name && eventSplitter.test(name)) {
            // Handle space-separated event names by delegating them individually.
            for(names = name.split(eventSplitter); i < names.length; i++){
                events = iteratee(events, names[i], callback, opts);
            }
        } else {
            // Finally, standard events.
            events = iteratee(events, name, callback, opts);
        }
        return events;
    }
    // The reducing API that adds a callback to the `events` object.
    function onApi(events, name, callback, options) {
        if (callback) {
            const handlers = events[name] || (events[name] = []);
            const context = options.context, ctx = options.ctx, listening = options.listening;
            if (listening) listening.count++;
            handlers.push({
                callback,
                context,
                ctx: context || ctx,
                listening
            });
        }
        return events;
    }
    /**
   * An try-catch guarded #on function, to prevent poisoning the global
   * `_listening` variable.
   * @param {any} obj
   * @param {string} name
   * @param {Function} callback
   * @param {any} context
   */ function tryCatchOn(obj, name, callback, context) {
        try {
            obj.on(name, callback, context);
        } catch (e) {
            return e;
        }
    }
    /**
   * The reducing API that removes a callback from the `events` object.
   */ function offApi(events, name, callback, options) {
        if (!events) return;
        const context = options.context, listeners = options.listeners;
        let i = 0, names;
        // Delete all event listeners and "drop" events.
        if (!name && !context && !callback) {
            for(names = keys$2(listeners); i < names.length; i++){
                listeners[names[i]].cleanup();
            }
            return;
        }
        names = name ? [
            name
        ] : keys$2(events);
        for(; i < names.length; i++){
            name = names[i];
            const handlers = events[name];
            // Bail out if there are no events stored.
            if (!handlers) {
                break;
            }
            // Find any remaining events.
            const remaining = [];
            for(let j = 0; j < handlers.length; j++){
                const handler = handlers[j];
                if (callback && callback !== handler.callback && callback !== handler.callback._callback || context && context !== handler.context) {
                    remaining.push(handler);
                } else {
                    const listening = handler.listening;
                    if (listening) listening.stop(name, callback);
                }
            }
            // Replace events if there are any remaining.  Otherwise, clean up.
            if (remaining.length) {
                events[name] = remaining;
            } else {
                delete events[name];
            }
        }
        return events;
    }
    /**
   * Reduces the event callbacks into a map of `{event: onceWrapper}`.
   * `offer` unbinds the `onceWrapper` after it has been called.
   */ function onceMap(map, name, callback, offer) {
        if (callback) {
            const _once = map[name] = once(function() {
                offer(name, _once);
                callback.apply(this, arguments);
            });
            _once._callback = callback;
        }
        return map;
    }
    /** Handles triggering the appropriate event callbacks. */ function triggerApi(objEvents, name, callback, args) {
        if (objEvents) {
            const events = objEvents[name];
            let allEvents = objEvents.all;
            if (events && allEvents) allEvents = allEvents.slice();
            if (events) triggerEvents(events, args);
            if (allEvents) triggerEvents(allEvents, [
                name
            ].concat(args));
        }
        return objEvents;
    }
    /**
   * A difficult-to-believe, but optimized internal dispatch function for
   * triggering events. Tries to keep the usual cases speedy (most internal
   * Backbone events have 3 arguments).
   */ function triggerEvents(events, args) {
        let ev, i = -1;
        const l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
        switch(args.length){
            case 0:
                while(++i < l)(ev = events[i]).callback.call(ev.ctx);
                return;
            case 1:
                while(++i < l)(ev = events[i]).callback.call(ev.ctx, a1);
                return;
            case 2:
                while(++i < l)(ev = events[i]).callback.call(ev.ctx, a1, a2);
                return;
            case 3:
                while(++i < l)(ev = events[i]).callback.call(ev.ctx, a1, a2, a3);
                return;
            default:
                while(++i < l)(ev = events[i]).callback.apply(ev.ctx, args);
                return;
        }
    }
    /**
   * A listening class that tracks and cleans up memory bindings
   * when all callbacks have been offed.
   */ class Listening {
        /**
     * @param {string} name
     * @param {Function} callback
     * @param {any} context
     * @param {Listening} _listening
     */ start(name, callback, context, _listening) {
            this._events = eventsApi(onApi, this._events || {}, name, callback, {
                context: this.obj,
                ctx: context,
                listening: _listening
            });
            if (_listening) {
                const listeners = this.obj._listeners || (this.obj._listeners = {});
                listeners[this.id] = this;
                // Allow the listening to use a counter, instead of tracking
                // callbacks for library interop
                this.interop = false;
            }
            return this;
        }
        /**
     * Stop's listening to a callback (or several).
     * Uses an optimized counter if the listenee uses Backbone.Events.
     * Otherwise, falls back to manual tracking to support events
     * library interop.
     * @param {string} name
     * @param {Function} callback
     */ stop(name, callback) {
            let cleanup;
            if (this.interop) {
                this._events = eventsApi(offApi, this._events, name, callback, {
                    context: undefined,
                    listeners: undefined
                });
                cleanup = !this._events;
            } else {
                this.count--;
                cleanup = this.count === 0;
            }
            if (cleanup) this.cleanup();
        }
        /**
     * Cleans up memory bindings between the listener and the listenee.
     */ cleanup() {
            delete this.listener._listeningTo[this.obj._listenId];
            if (!this.interop) delete this.obj._listeners[this.id];
        }
        /** @typedef {import('./eventemitter.js').default} EventEmitter */ /**
     * @param {any} listener
     * @param {any} obj
     */ constructor(listener, obj){
            this.id = listener._listenId;
            this.listener = listener;
            this.obj = obj;
            this.interop = true;
            this.count = 0;
            this._events = undefined;
        }
    }
    /**
   * @copyright 2010-2019 Jeremy Ashkenas and DocumentCloud
   * @copyright 2023 JC Brand
   */ // A private global variable to share between listeners and listenees.
    let _listening;
    /**
   * @function
   * @template {new(...args: any[]) => {}} ClassConstructor
   * @param {ClassConstructor} Base
   */ function EventEmitter(Base) {
        return class EventEmitter extends Base {
            /**
       * @typedef {import('./model.js').Model} Model
       * @typedef {import('./collection.js').Collection} Collection
       * @typedef {Record.<string, any>} Options
       *
       * @callback EventCallback
       * @param {any} event
       * @param {Model} model
       * @param {Collection} collection
       * @param {Options} [options]
       */ /**
       * Bind an event to a `callback` function. Passing `"all"` will bind
       * the callback to all events fired.
       * @param {string} name
       * @param {EventCallback} callback
       * @param {any} context
       * @return {EventEmitter}
       */ on(name, callback, context) {
                this._events = eventsApi(onApi, this._events || {}, name, callback, {
                    context: context,
                    ctx: this,
                    listening: _listening
                });
                if (_listening) {
                    const listeners = this._listeners || (this._listeners = {});
                    listeners[_listening.id] = _listening;
                    // Allow the listening to use a counter, instead of tracking
                    // callbacks for library interop
                    _listening.interop = false;
                }
                return this;
            }
            /**
       * Inversion-of-control versions of `on`. Tell *this* object to listen to
       * an event in another object... keeping track of what it's listening to
       * for easier unbinding later.
       * @param {any} obj
       * @param {string} name
       * @param {EventCallback} [callback]
       * @return {EventEmitter}
       */ listenTo(obj, name, callback) {
                if (!obj) return this;
                const id = obj._listenId || (obj._listenId = uniqueId('l'));
                const listeningTo = this._listeningTo || (this._listeningTo = {});
                let listening = _listening = listeningTo[id];
                // This object is not listening to any other events on `obj` yet.
                // Setup the necessary references to track the listening callbacks.
                if (!listening) {
                    this._listenId || (this._listenId = uniqueId('l'));
                    listening = _listening = listeningTo[id] = new Listening(this, obj);
                }
                // Bind callbacks on obj.
                const error = tryCatchOn(obj, name, callback, this);
                _listening = undefined;
                if (error) throw error;
                // If the target obj is not Backbone.Events, track events manually.
                if (listening.interop) listening.start(name, callback, this, _listening);
                return this;
            }
            /**
       * Remove one or many callbacks. If `context` is null, removes all
       * callbacks with that function. If `callback` is null, removes all
       * callbacks for the event. If `name` is null, removes all bound
       * callbacks for all events.
       * @param {string} name
       * @param {EventCallback} callback
       * @param {any} [context]
       * @return {EventEmitter}
       */ off(name, callback, context) {
                if (!this._events) return this;
                this._events = eventsApi(offApi, this._events, name, callback, {
                    context: context,
                    listeners: this._listeners
                });
                return this;
            }
            /**
       * Tell this object to stop listening to either specific events ... or
       * to every object it's currently listening to.
       * @param {any} [obj]
       * @param {string} [name]
       * @param {EventCallback} [callback]
       * @return {EventEmitter}
       */ stopListening(obj, name, callback) {
                const listeningTo = this._listeningTo;
                if (!listeningTo) return this;
                const ids = obj ? [
                    obj._listenId
                ] : keys$2(listeningTo);
                for(let i = 0; i < ids.length; i++){
                    const listening = listeningTo[ids[i]];
                    // If listening doesn't exist, this object is not currently
                    // listening to obj. Break out early.
                    if (!listening) break;
                    listening.obj.off(name, callback, this);
                    if (listening.interop) listening.stop(name, callback);
                }
                if (isEmpty(listeningTo)) this._listeningTo = undefined;
                return this;
            }
            /**
       * Bind an event to only be triggered a single time. After the first time
       * the callback is invoked, its listener will be removed. If multiple events
       * are passed in using the space-separated syntax, the handler will fire
       * once for each event, not once for a combination of all events.
       * @param {string} name
       * @param {EventCallback} callback
       * @param {any} context
       * @return {EventEmitter}
       */ once(name, callback, context) {
                // Map the event into a `{event: once}` object.
                const events = eventsApi(onceMap, {}, name, callback, this.off.bind(this));
                if (typeof name === 'string' && (context === null || context === undefined)) callback = undefined;
                return this.on(events, callback, context);
            }
            /**
       * Inversion-of-control versions of `once`.
       * @param {any} obj
       * @param {string} name
       * @param {EventCallback} [callback]
       * @return {EventEmitter}
       */ listenToOnce(obj, name, callback) {
                // Map the event into a `{event: once}` object.
                const events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj));
                return this.listenTo(obj, events);
            }
            /**
       * Trigger one or many events, firing all bound callbacks. Callbacks are
       * passed the same arguments as `trigger` is, apart from the event name
       * (unless you're listening on `"all"`, which will cause your callback to
       * receive the true name of the event as the first argument).
       * @param {string} name
       * @return {EventEmitter}
       */ trigger(name, ...args) {
                if (!this._events) return this;
                eventsApi(triggerApi, this._events, name, undefined, args);
                return this;
            }
        };
    }
    /**
   * @typedef {import('lit-html').TemplateResult} TemplateResult
   */ // Cached regex to split keys for `delegate`.
    const delegateEventSplitter = /^(\S+)\s*(.*)$/;
    class ElementView extends EventEmitter(HTMLElement) {
        /**
     * @typedef {import('./model.js').Model} Model
     * @typedef {import('./collection.js').Collection} Collection
     * @typedef {Record.<string, any>} Options
     *
     * @callback EventCallback
     * @param {any} event
     * @param {Model} model
     * @param {Collection} collection
     * @param {Options} [options]
     */ set events(events) {
            this._declarativeEvents = events;
        }
        get events() {
            return this._declarativeEvents;
        }
        createRenderRoot() {
            // Render without the shadow DOM
            return this;
        }
        connectedCallback() {
            if (!this._initialized) {
                this.preinitialize.apply(this, arguments);
                this.initialize.apply(this, arguments);
                this._initialized = true;
            }
            this.delegateEvents();
        }
        disconnectedCallback() {
            var _this$stopListening;
            this.undelegateEvents();
            (_this$stopListening = this.stopListening) === null || _this$stopListening === void 0 ? void 0 : _this$stopListening.call(this);
        }
        /**
     * preinitialize is an empty function by default. You can override it with a function
     * or object.  preinitialize will run before any instantiation logic is run in the View
     * eslint-disable-next-line class-methods-use-this
     */ preinitialize() {}
        /**
     * Initialize is an empty function by default. Override it with your own
     * initialization logic.
     */ initialize() {}
        beforeRender() {}
        afterRender() {}
        /**
     * **render** is the core function that your view should override, in order
     * to populate its element (`this.el`), with the appropriate HTML. The
     * convention is for **render** to always return `this`.
     */ render() {
            this.beforeRender();
            B(this.toHTML(), this);
            this.afterRender();
            return this;
        }
        /**
     * @returns {string|TemplateResult}
     */ toHTML() {
            return '';
        }
        /**
     * Set callbacks, where `this.events` is a hash of
     *
     * *{"event selector": "callback"}*
     *
     *     {
     *       'mousedown .title':  'edit',
     *       'click .button':     'save',
     *       'click .open':       function(e) { ... }
     *     }
     *
     * pairs. Callbacks will be bound to the view, with `this` set properly.
     * Uses event delegation for efficiency.
     * Omitting the selector binds the event to `this.el`.
     */ delegateEvents() {
            if (!this.events) {
                return this;
            }
            this.undelegateEvents();
            for(const key in this.events){
                let method = this.events[key];
                if (typeof method !== 'function') method = this[method];
                if (!method) continue;
                const match = key.match(delegateEventSplitter);
                this.delegate(match[1], match[2], method.bind(this));
            }
            return this;
        }
        /**
     * Make a event delegation handler for the given `eventName` and `selector`
     * and attach it to `this.el`.
     * If selector is empty, the listener will be bound to `this.el`. If not, a
     * new handler that will recursively traverse up the event target's DOM
     * hierarchy looking for a node that matches the selector. If one is found,
     * the event's `delegateTarget` property is set to it and the return the
     * result of calling bound `listener` with the parameters given to the
     * handler.
     * @param {string} eventName
     * @param {string} selector
     * @param {(ev: Event) => any} listener
     */ delegate(eventName, selector, listener) {
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const root = this;
            if (!root) {
                return this;
            }
            if (typeof selector === 'function') {
                listener = selector;
                selector = null;
            }
            // Given that `focus` and `blur` events do not bubble, do not delegate these events
            if ([
                'focus',
                'blur'
            ].indexOf(eventName) !== -1) {
                const els = this.querySelectorAll(selector);
                for(let i = 0, len = els.length; i < len; i++){
                    const item = els[i];
                    item.addEventListener(eventName, listener, false);
                    this._domEvents.push({
                        el: item,
                        eventName: eventName,
                        handler: listener
                    });
                }
                return listener;
            }
            const handler = selector ? function(e) {
                let node = e.target || e.srcElement;
                for(; node && node != root; node = node.parentNode){
                    if (node.matches(selector)) {
                        e.delegateTarget = node;
                        listener(e);
                    }
                }
            } : listener;
            this.addEventListener(eventName, handler, false);
            this._domEvents.push({
                el: this,
                eventName: eventName,
                handler: handler,
                listener: listener,
                selector: selector
            });
            return this;
        }
        /**
     * Clears all callbacks previously bound to the view by `delegateEvents`.
     * You usually don't need to use this, but may wish to if you have multiple
     * Backbone views attached to the same DOM element.
     */ undelegateEvents() {
            if (this) {
                for(let i = 0, len = this._domEvents.length; i < len; i++){
                    const item = this._domEvents[i];
                    item.el.removeEventListener(item.eventName, item.handler, false);
                }
                this._domEvents.length = 0;
            }
            return this;
        }
        /**
     * A finer-grained `undelegateEvents` for removing a single delegated event.
     * `selector` and `listener` are both optional.
     * @param {string} eventName
     * @param {string} selector
     * @param {(ev: Event) => any} listener
     */ undelegate(eventName, selector, listener) {
            if (typeof selector === 'function') {
                listener = selector;
                selector = null;
            }
            if (this) {
                const handlers = this._domEvents.slice();
                let i = handlers.length;
                while(i--){
                    const item = handlers[i];
                    const match = item.eventName === eventName && (listener ? item.listener === listener : true) && (selector ? item.selector === selector : true);
                    if (!match) {
                        continue;
                    }
                    item.el.removeEventListener(item.eventName, item.handler, false);
                    this._domEvents.splice(i, 1);
                }
            }
            return this;
        }
        /**
     * @param {Options} options
     */ constructor(options = {}){
            super();
            // Will be assigned to from Events
            this.stopListening = null;
            // Creating a View creates its initial element outside of the DOM,
            // if an existing element is not provided...
            this.cid = uniqueId('view');
            this._declarativeEvents = {};
            this._domEvents = [];
            const { model, collection, events } = options;
            Object.assign(this, {
                model: model,
                collection,
                events
            });
        }
    }
    /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.

  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */ /* global Reflect, Promise */ function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function() {
                if (o && i >= o.length) o = void 0;
                return {
                    value: o && o[i++],
                    done: !o
                };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }
    /*!
  MIT License

  Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.

  */ /**
   * Abstracts constructing a Blob object, so it also works in older
   * browsers that don't support the native Blob constructor. (i.e.
   * old QtWebKit versions, at least).
   * Abstracts constructing a Blob object, so it also works in older
   * browsers that don't support the native Blob constructor. (i.e.
   * old QtWebKit versions, at least).
   *
   * @param parts
   * @param properties
   */ function createBlob$1(parts, properties) {
        /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || [];
        properties = properties || {};
        try {
            return new Blob(parts, properties);
        } catch (e) {
            if (e.name !== 'TypeError') {
                throw e;
            }
            //tslint:disable-next-line:variable-name
            var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;
            var builder = new Builder();
            for(var i = 0; i < parts.length; i += 1){
                builder.append(parts[i]);
            }
            return builder.getBlob(properties.type);
        }
    }
    var BLOB_TYPE_PREFIX_REGEX$1 = /^~~local_forage_type~([^~]+)~/;
    var SERIALIZED_MARKER_LENGTH$1 = "__lfsc__:" /* SERIALIZED_MARKER */ .length;
    var TYPE_SERIALIZED_MARKER_LENGTH$1 = SERIALIZED_MARKER_LENGTH$1 + "arbf" /* TYPE_ARRAYBUFFER */ .length;
    //tslint:disable:no-magic-numbers no-bitwise prefer-switch no-unbound-method
    var toString$1 = Object.prototype.toString;
    function stringToBuffer$1(serializedString) {
        // Fill the string into a ArrayBuffer.
        var bufferLength = serializedString.length * 0.75;
        var len = serializedString.length;
        if (serializedString[serializedString.length - 1] === '=') {
            bufferLength--;
            if (serializedString[serializedString.length - 2] === '=') {
                bufferLength--;
            }
        }
        var buffer = new ArrayBuffer(bufferLength);
        var bytes = new Uint8Array(buffer);
        for(var i = 0, p = 0; i < len; i += 4){
            var encoded1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ .indexOf(serializedString[i]);
            var encoded2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ .indexOf(serializedString[i + 1]);
            var encoded3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ .indexOf(serializedString[i + 2]);
            var encoded4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ .indexOf(serializedString[i + 3]);
            bytes[p++] = encoded1 << 2 | encoded2 >> 4;
            bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
            bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
        }
        return buffer;
    }
    /**
   * Converts a buffer to a string to store, serialized, in the backend
   * storage library.
   */ function bufferToString$1(buffer) {
        // base64-arraybuffer
        var bytes = new Uint8Array(buffer);
        var base64String = '';
        for(var i = 0; i < bytes.length; i += 3){
            /*jslint bitwise: true */ base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ [bytes[i] >> 2];
            base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ [(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
            base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ [(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
            base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */ [bytes[i + 2] & 63];
        }
        if (bytes.length % 3 === 2) {
            base64String = base64String.substring(0, base64String.length - 1) + '=';
        } else if (bytes.length % 3 === 1) {
            base64String = base64String.substring(0, base64String.length - 2) + '==';
        }
        return base64String;
    }
    /**
   * Serialize a value, afterwards executing a callback (which usually
   * instructs the `setItem()` callback/promise to be executed). This is how
   * we store binary data with localStorage.
   * @param value
   * @param callback
   */ function serialize$2(value, callback) {
        var valueType = '';
        if (value) {
            valueType = toString$1.call(value);
        }
        // Cannot use `value instanceof ArrayBuffer` or such here, as these
        // checks fail when running the tests using casper.js...
        if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {
            // Convert binary arrays to a string and prefix the string with
            // a special marker.
            var buffer = void 0;
            var marker = "__lfsc__:" /* SERIALIZED_MARKER */ ;
            if (value instanceof ArrayBuffer) {
                buffer = value;
                marker += "arbf" /* TYPE_ARRAYBUFFER */ ;
            } else {
                buffer = value.buffer;
                if (valueType === '[object Int8Array]') {
                    marker += "si08" /* TYPE_INT8ARRAY */ ;
                } else if (valueType === '[object Uint8Array]') {
                    marker += "ui08" /* TYPE_UINT8ARRAY */ ;
                } else if (valueType === '[object Uint8ClampedArray]') {
                    marker += "uic8" /* TYPE_UINT8CLAMPEDARRAY */ ;
                } else if (valueType === '[object Int16Array]') {
                    marker += "si16" /* TYPE_INT16ARRAY */ ;
                } else if (valueType === '[object Uint16Array]') {
                    marker += "ur16" /* TYPE_UINT16ARRAY */ ;
                } else if (valueType === '[object Int32Array]') {
                    marker += "si32" /* TYPE_INT32ARRAY */ ;
                } else if (valueType === '[object Uint32Array]') {
                    marker += "ui32" /* TYPE_UINT32ARRAY */ ;
                } else if (valueType === '[object Float32Array]') {
                    marker += "fl32" /* TYPE_FLOAT32ARRAY */ ;
                } else if (valueType === '[object Float64Array]') {
                    marker += "fl64" /* TYPE_FLOAT64ARRAY */ ;
                } else {
                    callback(new Error('Failed to get type for BinaryArray'));
                }
            }
            callback(marker + bufferToString$1(buffer));
        } else if (valueType === '[object Blob]') {
            // Convert the blob to a binaryArray and then to a string.
            var fileReader = new FileReader();
            fileReader.onload = function() {
                // Backwards-compatible prefix for the blob type.
                //tslint:disable-next-line:restrict-plus-operands
                var str = "~~local_forage_type~" /* BLOB_TYPE_PREFIX */  + value.type + "~" + bufferToString$1(this.result);
                callback("__lfsc__:" /* SERIALIZED_MARKER */  + "blob" /* TYPE_BLOB */  + str);
            };
            fileReader.readAsArrayBuffer(value);
        } else {
            try {
                callback(JSON.stringify(value));
            } catch (e) {
                console.error('Couldn\'t convert value into a JSON string: ', value);
                callback(null, e);
            }
        }
    }
    /**
   * Deserialize data we've inserted into a value column/field. We place
   * special markers into our strings to mark them as encoded; this isn't
   * as nice as a meta field, but it's the only sane thing we can do whilst
   * keeping localStorage support intact.
   *
   * Oftentimes this will just deserialize JSON content, but if we have a
   * special marker (SERIALIZED_MARKER, defined above), we will extract
   * some kind of arraybuffer/binary data/typed array out of the string.
   * @param value
   */ function deserialize$2(value) {
        // If we haven't marked this string as being specially serialized (i.e.
        // something other than serialized JSON), we can just return it and be
        // done with it.
        if (value.substring(0, SERIALIZED_MARKER_LENGTH$1) !== "__lfsc__:" /* SERIALIZED_MARKER */ ) {
            return JSON.parse(value);
        }
        // The following code deals with deserializing some kind of Blob or
        // TypedArray. First we separate out the type of data we're dealing
        // with from the data itself.
        var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH$1);
        var type = value.substring(SERIALIZED_MARKER_LENGTH$1, TYPE_SERIALIZED_MARKER_LENGTH$1);
        var blobType;
        // Backwards-compatible blob type serialization strategy.
        // DBs created with older versions of localForage will simply not have the blob type.
        if (type === "blob" /* TYPE_BLOB */  && BLOB_TYPE_PREFIX_REGEX$1.test(serializedString)) {
            var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX$1);
            blobType = matcher[1];
            serializedString = serializedString.substring(matcher[0].length);
        }
        var buffer = stringToBuffer$1(serializedString);
        // Return the right type based on the code/type set during
        // serialization.
        switch(type){
            case "arbf" /* TYPE_ARRAYBUFFER */ :
                return buffer;
            case "blob" /* TYPE_BLOB */ :
                return createBlob$1([
                    buffer
                ], {
                    type: blobType
                });
            case "si08" /* TYPE_INT8ARRAY */ :
                return new Int8Array(buffer);
            case "ui08" /* TYPE_UINT8ARRAY */ :
                return new Uint8Array(buffer);
            case "uic8" /* TYPE_UINT8CLAMPEDARRAY */ :
                return new Uint8ClampedArray(buffer);
            case "si16" /* TYPE_INT16ARRAY */ :
                return new Int16Array(buffer);
            case "ur16" /* TYPE_UINT16ARRAY */ :
                return new Uint16Array(buffer);
            case "si32" /* TYPE_INT32ARRAY */ :
                return new Int32Array(buffer);
            case "ui32" /* TYPE_UINT32ARRAY */ :
                return new Uint32Array(buffer);
            case "fl32" /* TYPE_FLOAT32ARRAY */ :
                return new Float32Array(buffer);
            case "fl64" /* TYPE_FLOAT64ARRAY */ :
                return new Float64Array(buffer);
            default:
                throw new Error('Unkown type: ' + type);
        }
    }
    function clone$1(obj) {
        var e_1, _a;
        if (obj === null || typeof obj !== 'object' || 'isActiveClone' in obj) {
            return obj;
        }
        var temp = obj instanceof Date ? new Date(obj) : obj.constructor();
        try {
            for(var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()){
                var key = _c.value;
                if (Object.prototype.hasOwnProperty.call(obj, key)) {
                    obj['isActiveClone'] = null;
                    temp[key] = clone$1(obj[key]);
                    delete obj['isActiveClone'];
                }
            }
        } catch (e_1_1) {
            e_1 = {
                error: e_1_1
            };
        } finally{
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            } finally{
                if (e_1) throw e_1.error;
            }
        }
        return temp;
    }
    function getKeyPrefix(options, defaultConfig) {
        return (options.name || defaultConfig.name) + "/" + (options.storeName || defaultConfig.storeName) + "/";
    }
    function executeCallback$2(promise, callback) {
        if (callback) {
            promise.then(function(result) {
                callback(null, result);
            }, function(error) {
                callback(error);
            });
        }
    }
    function getCallback$1() {
        if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
            return arguments[arguments.length - 1];
        }
    }
    //tslint:disable-next-line:no-ignored-initial-value
    function dropInstanceCommon(options, callback) {
        var _this = this;
        callback = getCallback$1.apply(this, arguments);
        options = typeof options !== 'function' && options || {};
        if (!options.name) {
            var currentConfig = this.config();
            options.name = options.name || currentConfig.name;
            options.storeName = options.storeName || currentConfig.storeName;
        }
        var promise;
        if (!options.name) {
            promise = Promise.reject('Invalid arguments');
        } else {
            promise = new Promise(function(resolve) {
                if (!options.storeName) {
                    resolve(options.name + "/");
                } else {
                    resolve(getKeyPrefix(options, _this._defaultConfig));
                }
            });
        }
        return {
            promise: promise,
            callback: callback
        };
    }
    function normaliseKey(key) {
        // Cast the key to a string, as that's all we can set as a key.
        if (typeof key !== 'string') {
            console.warn(key + " used as a key, but it is not a string.");
            key = String(key);
        }
        return key;
    }
    var serialiser = {
        bufferToString: bufferToString$1,
        deserialize: deserialize$2,
        serialize: serialize$2,
        stringToBuffer: stringToBuffer$1
    };
    /*!
  MIT License

  Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.

  */ var _driver = 'localforage-driver-memory';
    var stores = {};
    /** @internal */ var Store = /** @class */ function() {
        function Store(kp) {
            this.kp = kp;
            this.data = {};
        }
        Store.resolve = function(kp) {
            if (!stores[kp]) {
                stores[kp] = new Store(kp);
            }
            return stores[kp];
        };
        Store.prototype.clear = function() {
            this.data = {};
        };
        Store.prototype.drop = function() {
            this.clear();
            delete stores[this.kp];
        };
        Store.prototype.get = function(key) {
            return this.data[key];
        };
        Store.prototype.key = function(idx) {
            return this.keys()[idx];
        };
        Store.prototype.keys = function() {
            return Object.keys(this.data);
        };
        Store.prototype.rm = function(k) {
            delete this.data[k];
        };
        Store.prototype.set = function(k, v) {
            this.data[k] = v;
        };
        return Store;
    }();
    function _initStorage$1(options) {
        var opts = options ? clone$1(options) : {};
        var kp = getKeyPrefix(opts, this._defaultConfig);
        var store = Store.resolve(kp);
        this._dbInfo = opts;
        this._dbInfo.serializer = serialiser;
        this._dbInfo.keyPrefix = kp;
        this._dbInfo.mStore = store;
        return Promise.resolve();
    }
    function clear$1(callback) {
        var _this = this;
        var promise = this.ready().then(function() {
            _this._dbInfo.mStore.clear();
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function dropInstance$1(_options, _cb) {
        var _a = dropInstanceCommon.apply(this, arguments), promise = _a.promise, callback = _a.callback;
        var outPromise = promise.then(function(keyPrefix) {
            Store.resolve(keyPrefix).drop();
        });
        executeCallback$2(outPromise, callback);
        return promise;
    }
    function getItem$1(key$, callback) {
        var _this = this;
        key$ = normaliseKey(key$);
        var promise = this.ready().then(function() {
            var result = _this._dbInfo.mStore.get(key$);
            // Deserialise if the result is not null or undefined
            return result == null ? null : _this._dbInfo.serializer.deserialize(result); //tslint:disable-line:triple-equals
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function iterate$1(iterator, callback) {
        var _this = this;
        var promise = this.ready().then(function() {
            var store = _this._dbInfo.mStore;
            var keys = store.keys();
            for(var i = 0; i < keys.length; i++){
                var value = store.get(keys[i]);
                // If a result was found, parse it from the serialized
                // string into a JS object. If result isn't truthy, the
                // key is likely undefined and we'll pass it straight
                // to the iterator.
                if (value) {
                    value = _this._dbInfo.serializer.deserialize(value);
                }
                value = iterator(value, keys[i], i + 1);
                if (value !== undefined) {
                    return value;
                }
            }
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function key$1(idx, callback) {
        var _this = this;
        var promise = this.ready().then(function() {
            var result;
            try {
                result = _this._dbInfo.mStore.key(idx);
                if (result === undefined) {
                    result = null;
                }
            } catch (_a) {
                result = null;
            }
            return result;
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function keys$1(callback) {
        var _this = this;
        var promise = this.ready().then(function() {
            return _this._dbInfo.mStore.keys();
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function length$1(callback) {
        var promise = this.keys().then(function(keys$) {
            return keys$.length;
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function removeItem$1(key$, callback) {
        var _this = this;
        key$ = normaliseKey(key$);
        var promise = this.ready().then(function() {
            _this._dbInfo.mStore.rm(key$);
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    function setItem$1(key$, value, callback) {
        var _this = this;
        key$ = normaliseKey(key$);
        var promise = this.ready().then(function() {
            if (value === undefined) {
                value = null;
            }
            // Save the original value to pass to the callback.
            var originalValue = value;
            return new Promise(function(resolve, reject) {
                _this._dbInfo.serializer.serialize(value, function(value$, error) {
                    if (error) {
                        reject(error);
                    } else {
                        try {
                            _this._dbInfo.mStore.set(key$, value$);
                            resolve(originalValue);
                        } catch (e) {
                            reject(e);
                        }
                    }
                });
            });
        });
        executeCallback$2(promise, callback);
        return promise;
    }
    var _support = true;
    var memoryDriver = /*#__PURE__*/ Object.freeze({
        __proto__: null,
        _driver: _driver,
        _initStorage: _initStorage$1,
        _support: _support,
        clear: clear$1,
        dropInstance: dropInstance$1,
        getItem: getItem$1,
        iterate: iterate$1,
        key: key$1,
        keys: keys$1,
        length: length$1,
        removeItem: removeItem$1,
        setItem: setItem$1
    });
    /**
   * Removes all key-value entries from the list cache.
   *
   * @private
   * @name clear
   * @memberOf ListCache
   */ function listCacheClear() {
        this.__data__ = [];
        this.size = 0;
    }
    /**
   * Performs a
   * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
   * comparison between two values to determine if they are equivalent.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to compare.
   * @param {*} other The other value to compare.
   * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
   * @example
   *
   * var object = { 'a': 1 };
   * var other = { 'a': 1 };
   *
   * _.eq(object, object);
   * // => true
   *
   * _.eq(object, other);
   * // => false
   *
   * _.eq('a', 'a');
   * // => true
   *
   * _.eq('a', Object('a'));
   * // => false
   *
   * _.eq(NaN, NaN);
   * // => true
   */ function eq(value, other) {
        return value === other || value !== value && other !== other;
    }
    /**
   * Gets the index at which the `key` is found in `array` of key-value pairs.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} key The key to search for.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */ function assocIndexOf(array, key) {
        var length = array.length;
        while(length--){
            if (eq(array[length][0], key)) {
                return length;
            }
        }
        return -1;
    }
    /** Used for built-in method references. */ var arrayProto = Array.prototype;
    /** Built-in value references. */ var splice = arrayProto.splice;
    /**
   * Removes `key` and its value from the list cache.
   *
   * @private
   * @name delete
   * @memberOf ListCache
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */ function listCacheDelete(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
            return false;
        }
        var lastIndex = data.length - 1;
        if (index == lastIndex) {
            data.pop();
        } else {
            splice.call(data, index, 1);
        }
        --this.size;
        return true;
    }
    /**
   * Gets the list cache value for `key`.
   *
   * @private
   * @name get
   * @memberOf ListCache
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */ function listCacheGet(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        return index < 0 ? undefined : data[index][1];
    }
    /**
   * Checks if a list cache value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf ListCache
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */ function listCacheHas(key) {
        return assocIndexOf(this.__data__, key) > -1;
    }
    /**
   * Sets the list cache `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf ListCache
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the list cache instance.
   */ function listCacheSet(key, value) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
            ++this.size;
            data.push([
                key,
                value
            ]);
        } else {
            data[index][1] = value;
        }
        return this;
    }
    /**
   * Creates an list cache object.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */ function ListCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while(++index < length){
            var entry = entries[index];
            this.set(entry[0], entry[1]);
        }
    }
    // Add methods to `ListCache`.
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype['delete'] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;
    /**
   * Removes all key-value entries from the stack.
   *
   * @private
   * @name clear
   * @memberOf Stack
   */ function stackClear() {
        this.__data__ = new ListCache();
        this.size = 0;
    }
    /**
   * Removes `key` and its value from the stack.
   *
   * @private
   * @name delete
   * @memberOf Stack
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */ function stackDelete(key) {
        var data = this.__data__, result = data['delete'](key);
        this.size = data.size;
        return result;
    }
    /**
   * Gets the stack value for `key`.
   *
   * @private
   * @name get
   * @memberOf Stack
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */ function stackGet(key) {
        return this.__data__.get(key);
    }
    /**
   * Checks if a stack value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf Stack
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */ function stackHas(key) {
        return this.__data__.has(key);
    }
    /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create');
    /**
   * Removes all key-value entries from the hash.
   *
   * @private
   * @name clear
   * @memberOf Hash
   */ function hashClear() {
        this.__data__ = nativeCreate ? nativeCreate(null) : {};
        this.size = 0;
    }
    /**
   * Removes `key` and its value from the hash.
   *
   * @private
   * @name delete
   * @memberOf Hash
   * @param {Object} hash The hash to modify.
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */ function hashDelete(key) {
        var result = this.has(key) && delete this.__data__[key];
        this.size -= result ? 1 : 0;
        return result;
    }
    /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
    /** Used for built-in method references. */ var objectProto$d = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$b = objectProto$d.hasOwnProperty;
    /**
   * Gets the hash value for `key`.
   *
   * @private
   * @name get
   * @memberOf Hash
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */ function hashGet(key) {
        var data = this.__data__;
        if (nativeCreate) {
            var result = data[key];
            return result === HASH_UNDEFINED$2 ? undefined : result;
        }
        return hasOwnProperty$b.call(data, key) ? data[key] : undefined;
    }
    /** Used for built-in method references. */ var objectProto$c = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$a = objectProto$c.hasOwnProperty;
    /**
   * Checks if a hash value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf Hash
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */ function hashHas(key) {
        var data = this.__data__;
        return nativeCreate ? data[key] !== undefined : hasOwnProperty$a.call(data, key);
    }
    /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
    /**
   * Sets the hash `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf Hash
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the hash instance.
   */ function hashSet(key, value) {
        var data = this.__data__;
        this.size += this.has(key) ? 0 : 1;
        data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
        return this;
    }
    /**
   * Creates a hash object.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */ function Hash(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while(++index < length){
            var entry = entries[index];
            this.set(entry[0], entry[1]);
        }
    }
    // Add methods to `Hash`.
    Hash.prototype.clear = hashClear;
    Hash.prototype['delete'] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    /**
   * Removes all key-value entries from the map.
   *
   * @private
   * @name clear
   * @memberOf MapCache
   */ function mapCacheClear() {
        this.size = 0;
        this.__data__ = {
            'hash': new Hash(),
            'map': new (Map || ListCache)(),
            'string': new Hash()
        };
    }
    /**
   * Checks if `value` is suitable for use as unique object key.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
   */ function isKeyable(value) {
        var type = typeof value;
        return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
    }
    /**
   * Gets the data for `map`.
   *
   * @private
   * @param {Object} map The map to query.
   * @param {string} key The reference key.
   * @returns {*} Returns the map data.
   */ function getMapData(map, key) {
        var data = map.__data__;
        return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
    }
    /**
   * Removes `key` and its value from the map.
   *
   * @private
   * @name delete
   * @memberOf MapCache
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */ function mapCacheDelete(key) {
        var result = getMapData(this, key)['delete'](key);
        this.size -= result ? 1 : 0;
        return result;
    }
    /**
   * Gets the map value for `key`.
   *
   * @private
   * @name get
   * @memberOf MapCache
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */ function mapCacheGet(key) {
        return getMapData(this, key).get(key);
    }
    /**
   * Checks if a map value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf MapCache
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */ function mapCacheHas(key) {
        return getMapData(this, key).has(key);
    }
    /**
   * Sets the map `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf MapCache
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the map cache instance.
   */ function mapCacheSet(key, value) {
        var data = getMapData(this, key), size = data.size;
        data.set(key, value);
        this.size += data.size == size ? 0 : 1;
        return this;
    }
    /**
   * Creates a map cache object to store key-value pairs.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */ function MapCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while(++index < length){
            var entry = entries[index];
            this.set(entry[0], entry[1]);
        }
    }
    // Add methods to `MapCache`.
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype['delete'] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200;
    /**
   * Sets the stack `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf Stack
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the stack cache instance.
   */ function stackSet(key, value) {
        var data = this.__data__;
        if (data instanceof ListCache) {
            var pairs = data.__data__;
            if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
                pairs.push([
                    key,
                    value
                ]);
                this.size = ++data.size;
                return this;
            }
            data = this.__data__ = new MapCache(pairs);
        }
        data.set(key, value);
        this.size = data.size;
        return this;
    }
    /**
   * Creates a stack cache object to store key-value pairs.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */ function Stack(entries) {
        var data = this.__data__ = new ListCache(entries);
        this.size = data.size;
    }
    // Add methods to `Stack`.
    Stack.prototype.clear = stackClear;
    Stack.prototype['delete'] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;
    /**
   * A specialized version of `_.forEach` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns `array`.
   */ function arrayEach(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length;
        while(++index < length){
            if (iteratee(array[index], index, array) === false) {
                break;
            }
        }
        return array;
    }
    var defineProperty = function() {
        try {
            var func = getNative(Object, 'defineProperty');
            func({}, '', {});
            return func;
        } catch (e) {}
    }();
    /**
   * The base implementation of `assignValue` and `assignMergeValue` without
   * value checks.
   *
   * @private
   * @param {Object} object The object to modify.
   * @param {string} key The key of the property to assign.
   * @param {*} value The value to assign.
   */ function baseAssignValue(object, key, value) {
        if (key == '__proto__' && defineProperty) {
            defineProperty(object, key, {
                'configurable': true,
                'enumerable': true,
                'value': value,
                'writable': true
            });
        } else {
            object[key] = value;
        }
    }
    /** Used for built-in method references. */ var objectProto$b = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
    /**
   * Assigns `value` to `key` of `object` if the existing value is not equivalent
   * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
   * for equality comparisons.
   *
   * @private
   * @param {Object} object The object to modify.
   * @param {string} key The key of the property to assign.
   * @param {*} value The value to assign.
   */ function assignValue(object, key, value) {
        var objValue = object[key];
        if (!(hasOwnProperty$9.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
            baseAssignValue(object, key, value);
        }
    }
    /**
   * Copies properties of `source` to `object`.
   *
   * @private
   * @param {Object} source The object to copy properties from.
   * @param {Array} props The property identifiers to copy.
   * @param {Object} [object={}] The object to copy properties to.
   * @param {Function} [customizer] The function to customize copied values.
   * @returns {Object} Returns `object`.
   */ function copyObject(source, props, object, customizer) {
        var isNew = !object;
        object || (object = {});
        var index = -1, length = props.length;
        while(++index < length){
            var key = props[index];
            var newValue = undefined;
            if (newValue === undefined) {
                newValue = source[key];
            }
            if (isNew) {
                baseAssignValue(object, key, newValue);
            } else {
                assignValue(object, key, newValue);
            }
        }
        return object;
    }
    /**
   * The base implementation of `_.assign` without support for multiple sources
   * or `customizer` functions.
   *
   * @private
   * @param {Object} object The destination object.
   * @param {Object} source The source object.
   * @returns {Object} Returns `object`.
   */ function baseAssign(object, source) {
        return object && copyObject(source, keys$2(source), object);
    }
    /**
   * This function is like
   * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
   * except that it includes inherited enumerable properties.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names.
   */ function nativeKeysIn(object) {
        var result = [];
        if (object != null) {
            for(var key in Object(object)){
                result.push(key);
            }
        }
        return result;
    }
    /** Used for built-in method references. */ var objectProto$a = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
    /**
   * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names.
   */ function baseKeysIn(object) {
        if (!isObject$1(object)) {
            return nativeKeysIn(object);
        }
        var isProto = isPrototype(object), result = [];
        for(var key in object){
            if (!(key == 'constructor' && (isProto || !hasOwnProperty$8.call(object, key)))) {
                result.push(key);
            }
        }
        return result;
    }
    /**
   * Creates an array of the own and inherited enumerable property names of `object`.
   *
   * **Note:** Non-object values are coerced to objects.
   *
   * @static
   * @memberOf _
   * @since 3.0.0
   * @category Object
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names.
   * @example
   *
   * function Foo() {
   *   this.a = 1;
   *   this.b = 2;
   * }
   *
   * Foo.prototype.c = 3;
   *
   * _.keysIn(new Foo);
   * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
   */ function keysIn(object) {
        return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }
    /**
   * The base implementation of `_.assignIn` without support for multiple sources
   * or `customizer` functions.
   *
   * @private
   * @param {Object} object The destination object.
   * @param {Object} source The source object.
   * @returns {Object} Returns `object`.
   */ function baseAssignIn(object, source) {
        return object && copyObject(source, keysIn(source), object);
    }
    /** Detect free variable `exports`. */ var freeExports = typeof exports1 == 'object' && exports1 && !exports1.nodeType && exports1;
    /** Detect free variable `module`. */ var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
    /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports;
    /** Built-in value references. */ var Buffer = moduleExports ? root$1.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
    /**
   * Creates a clone of  `buffer`.
   *
   * @private
   * @param {Buffer} buffer The buffer to clone.
   * @param {boolean} [isDeep] Specify a deep clone.
   * @returns {Buffer} Returns the cloned buffer.
   */ function cloneBuffer(buffer, isDeep) {
        if (isDeep) {
            return buffer.slice();
        }
        var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
        buffer.copy(result);
        return result;
    }
    /**
   * Copies the values of `source` to `array`.
   *
   * @private
   * @param {Array} source The array to copy values from.
   * @param {Array} [array=[]] The array to copy values to.
   * @returns {Array} Returns `array`.
   */ function copyArray(source, array) {
        var index = -1, length = source.length;
        array || (array = Array(length));
        while(++index < length){
            array[index] = source[index];
        }
        return array;
    }
    /**
   * A specialized version of `_.filter` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} predicate The function invoked per iteration.
   * @returns {Array} Returns the new filtered array.
   */ function arrayFilter(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
        while(++index < length){
            var value = array[index];
            if (predicate(value, index, array)) {
                result[resIndex++] = value;
            }
        }
        return result;
    }
    /**
   * This method returns a new empty array.
   *
   * @static
   * @memberOf _
   * @since 4.13.0
   * @category Util
   * @returns {Array} Returns the new empty array.
   * @example
   *
   * var arrays = _.times(2, _.stubArray);
   *
   * console.log(arrays);
   * // => [[], []]
   *
   * console.log(arrays[0] === arrays[1]);
   * // => false
   */ function stubArray() {
        return [];
    }
    /** Used for built-in method references. */ var objectProto$9 = Object.prototype;
    /** Built-in value references. */ var propertyIsEnumerable = objectProto$9.propertyIsEnumerable;
    /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
    /**
   * Creates an array of the own enumerable symbols of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of symbols.
   */ var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
        if (object == null) {
            return [];
        }
        object = Object(object);
        return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
            return propertyIsEnumerable.call(object, symbol);
        });
    };
    /**
   * Copies own symbols of `source` to `object`.
   *
   * @private
   * @param {Object} source The object to copy symbols from.
   * @param {Object} [object={}] The object to copy symbols to.
   * @returns {Object} Returns `object`.
   */ function copySymbols(source, object) {
        return copyObject(source, getSymbols(source), object);
    }
    /**
   * Appends the elements of `values` to `array`.
   *
   * @private
   * @param {Array} array The array to modify.
   * @param {Array} values The values to append.
   * @returns {Array} Returns `array`.
   */ function arrayPush(array, values) {
        var index = -1, length = values.length, offset = array.length;
        while(++index < length){
            array[offset + index] = values[index];
        }
        return array;
    }
    /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object);
    /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetSymbols = Object.getOwnPropertySymbols;
    /**
   * Creates an array of the own and inherited enumerable symbols of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of symbols.
   */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
        var result = [];
        while(object){
            arrayPush(result, getSymbols(object));
            object = getPrototype(object);
        }
        return result;
    };
    /**
   * Copies own and inherited symbols of `source` to `object`.
   *
   * @private
   * @param {Object} source The object to copy symbols from.
   * @param {Object} [object={}] The object to copy symbols to.
   * @returns {Object} Returns `object`.
   */ function copySymbolsIn(source, object) {
        return copyObject(source, getSymbolsIn(source), object);
    }
    /**
   * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
   * `keysFunc` and `symbolsFunc` to get the enumerable property names and
   * symbols of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Function} keysFunc The function to get the keys of `object`.
   * @param {Function} symbolsFunc The function to get the symbols of `object`.
   * @returns {Array} Returns the array of property names and symbols.
   */ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
        var result = keysFunc(object);
        return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
    }
    /**
   * Creates an array of own enumerable property names and symbols of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names and symbols.
   */ function getAllKeys(object) {
        return baseGetAllKeys(object, keys$2, getSymbols);
    }
    /**
   * Creates an array of own and inherited enumerable property names and
   * symbols of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the array of property names and symbols.
   */ function getAllKeysIn(object) {
        return baseGetAllKeys(object, keysIn, getSymbolsIn);
    }
    /** Used for built-in method references. */ var objectProto$8 = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
    /**
   * Initializes an array clone.
   *
   * @private
   * @param {Array} array The array to clone.
   * @returns {Array} Returns the initialized clone.
   */ function initCloneArray(array) {
        var length = array.length, result = new array.constructor(length);
        // Add properties assigned by `RegExp#exec`.
        if (length && typeof array[0] == 'string' && hasOwnProperty$7.call(array, 'index')) {
            result.index = array.index;
            result.input = array.input;
        }
        return result;
    }
    /** Built-in value references. */ var Uint8Array$1 = root$1.Uint8Array;
    /**
   * Creates a clone of `arrayBuffer`.
   *
   * @private
   * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
   * @returns {ArrayBuffer} Returns the cloned array buffer.
   */ function cloneArrayBuffer(arrayBuffer) {
        var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
        new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
        return result;
    }
    /**
   * Creates a clone of `dataView`.
   *
   * @private
   * @param {Object} dataView The data view to clone.
   * @param {boolean} [isDeep] Specify a deep clone.
   * @returns {Object} Returns the cloned data view.
   */ function cloneDataView(dataView, isDeep) {
        var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
        return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
    }
    /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/;
    /**
   * Creates a clone of `regexp`.
   *
   * @private
   * @param {Object} regexp The regexp to clone.
   * @returns {Object} Returns the cloned regexp.
   */ function cloneRegExp(regexp) {
        var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
        result.lastIndex = regexp.lastIndex;
        return result;
    }
    /** Used to convert symbols to primitives and strings. */ var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : undefined, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : undefined;
    /**
   * Creates a clone of the `symbol` object.
   *
   * @private
   * @param {Object} symbol The symbol object to clone.
   * @returns {Object} Returns the cloned symbol object.
   */ function cloneSymbol(symbol) {
        return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
    }
    /**
   * Creates a clone of `typedArray`.
   *
   * @private
   * @param {Object} typedArray The typed array to clone.
   * @param {boolean} [isDeep] Specify a deep clone.
   * @returns {Object} Returns the cloned typed array.
   */ function cloneTypedArray(typedArray, isDeep) {
        var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
        return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
    }
    /** `Object#toString` result references. */ var boolTag$2 = '[object Boolean]', dateTag$2 = '[object Date]', mapTag$3 = '[object Map]', numberTag$2 = '[object Number]', regexpTag$2 = '[object RegExp]', setTag$3 = '[object Set]', stringTag$3 = '[object String]', symbolTag$2 = '[object Symbol]';
    var arrayBufferTag$2 = '[object ArrayBuffer]', dataViewTag$2 = '[object DataView]', float32Tag$1 = '[object Float32Array]', float64Tag$1 = '[object Float64Array]', int8Tag$1 = '[object Int8Array]', int16Tag$1 = '[object Int16Array]', int32Tag$1 = '[object Int32Array]', uint8Tag$1 = '[object Uint8Array]', uint8ClampedTag$1 = '[object Uint8ClampedArray]', uint16Tag$1 = '[object Uint16Array]', uint32Tag$1 = '[object Uint32Array]';
    /**
   * Initializes an object clone based on its `toStringTag`.
   *
   * **Note:** This function only supports cloning values with tags of
   * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
   *
   * @private
   * @param {Object} object The object to clone.
   * @param {string} tag The `toStringTag` of the object to clone.
   * @param {boolean} [isDeep] Specify a deep clone.
   * @returns {Object} Returns the initialized clone.
   */ function initCloneByTag(object, tag, isDeep) {
        var Ctor = object.constructor;
        switch(tag){
            case arrayBufferTag$2:
                return cloneArrayBuffer(object);
            case boolTag$2:
            case dateTag$2:
                return new Ctor(+object);
            case dataViewTag$2:
                return cloneDataView(object, isDeep);
            case float32Tag$1:
            case float64Tag$1:
            case int8Tag$1:
            case int16Tag$1:
            case int32Tag$1:
            case uint8Tag$1:
            case uint8ClampedTag$1:
            case uint16Tag$1:
            case uint32Tag$1:
                return cloneTypedArray(object, isDeep);
            case mapTag$3:
                return new Ctor();
            case numberTag$2:
            case stringTag$3:
                return new Ctor(object);
            case regexpTag$2:
                return cloneRegExp(object);
            case setTag$3:
                return new Ctor();
            case symbolTag$2:
                return cloneSymbol(object);
        }
    }
    /** Built-in value references. */ var objectCreate = Object.create;
    /**
   * The base implementation of `_.create` without support for assigning
   * properties to the created object.
   *
   * @private
   * @param {Object} proto The object to inherit from.
   * @returns {Object} Returns the new object.
   */ var baseCreate = function() {
        function object() {}
        return function(proto) {
            if (!isObject$1(proto)) {
                return {};
            }
            if (objectCreate) {
                return objectCreate(proto);
            }
            object.prototype = proto;
            var result = new object();
            object.prototype = undefined;
            return result;
        };
    }();
    /**
   * Initializes an object clone.
   *
   * @private
   * @param {Object} object The object to clone.
   * @returns {Object} Returns the initialized clone.
   */ function initCloneObject(object) {
        return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
    }
    /** `Object#toString` result references. */ var mapTag$2 = '[object Map]';
    /**
   * The base implementation of `_.isMap` without Node.js optimizations.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a map, else `false`.
   */ function baseIsMap(value) {
        return isObjectLike(value) && getTag(value) == mapTag$2;
    }
    /* Node.js helper references. */ var nodeIsMap = nodeUtil && nodeUtil.isMap;
    /**
   * Checks if `value` is classified as a `Map` object.
   *
   * @static
   * @memberOf _
   * @since 4.3.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a map, else `false`.
   * @example
   *
   * _.isMap(new Map);
   * // => true
   *
   * _.isMap(new WeakMap);
   * // => false
   */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
    /** `Object#toString` result references. */ var setTag$2 = '[object Set]';
    /**
   * The base implementation of `_.isSet` without Node.js optimizations.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a set, else `false`.
   */ function baseIsSet(value) {
        return isObjectLike(value) && getTag(value) == setTag$2;
    }
    /* Node.js helper references. */ var nodeIsSet = nodeUtil && nodeUtil.isSet;
    /**
   * Checks if `value` is classified as a `Set` object.
   *
   * @static
   * @memberOf _
   * @since 4.3.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a set, else `false`.
   * @example
   *
   * _.isSet(new Set);
   * // => true
   *
   * _.isSet(new WeakSet);
   * // => false
   */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
    /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG$3 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$3 = 4;
    /** `Object#toString` result references. */ var argsTag$1 = '[object Arguments]', arrayTag$1 = '[object Array]', boolTag$1 = '[object Boolean]', dateTag$1 = '[object Date]', errorTag$1 = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag$1 = '[object Map]', numberTag$1 = '[object Number]', objectTag$2 = '[object Object]', regexpTag$1 = '[object RegExp]', setTag$1 = '[object Set]', stringTag$2 = '[object String]', symbolTag$1 = '[object Symbol]', weakMapTag = '[object WeakMap]';
    var arrayBufferTag$1 = '[object ArrayBuffer]', dataViewTag$1 = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]';
    /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {};
    cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$2] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$2] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
    cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
    /**
   * The base implementation of `_.clone` and `_.cloneDeep` which tracks
   * traversed objects.
   *
   * @private
   * @param {*} value The value to clone.
   * @param {boolean} bitmask The bitmask flags.
   *  1 - Deep clone
   *  2 - Flatten inherited properties
   *  4 - Clone symbols
   * @param {Function} [customizer] The function to customize cloning.
   * @param {string} [key] The key of `value`.
   * @param {Object} [object] The parent object of `value`.
   * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
   * @returns {*} Returns the cloned value.
   */ function baseClone(value, bitmask, customizer, key, object, stack) {
        var result, isDeep = bitmask & CLONE_DEEP_FLAG$3, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$3;
        if (customizer) {
            result = object ? customizer(value, key, object, stack) : customizer(value);
        }
        if (result !== undefined) {
            return result;
        }
        if (!isObject$1(value)) {
            return value;
        }
        var isArr = isArray(value);
        if (isArr) {
            result = initCloneArray(value);
            if (!isDeep) {
                return copyArray(value, result);
            }
        } else {
            var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
            if (isBuffer(value)) {
                return cloneBuffer(value, isDeep);
            }
            if (tag == objectTag$2 || tag == argsTag$1 || isFunc && !object) {
                result = isFlat || isFunc ? {} : initCloneObject(value);
                if (!isDeep) {
                    return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
                }
            } else {
                if (!cloneableTags[tag]) {
                    return object ? value : {};
                }
                result = initCloneByTag(value, tag, isDeep);
            }
        }
        // Check for circular references and return its corresponding clone.
        stack || (stack = new Stack());
        var stacked = stack.get(value);
        if (stacked) {
            return stacked;
        }
        stack.set(value, result);
        if (isSet(value)) {
            value.forEach(function(subValue) {
                result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
            });
        } else if (isMap(value)) {
            value.forEach(function(subValue, key) {
                result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
            });
        }
        var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys$2;
        var props = isArr ? undefined : keysFunc(value);
        arrayEach(props || value, function(subValue, key) {
            if (props) {
                key = subValue;
                subValue = value[key];
            }
            // Recursively populate clone (susceptible to call stack limits).
            assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
        });
        return result;
    }
    /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG$2 = 1, CLONE_SYMBOLS_FLAG$2 = 4;
    /**
   * This method is like `_.clone` except that it recursively clones `value`.
   *
   * @static
   * @memberOf _
   * @since 1.0.0
   * @category Lang
   * @param {*} value The value to recursively clone.
   * @returns {*} Returns the deep cloned value.
   * @see _.clone
   * @example
   *
   * var objects = [{ 'a': 1 }, { 'b': 2 }];
   *
   * var deep = _.cloneDeep(objects);
   * console.log(deep[0] === objects[0]);
   * // => false
   */ function cloneDeep(value) {
        return baseClone(value, CLONE_DEEP_FLAG$2 | CLONE_SYMBOLS_FLAG$2);
    }
    /** `Object#toString` result references. */ var stringTag$1 = '[object String]';
    /**
   * Checks if `value` is classified as a `String` primitive or object.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a string, else `false`.
   * @example
   *
   * _.isString('abc');
   * // => true
   *
   * _.isString(1);
   * // => false
   */ function isString(value) {
        return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag$1;
    }
    var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
    function getDefaultExportFromCjs(x) {
        return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
    }
    function commonjsRequire(path) {
        throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
    }
    var localforage = {
        exports: {}
    };
    /*!
      localForage -- Offline Storage, Improved
      Version 1.10.0
      https://localforage.github.io/localForage
      (c) 2013-2017 Mozilla, Apache License 2.0
  */ var hasRequiredLocalforage;
    function requireLocalforage() {
        if (hasRequiredLocalforage) return localforage.exports;
        hasRequiredLocalforage = 1;
        (function(module1, exports1) {
            (function(f) {
                {
                    module1.exports = f();
                }
            })(function() {
                return (function e(t, n, r) {
                    function s(o, u) {
                        if (!n[o]) {
                            if (!t[o]) {
                                var a = typeof commonjsRequire == "function" && commonjsRequire;
                                if (!u && a) return a(o, true);
                                if (i) return i(o, true);
                                var f = new Error("Cannot find module '" + o + "'");
                                throw f.code = "MODULE_NOT_FOUND", f;
                            }
                            var l = n[o] = {
                                exports: {}
                            };
                            t[o][0].call(l.exports, function(e) {
                                var n = t[o][1][e];
                                return s(n ? n : e);
                            }, l, l.exports, e, t, n, r);
                        }
                        return n[o].exports;
                    }
                    var i = typeof commonjsRequire == "function" && commonjsRequire;
                    for(var o = 0; o < r.length; o++)s(r[o]);
                    return s;
                })({
                    1: [
                        function(_dereq_, module1, exports1) {
                            (function(global1) {
                                var Mutation = global1.MutationObserver || global1.WebKitMutationObserver;
                                var scheduleDrain;
                                {
                                    if (Mutation) {
                                        var called = 0;
                                        var observer = new Mutation(nextTick);
                                        var element = global1.document.createTextNode('');
                                        observer.observe(element, {
                                            characterData: true
                                        });
                                        scheduleDrain = function() {
                                            element.data = called = ++called % 2;
                                        };
                                    } else if (!global1.setImmediate && typeof global1.MessageChannel !== 'undefined') {
                                        var channel = new global1.MessageChannel();
                                        channel.port1.onmessage = nextTick;
                                        scheduleDrain = function() {
                                            channel.port2.postMessage(0);
                                        };
                                    } else if ('document' in global1 && 'onreadystatechange' in global1.document.createElement('script')) {
                                        scheduleDrain = function() {
                                            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
                                            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
                                            var scriptEl = global1.document.createElement('script');
                                            scriptEl.onreadystatechange = function() {
                                                nextTick();
                                                scriptEl.onreadystatechange = null;
                                                scriptEl.parentNode.removeChild(scriptEl);
                                                scriptEl = null;
                                            };
                                            global1.document.documentElement.appendChild(scriptEl);
                                        };
                                    } else {
                                        scheduleDrain = function() {
                                            setTimeout(nextTick, 0);
                                        };
                                    }
                                }
                                var draining;
                                var queue = [];
                                //named nextTick for less confusing stack traces
                                function nextTick() {
                                    draining = true;
                                    var i, oldQueue;
                                    var len = queue.length;
                                    while(len){
                                        oldQueue = queue;
                                        queue = [];
                                        i = -1;
                                        while(++i < len){
                                            oldQueue[i]();
                                        }
                                        len = queue.length;
                                    }
                                    draining = false;
                                }
                                module1.exports = immediate;
                                function immediate(task) {
                                    if (queue.push(task) === 1 && !draining) {
                                        scheduleDrain();
                                    }
                                }
                            }).call(this, typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
                        },
                        {}
                    ],
                    2: [
                        function(_dereq_, module1, exports1) {
                            var immediate = _dereq_(1);
                            /* istanbul ignore next */ function INTERNAL() {}
                            var handlers = {};
                            var REJECTED = [
                                'REJECTED'
                            ];
                            var FULFILLED = [
                                'FULFILLED'
                            ];
                            var PENDING = [
                                'PENDING'
                            ];
                            module1.exports = Promise1;
                            function Promise1(resolver) {
                                if (typeof resolver !== 'function') {
                                    throw new TypeError('resolver must be a function');
                                }
                                this.state = PENDING;
                                this.queue = [];
                                this.outcome = void 0;
                                if (resolver !== INTERNAL) {
                                    safelyResolveThenable(this, resolver);
                                }
                            }
                            Promise1.prototype["catch"] = function(onRejected) {
                                return this.then(null, onRejected);
                            };
                            Promise1.prototype.then = function(onFulfilled, onRejected) {
                                if (typeof onFulfilled !== 'function' && this.state === FULFILLED || typeof onRejected !== 'function' && this.state === REJECTED) {
                                    return this;
                                }
                                var promise = new this.constructor(INTERNAL);
                                if (this.state !== PENDING) {
                                    var resolver = this.state === FULFILLED ? onFulfilled : onRejected;
                                    unwrap(promise, resolver, this.outcome);
                                } else {
                                    this.queue.push(new QueueItem(promise, onFulfilled, onRejected));
                                }
                                return promise;
                            };
                            function QueueItem(promise, onFulfilled, onRejected) {
                                this.promise = promise;
                                if (typeof onFulfilled === 'function') {
                                    this.onFulfilled = onFulfilled;
                                    this.callFulfilled = this.otherCallFulfilled;
                                }
                                if (typeof onRejected === 'function') {
                                    this.onRejected = onRejected;
                                    this.callRejected = this.otherCallRejected;
                                }
                            }
                            QueueItem.prototype.callFulfilled = function(value) {
                                handlers.resolve(this.promise, value);
                            };
                            QueueItem.prototype.otherCallFulfilled = function(value) {
                                unwrap(this.promise, this.onFulfilled, value);
                            };
                            QueueItem.prototype.callRejected = function(value) {
                                handlers.reject(this.promise, value);
                            };
                            QueueItem.prototype.otherCallRejected = function(value) {
                                unwrap(this.promise, this.onRejected, value);
                            };
                            function unwrap(promise, func, value) {
                                immediate(function() {
                                    var returnValue;
                                    try {
                                        returnValue = func(value);
                                    } catch (e) {
                                        return handlers.reject(promise, e);
                                    }
                                    if (returnValue === promise) {
                                        handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));
                                    } else {
                                        handlers.resolve(promise, returnValue);
                                    }
                                });
                            }
                            handlers.resolve = function(self1, value) {
                                var result = tryCatch(getThen, value);
                                if (result.status === 'error') {
                                    return handlers.reject(self1, result.value);
                                }
                                var thenable = result.value;
                                if (thenable) {
                                    safelyResolveThenable(self1, thenable);
                                } else {
                                    self1.state = FULFILLED;
                                    self1.outcome = value;
                                    var i = -1;
                                    var len = self1.queue.length;
                                    while(++i < len){
                                        self1.queue[i].callFulfilled(value);
                                    }
                                }
                                return self1;
                            };
                            handlers.reject = function(self1, error) {
                                self1.state = REJECTED;
                                self1.outcome = error;
                                var i = -1;
                                var len = self1.queue.length;
                                while(++i < len){
                                    self1.queue[i].callRejected(error);
                                }
                                return self1;
                            };
                            function getThen(obj) {
                                // Make sure we only access the accessor once as required by the spec
                                var then = obj && obj.then;
                                if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {
                                    return function appyThen() {
                                        then.apply(obj, arguments);
                                    };
                                }
                            }
                            function safelyResolveThenable(self1, thenable) {
                                // Either fulfill, reject or reject with error
                                var called = false;
                                function onError(value) {
                                    if (called) {
                                        return;
                                    }
                                    called = true;
                                    handlers.reject(self1, value);
                                }
                                function onSuccess(value) {
                                    if (called) {
                                        return;
                                    }
                                    called = true;
                                    handlers.resolve(self1, value);
                                }
                                function tryToUnwrap() {
                                    thenable(onSuccess, onError);
                                }
                                var result = tryCatch(tryToUnwrap);
                                if (result.status === 'error') {
                                    onError(result.value);
                                }
                            }
                            function tryCatch(func, value) {
                                var out = {};
                                try {
                                    out.value = func(value);
                                    out.status = 'success';
                                } catch (e) {
                                    out.status = 'error';
                                    out.value = e;
                                }
                                return out;
                            }
                            Promise1.resolve = resolve;
                            function resolve(value) {
                                if (value instanceof this) {
                                    return value;
                                }
                                return handlers.resolve(new this(INTERNAL), value);
                            }
                            Promise1.reject = reject;
                            function reject(reason) {
                                var promise = new this(INTERNAL);
                                return handlers.reject(promise, reason);
                            }
                            Promise1.all = all;
                            function all(iterable) {
                                var self1 = this;
                                if (Object.prototype.toString.call(iterable) !== '[object Array]') {
                                    return this.reject(new TypeError('must be an array'));
                                }
                                var len = iterable.length;
                                var called = false;
                                if (!len) {
                                    return this.resolve([]);
                                }
                                var values = new Array(len);
                                var resolved = 0;
                                var i = -1;
                                var promise = new this(INTERNAL);
                                while(++i < len){
                                    allResolver(iterable[i], i);
                                }
                                return promise;
                                function allResolver(value, i) {
                                    self1.resolve(value).then(resolveFromAll, function(error) {
                                        if (!called) {
                                            called = true;
                                            handlers.reject(promise, error);
                                        }
                                    });
                                    function resolveFromAll(outValue) {
                                        values[i] = outValue;
                                        if (++resolved === len && !called) {
                                            called = true;
                                            handlers.resolve(promise, values);
                                        }
                                    }
                                }
                            }
                            Promise1.race = race;
                            function race(iterable) {
                                var self1 = this;
                                if (Object.prototype.toString.call(iterable) !== '[object Array]') {
                                    return this.reject(new TypeError('must be an array'));
                                }
                                var len = iterable.length;
                                var called = false;
                                if (!len) {
                                    return this.resolve([]);
                                }
                                var i = -1;
                                var promise = new this(INTERNAL);
                                while(++i < len){
                                    resolver(iterable[i]);
                                }
                                return promise;
                                function resolver(value) {
                                    self1.resolve(value).then(function(response) {
                                        if (!called) {
                                            called = true;
                                            handlers.resolve(promise, response);
                                        }
                                    }, function(error) {
                                        if (!called) {
                                            called = true;
                                            handlers.reject(promise, error);
                                        }
                                    });
                                }
                            }
                        },
                        {
                            "1": 1
                        }
                    ],
                    3: [
                        function(_dereq_, module1, exports1) {
                            (function(global1) {
                                if (typeof global1.Promise !== 'function') {
                                    global1.Promise = _dereq_(2);
                                }
                            }).call(this, typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
                        },
                        {
                            "2": 2
                        }
                    ],
                    4: [
                        function(_dereq_, module1, exports1) {
                            var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
                                return typeof obj;
                            } : function(obj) {
                                return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
                            };
                            function _classCallCheck(instance, Constructor) {
                                if (!(instance instanceof Constructor)) {
                                    throw new TypeError("Cannot call a class as a function");
                                }
                            }
                            function getIDB() {
                                /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */ try {
                                    if (typeof indexedDB !== 'undefined') {
                                        return indexedDB;
                                    }
                                    if (typeof webkitIndexedDB !== 'undefined') {
                                        return webkitIndexedDB;
                                    }
                                    if (typeof mozIndexedDB !== 'undefined') {
                                        return mozIndexedDB;
                                    }
                                    if (typeof OIndexedDB !== 'undefined') {
                                        return OIndexedDB;
                                    }
                                    if (typeof msIndexedDB !== 'undefined') {
                                        return msIndexedDB;
                                    }
                                } catch (e) {
                                    return;
                                }
                            }
                            var idb = getIDB();
                            function isIndexedDBValid() {
                                try {
                                    // Initialize IndexedDB; fall back to vendor-prefixed versions
                                    // if needed.
                                    if (!idb || !idb.open) {
                                        return false;
                                    }
                                    // We mimic PouchDB here;
                                    //
                                    // We test for openDatabase because IE Mobile identifies itself
                                    // as Safari. Oh the lulz...
                                    var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);
                                    var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;
                                    // Safari <10.1 does not meet our requirements for IDB support
                                    // (see: https://github.com/pouchdb/pouchdb/issues/5572).
                                    // Safari 10.1 shipped with fetch, we can use that to detect it.
                                    // Note: this creates issues with `window.fetch` polyfills and
                                    // overrides; see:
                                    // https://github.com/localForage/localForage/issues/856
                                    return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' && // some outdated implementations of IDB that appear on Samsung
                                    // and HTC Android devices <4.4 are missing IDBKeyRange
                                    // See: https://github.com/mozilla/localForage/issues/128
                                    // See: https://github.com/mozilla/localForage/issues/272
                                    typeof IDBKeyRange !== 'undefined';
                                } catch (e) {
                                    return false;
                                }
                            }
                            // Abstracts constructing a Blob object, so it also works in older
                            // browsers that don't support the native Blob constructor. (i.e.
                            // old QtWebKit versions, at least).
                            // Abstracts constructing a Blob object, so it also works in older
                            // browsers that don't support the native Blob constructor. (i.e.
                            // old QtWebKit versions, at least).
                            function createBlob(parts, properties) {
                                /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || [];
                                properties = properties || {};
                                try {
                                    return new Blob(parts, properties);
                                } catch (e) {
                                    if (e.name !== 'TypeError') {
                                        throw e;
                                    }
                                    var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;
                                    var builder = new Builder();
                                    for(var i = 0; i < parts.length; i += 1){
                                        builder.append(parts[i]);
                                    }
                                    return builder.getBlob(properties.type);
                                }
                            }
                            // This is CommonJS because lie is an external dependency, so Rollup
                            // can just ignore it.
                            if (typeof Promise === 'undefined') {
                                // In the "nopromises" build this will just throw if you don't have
                                // a global promise object, but it would throw anyway later.
                                _dereq_(3);
                            }
                            var Promise$1 = Promise;
                            function executeCallback(promise, callback) {
                                if (callback) {
                                    promise.then(function(result) {
                                        callback(null, result);
                                    }, function(error) {
                                        callback(error);
                                    });
                                }
                            }
                            function executeTwoCallbacks(promise, callback, errorCallback) {
                                if (typeof callback === 'function') {
                                    promise.then(callback);
                                }
                                if (typeof errorCallback === 'function') {
                                    promise["catch"](errorCallback);
                                }
                            }
                            function normalizeKey(key) {
                                // Cast the key to a string, as that's all we can set as a key.
                                if (typeof key !== 'string') {
                                    console.warn(key + ' used as a key, but it is not a string.');
                                    key = String(key);
                                }
                                return key;
                            }
                            function getCallback() {
                                if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
                                    return arguments[arguments.length - 1];
                                }
                            }
                            // Some code originally from async_storage.js in
                            // [Gaia](https://github.com/mozilla-b2g/gaia).
                            var DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';
                            var supportsBlobs = void 0;
                            var dbContexts = {};
                            var toString = Object.prototype.toString;
                            // Transaction Modes
                            var READ_ONLY = 'readonly';
                            var READ_WRITE = 'readwrite';
                            // Transform a binary string to an array buffer, because otherwise
                            // weird stuff happens when you try to work with the binary string directly.
                            // It is known.
                            // From http://stackoverflow.com/questions/14967647/ (continues on next line)
                            // encode-decode-image-with-base64-breaks-image (2013-04-21)
                            function _binStringToArrayBuffer(bin) {
                                var length = bin.length;
                                var buf = new ArrayBuffer(length);
                                var arr = new Uint8Array(buf);
                                for(var i = 0; i < length; i++){
                                    arr[i] = bin.charCodeAt(i);
                                }
                                return buf;
                            }
                            //
                            // Blobs are not supported in all versions of IndexedDB, notably
                            // Chrome <37 and Android <5. In those versions, storing a blob will throw.
                            //
                            // Various other blob bugs exist in Chrome v37-42 (inclusive).
                            // Detecting them is expensive and confusing to users, and Chrome 37-42
                            // is at very low usage worldwide, so we do a hacky userAgent check instead.
                            //
                            // content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120
                            // 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916
                            // FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836
                            //
                            // Code borrowed from PouchDB. See:
                            // https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js
                            //
                            function _checkBlobSupportWithoutCaching(idb) {
                                return new Promise$1(function(resolve) {
                                    var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);
                                    var blob = createBlob([
                                        ''
                                    ]);
                                    txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');
                                    txn.onabort = function(e) {
                                        // If the transaction aborts now its due to not being able to
                                        // write to the database, likely due to the disk being full
                                        e.preventDefault();
                                        e.stopPropagation();
                                        resolve(false);
                                    };
                                    txn.oncomplete = function() {
                                        var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/);
                                        var matchedEdge = navigator.userAgent.match(/Edge\//);
                                        // MS Edge pretends to be Chrome 42:
                                        // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx
                                        resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);
                                    };
                                })["catch"](function() {
                                    return false; // error, so assume unsupported
                                });
                            }
                            function _checkBlobSupport(idb) {
                                if (typeof supportsBlobs === 'boolean') {
                                    return Promise$1.resolve(supportsBlobs);
                                }
                                return _checkBlobSupportWithoutCaching(idb).then(function(value) {
                                    supportsBlobs = value;
                                    return supportsBlobs;
                                });
                            }
                            function _deferReadiness(dbInfo) {
                                var dbContext = dbContexts[dbInfo.name];
                                // Create a deferred object representing the current database operation.
                                var deferredOperation = {};
                                deferredOperation.promise = new Promise$1(function(resolve, reject) {
                                    deferredOperation.resolve = resolve;
                                    deferredOperation.reject = reject;
                                });
                                // Enqueue the deferred operation.
                                dbContext.deferredOperations.push(deferredOperation);
                                // Chain its promise to the database readiness.
                                if (!dbContext.dbReady) {
                                    dbContext.dbReady = deferredOperation.promise;
                                } else {
                                    dbContext.dbReady = dbContext.dbReady.then(function() {
                                        return deferredOperation.promise;
                                    });
                                }
                            }
                            function _advanceReadiness(dbInfo) {
                                var dbContext = dbContexts[dbInfo.name];
                                // Dequeue a deferred operation.
                                var deferredOperation = dbContext.deferredOperations.pop();
                                // Resolve its promise (which is part of the database readiness
                                // chain of promises).
                                if (deferredOperation) {
                                    deferredOperation.resolve();
                                    return deferredOperation.promise;
                                }
                            }
                            function _rejectReadiness(dbInfo, err) {
                                var dbContext = dbContexts[dbInfo.name];
                                // Dequeue a deferred operation.
                                var deferredOperation = dbContext.deferredOperations.pop();
                                // Reject its promise (which is part of the database readiness
                                // chain of promises).
                                if (deferredOperation) {
                                    deferredOperation.reject(err);
                                    return deferredOperation.promise;
                                }
                            }
                            function _getConnection(dbInfo, upgradeNeeded) {
                                return new Promise$1(function(resolve, reject) {
                                    dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();
                                    if (dbInfo.db) {
                                        if (upgradeNeeded) {
                                            _deferReadiness(dbInfo);
                                            dbInfo.db.close();
                                        } else {
                                            return resolve(dbInfo.db);
                                        }
                                    }
                                    var dbArgs = [
                                        dbInfo.name
                                    ];
                                    if (upgradeNeeded) {
                                        dbArgs.push(dbInfo.version);
                                    }
                                    var openreq = idb.open.apply(idb, dbArgs);
                                    if (upgradeNeeded) {
                                        openreq.onupgradeneeded = function(e) {
                                            var db = openreq.result;
                                            try {
                                                db.createObjectStore(dbInfo.storeName);
                                                if (e.oldVersion <= 1) {
                                                    // Added when support for blob shims was added
                                                    db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);
                                                }
                                            } catch (ex) {
                                                if (ex.name === 'ConstraintError') {
                                                    console.warn('The database "' + dbInfo.name + '"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage "' + dbInfo.storeName + '" already exists.');
                                                } else {
                                                    throw ex;
                                                }
                                            }
                                        };
                                    }
                                    openreq.onerror = function(e) {
                                        e.preventDefault();
                                        reject(openreq.error);
                                    };
                                    openreq.onsuccess = function() {
                                        var db = openreq.result;
                                        db.onversionchange = function(e) {
                                            // Triggered when the database is modified (e.g. adding an objectStore) or
                                            // deleted (even when initiated by other sessions in different tabs).
                                            // Closing the connection here prevents those operations from being blocked.
                                            // If the database is accessed again later by this instance, the connection
                                            // will be reopened or the database recreated as needed.
                                            e.target.close();
                                        };
                                        resolve(db);
                                        _advanceReadiness(dbInfo);
                                    };
                                });
                            }
                            function _getOriginalConnection(dbInfo) {
                                return _getConnection(dbInfo, false);
                            }
                            function _getUpgradedConnection(dbInfo) {
                                return _getConnection(dbInfo, true);
                            }
                            function _isUpgradeNeeded(dbInfo, defaultVersion) {
                                if (!dbInfo.db) {
                                    return true;
                                }
                                var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);
                                var isDowngrade = dbInfo.version < dbInfo.db.version;
                                var isUpgrade = dbInfo.version > dbInfo.db.version;
                                if (isDowngrade) {
                                    // If the version is not the default one
                                    // then warn for impossible downgrade.
                                    if (dbInfo.version !== defaultVersion) {
                                        console.warn('The database "' + dbInfo.name + '"' + " can't be downgraded from version " + dbInfo.db.version + ' to version ' + dbInfo.version + '.');
                                    }
                                    // Align the versions to prevent errors.
                                    dbInfo.version = dbInfo.db.version;
                                }
                                if (isUpgrade || isNewStore) {
                                    // If the store is new then increment the version (if needed).
                                    // This will trigger an "upgradeneeded" event which is required
                                    // for creating a store.
                                    if (isNewStore) {
                                        var incVersion = dbInfo.db.version + 1;
                                        if (incVersion > dbInfo.version) {
                                            dbInfo.version = incVersion;
                                        }
                                    }
                                    return true;
                                }
                                return false;
                            }
                            // encode a blob for indexeddb engines that don't support blobs
                            function _encodeBlob(blob) {
                                return new Promise$1(function(resolve, reject) {
                                    var reader = new FileReader();
                                    reader.onerror = reject;
                                    reader.onloadend = function(e) {
                                        var base64 = btoa(e.target.result || '');
                                        resolve({
                                            __local_forage_encoded_blob: true,
                                            data: base64,
                                            type: blob.type
                                        });
                                    };
                                    reader.readAsBinaryString(blob);
                                });
                            }
                            // decode an encoded blob
                            function _decodeBlob(encodedBlob) {
                                var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));
                                return createBlob([
                                    arrayBuff
                                ], {
                                    type: encodedBlob.type
                                });
                            }
                            // is this one of our fancy encoded blobs?
                            function _isEncodedBlob(value) {
                                return value && value.__local_forage_encoded_blob;
                            }
                            // Specialize the default `ready()` function by making it dependent
                            // on the current database operations. Thus, the driver will be actually
                            // ready when it's been initialized (default) *and* there are no pending
                            // operations on the database (initiated by some other instances).
                            function _fullyReady(callback) {
                                var self1 = this;
                                var promise = self1._initReady().then(function() {
                                    var dbContext = dbContexts[self1._dbInfo.name];
                                    if (dbContext && dbContext.dbReady) {
                                        return dbContext.dbReady;
                                    }
                                });
                                executeTwoCallbacks(promise, callback, callback);
                                return promise;
                            }
                            // Try to establish a new db connection to replace the
                            // current one which is broken (i.e. experiencing
                            // InvalidStateError while creating a transaction).
                            function _tryReconnect(dbInfo) {
                                _deferReadiness(dbInfo);
                                var dbContext = dbContexts[dbInfo.name];
                                var forages = dbContext.forages;
                                for(var i = 0; i < forages.length; i++){
                                    var forage = forages[i];
                                    if (forage._dbInfo.db) {
                                        forage._dbInfo.db.close();
                                        forage._dbInfo.db = null;
                                    }
                                }
                                dbInfo.db = null;
                                return _getOriginalConnection(dbInfo).then(function(db) {
                                    dbInfo.db = db;
                                    if (_isUpgradeNeeded(dbInfo)) {
                                        // Reopen the database for upgrading.
                                        return _getUpgradedConnection(dbInfo);
                                    }
                                    return db;
                                }).then(function(db) {
                                    // store the latest db reference
                                    // in case the db was upgraded
                                    dbInfo.db = dbContext.db = db;
                                    for(var i = 0; i < forages.length; i++){
                                        forages[i]._dbInfo.db = db;
                                    }
                                })["catch"](function(err) {
                                    _rejectReadiness(dbInfo, err);
                                    throw err;
                                });
                            }
                            // FF doesn't like Promises (micro-tasks) and IDDB store operations,
                            // so we have to do it with callbacks
                            function createTransaction(dbInfo, mode, callback, retries) {
                                if (retries === undefined) {
                                    retries = 1;
                                }
                                try {
                                    var tx = dbInfo.db.transaction(dbInfo.storeName, mode);
                                    callback(null, tx);
                                } catch (err) {
                                    if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {
                                        return Promise$1.resolve().then(function() {
                                            if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {
                                                // increase the db version, to create the new ObjectStore
                                                if (dbInfo.db) {
                                                    dbInfo.version = dbInfo.db.version + 1;
                                                }
                                                // Reopen the database for upgrading.
                                                return _getUpgradedConnection(dbInfo);
                                            }
                                        }).then(function() {
                                            return _tryReconnect(dbInfo).then(function() {
                                                createTransaction(dbInfo, mode, callback, retries - 1);
                                            });
                                        })["catch"](callback);
                                    }
                                    callback(err);
                                }
                            }
                            function createDbContext() {
                                return {
                                    // Running localForages sharing a database.
                                    forages: [],
                                    // Shared database.
                                    db: null,
                                    // Database readiness (promise).
                                    dbReady: null,
                                    // Deferred operations on the database.
                                    deferredOperations: []
                                };
                            }
                            // Open the IndexedDB database (automatically creates one if one didn't
                            // previously exist), using any options set in the config.
                            function _initStorage(options) {
                                var self1 = this;
                                var dbInfo = {
                                    db: null
                                };
                                if (options) {
                                    for(var i in options){
                                        dbInfo[i] = options[i];
                                    }
                                }
                                // Get the current context of the database;
                                var dbContext = dbContexts[dbInfo.name];
                                // ...or create a new context.
                                if (!dbContext) {
                                    dbContext = createDbContext();
                                    // Register the new context in the global container.
                                    dbContexts[dbInfo.name] = dbContext;
                                }
                                // Register itself as a running localForage in the current context.
                                dbContext.forages.push(self1);
                                // Replace the default `ready()` function with the specialized one.
                                if (!self1._initReady) {
                                    self1._initReady = self1.ready;
                                    self1.ready = _fullyReady;
                                }
                                // Create an array of initialization states of the related localForages.
                                var initPromises = [];
                                function ignoreErrors() {
                                    // Don't handle errors here,
                                    // just makes sure related localForages aren't pending.
                                    return Promise$1.resolve();
                                }
                                for(var j = 0; j < dbContext.forages.length; j++){
                                    var forage = dbContext.forages[j];
                                    if (forage !== self1) {
                                        // Don't wait for itself...
                                        initPromises.push(forage._initReady()["catch"](ignoreErrors));
                                    }
                                }
                                // Take a snapshot of the related localForages.
                                var forages = dbContext.forages.slice(0);
                                // Initialize the connection process only when
                                // all the related localForages aren't pending.
                                return Promise$1.all(initPromises).then(function() {
                                    dbInfo.db = dbContext.db;
                                    // Get the connection or open a new one without upgrade.
                                    return _getOriginalConnection(dbInfo);
                                }).then(function(db) {
                                    dbInfo.db = db;
                                    if (_isUpgradeNeeded(dbInfo, self1._defaultConfig.version)) {
                                        // Reopen the database for upgrading.
                                        return _getUpgradedConnection(dbInfo);
                                    }
                                    return db;
                                }).then(function(db) {
                                    dbInfo.db = dbContext.db = db;
                                    self1._dbInfo = dbInfo;
                                    // Share the final connection amongst related localForages.
                                    for(var k = 0; k < forages.length; k++){
                                        var forage = forages[k];
                                        if (forage !== self1) {
                                            // Self is already up-to-date.
                                            forage._dbInfo.db = dbInfo.db;
                                            forage._dbInfo.version = dbInfo.version;
                                        }
                                    }
                                });
                            }
                            function getItem(key, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_ONLY, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                var req = store.get(key);
                                                req.onsuccess = function() {
                                                    var value = req.result;
                                                    if (value === undefined) {
                                                        value = null;
                                                    }
                                                    if (_isEncodedBlob(value)) {
                                                        value = _decodeBlob(value);
                                                    }
                                                    resolve(value);
                                                };
                                                req.onerror = function() {
                                                    reject(req.error);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Iterate over all items stored in database.
                            function iterate(iterator, callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_ONLY, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                var req = store.openCursor();
                                                var iterationNumber = 1;
                                                req.onsuccess = function() {
                                                    var cursor = req.result;
                                                    if (cursor) {
                                                        var value = cursor.value;
                                                        if (_isEncodedBlob(value)) {
                                                            value = _decodeBlob(value);
                                                        }
                                                        var result = iterator(value, cursor.key, iterationNumber++);
                                                        // when the iterator callback returns any
                                                        // (non-`undefined`) value, then we stop
                                                        // the iteration immediately
                                                        if (result !== void 0) {
                                                            resolve(result);
                                                        } else {
                                                            cursor["continue"]();
                                                        }
                                                    } else {
                                                        resolve();
                                                    }
                                                };
                                                req.onerror = function() {
                                                    reject(req.error);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function setItem(key, value, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = new Promise$1(function(resolve, reject) {
                                    var dbInfo;
                                    self1.ready().then(function() {
                                        dbInfo = self1._dbInfo;
                                        if (toString.call(value) === '[object Blob]') {
                                            return _checkBlobSupport(dbInfo.db).then(function(blobSupport) {
                                                if (blobSupport) {
                                                    return value;
                                                }
                                                return _encodeBlob(value);
                                            });
                                        }
                                        return value;
                                    }).then(function(value) {
                                        createTransaction(self1._dbInfo, READ_WRITE, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                // The reason we don't _save_ null is because IE 10 does
                                                // not support saving the `null` type in IndexedDB. How
                                                // ironic, given the bug below!
                                                // See: https://github.com/mozilla/localForage/issues/161
                                                if (value === null) {
                                                    value = undefined;
                                                }
                                                var req = store.put(value, key);
                                                transaction.oncomplete = function() {
                                                    // Cast to undefined so the value passed to
                                                    // callback/promise is the same as what one would get out
                                                    // of `getItem()` later. This leads to some weirdness
                                                    // (setItem('foo', undefined) will return `null`), but
                                                    // it's not my fault localStorage is our baseline and that
                                                    // it's weird.
                                                    if (value === undefined) {
                                                        value = null;
                                                    }
                                                    resolve(value);
                                                };
                                                transaction.onabort = transaction.onerror = function() {
                                                    var err = req.error ? req.error : req.transaction.error;
                                                    reject(err);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function removeItem(key, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_WRITE, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                // We use a Grunt task to make this safe for IE and some
                                                // versions of Android (including those used by Cordova).
                                                // Normally IE won't like `.delete()` and will insist on
                                                // using `['delete']()`, but we have a build step that
                                                // fixes this for us now.
                                                var req = store["delete"](key);
                                                transaction.oncomplete = function() {
                                                    resolve();
                                                };
                                                transaction.onerror = function() {
                                                    reject(req.error);
                                                };
                                                // The request will be also be aborted if we've exceeded our storage
                                                // space.
                                                transaction.onabort = function() {
                                                    var err = req.error ? req.error : req.transaction.error;
                                                    reject(err);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function clear(callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_WRITE, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                var req = store.clear();
                                                transaction.oncomplete = function() {
                                                    resolve();
                                                };
                                                transaction.onabort = transaction.onerror = function() {
                                                    var err = req.error ? req.error : req.transaction.error;
                                                    reject(err);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function length(callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_ONLY, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                var req = store.count();
                                                req.onsuccess = function() {
                                                    resolve(req.result);
                                                };
                                                req.onerror = function() {
                                                    reject(req.error);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function key(n, callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    if (n < 0) {
                                        resolve(null);
                                        return;
                                    }
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_ONLY, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                var advanced = false;
                                                var req = store.openKeyCursor();
                                                req.onsuccess = function() {
                                                    var cursor = req.result;
                                                    if (!cursor) {
                                                        // this means there weren't enough keys
                                                        resolve(null);
                                                        return;
                                                    }
                                                    if (n === 0) {
                                                        // We have the first key, return it if that's what they
                                                        // wanted.
                                                        resolve(cursor.key);
                                                    } else {
                                                        if (!advanced) {
                                                            // Otherwise, ask the cursor to skip ahead n
                                                            // records.
                                                            advanced = true;
                                                            cursor.advance(n);
                                                        } else {
                                                            // When we get here, we've got the nth key.
                                                            resolve(cursor.key);
                                                        }
                                                    }
                                                };
                                                req.onerror = function() {
                                                    reject(req.error);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function keys(callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        createTransaction(self1._dbInfo, READ_ONLY, function(err, transaction) {
                                            if (err) {
                                                return reject(err);
                                            }
                                            try {
                                                var store = transaction.objectStore(self1._dbInfo.storeName);
                                                var req = store.openKeyCursor();
                                                var keys = [];
                                                req.onsuccess = function() {
                                                    var cursor = req.result;
                                                    if (!cursor) {
                                                        resolve(keys);
                                                        return;
                                                    }
                                                    keys.push(cursor.key);
                                                    cursor["continue"]();
                                                };
                                                req.onerror = function() {
                                                    reject(req.error);
                                                };
                                            } catch (e) {
                                                reject(e);
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function dropInstance(options, callback) {
                                callback = getCallback.apply(this, arguments);
                                var currentConfig = this.config();
                                options = typeof options !== 'function' && options || {};
                                if (!options.name) {
                                    options.name = options.name || currentConfig.name;
                                    options.storeName = options.storeName || currentConfig.storeName;
                                }
                                var self1 = this;
                                var promise;
                                if (!options.name) {
                                    promise = Promise$1.reject('Invalid arguments');
                                } else {
                                    var isCurrentDb = options.name === currentConfig.name && self1._dbInfo.db;
                                    var dbPromise = isCurrentDb ? Promise$1.resolve(self1._dbInfo.db) : _getOriginalConnection(options).then(function(db) {
                                        var dbContext = dbContexts[options.name];
                                        var forages = dbContext.forages;
                                        dbContext.db = db;
                                        for(var i = 0; i < forages.length; i++){
                                            forages[i]._dbInfo.db = db;
                                        }
                                        return db;
                                    });
                                    if (!options.storeName) {
                                        promise = dbPromise.then(function(db) {
                                            _deferReadiness(options);
                                            var dbContext = dbContexts[options.name];
                                            var forages = dbContext.forages;
                                            db.close();
                                            for(var i = 0; i < forages.length; i++){
                                                var forage = forages[i];
                                                forage._dbInfo.db = null;
                                            }
                                            var dropDBPromise = new Promise$1(function(resolve, reject) {
                                                var req = idb.deleteDatabase(options.name);
                                                req.onerror = function() {
                                                    var db = req.result;
                                                    if (db) {
                                                        db.close();
                                                    }
                                                    reject(req.error);
                                                };
                                                req.onblocked = function() {
                                                    // Closing all open connections in onversionchange handler should prevent this situation, but if
                                                    // we do get here, it just means the request remains pending - eventually it will succeed or error
                                                    console.warn('dropInstance blocked for database "' + options.name + '" until all open connections are closed');
                                                };
                                                req.onsuccess = function() {
                                                    var db = req.result;
                                                    if (db) {
                                                        db.close();
                                                    }
                                                    resolve(db);
                                                };
                                            });
                                            return dropDBPromise.then(function(db) {
                                                dbContext.db = db;
                                                for(var i = 0; i < forages.length; i++){
                                                    var _forage = forages[i];
                                                    _advanceReadiness(_forage._dbInfo);
                                                }
                                            })["catch"](function(err) {
                                                (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() {});
                                                throw err;
                                            });
                                        });
                                    } else {
                                        promise = dbPromise.then(function(db) {
                                            if (!db.objectStoreNames.contains(options.storeName)) {
                                                return;
                                            }
                                            var newVersion = db.version + 1;
                                            _deferReadiness(options);
                                            var dbContext = dbContexts[options.name];
                                            var forages = dbContext.forages;
                                            db.close();
                                            for(var i = 0; i < forages.length; i++){
                                                var forage = forages[i];
                                                forage._dbInfo.db = null;
                                                forage._dbInfo.version = newVersion;
                                            }
                                            var dropObjectPromise = new Promise$1(function(resolve, reject) {
                                                var req = idb.open(options.name, newVersion);
                                                req.onerror = function(err) {
                                                    var db = req.result;
                                                    db.close();
                                                    reject(err);
                                                };
                                                req.onupgradeneeded = function() {
                                                    var db = req.result;
                                                    db.deleteObjectStore(options.storeName);
                                                };
                                                req.onsuccess = function() {
                                                    var db = req.result;
                                                    db.close();
                                                    resolve(db);
                                                };
                                            });
                                            return dropObjectPromise.then(function(db) {
                                                dbContext.db = db;
                                                for(var j = 0; j < forages.length; j++){
                                                    var _forage2 = forages[j];
                                                    _forage2._dbInfo.db = db;
                                                    _advanceReadiness(_forage2._dbInfo);
                                                }
                                            })["catch"](function(err) {
                                                (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function() {});
                                                throw err;
                                            });
                                        });
                                    }
                                }
                                executeCallback(promise, callback);
                                return promise;
                            }
                            var asyncStorage = {
                                _driver: 'asyncStorage',
                                _initStorage: _initStorage,
                                _support: isIndexedDBValid(),
                                iterate: iterate,
                                getItem: getItem,
                                setItem: setItem,
                                removeItem: removeItem,
                                clear: clear,
                                length: length,
                                key: key,
                                keys: keys,
                                dropInstance: dropInstance
                            };
                            function isWebSQLValid() {
                                return typeof openDatabase === 'function';
                            }
                            // Sadly, the best way to save binary data in WebSQL/localStorage is serializing
                            // it to Base64, so this is how we store it to prevent very strange errors with less
                            // verbose ways of binary <-> string data storage.
                            var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
                            var BLOB_TYPE_PREFIX = '~~local_forage_type~';
                            var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
                            var SERIALIZED_MARKER = '__lfsc__:';
                            var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;
                            // OMG the serializations!
                            var TYPE_ARRAYBUFFER = 'arbf';
                            var TYPE_BLOB = 'blob';
                            var TYPE_INT8ARRAY = 'si08';
                            var TYPE_UINT8ARRAY = 'ui08';
                            var TYPE_UINT8CLAMPEDARRAY = 'uic8';
                            var TYPE_INT16ARRAY = 'si16';
                            var TYPE_INT32ARRAY = 'si32';
                            var TYPE_UINT16ARRAY = 'ur16';
                            var TYPE_UINT32ARRAY = 'ui32';
                            var TYPE_FLOAT32ARRAY = 'fl32';
                            var TYPE_FLOAT64ARRAY = 'fl64';
                            var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;
                            var toString$1 = Object.prototype.toString;
                            function stringToBuffer(serializedString) {
                                // Fill the string into a ArrayBuffer.
                                var bufferLength = serializedString.length * 0.75;
                                var len = serializedString.length;
                                var i;
                                var p = 0;
                                var encoded1, encoded2, encoded3, encoded4;
                                if (serializedString[serializedString.length - 1] === '=') {
                                    bufferLength--;
                                    if (serializedString[serializedString.length - 2] === '=') {
                                        bufferLength--;
                                    }
                                }
                                var buffer = new ArrayBuffer(bufferLength);
                                var bytes = new Uint8Array(buffer);
                                for(i = 0; i < len; i += 4){
                                    encoded1 = BASE_CHARS.indexOf(serializedString[i]);
                                    encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);
                                    encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);
                                    encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);
                                    /*jslint bitwise: true */ bytes[p++] = encoded1 << 2 | encoded2 >> 4;
                                    bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
                                    bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
                                }
                                return buffer;
                            }
                            // Converts a buffer to a string to store, serialized, in the backend
                            // storage library.
                            function bufferToString(buffer) {
                                // base64-arraybuffer
                                var bytes = new Uint8Array(buffer);
                                var base64String = '';
                                var i;
                                for(i = 0; i < bytes.length; i += 3){
                                    /*jslint bitwise: true */ base64String += BASE_CHARS[bytes[i] >> 2];
                                    base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
                                    base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
                                    base64String += BASE_CHARS[bytes[i + 2] & 63];
                                }
                                if (bytes.length % 3 === 2) {
                                    base64String = base64String.substring(0, base64String.length - 1) + '=';
                                } else if (bytes.length % 3 === 1) {
                                    base64String = base64String.substring(0, base64String.length - 2) + '==';
                                }
                                return base64String;
                            }
                            // Serialize a value, afterwards executing a callback (which usually
                            // instructs the `setItem()` callback/promise to be executed). This is how
                            // we store binary data with localStorage.
                            function serialize(value, callback) {
                                var valueType = '';
                                if (value) {
                                    valueType = toString$1.call(value);
                                }
                                // Cannot use `value instanceof ArrayBuffer` or such here, as these
                                // checks fail when running the tests using casper.js...
                                //
                                // TODO: See why those tests fail and use a better solution.
                                if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {
                                    // Convert binary arrays to a string and prefix the string with
                                    // a special marker.
                                    var buffer;
                                    var marker = SERIALIZED_MARKER;
                                    if (value instanceof ArrayBuffer) {
                                        buffer = value;
                                        marker += TYPE_ARRAYBUFFER;
                                    } else {
                                        buffer = value.buffer;
                                        if (valueType === '[object Int8Array]') {
                                            marker += TYPE_INT8ARRAY;
                                        } else if (valueType === '[object Uint8Array]') {
                                            marker += TYPE_UINT8ARRAY;
                                        } else if (valueType === '[object Uint8ClampedArray]') {
                                            marker += TYPE_UINT8CLAMPEDARRAY;
                                        } else if (valueType === '[object Int16Array]') {
                                            marker += TYPE_INT16ARRAY;
                                        } else if (valueType === '[object Uint16Array]') {
                                            marker += TYPE_UINT16ARRAY;
                                        } else if (valueType === '[object Int32Array]') {
                                            marker += TYPE_INT32ARRAY;
                                        } else if (valueType === '[object Uint32Array]') {
                                            marker += TYPE_UINT32ARRAY;
                                        } else if (valueType === '[object Float32Array]') {
                                            marker += TYPE_FLOAT32ARRAY;
                                        } else if (valueType === '[object Float64Array]') {
                                            marker += TYPE_FLOAT64ARRAY;
                                        } else {
                                            callback(new Error('Failed to get type for BinaryArray'));
                                        }
                                    }
                                    callback(marker + bufferToString(buffer));
                                } else if (valueType === '[object Blob]') {
                                    // Conver the blob to a binaryArray and then to a string.
                                    var fileReader = new FileReader();
                                    fileReader.onload = function() {
                                        // Backwards-compatible prefix for the blob type.
                                        var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);
                                        callback(SERIALIZED_MARKER + TYPE_BLOB + str);
                                    };
                                    fileReader.readAsArrayBuffer(value);
                                } else {
                                    try {
                                        callback(JSON.stringify(value));
                                    } catch (e) {
                                        console.error("Couldn't convert value into a JSON string: ", value);
                                        callback(null, e);
                                    }
                                }
                            }
                            // Deserialize data we've inserted into a value column/field. We place
                            // special markers into our strings to mark them as encoded; this isn't
                            // as nice as a meta field, but it's the only sane thing we can do whilst
                            // keeping localStorage support intact.
                            //
                            // Oftentimes this will just deserialize JSON content, but if we have a
                            // special marker (SERIALIZED_MARKER, defined above), we will extract
                            // some kind of arraybuffer/binary data/typed array out of the string.
                            function deserialize(value) {
                                // If we haven't marked this string as being specially serialized (i.e.
                                // something other than serialized JSON), we can just return it and be
                                // done with it.
                                if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
                                    return JSON.parse(value);
                                }
                                // The following code deals with deserializing some kind of Blob or
                                // TypedArray. First we separate out the type of data we're dealing
                                // with from the data itself.
                                var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
                                var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);
                                var blobType;
                                // Backwards-compatible blob type serialization strategy.
                                // DBs created with older versions of localForage will simply not have the blob type.
                                if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
                                    var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
                                    blobType = matcher[1];
                                    serializedString = serializedString.substring(matcher[0].length);
                                }
                                var buffer = stringToBuffer(serializedString);
                                // Return the right type based on the code/type set during
                                // serialization.
                                switch(type){
                                    case TYPE_ARRAYBUFFER:
                                        return buffer;
                                    case TYPE_BLOB:
                                        return createBlob([
                                            buffer
                                        ], {
                                            type: blobType
                                        });
                                    case TYPE_INT8ARRAY:
                                        return new Int8Array(buffer);
                                    case TYPE_UINT8ARRAY:
                                        return new Uint8Array(buffer);
                                    case TYPE_UINT8CLAMPEDARRAY:
                                        return new Uint8ClampedArray(buffer);
                                    case TYPE_INT16ARRAY:
                                        return new Int16Array(buffer);
                                    case TYPE_UINT16ARRAY:
                                        return new Uint16Array(buffer);
                                    case TYPE_INT32ARRAY:
                                        return new Int32Array(buffer);
                                    case TYPE_UINT32ARRAY:
                                        return new Uint32Array(buffer);
                                    case TYPE_FLOAT32ARRAY:
                                        return new Float32Array(buffer);
                                    case TYPE_FLOAT64ARRAY:
                                        return new Float64Array(buffer);
                                    default:
                                        throw new Error('Unkown type: ' + type);
                                }
                            }
                            var localforageSerializer = {
                                serialize: serialize,
                                deserialize: deserialize,
                                stringToBuffer: stringToBuffer,
                                bufferToString: bufferToString
                            };
                            /*
             * Includes code from:
             *
             * base64-arraybuffer
             * https://github.com/niklasvh/base64-arraybuffer
             *
             * Copyright (c) 2012 Niklas von Hertzen
             * Licensed under the MIT license.
             */ function createDbTable(t, dbInfo, callback, errorCallback) {
                                t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);
                            }
                            // Open the WebSQL database (automatically creates one if one didn't
                            // previously exist), using any options set in the config.
                            function _initStorage$1(options) {
                                var self1 = this;
                                var dbInfo = {
                                    db: null
                                };
                                if (options) {
                                    for(var i in options){
                                        dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];
                                    }
                                }
                                var dbInfoPromise = new Promise$1(function(resolve, reject) {
                                    // Open the database; the openDatabase API will automatically
                                    // create it for us if it doesn't exist.
                                    try {
                                        dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);
                                    } catch (e) {
                                        return reject(e);
                                    }
                                    // Create our key/value table if it doesn't exist.
                                    dbInfo.db.transaction(function(t) {
                                        createDbTable(t, dbInfo, function() {
                                            self1._dbInfo = dbInfo;
                                            resolve();
                                        }, function(t, error) {
                                            reject(error);
                                        });
                                    }, reject);
                                });
                                dbInfo.serializer = localforageSerializer;
                                return dbInfoPromise;
                            }
                            function tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {
                                t.executeSql(sqlStatement, args, callback, function(t, error) {
                                    if (error.code === error.SYNTAX_ERR) {
                                        t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name = ?", [
                                            dbInfo.storeName
                                        ], function(t, results) {
                                            if (!results.rows.length) {
                                                // if the table is missing (was deleted)
                                                // re-create it table and retry
                                                createDbTable(t, dbInfo, function() {
                                                    t.executeSql(sqlStatement, args, callback, errorCallback);
                                                }, errorCallback);
                                            } else {
                                                errorCallback(t, error);
                                            }
                                        }, errorCallback);
                                    } else {
                                        errorCallback(t, error);
                                    }
                                }, errorCallback);
                            }
                            function getItem$1(key, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [
                                                key
                                            ], function(t, results) {
                                                var result = results.rows.length ? results.rows.item(0).value : null;
                                                // Check to see if this is serialized content we need to
                                                // unpack.
                                                if (result) {
                                                    result = dbInfo.serializer.deserialize(result);
                                                }
                                                resolve(result);
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function iterate$1(iterator, callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function(t, results) {
                                                var rows = results.rows;
                                                var length = rows.length;
                                                for(var i = 0; i < length; i++){
                                                    var item = rows.item(i);
                                                    var result = item.value;
                                                    // Check to see if this is serialized content
                                                    // we need to unpack.
                                                    if (result) {
                                                        result = dbInfo.serializer.deserialize(result);
                                                    }
                                                    result = iterator(result, item.key, i + 1);
                                                    // void(0) prevents problems with redefinition
                                                    // of `undefined`.
                                                    if (result !== void 0) {
                                                        resolve(result);
                                                        return;
                                                    }
                                                }
                                                resolve();
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function _setItem(key, value, callback, retriesLeft) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        // The localStorage API doesn't return undefined values in an
                                        // "expected" way, so undefined is always cast to null in all
                                        // drivers. See: https://github.com/mozilla/localForage/pull/42
                                        if (value === undefined) {
                                            value = null;
                                        }
                                        // Save the original value to pass to the callback.
                                        var originalValue = value;
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.serializer.serialize(value, function(value, error) {
                                            if (error) {
                                                reject(error);
                                            } else {
                                                dbInfo.db.transaction(function(t) {
                                                    tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [
                                                        key,
                                                        value
                                                    ], function() {
                                                        resolve(originalValue);
                                                    }, function(t, error) {
                                                        reject(error);
                                                    });
                                                }, function(sqlError) {
                                                    // The transaction failed; check
                                                    // to see if it's a quota error.
                                                    if (sqlError.code === sqlError.QUOTA_ERR) {
                                                        // We reject the callback outright for now, but
                                                        // it's worth trying to re-run the transaction.
                                                        // Even if the user accepts the prompt to use
                                                        // more storage on Safari, this error will
                                                        // be called.
                                                        //
                                                        // Try to re-run the transaction.
                                                        if (retriesLeft > 0) {
                                                            resolve(_setItem.apply(self1, [
                                                                key,
                                                                originalValue,
                                                                callback,
                                                                retriesLeft - 1
                                                            ]));
                                                            return;
                                                        }
                                                        reject(sqlError);
                                                    }
                                                });
                                            }
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function setItem$1(key, value, callback) {
                                return _setItem.apply(this, [
                                    key,
                                    value,
                                    callback,
                                    1
                                ]);
                            }
                            function removeItem$1(key, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [
                                                key
                                            ], function() {
                                                resolve();
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Deletes every item in the table.
                            // TODO: Find out if this resets the AUTO_INCREMENT number.
                            function clear$1(callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function() {
                                                resolve();
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Does a simple `COUNT(key)` to get the number of items stored in
                            // localForage.
                            function length$1(callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            // Ahhh, SQL makes this one soooooo easy.
                                            tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function(t, results) {
                                                var result = results.rows.item(0).c;
                                                resolve(result);
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Return the key located at key index X; essentially gets the key from a
                            // `WHERE id = ?`. This is the most efficient way I can think to implement
                            // this rarely-used (in my experience) part of the API, but it can seem
                            // inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so
                            // the ID of each key will change every time it's updated. Perhaps a stored
                            // procedure for the `setItem()` SQL would solve this problem?
                            // TODO: Don't change ID on `setItem()`.
                            function key$1(n, callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [
                                                n + 1
                                            ], function(t, results) {
                                                var result = results.rows.length ? results.rows.item(0).key : null;
                                                resolve(result);
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function keys$1(callback) {
                                var self1 = this;
                                var promise = new Promise$1(function(resolve, reject) {
                                    self1.ready().then(function() {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.db.transaction(function(t) {
                                            tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function(t, results) {
                                                var keys = [];
                                                for(var i = 0; i < results.rows.length; i++){
                                                    keys.push(results.rows.item(i).key);
                                                }
                                                resolve(keys);
                                            }, function(t, error) {
                                                reject(error);
                                            });
                                        });
                                    })["catch"](reject);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // https://www.w3.org/TR/webdatabase/#databases
                            // > There is no way to enumerate or delete the databases available for an origin from this API.
                            function getAllStoreNames(db) {
                                return new Promise$1(function(resolve, reject) {
                                    db.transaction(function(t) {
                                        t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function(t, results) {
                                            var storeNames = [];
                                            for(var i = 0; i < results.rows.length; i++){
                                                storeNames.push(results.rows.item(i).name);
                                            }
                                            resolve({
                                                db: db,
                                                storeNames: storeNames
                                            });
                                        }, function(t, error) {
                                            reject(error);
                                        });
                                    }, function(sqlError) {
                                        reject(sqlError);
                                    });
                                });
                            }
                            function dropInstance$1(options, callback) {
                                callback = getCallback.apply(this, arguments);
                                var currentConfig = this.config();
                                options = typeof options !== 'function' && options || {};
                                if (!options.name) {
                                    options.name = options.name || currentConfig.name;
                                    options.storeName = options.storeName || currentConfig.storeName;
                                }
                                var self1 = this;
                                var promise;
                                if (!options.name) {
                                    promise = Promise$1.reject('Invalid arguments');
                                } else {
                                    promise = new Promise$1(function(resolve) {
                                        var db;
                                        if (options.name === currentConfig.name) {
                                            // use the db reference of the current instance
                                            db = self1._dbInfo.db;
                                        } else {
                                            db = openDatabase(options.name, '', '', 0);
                                        }
                                        if (!options.storeName) {
                                            // drop all database tables
                                            resolve(getAllStoreNames(db));
                                        } else {
                                            resolve({
                                                db: db,
                                                storeNames: [
                                                    options.storeName
                                                ]
                                            });
                                        }
                                    }).then(function(operationInfo) {
                                        return new Promise$1(function(resolve, reject) {
                                            operationInfo.db.transaction(function(t) {
                                                function dropTable(storeName) {
                                                    return new Promise$1(function(resolve, reject) {
                                                        t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function() {
                                                            resolve();
                                                        }, function(t, error) {
                                                            reject(error);
                                                        });
                                                    });
                                                }
                                                var operations = [];
                                                for(var i = 0, len = operationInfo.storeNames.length; i < len; i++){
                                                    operations.push(dropTable(operationInfo.storeNames[i]));
                                                }
                                                Promise$1.all(operations).then(function() {
                                                    resolve();
                                                })["catch"](function(e) {
                                                    reject(e);
                                                });
                                            }, function(sqlError) {
                                                reject(sqlError);
                                            });
                                        });
                                    });
                                }
                                executeCallback(promise, callback);
                                return promise;
                            }
                            var webSQLStorage = {
                                _driver: 'webSQLStorage',
                                _initStorage: _initStorage$1,
                                _support: isWebSQLValid(),
                                iterate: iterate$1,
                                getItem: getItem$1,
                                setItem: setItem$1,
                                removeItem: removeItem$1,
                                clear: clear$1,
                                length: length$1,
                                key: key$1,
                                keys: keys$1,
                                dropInstance: dropInstance$1
                            };
                            function isLocalStorageValid() {
                                try {
                                    return typeof localStorage !== 'undefined' && 'setItem' in localStorage && // in IE8 typeof localStorage.setItem === 'object'
                                    !!localStorage.setItem;
                                } catch (e) {
                                    return false;
                                }
                            }
                            function _getKeyPrefix(options, defaultConfig) {
                                var keyPrefix = options.name + '/';
                                if (options.storeName !== defaultConfig.storeName) {
                                    keyPrefix += options.storeName + '/';
                                }
                                return keyPrefix;
                            }
                            // Check if localStorage throws when saving an item
                            function checkIfLocalStorageThrows() {
                                var localStorageTestKey = '_localforage_support_test';
                                try {
                                    localStorage.setItem(localStorageTestKey, true);
                                    localStorage.removeItem(localStorageTestKey);
                                    return false;
                                } catch (e) {
                                    return true;
                                }
                            }
                            // Check if localStorage is usable and allows to save an item
                            // This method checks if localStorage is usable in Safari Private Browsing
                            // mode, or in any other case where the available quota for localStorage
                            // is 0 and there wasn't any saved items yet.
                            function _isLocalStorageUsable() {
                                return !checkIfLocalStorageThrows() || localStorage.length > 0;
                            }
                            // Config the localStorage backend, using options set in the config.
                            function _initStorage$2(options) {
                                var self1 = this;
                                var dbInfo = {};
                                if (options) {
                                    for(var i in options){
                                        dbInfo[i] = options[i];
                                    }
                                }
                                dbInfo.keyPrefix = _getKeyPrefix(options, self1._defaultConfig);
                                if (!_isLocalStorageUsable()) {
                                    return Promise$1.reject();
                                }
                                self1._dbInfo = dbInfo;
                                dbInfo.serializer = localforageSerializer;
                                return Promise$1.resolve();
                            }
                            // Remove all keys from the datastore, effectively destroying all data in
                            // the app's key/value store!
                            function clear$2(callback) {
                                var self1 = this;
                                var promise = self1.ready().then(function() {
                                    var keyPrefix = self1._dbInfo.keyPrefix;
                                    for(var i = localStorage.length - 1; i >= 0; i--){
                                        var key = localStorage.key(i);
                                        if (key.indexOf(keyPrefix) === 0) {
                                            localStorage.removeItem(key);
                                        }
                                    }
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Retrieve an item from the store. Unlike the original async_storage
                            // library in Gaia, we don't modify return values at all. If a key's value
                            // is `undefined`, we pass that value to the callback function.
                            function getItem$2(key, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = self1.ready().then(function() {
                                    var dbInfo = self1._dbInfo;
                                    var result = localStorage.getItem(dbInfo.keyPrefix + key);
                                    // If a result was found, parse it from the serialized
                                    // string into a JS object. If result isn't truthy, the key
                                    // is likely undefined and we'll pass it straight to the
                                    // callback.
                                    if (result) {
                                        result = dbInfo.serializer.deserialize(result);
                                    }
                                    return result;
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Iterate over all items in the store.
                            function iterate$2(iterator, callback) {
                                var self1 = this;
                                var promise = self1.ready().then(function() {
                                    var dbInfo = self1._dbInfo;
                                    var keyPrefix = dbInfo.keyPrefix;
                                    var keyPrefixLength = keyPrefix.length;
                                    var length = localStorage.length;
                                    // We use a dedicated iterator instead of the `i` variable below
                                    // so other keys we fetch in localStorage aren't counted in
                                    // the `iterationNumber` argument passed to the `iterate()`
                                    // callback.
                                    //
                                    // See: github.com/mozilla/localForage/pull/435#discussion_r38061530
                                    var iterationNumber = 1;
                                    for(var i = 0; i < length; i++){
                                        var key = localStorage.key(i);
                                        if (key.indexOf(keyPrefix) !== 0) {
                                            continue;
                                        }
                                        var value = localStorage.getItem(key);
                                        // If a result was found, parse it from the serialized
                                        // string into a JS object. If result isn't truthy, the
                                        // key is likely undefined and we'll pass it straight
                                        // to the iterator.
                                        if (value) {
                                            value = dbInfo.serializer.deserialize(value);
                                        }
                                        value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);
                                        if (value !== void 0) {
                                            return value;
                                        }
                                    }
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Same as localStorage's key() method, except takes a callback.
                            function key$2(n, callback) {
                                var self1 = this;
                                var promise = self1.ready().then(function() {
                                    var dbInfo = self1._dbInfo;
                                    var result;
                                    try {
                                        result = localStorage.key(n);
                                    } catch (error) {
                                        result = null;
                                    }
                                    // Remove the prefix from the key, if a key is found.
                                    if (result) {
                                        result = result.substring(dbInfo.keyPrefix.length);
                                    }
                                    return result;
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function keys$2(callback) {
                                var self1 = this;
                                var promise = self1.ready().then(function() {
                                    var dbInfo = self1._dbInfo;
                                    var length = localStorage.length;
                                    var keys = [];
                                    for(var i = 0; i < length; i++){
                                        var itemKey = localStorage.key(i);
                                        if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {
                                            keys.push(itemKey.substring(dbInfo.keyPrefix.length));
                                        }
                                    }
                                    return keys;
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Supply the number of keys in the datastore to the callback function.
                            function length$2(callback) {
                                var self1 = this;
                                var promise = self1.keys().then(function(keys) {
                                    return keys.length;
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Remove an item from the store, nice and simple.
                            function removeItem$2(key, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = self1.ready().then(function() {
                                    var dbInfo = self1._dbInfo;
                                    localStorage.removeItem(dbInfo.keyPrefix + key);
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            // Set a key's value and run an optional callback once the value is set.
                            // Unlike Gaia's implementation, the callback function is passed the value,
                            // in case you want to operate on that value only after you're sure it
                            // saved, or something like that.
                            function setItem$2(key, value, callback) {
                                var self1 = this;
                                key = normalizeKey(key);
                                var promise = self1.ready().then(function() {
                                    // Convert undefined values to null.
                                    // https://github.com/mozilla/localForage/pull/42
                                    if (value === undefined) {
                                        value = null;
                                    }
                                    // Save the original value to pass to the callback.
                                    var originalValue = value;
                                    return new Promise$1(function(resolve, reject) {
                                        var dbInfo = self1._dbInfo;
                                        dbInfo.serializer.serialize(value, function(value, error) {
                                            if (error) {
                                                reject(error);
                                            } else {
                                                try {
                                                    localStorage.setItem(dbInfo.keyPrefix + key, value);
                                                    resolve(originalValue);
                                                } catch (e) {
                                                    // localStorage capacity exceeded.
                                                    // TODO: Make this a specific error/event.
                                                    if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
                                                        reject(e);
                                                    }
                                                    reject(e);
                                                }
                                            }
                                        });
                                    });
                                });
                                executeCallback(promise, callback);
                                return promise;
                            }
                            function dropInstance$2(options, callback) {
                                callback = getCallback.apply(this, arguments);
                                options = typeof options !== 'function' && options || {};
                                if (!options.name) {
                                    var currentConfig = this.config();
                                    options.name = options.name || currentConfig.name;
                                    options.storeName = options.storeName || currentConfig.storeName;
                                }
                                var self1 = this;
                                var promise;
                                if (!options.name) {
                                    promise = Promise$1.reject('Invalid arguments');
                                } else {
                                    promise = new Promise$1(function(resolve) {
                                        if (!options.storeName) {
                                            resolve(options.name + '/');
                                        } else {
                                            resolve(_getKeyPrefix(options, self1._defaultConfig));
                                        }
                                    }).then(function(keyPrefix) {
                                        for(var i = localStorage.length - 1; i >= 0; i--){
                                            var key = localStorage.key(i);
                                            if (key.indexOf(keyPrefix) === 0) {
                                                localStorage.removeItem(key);
                                            }
                                        }
                                    });
                                }
                                executeCallback(promise, callback);
                                return promise;
                            }
                            var localStorageWrapper = {
                                _driver: 'localStorageWrapper',
                                _initStorage: _initStorage$2,
                                _support: isLocalStorageValid(),
                                iterate: iterate$2,
                                getItem: getItem$2,
                                setItem: setItem$2,
                                removeItem: removeItem$2,
                                clear: clear$2,
                                length: length$2,
                                key: key$2,
                                keys: keys$2,
                                dropInstance: dropInstance$2
                            };
                            var sameValue = function sameValue(x, y) {
                                return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);
                            };
                            var includes = function includes(array, searchElement) {
                                var len = array.length;
                                var i = 0;
                                while(i < len){
                                    if (sameValue(array[i], searchElement)) {
                                        return true;
                                    }
                                    i++;
                                }
                                return false;
                            };
                            var isArray = Array.isArray || function(arg) {
                                return Object.prototype.toString.call(arg) === '[object Array]';
                            };
                            // Drivers are stored here when `defineDriver()` is called.
                            // They are shared across all instances of localForage.
                            var DefinedDrivers = {};
                            var DriverSupport = {};
                            var DefaultDrivers = {
                                INDEXEDDB: asyncStorage,
                                WEBSQL: webSQLStorage,
                                LOCALSTORAGE: localStorageWrapper
                            };
                            var DefaultDriverOrder = [
                                DefaultDrivers.INDEXEDDB._driver,
                                DefaultDrivers.WEBSQL._driver,
                                DefaultDrivers.LOCALSTORAGE._driver
                            ];
                            var OptionalDriverMethods = [
                                'dropInstance'
                            ];
                            var LibraryMethods = [
                                'clear',
                                'getItem',
                                'iterate',
                                'key',
                                'keys',
                                'length',
                                'removeItem',
                                'setItem'
                            ].concat(OptionalDriverMethods);
                            var DefaultConfig = {
                                description: '',
                                driver: DefaultDriverOrder.slice(),
                                name: 'localforage',
                                // Default DB size is _JUST UNDER_ 5MB, as it's the highest size
                                // we can use without a prompt.
                                size: 4980736,
                                storeName: 'keyvaluepairs',
                                version: 1.0
                            };
                            function callWhenReady(localForageInstance, libraryMethod) {
                                localForageInstance[libraryMethod] = function() {
                                    var _args = arguments;
                                    return localForageInstance.ready().then(function() {
                                        return localForageInstance[libraryMethod].apply(localForageInstance, _args);
                                    });
                                };
                            }
                            function extend() {
                                for(var i = 1; i < arguments.length; i++){
                                    var arg = arguments[i];
                                    if (arg) {
                                        for(var _key in arg){
                                            if (arg.hasOwnProperty(_key)) {
                                                if (isArray(arg[_key])) {
                                                    arguments[0][_key] = arg[_key].slice();
                                                } else {
                                                    arguments[0][_key] = arg[_key];
                                                }
                                            }
                                        }
                                    }
                                }
                                return arguments[0];
                            }
                            var LocalForage = function() {
                                function LocalForage(options) {
                                    _classCallCheck(this, LocalForage);
                                    for(var driverTypeKey in DefaultDrivers){
                                        if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {
                                            var driver = DefaultDrivers[driverTypeKey];
                                            var driverName = driver._driver;
                                            this[driverTypeKey] = driverName;
                                            if (!DefinedDrivers[driverName]) {
                                                // we don't need to wait for the promise,
                                                // since the default drivers can be defined
                                                // in a blocking manner
                                                this.defineDriver(driver);
                                            }
                                        }
                                    }
                                    this._defaultConfig = extend({}, DefaultConfig);
                                    this._config = extend({}, this._defaultConfig, options);
                                    this._driverSet = null;
                                    this._initDriver = null;
                                    this._ready = false;
                                    this._dbInfo = null;
                                    this._wrapLibraryMethodsWithReady();
                                    this.setDriver(this._config.driver)["catch"](function() {});
                                }
                                // Set any config values for localForage; can be called anytime before
                                // the first API call (e.g. `getItem`, `setItem`).
                                // We loop through options so we don't overwrite existing config
                                // values.
                                LocalForage.prototype.config = function config(options) {
                                    // If the options argument is an object, we use it to set values.
                                    // Otherwise, we return either a specified config value or all
                                    // config values.
                                    if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
                                        // If localforage is ready and fully initialized, we can't set
                                        // any new configuration values. Instead, we return an error.
                                        if (this._ready) {
                                            return new Error("Can't call config() after localforage " + 'has been used.');
                                        }
                                        for(var i in options){
                                            if (i === 'storeName') {
                                                options[i] = options[i].replace(/\W/g, '_');
                                            }
                                            if (i === 'version' && typeof options[i] !== 'number') {
                                                return new Error('Database version must be a number.');
                                            }
                                            this._config[i] = options[i];
                                        }
                                        // after all config options are set and
                                        // the driver option is used, try setting it
                                        if ('driver' in options && options.driver) {
                                            return this.setDriver(this._config.driver);
                                        }
                                        return true;
                                    } else if (typeof options === 'string') {
                                        return this._config[options];
                                    } else {
                                        return this._config;
                                    }
                                };
                                // Used to define a custom driver, shared across all instances of
                                // localForage.
                                LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {
                                    var promise = new Promise$1(function(resolve, reject) {
                                        try {
                                            var driverName = driverObject._driver;
                                            var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');
                                            // A driver name should be defined and not overlap with the
                                            // library-defined, default drivers.
                                            if (!driverObject._driver) {
                                                reject(complianceError);
                                                return;
                                            }
                                            var driverMethods = LibraryMethods.concat('_initStorage');
                                            for(var i = 0, len = driverMethods.length; i < len; i++){
                                                var driverMethodName = driverMethods[i];
                                                // when the property is there,
                                                // it should be a method even when optional
                                                var isRequired = !includes(OptionalDriverMethods, driverMethodName);
                                                if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {
                                                    reject(complianceError);
                                                    return;
                                                }
                                            }
                                            var configureMissingMethods = function configureMissingMethods() {
                                                var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {
                                                    return function() {
                                                        var error = new Error('Method ' + methodName + ' is not implemented by the current driver');
                                                        var promise = Promise$1.reject(error);
                                                        executeCallback(promise, arguments[arguments.length - 1]);
                                                        return promise;
                                                    };
                                                };
                                                for(var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++){
                                                    var optionalDriverMethod = OptionalDriverMethods[_i];
                                                    if (!driverObject[optionalDriverMethod]) {
                                                        driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);
                                                    }
                                                }
                                            };
                                            configureMissingMethods();
                                            var setDriverSupport = function setDriverSupport(support) {
                                                if (DefinedDrivers[driverName]) {
                                                    console.info('Redefining LocalForage driver: ' + driverName);
                                                }
                                                DefinedDrivers[driverName] = driverObject;
                                                DriverSupport[driverName] = support;
                                                // don't use a then, so that we can define
                                                // drivers that have simple _support methods
                                                // in a blocking manner
                                                resolve();
                                            };
                                            if ('_support' in driverObject) {
                                                if (driverObject._support && typeof driverObject._support === 'function') {
                                                    driverObject._support().then(setDriverSupport, reject);
                                                } else {
                                                    setDriverSupport(!!driverObject._support);
                                                }
                                            } else {
                                                setDriverSupport(true);
                                            }
                                        } catch (e) {
                                            reject(e);
                                        }
                                    });
                                    executeTwoCallbacks(promise, callback, errorCallback);
                                    return promise;
                                };
                                LocalForage.prototype.driver = function driver() {
                                    return this._driver || null;
                                };
                                LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {
                                    var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));
                                    executeTwoCallbacks(getDriverPromise, callback, errorCallback);
                                    return getDriverPromise;
                                };
                                LocalForage.prototype.getSerializer = function getSerializer(callback) {
                                    var serializerPromise = Promise$1.resolve(localforageSerializer);
                                    executeTwoCallbacks(serializerPromise, callback);
                                    return serializerPromise;
                                };
                                LocalForage.prototype.ready = function ready(callback) {
                                    var self1 = this;
                                    var promise = self1._driverSet.then(function() {
                                        if (self1._ready === null) {
                                            self1._ready = self1._initDriver();
                                        }
                                        return self1._ready;
                                    });
                                    executeTwoCallbacks(promise, callback, callback);
                                    return promise;
                                };
                                LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {
                                    var self1 = this;
                                    if (!isArray(drivers)) {
                                        drivers = [
                                            drivers
                                        ];
                                    }
                                    var supportedDrivers = this._getSupportedDrivers(drivers);
                                    function setDriverToConfig() {
                                        self1._config.driver = self1.driver();
                                    }
                                    function extendSelfWithDriver(driver) {
                                        self1._extend(driver);
                                        setDriverToConfig();
                                        self1._ready = self1._initStorage(self1._config);
                                        return self1._ready;
                                    }
                                    function initDriver(supportedDrivers) {
                                        return function() {
                                            var currentDriverIndex = 0;
                                            function driverPromiseLoop() {
                                                while(currentDriverIndex < supportedDrivers.length){
                                                    var driverName = supportedDrivers[currentDriverIndex];
                                                    currentDriverIndex++;
                                                    self1._dbInfo = null;
                                                    self1._ready = null;
                                                    return self1.getDriver(driverName).then(extendSelfWithDriver)["catch"](driverPromiseLoop);
                                                }
                                                setDriverToConfig();
                                                var error = new Error('No available storage method found.');
                                                self1._driverSet = Promise$1.reject(error);
                                                return self1._driverSet;
                                            }
                                            return driverPromiseLoop();
                                        };
                                    }
                                    // There might be a driver initialization in progress
                                    // so wait for it to finish in order to avoid a possible
                                    // race condition to set _dbInfo
                                    var oldDriverSetDone = this._driverSet !== null ? this._driverSet["catch"](function() {
                                        return Promise$1.resolve();
                                    }) : Promise$1.resolve();
                                    this._driverSet = oldDriverSetDone.then(function() {
                                        var driverName = supportedDrivers[0];
                                        self1._dbInfo = null;
                                        self1._ready = null;
                                        return self1.getDriver(driverName).then(function(driver) {
                                            self1._driver = driver._driver;
                                            setDriverToConfig();
                                            self1._wrapLibraryMethodsWithReady();
                                            self1._initDriver = initDriver(supportedDrivers);
                                        });
                                    })["catch"](function() {
                                        setDriverToConfig();
                                        var error = new Error('No available storage method found.');
                                        self1._driverSet = Promise$1.reject(error);
                                        return self1._driverSet;
                                    });
                                    executeTwoCallbacks(this._driverSet, callback, errorCallback);
                                    return this._driverSet;
                                };
                                LocalForage.prototype.supports = function supports(driverName) {
                                    return !!DriverSupport[driverName];
                                };
                                LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {
                                    extend(this, libraryMethodsAndProperties);
                                };
                                LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {
                                    var supportedDrivers = [];
                                    for(var i = 0, len = drivers.length; i < len; i++){
                                        var driverName = drivers[i];
                                        if (this.supports(driverName)) {
                                            supportedDrivers.push(driverName);
                                        }
                                    }
                                    return supportedDrivers;
                                };
                                LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {
                                    // Add a stub for each driver API method that delays the call to the
                                    // corresponding driver method until localForage is ready. These stubs
                                    // will be replaced by the driver methods as soon as the driver is
                                    // loaded, so there is no performance impact.
                                    for(var i = 0, len = LibraryMethods.length; i < len; i++){
                                        callWhenReady(this, LibraryMethods[i]);
                                    }
                                };
                                LocalForage.prototype.createInstance = function createInstance(options) {
                                    return new LocalForage(options);
                                };
                                return LocalForage;
                            }();
                            // The actual localForage object that we expose as a module or via a
                            // global. It's extended by pulling in one of our other libraries.
                            var localforage_js = new LocalForage();
                            module1.exports = localforage_js;
                        },
                        {
                            "3": 3
                        }
                    ]
                }, {}, [
                    4
                ])(4);
            });
        })(localforage);
        return localforage.exports;
    }
    var localforageExports = requireLocalforage();
    var localForage = /*@__PURE__*/ getDefaultExportFromCjs(localforageExports);
    /**
   * This function is like `assignValue` except that it doesn't assign
   * `undefined` values.
   *
   * @private
   * @param {Object} object The object to modify.
   * @param {string} key The key of the property to assign.
   * @param {*} value The value to assign.
   */ function assignMergeValue(object, key, value) {
        if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
            baseAssignValue(object, key, value);
        }
    }
    /**
   * Creates a base function for methods like `_.forIn` and `_.forOwn`.
   *
   * @private
   * @param {boolean} [fromRight] Specify iterating from right to left.
   * @returns {Function} Returns the new base function.
   */ function createBaseFor(fromRight) {
        return function(object, iteratee, keysFunc) {
            var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
            while(length--){
                var key = props[++index];
                if (iteratee(iterable[key], key, iterable) === false) {
                    break;
                }
            }
            return object;
        };
    }
    /**
   * The base implementation of `baseForOwn` which iterates over `object`
   * properties returned by `keysFunc` and invokes `iteratee` for each property.
   * Iteratee functions may exit iteration early by explicitly returning `false`.
   *
   * @private
   * @param {Object} object The object to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @param {Function} keysFunc The function to get the keys of `object`.
   * @returns {Object} Returns `object`.
   */ var baseFor = createBaseFor();
    /**
   * This method is like `_.isArrayLike` except that it also checks if `value`
   * is an object.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an array-like object,
   *  else `false`.
   * @example
   *
   * _.isArrayLikeObject([1, 2, 3]);
   * // => true
   *
   * _.isArrayLikeObject(document.body.children);
   * // => true
   *
   * _.isArrayLikeObject('abc');
   * // => false
   *
   * _.isArrayLikeObject(_.noop);
   * // => false
   */ function isArrayLikeObject(value) {
        return isObjectLike(value) && isArrayLike(value);
    }
    /** `Object#toString` result references. */ var objectTag$1 = '[object Object]';
    /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto$7 = Object.prototype;
    /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString;
    /** Used to check objects for own properties. */ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
    /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object);
    /**
   * Checks if `value` is a plain object, that is, an object created by the
   * `Object` constructor or one with a `[[Prototype]]` of `null`.
   *
   * @static
   * @memberOf _
   * @since 0.8.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
   * @example
   *
   * function Foo() {
   *   this.a = 1;
   * }
   *
   * _.isPlainObject(new Foo);
   * // => false
   *
   * _.isPlainObject([1, 2, 3]);
   * // => false
   *
   * _.isPlainObject({ 'x': 0, 'y': 0 });
   * // => true
   *
   * _.isPlainObject(Object.create(null));
   * // => true
   */ function isPlainObject(value) {
        if (!isObjectLike(value) || baseGetTag(value) != objectTag$1) {
            return false;
        }
        var proto = getPrototype(value);
        if (proto === null) {
            return true;
        }
        var Ctor = hasOwnProperty$6.call(proto, 'constructor') && proto.constructor;
        return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
    }
    /**
   * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
   *
   * @private
   * @param {Object} object The object to query.
   * @param {string} key The key of the property to get.
   * @returns {*} Returns the property value.
   */ function safeGet(object, key) {
        if (key === 'constructor' && typeof object[key] === 'function') {
            return;
        }
        if (key == '__proto__') {
            return;
        }
        return object[key];
    }
    /**
   * Converts `value` to a plain object flattening inherited enumerable string
   * keyed properties of `value` to own properties of the plain object.
   *
   * @static
   * @memberOf _
   * @since 3.0.0
   * @category Lang
   * @param {*} value The value to convert.
   * @returns {Object} Returns the converted plain object.
   * @example
   *
   * function Foo() {
   *   this.b = 2;
   * }
   *
   * Foo.prototype.c = 3;
   *
   * _.assign({ 'a': 1 }, new Foo);
   * // => { 'a': 1, 'b': 2 }
   *
   * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
   * // => { 'a': 1, 'b': 2, 'c': 3 }
   */ function toPlainObject(value) {
        return copyObject(value, keysIn(value));
    }
    /**
   * A specialized version of `baseMerge` for arrays and objects which performs
   * deep merges and tracks traversed objects enabling objects with circular
   * references to be merged.
   *
   * @private
   * @param {Object} object The destination object.
   * @param {Object} source The source object.
   * @param {string} key The key of the value to merge.
   * @param {number} srcIndex The index of `source`.
   * @param {Function} mergeFunc The function to merge values.
   * @param {Function} [customizer] The function to customize assigned values.
   * @param {Object} [stack] Tracks traversed source values and their merged
   *  counterparts.
   */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
        var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
        if (stacked) {
            assignMergeValue(object, key, stacked);
            return;
        }
        var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;
        var isCommon = newValue === undefined;
        if (isCommon) {
            var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
            newValue = srcValue;
            if (isArr || isBuff || isTyped) {
                if (isArray(objValue)) {
                    newValue = objValue;
                } else if (isArrayLikeObject(objValue)) {
                    newValue = copyArray(objValue);
                } else if (isBuff) {
                    isCommon = false;
                    newValue = cloneBuffer(srcValue, true);
                } else if (isTyped) {
                    isCommon = false;
                    newValue = cloneTypedArray(srcValue, true);
                } else {
                    newValue = [];
                }
            } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
                newValue = objValue;
                if (isArguments(objValue)) {
                    newValue = toPlainObject(objValue);
                } else if (!isObject$1(objValue) || isFunction(objValue)) {
                    newValue = initCloneObject(srcValue);
                }
            } else {
                isCommon = false;
            }
        }
        if (isCommon) {
            // Recursively merge objects and arrays (susceptible to call stack limits).
            stack.set(srcValue, newValue);
            mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
            stack['delete'](srcValue);
        }
        assignMergeValue(object, key, newValue);
    }
    /**
   * The base implementation of `_.merge` without support for multiple sources.
   *
   * @private
   * @param {Object} object The destination object.
   * @param {Object} source The source object.
   * @param {number} srcIndex The index of `source`.
   * @param {Function} [customizer] The function to customize merged values.
   * @param {Object} [stack] Tracks traversed source values and their merged
   *  counterparts.
   */ function baseMerge(object, source, srcIndex, customizer, stack) {
        if (object === source) {
            return;
        }
        baseFor(source, function(srcValue, key) {
            stack || (stack = new Stack());
            if (isObject$1(srcValue)) {
                baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
            } else {
                var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + '', object, source, stack) : undefined;
                if (newValue === undefined) {
                    newValue = srcValue;
                }
                assignMergeValue(object, key, newValue);
            }
        }, keysIn);
    }
    /**
   * This method returns the first argument it receives.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Util
   * @param {*} value Any value.
   * @returns {*} Returns `value`.
   * @example
   *
   * var object = { 'a': 1 };
   *
   * console.log(_.identity(object) === object);
   * // => true
   */ function identity(value) {
        return value;
    }
    /**
   * A faster alternative to `Function#apply`, this function invokes `func`
   * with the `this` binding of `thisArg` and the arguments of `args`.
   *
   * @private
   * @param {Function} func The function to invoke.
   * @param {*} thisArg The `this` binding of `func`.
   * @param {Array} args The arguments to invoke `func` with.
   * @returns {*} Returns the result of `func`.
   */ function apply(func, thisArg, args) {
        switch(args.length){
            case 0:
                return func.call(thisArg);
            case 1:
                return func.call(thisArg, args[0]);
            case 2:
                return func.call(thisArg, args[0], args[1]);
            case 3:
                return func.call(thisArg, args[0], args[1], args[2]);
        }
        return func.apply(thisArg, args);
    }
    /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax$1 = Math.max;
    /**
   * A specialized version of `baseRest` which transforms the rest array.
   *
   * @private
   * @param {Function} func The function to apply a rest parameter to.
   * @param {number} [start=func.length-1] The start position of the rest parameter.
   * @param {Function} transform The rest array transform.
   * @returns {Function} Returns the new function.
   */ function overRest(func, start, transform) {
        start = nativeMax$1(start === undefined ? func.length - 1 : start, 0);
        return function() {
            var args = arguments, index = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
            while(++index < length){
                array[index] = args[start + index];
            }
            index = -1;
            var otherArgs = Array(start + 1);
            while(++index < start){
                otherArgs[index] = args[index];
            }
            otherArgs[start] = transform(array);
            return apply(func, this, otherArgs);
        };
    }
    /**
   * Creates a function that returns `value`.
   *
   * @static
   * @memberOf _
   * @since 2.4.0
   * @category Util
   * @param {*} value The value to return from the new function.
   * @returns {Function} Returns the new constant function.
   * @example
   *
   * var objects = _.times(2, _.constant({ 'a': 1 }));
   *
   * console.log(objects);
   * // => [{ 'a': 1 }, { 'a': 1 }]
   *
   * console.log(objects[0] === objects[1]);
   * // => true
   */ function constant(value) {
        return function() {
            return value;
        };
    }
    /**
   * The base implementation of `setToString` without support for hot loop shorting.
   *
   * @private
   * @param {Function} func The function to modify.
   * @param {Function} string The `toString` result.
   * @returns {Function} Returns `func`.
   */ var baseSetToString = !defineProperty ? identity : function(func, string) {
        return defineProperty(func, 'toString', {
            'configurable': true,
            'enumerable': false,
            'value': constant(string),
            'writable': true
        });
    };
    /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16;
    /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now;
    /**
   * Creates a function that'll short out and invoke `identity` instead
   * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
   * milliseconds.
   *
   * @private
   * @param {Function} func The function to restrict.
   * @returns {Function} Returns the new shortable function.
   */ function shortOut(func) {
        var count = 0, lastCalled = 0;
        return function() {
            var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
            lastCalled = stamp;
            if (remaining > 0) {
                if (++count >= HOT_COUNT) {
                    return arguments[0];
                }
            } else {
                count = 0;
            }
            return func.apply(undefined, arguments);
        };
    }
    /**
   * Sets the `toString` method of `func` to return `string`.
   *
   * @private
   * @param {Function} func The function to modify.
   * @param {Function} string The `toString` result.
   * @returns {Function} Returns `func`.
   */ var setToString = shortOut(baseSetToString);
    /**
   * The base implementation of `_.rest` which doesn't validate or coerce arguments.
   *
   * @private
   * @param {Function} func The function to apply a rest parameter to.
   * @param {number} [start=func.length-1] The start position of the rest parameter.
   * @returns {Function} Returns the new function.
   */ function baseRest(func, start) {
        return setToString(overRest(func, start, identity), func + '');
    }
    /**
   * Checks if the given arguments are from an iteratee call.
   *
   * @private
   * @param {*} value The potential iteratee value argument.
   * @param {*} index The potential iteratee index or key argument.
   * @param {*} object The potential iteratee object argument.
   * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
   *  else `false`.
   */ function isIterateeCall(value, index, object) {
        if (!isObject$1(object)) {
            return false;
        }
        var type = typeof index;
        if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
            return eq(object[index], value);
        }
        return false;
    }
    /**
   * Creates a function like `_.assign`.
   *
   * @private
   * @param {Function} assigner The function to assign values.
   * @returns {Function} Returns the new assigner function.
   */ function createAssigner(assigner) {
        return baseRest(function(object, sources) {
            var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
            customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;
            if (guard && isIterateeCall(sources[0], sources[1], guard)) {
                customizer = length < 3 ? undefined : customizer;
                length = 1;
            }
            object = Object(object);
            while(++index < length){
                var source = sources[index];
                if (source) {
                    assigner(object, source, index, customizer);
                }
            }
            return object;
        });
    }
    /**
   * This method is like `_.assign` except that it recursively merges own and
   * inherited enumerable string keyed properties of source objects into the
   * destination object. Source properties that resolve to `undefined` are
   * skipped if a destination value exists. Array and plain object properties
   * are merged recursively. Other objects and value types are overridden by
   * assignment. Source objects are applied from left to right. Subsequent
   * sources overwrite property assignments of previous sources.
   *
   * **Note:** This method mutates `object`.
   *
   * @static
   * @memberOf _
   * @since 0.5.0
   * @category Object
   * @param {Object} object The destination object.
   * @param {...Object} [sources] The source objects.
   * @returns {Object} Returns `object`.
   * @example
   *
   * var object = {
   *   'a': [{ 'b': 2 }, { 'd': 4 }]
   * };
   *
   * var other = {
   *   'a': [{ 'c': 3 }, { 'e': 5 }]
   * };
   *
   * _.merge(object, other);
   * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
   */ var merge = createAssigner(function(object, source, srcIndex) {
        baseMerge(object, source, srcIndex);
    });
    /**
   * This method is like `_.merge` except that it accepts `customizer` which
   * is invoked to produce the merged values of the destination and source
   * properties. If `customizer` returns `undefined`, merging is handled by the
   * method instead. The `customizer` is invoked with six arguments:
   * (objValue, srcValue, key, object, source, stack).
   *
   * **Note:** This method mutates `object`.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Object
   * @param {Object} object The destination object.
   * @param {...Object} sources The source objects.
   * @param {Function} customizer The function to customize assigned values.
   * @returns {Object} Returns `object`.
   * @example
   *
   * function customizer(objValue, srcValue) {
   *   if (_.isArray(objValue)) {
   *     return objValue.concat(srcValue);
   *   }
   * }
   *
   * var object = { 'a': [1], 'b': [2] };
   * var other = { 'a': [3], 'b': [4] };
   *
   * _.mergeWith(object, other, customizer);
   * // => { 'a': [1, 3], 'b': [2, 4] }
   */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
        baseMerge(object, source, srcIndex, customizer);
    });
    function getOpenPromise() {
        const wrapper = {
            isResolved: false,
            isPending: true,
            isRejected: false
        };
        let promise;
        let resolve = ()=>{};
        let reject = ()=>{};
        if (typeof Promise.withResolvers === 'function') {
            const { promise: p, resolve: r, reject: j } = Promise.withResolvers();
            promise = p;
            resolve = r;
            reject = j;
        } else {
            promise = new Promise((r, j)=>{
                resolve = r;
                reject = j;
            });
        }
        Object.assign(promise, _object_spread_props(_object_spread({}, wrapper), {
            resolve,
            reject
        }));
        promise.then((v)=>{
            promise.isResolved = true;
            promise.isPending = false;
            promise.isRejected = false;
            return v;
        }, (e)=>{
            promise.isResolved = false;
            promise.isPending = false;
            promise.isRejected = true;
            throw e;
        });
        return promise;
    }
    /** Error message constants. */ const FUNC_ERROR_TEXT$2 = 'Expected a function';
    /* Built-in method references for those with the same name as other `lodash` methods. */ const nativeMax = Math.max;
    const nativeMin = Math.min;
    function toNumber(value) {
        if (typeof value === 'number') {
            return value;
        }
        if (typeof value === 'string') {
            const parsed = parseFloat(value);
            return isNaN(parsed) ? 0 : parsed;
        }
        return 0;
    }
    function isObject(value) {
        const type = typeof value;
        return value != null && (type === 'object' || type === 'function');
    }
    /**
   * Creates a debounced function that delays invoking `func` until after `wait`
   * milliseconds have elapsed since the last time the debounced function was
   * invoked. The debounced function comes with a `cancel` method to cancel
   * delayed `func` invocations and a `flush` method to immediately invoke them.
   *
   * This function differs from lodash's debounce by merging all passed objects
   * before passing them to the final invoked function.
   *
   * Because of this, invoking can only happen on the trailing edge, since
   * passed-in data would be discarded if invoking happened on the leading edge.
   *
   * If `wait` is `0`, `func` invocation is deferred until to the next tick,
   * similar to `setTimeout` with a timeout of `0`.
   *
   * @static
   * @category Function
   * @param {Function} func The function to mergebounce.
   * @param {number} [wait=0] The number of milliseconds to delay.
   * @param {Object} [options={}] The options object.
   * @param {number} [options.maxWait]
   *  The maximum time `func` is allowed to be delayed before it's invoked.
   * @param {boolean} [options.concatArrays=false]
   *  By default arrays will be treated as objects when being merged. When
   *  merging two arrays, the values in the 2nd arrray will replace the
   *  corresponding values (i.e. those with the same indexes) in the first array.
   *  When `concatArrays` is set to `true`, arrays will be concatenated instead.
   * @param {boolean} [options.dedupeArrays=false]
   *  This option is similar to `concatArrays`, except that the concatenated
   *  array will also be deduplicated. Thus any entries that are concatenated to the
   *  existing array, which are already contained in the existing array, will
   *  first be removed.
   * @param {boolean} [options.promise=false]
   *  By default, when calling a merge-debounced function that doesn't execute
   *  immediately, you'll receive the result from its previous execution, or
   *  `undefined` if it has never executed before. By setting the `promise`
   *  option to `true`, a promise will be returned instead of the previous
   *  execution result when the function is debounced. The promise will resolve
   *  with the result of the next execution, as soon as it happens.
   * @returns {Function} Returns the new debounced function.
   * @example
   *
   * // Avoid costly calculations while the window size is in flux.
   * window.addEventListener('resize', mergebounce(calculateLayout, 150));
   *
   * // Invoke `sendMail` when clicked, debouncing subsequent calls.
   * element.addEventListner('click', mergebounce(sendMail, 300));
   *
   * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
   * const mergebounced = mergebounce(batchLog, 250, { 'maxWait': 1000 });
   * const source = new EventSource('/stream');
   * jQuery(source).on('message', mergebounced);
   *
   * // Cancel the trailing debounced invocation.
   * window.addEventListener('popstate', mergebounced.cancel);
   */ function mergebounce(func, wait, options = {}) {
        let lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, maxing = false;
        let promise = options.promise ? getOpenPromise() : null;
        if (typeof func != 'function') {
            throw new TypeError(FUNC_ERROR_TEXT$2);
        }
        wait = toNumber(wait) || 0;
        if (isObject(options)) {
            maxing = 'maxWait' in options;
            maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
        }
        function invokeFunc(time) {
            const args = lastArgs;
            const thisArg = lastThis;
            const existingPromise = promise;
            lastArgs = lastThis = undefined;
            lastInvokeTime = time;
            result = func.apply(thisArg, args);
            if (options.promise) {
                existingPromise.resolve(result);
                promise = getOpenPromise();
            }
            return options.promise ? existingPromise : result;
        }
        function leadingEdge(time) {
            // Reset any `maxWait` timer.
            lastInvokeTime = time;
            // Start the timer for the trailing edge.
            timerId = setTimeout(timerExpired, wait);
            return options.promise ? promise : result;
        }
        function remainingWait(time) {
            const timeSinceLastCall = time - lastCallTime;
            const timeSinceLastInvoke = time - lastInvokeTime;
            const timeWaiting = wait - timeSinceLastCall;
            return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
        }
        function shouldInvoke(time) {
            const timeSinceLastCall = time - lastCallTime;
            const timeSinceLastInvoke = time - lastInvokeTime;
            // Either this is the first call, activity has stopped and we're at the
            // trailing edge, the system time has gone backwards and we're treating
            // it as the trailing edge, or we've hit the `maxWait` limit.
            return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
        }
        function timerExpired() {
            const time = Date.now();
            if (shouldInvoke(time)) {
                return trailingEdge(time);
            }
            // Restart the timer.
            timerId = setTimeout(timerExpired, remainingWait(time));
        }
        function trailingEdge(time) {
            timerId = undefined;
            // Only invoke if we have `lastArgs` which means `func` has been
            // debounced at least once.
            if (lastArgs) {
                return invokeFunc(time);
            }
            lastArgs = lastThis = undefined;
            return options.promise ? promise : result;
        }
        function cancel() {
            if (timerId !== undefined) {
                clearTimeout(timerId);
            }
            lastInvokeTime = 0;
            lastArgs = lastCallTime = lastThis = timerId = undefined;
        }
        function flush() {
            return timerId === undefined ? result : trailingEdge(Date.now());
        }
        function concatArrays(objValue, srcValue) {
            if (Array.isArray(objValue) && Array.isArray(srcValue)) {
                if (options !== null && options !== void 0 && options.dedupeArrays) {
                    return objValue.concat(srcValue.filter((i)=>objValue.indexOf(i) === -1));
                } else {
                    return objValue.concat(srcValue);
                }
            }
        }
        function mergeArguments(args) {
            var _lastArgs;
            if ((_lastArgs = lastArgs) !== null && _lastArgs !== void 0 && _lastArgs.length) {
                if (!args.length) {
                    return lastArgs;
                }
                if (options !== null && options !== void 0 && options.concatArrays || options !== null && options !== void 0 && options.dedupeArrays) {
                    return mergeWith(lastArgs, args, concatArrays);
                } else {
                    return merge(lastArgs, args);
                }
            } else {
                return args || [];
            }
        }
        function debounced() {
            const time = Date.now();
            const isInvoking = shouldInvoke(time);
            lastArgs = mergeArguments(Array.from(arguments));
            lastThis = this;
            lastCallTime = time;
            if (isInvoking) {
                if (timerId === undefined) {
                    return leadingEdge(lastCallTime);
                }
                if (maxing) {
                    // Handle invocations in a tight loop.
                    clearTimeout(timerId);
                    timerId = setTimeout(timerExpired, wait);
                    return invokeFunc(lastCallTime);
                }
            }
            if (timerId === undefined) {
                timerId = setTimeout(timerExpired, wait);
            }
            return options.promise ? promise : result;
        }
        debounced.cancel = cancel;
        debounced.flush = flush;
        return debounced;
    }
    function executeCallback$1(promise, callback) {
        if (callback) {
            promise.then(function(result) {
                callback(null, result);
            }, function(error) {
                callback(error);
            });
        }
    }
    function getCallback() {
        if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
            return arguments[arguments.length - 1];
        }
    }
    function normalizeKey(key) {
        // Cast the key to a string, as that's all we can set as a key.
        if (typeof key !== 'string') {
            console.warn(`${key} used as a key, but it is not a string.`);
            key = String(key);
        }
        return key;
    }
    // Abstracts constructing a Blob object, so it also works in older
    // browsers that don't support the native Blob constructor. (i.e.
    // old QtWebKit versions, at least).
    // Abstracts constructing a Blob object, so it also works in older
    // browsers that don't support the native Blob constructor. (i.e.
    // old QtWebKit versions, at least).
    function createBlob(parts, properties) {
        /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || [];
        properties = properties || {};
        try {
            return new Blob(parts, properties);
        } catch (e) {
            if (e.name !== 'TypeError') {
                throw e;
            }
            var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;
            var builder = new Builder();
            for(var i = 0; i < parts.length; i += 1){
                builder.append(parts[i]);
            }
            return builder.getBlob(properties.type);
        }
    }
    /* eslint-disable no-bitwise */ // Sadly, the best way to save binary data in WebSQL/localStorage is serializing
    // it to Base64, so this is how we store it to prevent very strange errors with less
    // verbose ways of binary <-> string data storage.
    var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    var BLOB_TYPE_PREFIX = '~~local_forage_type~';
    var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
    var SERIALIZED_MARKER = '__lfsc__:';
    var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;
    // OMG the serializations!
    var TYPE_ARRAYBUFFER = 'arbf';
    var TYPE_BLOB = 'blob';
    var TYPE_INT8ARRAY = 'si08';
    var TYPE_UINT8ARRAY = 'ui08';
    var TYPE_UINT8CLAMPEDARRAY = 'uic8';
    var TYPE_INT16ARRAY = 'si16';
    var TYPE_INT32ARRAY = 'si32';
    var TYPE_UINT16ARRAY = 'ur16';
    var TYPE_UINT32ARRAY = 'ui32';
    var TYPE_FLOAT32ARRAY = 'fl32';
    var TYPE_FLOAT64ARRAY = 'fl64';
    var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;
    var toString = Object.prototype.toString;
    function stringToBuffer(serializedString) {
        // Fill the string into a ArrayBuffer.
        var bufferLength = serializedString.length * 0.75;
        var len = serializedString.length;
        var i;
        var p = 0;
        var encoded1, encoded2, encoded3, encoded4;
        if (serializedString[serializedString.length - 1] === '=') {
            bufferLength--;
            if (serializedString[serializedString.length - 2] === '=') {
                bufferLength--;
            }
        }
        var buffer = new ArrayBuffer(bufferLength);
        var bytes = new Uint8Array(buffer);
        for(i = 0; i < len; i += 4){
            encoded1 = BASE_CHARS.indexOf(serializedString[i]);
            encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);
            encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);
            encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);
            /*jslint bitwise: true */ bytes[p++] = encoded1 << 2 | encoded2 >> 4;
            bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
            bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
        }
        return buffer;
    }
    // Converts a buffer to a string to store, serialized, in the backend
    // storage library.
    function bufferToString(buffer) {
        // base64-arraybuffer
        var bytes = new Uint8Array(buffer);
        var base64String = '';
        var i;
        for(i = 0; i < bytes.length; i += 3){
            /*jslint bitwise: true */ base64String += BASE_CHARS[bytes[i] >> 2];
            base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
            base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
            base64String += BASE_CHARS[bytes[i + 2] & 63];
        }
        if (bytes.length % 3 === 2) {
            base64String = base64String.substring(0, base64String.length - 1) + '=';
        } else if (bytes.length % 3 === 1) {
            base64String = base64String.substring(0, base64String.length - 2) + '==';
        }
        return base64String;
    }
    // Serialize a value, afterwards executing a callback (which usually
    // instructs the `setItem()` callback/promise to be executed). This is how
    // we store binary data with localStorage.
    function serialize$1(value, callback) {
        var valueType = '';
        if (value) {
            valueType = toString.call(value);
        }
        // Cannot use `value instanceof ArrayBuffer` or such here, as these
        // checks fail when running the tests using casper.js...
        //
        // TODO: See why those tests fail and use a better solution.
        if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString.call(value.buffer) === '[object ArrayBuffer]')) {
            // Convert binary arrays to a string and prefix the string with
            // a special marker.
            var buffer;
            var marker = SERIALIZED_MARKER;
            if (value instanceof ArrayBuffer) {
                buffer = value;
                marker += TYPE_ARRAYBUFFER;
            } else {
                buffer = value.buffer;
                if (valueType === '[object Int8Array]') {
                    marker += TYPE_INT8ARRAY;
                } else if (valueType === '[object Uint8Array]') {
                    marker += TYPE_UINT8ARRAY;
                } else if (valueType === '[object Uint8ClampedArray]') {
                    marker += TYPE_UINT8CLAMPEDARRAY;
                } else if (valueType === '[object Int16Array]') {
                    marker += TYPE_INT16ARRAY;
                } else if (valueType === '[object Uint16Array]') {
                    marker += TYPE_UINT16ARRAY;
                } else if (valueType === '[object Int32Array]') {
                    marker += TYPE_INT32ARRAY;
                } else if (valueType === '[object Uint32Array]') {
                    marker += TYPE_UINT32ARRAY;
                } else if (valueType === '[object Float32Array]') {
                    marker += TYPE_FLOAT32ARRAY;
                } else if (valueType === '[object Float64Array]') {
                    marker += TYPE_FLOAT64ARRAY;
                } else {
                    callback(new Error('Failed to get type for BinaryArray'));
                }
            }
            callback(marker + bufferToString(buffer));
        } else if (valueType === '[object Blob]') {
            // Conver the blob to a binaryArray and then to a string.
            var fileReader = new FileReader();
            fileReader.onload = function() {
                // Backwards-compatible prefix for the blob type.
                var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);
                callback(SERIALIZED_MARKER + TYPE_BLOB + str);
            };
            fileReader.readAsArrayBuffer(value);
        } else {
            try {
                callback(JSON.stringify(value));
            } catch (e) {
                console.error("Couldn't convert value into a JSON string: ", value);
                callback(null, e);
            }
        }
    }
    // Deserialize data we've inserted into a value column/field. We place
    // special markers into our strings to mark them as encoded; this isn't
    // as nice as a meta field, but it's the only sane thing we can do whilst
    // keeping localStorage support intact.
    //
    // Oftentimes this will just deserialize JSON content, but if we have a
    // special marker (SERIALIZED_MARKER, defined above), we will extract
    // some kind of arraybuffer/binary data/typed array out of the string.
    function deserialize$1(value) {
        // If we haven't marked this string as being specially serialized (i.e.
        // something other than serialized JSON), we can just return it and be
        // done with it.
        if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
            return JSON.parse(value);
        }
        // The following code deals with deserializing some kind of Blob or
        // TypedArray. First we separate out the type of data we're dealing
        // with from the data itself.
        var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
        var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);
        var blobType;
        // Backwards-compatible blob type serialization strategy.
        // DBs created with older versions of localForage will simply not have the blob type.
        if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
            var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
            blobType = matcher[1];
            serializedString = serializedString.substring(matcher[0].length);
        }
        var buffer = stringToBuffer(serializedString);
        // Return the right type based on the code/type set during
        // serialization.
        switch(type){
            case TYPE_ARRAYBUFFER:
                return buffer;
            case TYPE_BLOB:
                return createBlob([
                    buffer
                ], {
                    type: blobType
                });
            case TYPE_INT8ARRAY:
                return new Int8Array(buffer);
            case TYPE_UINT8ARRAY:
                return new Uint8Array(buffer);
            case TYPE_UINT8CLAMPEDARRAY:
                return new Uint8ClampedArray(buffer);
            case TYPE_INT16ARRAY:
                return new Int16Array(buffer);
            case TYPE_UINT16ARRAY:
                return new Uint16Array(buffer);
            case TYPE_INT32ARRAY:
                return new Int32Array(buffer);
            case TYPE_UINT32ARRAY:
                return new Uint32Array(buffer);
            case TYPE_FLOAT32ARRAY:
                return new Float32Array(buffer);
            case TYPE_FLOAT64ARRAY:
                return new Float64Array(buffer);
            default:
                throw new Error('Unkown type: ' + type);
        }
    }
    var localforageSerializer = {
        serialize: serialize$1,
        deserialize: deserialize$1
    };
    // Copyright 2014 Mozilla
    // Copyright 2015 Thodoris Greasidis
    // Copyright 2018 JC Brand
    //
    // Licensed under the Apache License, Version 2.0 (the "License");
    // you may not use this file except in compliance with the License.
    // You may obtain a copy of the License at
    //
    // http://www.apache.org/licenses/LICENSE-2.0
    //
    // Unless required by applicable law or agreed to in writing, software
    // distributed under the License is distributed on an "AS IS" BASIS,
    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    // See the License for the specific language governing permissions and
    // limitations under the License.
    const serialize = localforageSerializer['serialize'];
    const deserialize = localforageSerializer['deserialize'];
    function isSessionStorageValid() {
        // If the app is running inside a Google Chrome packaged webapp, or some
        // other context where sessionStorage isn't available, we don't use
        // sessionStorage. This feature detection is preferred over the old
        // `if (window.chrome && window.chrome.runtime)` code.
        // See: https://github.com/mozilla/localForage/issues/68
        try {
            // If sessionStorage isn't available, we get outta here!
            // This should be inside a try catch
            if (sessionStorage && 'setItem' in sessionStorage) {
                return true;
            }
        } catch (e) {
            console.log(e);
        }
        return false;
    }
    function _getKeyPrefix(options, defaultConfig) {
        let keyPrefix = options.name + '/';
        if (options.storeName !== defaultConfig.storeName) {
            keyPrefix += options.storeName + '/';
        }
        return keyPrefix;
    }
    const dbInfo = {
        'serializer': {
            'serialize': serialize,
            'deserialize': deserialize
        }
    };
    function _initStorage(options) {
        dbInfo.keyPrefix = _getKeyPrefix(options, this._defaultConfig);
        if (options) {
            for(const i in options){
                // eslint-disable-line guard-for-in
                dbInfo[i] = options[i];
            }
        }
    }
    // Remove all keys from the datastore, effectively destroying all data in
    // the app's key/value store!
    function clear(callback) {
        const promise = this.ready().then(function() {
            const keyPrefix = dbInfo.keyPrefix;
            for(let i = sessionStorage.length - 1; i >= 0; i--){
                const key = sessionStorage.key(i);
                if (key.indexOf(keyPrefix) === 0) {
                    sessionStorage.removeItem(key);
                }
            }
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    // Retrieve an item from the store. Unlike the original async_storage
    // library in Gaia, we don't modify return values at all. If a key's value
    // is `undefined`, we pass that value to the callback function.
    function getItem(key, callback) {
        key = normalizeKey(key);
        const promise = this.ready().then(function() {
            let result = sessionStorage.getItem(dbInfo.keyPrefix + key);
            // If a result was found, parse it from the serialized
            // string into a JS object. If result isn't truthy, the key
            // is likely undefined and we'll pass it straight to the
            // callback.
            if (result) {
                result = dbInfo.serializer.deserialize(result);
            }
            return result;
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    // Iterate over all items in the store.
    function iterate(iterator, callback) {
        const self1 = this;
        const promise = self1.ready().then(function() {
            const keyPrefix = dbInfo.keyPrefix;
            const keyPrefixLength = keyPrefix.length;
            const length = sessionStorage.length;
            // We use a dedicated iterator instead of the `i` variable below
            // so other keys we fetch in sessionStorage aren't counted in
            // the `iterationNumber` argument passed to the `iterate()`
            // callback.
            //
            // See: github.com/mozilla/localForage/pull/435#discussion_r38061530
            let iterationNumber = 1;
            for(let i = 0; i < length; i++){
                const key = sessionStorage.key(i);
                if (key.indexOf(keyPrefix) !== 0) {
                    continue;
                }
                let value = sessionStorage.getItem(key);
                // If a result was found, parse it from the serialized
                // string into a JS object. If result isn't truthy, the
                // key is likely undefined and we'll pass it straight
                // to the iterator.
                if (value) {
                    value = dbInfo.serializer.deserialize(value);
                }
                value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);
                if (value !== void 0) {
                    // eslint-disable-line no-void
                    return value;
                }
            }
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    // Same as sessionStorage's key() method, except takes a callback.
    function key(n, callback) {
        const self1 = this;
        const promise = self1.ready().then(function() {
            let result;
            try {
                result = sessionStorage.key(n);
            } catch (error) {
                result = null;
            }
            // Remove the prefix from the key, if a key is found.
            if (result) {
                result = result.substring(dbInfo.keyPrefix.length);
            }
            return result;
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    function keys(callback) {
        const self1 = this;
        const promise = self1.ready().then(function() {
            const length = sessionStorage.length;
            const keys = [];
            for(let i = 0; i < length; i++){
                const itemKey = sessionStorage.key(i);
                if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {
                    keys.push(itemKey.substring(dbInfo.keyPrefix.length));
                }
            }
            return keys;
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    // Supply the number of keys in the datastore to the callback function.
    function length(callback) {
        const self1 = this;
        const promise = self1.keys().then(function(keys) {
            return keys.length;
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    // Remove an item from the store, nice and simple.
    function removeItem(key, callback) {
        key = normalizeKey(key);
        const promise = this.ready().then(function() {
            sessionStorage.removeItem(dbInfo.keyPrefix + key);
        });
        executeCallback$1(promise, callback);
        return promise;
    }
    /**
   * Set a key's value and run an optional callback once the value is set.
   * Unlike Gaia's implementation, the callback function is passed the value,
   * in case you want to operate on that value only after you're sure it
   * saved, or something like that.
   * @template T
   * @param {string} key - The key under which the value is stored.
   * @param {T} value - The value to be stored, can be of any type.
   * @param {(err: any, value: T) => void} [callback] - Optional callback function to be called after the value is set.
   * @returns {Promise<T>}
   */ function setItem(key, value, callback) {
        return _async_to_generator(function*() {
            var _value;
            key = normalizeKey(key);
            yield this.ready();
            // Convert undefined values to null.
            // https://github.com/mozilla/localForage/pull/42
            value = (_value = value) !== null && _value !== void 0 ? _value : null;
            // Save the original value to pass to the callback.
            const originalValue = value;
            dbInfo.serializer.serialize(value, (value, error)=>{
                if (error) {
                    throw error;
                } else {
                    try {
                        sessionStorage.setItem(dbInfo.keyPrefix + key, value);
                        executeCallback$1(Promise.resolve(originalValue), callback);
                    } catch (e) {
                        if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
                            console.error('Your sesionStorage capacity is used up.');
                            throw e;
                        }
                        throw e;
                    }
                }
            });
            return value;
        }).call(this);
    }
    function dropInstance(options, callback) {
        callback = getCallback.apply(this, arguments);
        options = typeof options !== 'function' && options || {};
        if (!options.name) {
            const currentConfig = this.config();
            options.name = options.name || currentConfig.name;
            options.storeName = options.storeName || currentConfig.storeName;
        }
        const self1 = this;
        let promise;
        if (!options.name) {
            promise = Promise.reject(new Error('Invalid arguments'));
        } else {
            promise = new Promise(function(resolve) {
                if (!options.storeName) {
                    resolve(`${options.name}/`);
                } else {
                    resolve(_getKeyPrefix(options, self1._defaultConfig));
                }
            }).then(function(keyPrefix) {
                for(let i = sessionStorage.length - 1; i >= 0; i--){
                    const key = sessionStorage.key(i);
                    if (key.indexOf(keyPrefix) === 0) {
                        sessionStorage.removeItem(key);
                    }
                }
            });
        }
        executeCallback$1(promise, callback);
        return promise;
    }
    const sessionStorageWrapper = {
        _driver: 'sessionStorageWrapper',
        _initStorage: _initStorage,
        _support: isSessionStorageValid(),
        iterate,
        getItem,
        setItem,
        removeItem,
        clear,
        length,
        key,
        keys,
        dropInstance
    };
    var localforageSetitems$1 = {
        exports: {}
    };
    var localforageSetitems = localforageSetitems$1.exports;
    var hasRequiredLocalforageSetitems;
    function requireLocalforageSetitems() {
        if (hasRequiredLocalforageSetitems) return localforageSetitems$1.exports;
        hasRequiredLocalforageSetitems = 1;
        (function(module1, exports1) {
            (function(global1, factory) {
                factory(exports1, requireLocalforage());
            })(localforageSetitems, function(exports1, localforage) {
                localforage = 'default' in localforage ? localforage['default'] : localforage;
                function getSerializerPromise(localForageInstance) {
                    if (getSerializerPromise.result) {
                        return getSerializerPromise.result;
                    }
                    if (!localForageInstance || typeof localForageInstance.getSerializer !== 'function') {
                        return Promise.reject(new Error('localforage.getSerializer() was not available! ' + 'localforage v1.4+ is required!'));
                    }
                    getSerializerPromise.result = localForageInstance.getSerializer();
                    return getSerializerPromise.result;
                }
                function executeCallback(promise, callback) {
                    if (callback) {
                        promise.then(function(result) {
                            callback(null, result);
                        }, function(error) {
                            callback(error);
                        });
                    }
                }
                function forEachItem(items, keyFn, valueFn, loopFn) {
                    function ensurePropGetterMethod(propFn, defaultPropName) {
                        var propName = propFn || defaultPropName;
                        if ((!propFn || typeof propFn !== 'function') && typeof propName === 'string') {
                            propFn = function propFn(item) {
                                return item[propName];
                            };
                        }
                        return propFn;
                    }
                    var result = [];
                    // http://stackoverflow.com/questions/4775722/check-if-object-is-array
                    if (Object.prototype.toString.call(items) === '[object Array]') {
                        keyFn = ensurePropGetterMethod(keyFn, 'key');
                        valueFn = ensurePropGetterMethod(valueFn, 'value');
                        for(var i = 0, len = items.length; i < len; i++){
                            var item = items[i];
                            result.push(loopFn(keyFn(item), valueFn(item)));
                        }
                    } else {
                        for(var prop in items){
                            if (items.hasOwnProperty(prop)) {
                                result.push(loopFn(prop, items[prop]));
                            }
                        }
                    }
                    return result;
                }
                function setItemsIndexedDB(items, keyFn, valueFn, callback) {
                    var localforageInstance = this;
                    var promise = localforageInstance.ready().then(function() {
                        return new Promise(function(resolve, reject) {
                            // Inspired from @lu4 PR mozilla/localForage#318
                            var dbInfo = localforageInstance._dbInfo;
                            var transaction = dbInfo.db.transaction(dbInfo.storeName, 'readwrite');
                            var store = transaction.objectStore(dbInfo.storeName);
                            var lastError;
                            transaction.oncomplete = function() {
                                resolve(items);
                            };
                            transaction.onabort = transaction.onerror = function(event) {
                                reject(lastError || event.target);
                            };
                            function requestOnError(evt) {
                                var request = evt.target || this;
                                lastError = request.error || request.transaction.error;
                                reject(lastError);
                            }
                            forEachItem(items, keyFn, valueFn, function(key, value) {
                                // The reason we don't _save_ null is because IE 10 does
                                // not support saving the `null` type in IndexedDB. How
                                // ironic, given the bug below!
                                // See: https://github.com/mozilla/localForage/issues/161
                                if (value === null) {
                                    value = undefined;
                                }
                                var request = store.put(value, key);
                                request.onerror = requestOnError;
                            });
                        });
                    });
                    executeCallback(promise, callback);
                    return promise;
                }
                function setItemsWebsql(items, keyFn, valueFn, callback) {
                    var localforageInstance = this;
                    var promise = new Promise(function(resolve, reject) {
                        localforageInstance.ready().then(function() {
                            return getSerializerPromise(localforageInstance);
                        }).then(function(serializer) {
                            // Inspired from @lu4 PR mozilla/localForage#318
                            var dbInfo = localforageInstance._dbInfo;
                            dbInfo.db.transaction(function(t) {
                                var query = 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' (key, value) VALUES (?, ?)';
                                var itemPromises = forEachItem(items, keyFn, valueFn, function(key, value) {
                                    return new Promise(function(resolve, reject) {
                                        serializer.serialize(value, function(value, error) {
                                            if (error) {
                                                reject(error);
                                            } else {
                                                t.executeSql(query, [
                                                    key,
                                                    value
                                                ], function() {
                                                    resolve();
                                                }, function(t, error) {
                                                    reject(error);
                                                });
                                            }
                                        });
                                    });
                                });
                                Promise.all(itemPromises).then(function() {
                                    resolve(items);
                                }, reject);
                            }, function(sqlError) {
                                reject(sqlError);
                            } /*, function() {
                   if (resolving) {
                       resolve(items);
                   }
                }*/ );
                        }).catch(reject);
                    });
                    executeCallback(promise, callback);
                    return promise;
                }
                function setItemsGeneric(items, keyFn, valueFn, callback) {
                    var localforageInstance = this;
                    var itemPromises = forEachItem(items, keyFn, valueFn, function(key, value) {
                        return localforageInstance.setItem(key, value);
                    });
                    var promise = Promise.all(itemPromises);
                    executeCallback(promise, callback);
                    return promise;
                }
                function localforageSetItems(items, keyFn, valueFn, callback) {
                    var localforageInstance = this;
                    var currentDriver = localforageInstance.driver();
                    if (currentDriver === localforageInstance.INDEXEDDB) {
                        return setItemsIndexedDB.call(localforageInstance, items, keyFn, valueFn, callback);
                    } else if (currentDriver === localforageInstance.WEBSQL) {
                        return setItemsWebsql.call(localforageInstance, items, keyFn, valueFn, callback);
                    } else {
                        return setItemsGeneric.call(localforageInstance, items, keyFn, valueFn, callback);
                    }
                }
                function extendPrototype(localforage$$1) {
                    var localforagePrototype = Object.getPrototypeOf(localforage$$1);
                    if (localforagePrototype) {
                        localforagePrototype.setItems = localforageSetItems;
                        localforagePrototype.setItems.indexedDB = function() {
                            return setItemsIndexedDB.apply(this, arguments);
                        };
                        localforagePrototype.setItems.websql = function() {
                            return setItemsWebsql.apply(this, arguments);
                        };
                        localforagePrototype.setItems.generic = function() {
                            return setItemsGeneric.apply(this, arguments);
                        };
                    }
                }
                var extendPrototypeResult = extendPrototype(localforage);
                exports1.setItemsGeneric = setItemsGeneric;
                exports1.localforageSetItems = localforageSetItems;
                exports1.extendPrototype = extendPrototype;
                exports1.extendPrototypeResult = extendPrototypeResult;
                Object.defineProperty(exports1, '__esModule', {
                    value: true
                });
            });
        })(localforageSetitems$1, localforageSetitems$1.exports);
        return localforageSetitems$1.exports;
    }
    var localforageSetitemsExports = requireLocalforageSetitems();
    function getSerializerPromise(localForageInstance) {
        if (getSerializerPromise.result) {
            return getSerializerPromise.result;
        }
        if (!localForageInstance || typeof localForageInstance.getSerializer !== 'function') {
            return Promise.reject(new Error('localforage.getSerializer() was not available! ' + 'localforage v1.4+ is required!'));
        }
        getSerializerPromise.result = localForageInstance.getSerializer();
        return getSerializerPromise.result;
    }
    function executeCallback(promise, callback) {
        if (callback) {
            promise.then(function(result) {
                callback(null, result);
            }, function(error) {
                callback(error);
            });
        }
        return promise;
    }
    function getItemKeyValue(key, callback) {
        var localforageInstance = this;
        var promise = localforageInstance.getItem(key).then(function(value) {
            return {
                key: key,
                value: value
            };
        });
        executeCallback(promise, callback);
        return promise;
    }
    function getItemsGeneric(keys /*, callback*/ ) {
        var localforageInstance = this;
        var promise = new Promise(function(resolve, reject) {
            var itemPromises = [];
            for(var i = 0, len = keys.length; i < len; i++){
                itemPromises.push(getItemKeyValue.call(localforageInstance, keys[i]));
            }
            Promise.all(itemPromises).then(function(keyValuePairs) {
                var result = {};
                for(var i = 0, len = keyValuePairs.length; i < len; i++){
                    var keyValuePair = keyValuePairs[i];
                    result[keyValuePair.key] = keyValuePair.value;
                }
                resolve(result);
            }).catch(reject);
        });
        return promise;
    }
    function getAllItemsUsingIterate() {
        var localforageInstance = this;
        var accumulator = {};
        return localforageInstance.iterate(function(value, key /*, iterationNumber*/ ) {
            accumulator[key] = value;
        }).then(function() {
            return accumulator;
        });
    }
    function getIDBKeyRange() {
        /* global IDBKeyRange, webkitIDBKeyRange, mozIDBKeyRange */ if (typeof IDBKeyRange !== 'undefined') {
            return IDBKeyRange;
        }
        if (typeof webkitIDBKeyRange !== 'undefined') {
            return webkitIDBKeyRange;
        }
        if (typeof mozIDBKeyRange !== 'undefined') {
            return mozIDBKeyRange;
        }
    }
    var idbKeyRange = getIDBKeyRange();
    function getItemsIndexedDB(keys /*, callback*/ ) {
        keys = keys.slice();
        var localforageInstance = this;
        function comparer(a, b) {
            return a < b ? -1 : a > b ? 1 : 0;
        }
        var promise = new Promise(function(resolve, reject) {
            localforageInstance.ready().then(function() {
                // Thanks https://hacks.mozilla.org/2014/06/breaking-the-borders-of-indexeddb/
                var dbInfo = localforageInstance._dbInfo;
                var store = dbInfo.db.transaction(dbInfo.storeName, 'readonly').objectStore(dbInfo.storeName);
                var set = keys.sort(comparer);
                var keyRangeValue = idbKeyRange.bound(keys[0], keys[keys.length - 1], false, false);
                var req;
                if ('getAll' in store) {
                    req = store.getAll(keyRangeValue);
                    req.onsuccess = function() {
                        var value = req.result;
                        if (value === undefined) {
                            value = null;
                        }
                        resolve(value);
                    };
                } else {
                    req = store.openCursor(keyRangeValue);
                    var result = {};
                    var i = 0;
                    req.onsuccess = function() /*event*/ {
                        var cursor = req.result; // event.target.result;
                        if (!cursor) {
                            resolve(result);
                            return;
                        }
                        var key = cursor.key;
                        while(key > set[i]){
                            i++; // The cursor has passed beyond this key. Check next.
                            if (i === set.length) {
                                // There is no next. Stop searching.
                                resolve(result);
                                return;
                            }
                        }
                        if (key === set[i]) {
                            // The current cursor value should be included and we should continue
                            // a single step in case next item has the same key or possibly our
                            // next key in set.
                            var value = cursor.value;
                            if (value === undefined) {
                                value = null;
                            }
                            result[key] = value;
                            // onfound(cursor.value);
                            cursor.continue();
                        } else {
                            // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.
                            cursor.continue(set[i]);
                        }
                    };
                }
                req.onerror = function() /*event*/ {
                    reject(req.error);
                };
            }).catch(reject);
        });
        return promise;
    }
    function getItemsWebsql(keys /*, callback*/ ) {
        var localforageInstance = this;
        var promise = new Promise(function(resolve, reject) {
            localforageInstance.ready().then(function() {
                return getSerializerPromise(localforageInstance);
            }).then(function(serializer) {
                var dbInfo = localforageInstance._dbInfo;
                dbInfo.db.transaction(function(t) {
                    var queryParts = new Array(keys.length);
                    for(var i = 0, len = keys.length; i < len; i++){
                        queryParts[i] = '?';
                    }
                    t.executeSql('SELECT * FROM ' + dbInfo.storeName + ' WHERE (key IN (' + queryParts.join(',') + '))', keys, function(t, results) {
                        var result = {};
                        var rows = results.rows;
                        for(var i = 0, len = rows.length; i < len; i++){
                            var item = rows.item(i);
                            var value = item.value;
                            // Check to see if this is serialized content we need to
                            // unpack.
                            if (value) {
                                value = serializer.deserialize(value);
                            }
                            result[item.key] = value;
                        }
                        resolve(result);
                    }, function(t, error) {
                        reject(error);
                    });
                });
            }).catch(reject);
        });
        return promise;
    }
    function localforageGetItems(keys, callback) {
        var localforageInstance = this;
        var promise;
        if (!arguments.length || keys === null) {
            promise = getAllItemsUsingIterate.apply(localforageInstance);
        } else {
            var currentDriver = localforageInstance.driver();
            if (currentDriver === localforageInstance.INDEXEDDB) {
                promise = getItemsIndexedDB.apply(localforageInstance, arguments);
            } else if (currentDriver === localforageInstance.WEBSQL) {
                promise = getItemsWebsql.apply(localforageInstance, arguments);
            } else {
                promise = getItemsGeneric.apply(localforageInstance, arguments);
            }
        }
        executeCallback(promise, callback);
        return promise;
    }
    function extendPrototype(localforage$$1) {
        var localforagePrototype = Object.getPrototypeOf(localforage$$1);
        if (localforagePrototype) {
            localforagePrototype.getItems = localforageGetItems;
            localforagePrototype.getItems.indexedDB = function() {
                return getItemsIndexedDB.apply(this, arguments);
            };
            localforagePrototype.getItems.websql = function() {
                return getItemsWebsql.apply(this, arguments);
            };
            localforagePrototype.getItems.generic = function() {
                return getItemsGeneric.apply(this, arguments);
            };
        }
    }
    extendPrototype(localForage);
    /** Used for built-in method references. */ var objectProto$6 = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
    /**
   * The base implementation of `_.has` without support for deep paths.
   *
   * @private
   * @param {Object} [object] The object to query.
   * @param {Array|string} key The key to check.
   * @returns {boolean} Returns `true` if `key` exists, else `false`.
   */ function baseHas(object, key) {
        return object != null && hasOwnProperty$5.call(object, key);
    }
    /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
    /**
   * Checks if `value` is a property name and not a property path.
   *
   * @private
   * @param {*} value The value to check.
   * @param {Object} [object] The object to query keys on.
   * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
   */ function isKey(value, object) {
        if (isArray(value)) {
            return false;
        }
        var type = typeof value;
        if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
            return true;
        }
        return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
    }
    /** Error message constants. */ var FUNC_ERROR_TEXT$1 = 'Expected a function';
    /**
   * Creates a function that memoizes the result of `func`. If `resolver` is
   * provided, it determines the cache key for storing the result based on the
   * arguments provided to the memoized function. By default, the first argument
   * provided to the memoized function is used as the map cache key. The `func`
   * is invoked with the `this` binding of the memoized function.
   *
   * **Note:** The cache is exposed as the `cache` property on the memoized
   * function. Its creation may be customized by replacing the `_.memoize.Cache`
   * constructor with one whose instances implement the
   * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
   * method interface of `clear`, `delete`, `get`, `has`, and `set`.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Function
   * @param {Function} func The function to have its output memoized.
   * @param {Function} [resolver] The function to resolve the cache key.
   * @returns {Function} Returns the new memoized function.
   * @example
   *
   * var object = { 'a': 1, 'b': 2 };
   * var other = { 'c': 3, 'd': 4 };
   *
   * var values = _.memoize(_.values);
   * values(object);
   * // => [1, 2]
   *
   * values(other);
   * // => [3, 4]
   *
   * object.a = 2;
   * values(object);
   * // => [1, 2]
   *
   * // Modify the result cache.
   * values.cache.set(object, ['a', 'b']);
   * values(object);
   * // => ['a', 'b']
   *
   * // Replace `_.memoize.Cache`.
   * _.memoize.Cache = WeakMap;
   */ function memoize(func, resolver) {
        if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
            throw new TypeError(FUNC_ERROR_TEXT$1);
        }
        var memoized = function() {
            var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
            if (cache.has(key)) {
                return cache.get(key);
            }
            var result = func.apply(this, args);
            memoized.cache = cache.set(key, result) || cache;
            return result;
        };
        memoized.cache = new (memoize.Cache || MapCache)();
        return memoized;
    }
    // Expose `MapCache`.
    memoize.Cache = MapCache;
    /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500;
    /**
   * A specialized version of `_.memoize` which clears the memoized function's
   * cache when it exceeds `MAX_MEMOIZE_SIZE`.
   *
   * @private
   * @param {Function} func The function to have its output memoized.
   * @returns {Function} Returns the new memoized function.
   */ function memoizeCapped(func) {
        var result = memoize(func, function(key) {
            if (cache.size === MAX_MEMOIZE_SIZE) {
                cache.clear();
            }
            return key;
        });
        var cache = result.cache;
        return result;
    }
    /** Used to match property names within property paths. */ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g;
    /**
   * Converts `string` to a property path array.
   *
   * @private
   * @param {string} string The string to convert.
   * @returns {Array} Returns the property path array.
   */ var stringToPath = memoizeCapped(function(string) {
        var result = [];
        if (string.charCodeAt(0) === 46 /* . */ ) {
            result.push('');
        }
        string.replace(rePropName, function(match, number, quote, subString) {
            result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
        });
        return result;
    });
    /**
   * Casts `value` to a path array if it's not one.
   *
   * @private
   * @param {*} value The value to inspect.
   * @param {Object} [object] The object to query keys on.
   * @returns {Array} Returns the cast property path array.
   */ function castPath(value, object) {
        if (isArray(value)) {
            return value;
        }
        return isKey(value, object) ? [
            value
        ] : stringToPath(toString$2(value));
    }
    /**
   * Converts `value` to a string key if it's not a string or symbol.
   *
   * @private
   * @param {*} value The value to inspect.
   * @returns {string|symbol} Returns the key.
   */ function toKey(value) {
        if (typeof value == 'string' || isSymbol(value)) {
            return value;
        }
        var result = value + '';
        return result == '0' && 1 / value == -Infinity ? '-0' : result;
    }
    /**
   * Checks if `path` exists on `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Array|string} path The path to check.
   * @param {Function} hasFunc The function to check properties.
   * @returns {boolean} Returns `true` if `path` exists, else `false`.
   */ function hasPath(object, path, hasFunc) {
        path = castPath(path, object);
        var index = -1, length = path.length, result = false;
        while(++index < length){
            var key = toKey(path[index]);
            if (!(result = object != null && hasFunc(object, key))) {
                break;
            }
            object = object[key];
        }
        if (result || ++index != length) {
            return result;
        }
        length = object == null ? 0 : object.length;
        return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
    }
    /**
   * Checks if `path` is a direct property of `object`.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Object
   * @param {Object} object The object to query.
   * @param {Array|string} path The path to check.
   * @returns {boolean} Returns `true` if `path` exists, else `false`.
   * @example
   *
   * var object = { 'a': { 'b': 2 } };
   * var other = _.create({ 'a': _.create({ 'b': 2 }) });
   *
   * _.has(object, 'a');
   * // => true
   *
   * _.has(object, 'a.b');
   * // => true
   *
   * _.has(object, ['a', 'b']);
   * // => true
   *
   * _.has(other, 'a');
   * // => false
   */ function has(object, path) {
        return object != null && hasPath(object, path, baseHas);
    }
    /**
   * This method is like `_.get` except that if the resolved value is a
   * function it's invoked with the `this` binding of its parent object and
   * its result is returned.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Object
   * @param {Object} object The object to query.
   * @param {Array|string} path The path of the property to resolve.
   * @param {*} [defaultValue] The value returned for `undefined` resolved values.
   * @returns {*} Returns the resolved value.
   * @example
   *
   * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
   *
   * _.result(object, 'a[0].b.c1');
   * // => 3
   *
   * _.result(object, 'a[0].b.c2');
   * // => 4
   *
   * _.result(object, 'a[0].b.c3', 'default');
   * // => 'default'
   *
   * _.result(object, 'a[0].b.c3', _.constant('default'));
   * // => 'default'
   */ function result(object, path, defaultValue) {
        path = castPath(path, object);
        var index = -1, length = path.length;
        // Ensure the loop is entered when path is empty.
        if (!length) {
            length = 1;
            object = undefined;
        }
        while(++index < length){
            var value = object == null ? undefined : object[toKey(path[index])];
            if (value === undefined) {
                index = length;
                value = defaultValue;
            }
            object = isFunction(value) ? value.call(object) : value;
        }
        return object;
    }
    //     (c) 2010-2019 Jeremy Ashkenas and DocumentCloud
    function S4() {
        // Generate four random hex digits.
        return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
    }
    function guid() {
        // Generate a pseudo-GUID by concatenating random hexadecimal.
        return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4();
    }
    function getResolveablePromise() {
        /**
     * @typedef {Object} PromiseWrapper
     * @property {boolean} isResolved
     * @property {boolean} isPending
     * @property {boolean} isRejected
     * @property {Function} resolve
     * @property {Function} reject
     */ /** @type {PromiseWrapper} */ const wrapper = {
            isResolved: false,
            isPending: true,
            isRejected: false,
            resolve: null,
            reject: null
        };
        /**
     * @typedef {Promise & PromiseWrapper} ResolveablePromise
     */ const promise = /** @type {ResolveablePromise} */ new Promise((resolve, reject)=>{
            wrapper.resolve = resolve;
            wrapper.reject = reject;
        });
        Object.assign(promise, wrapper);
        promise.then(function(v) {
            promise.isResolved = true;
            promise.isPending = false;
            promise.isRejected = false;
            return v;
        }, function(e) {
            promise.isResolved = false;
            promise.isPending = false;
            promise.isRejected = true;
            throw e;
        });
        return promise;
    }
    // Throw an error when a URL is needed, and none is supplied.
    function urlError() {
        throw new Error('A "url" property or function must be specified');
    }
    // Wrap an optional error callback with a fallback error event.
    function wrapError(model, options) {
        const error = options.error;
        options.error = function(resp) {
            if (error) error.call(options.context, model, resp, options);
            model.trigger('error', model, resp, options);
        };
    }
    // Map from CRUD to HTTP for our default `sync` implementation.
    const methodMap = {
        create: 'POST',
        update: 'PUT',
        patch: 'PATCH',
        delete: 'DELETE',
        read: 'GET'
    };
    /**
   * @typedef {import('./model.js').Model} Model
   * @typedef {import('./collection.js').Collection} Collection
   */ /**
   * @param {Model | Collection} model
   */ function getSyncMethod(model) {
        const store = result(model, 'browserStorage') || result(/** @type {Model} */ model.collection, 'browserStorage');
        return store ? store.sync() : sync;
    }
    /**
   * @typedef {Object} SyncOptions
   * @property {string} [url]
   * @property {any} [data]
   * @property {any} [attrs]
   * @property {Function} [success]
   * @property {Function} [error]
   * @property {any} [xhr]
   */ /**
   * Override this function to change the manner in which Backbone persists
   * models to the server. You will be passed the type of request, and the
   * model in question. By default makes a `fetch()` API call
   * to the model's `url()`.
   *
   * Some possible customizations could be:
   *
   * - Use `setTimeout` to batch rapid-fire updates into a single request.
   * - Persist models via WebSockets instead of Ajax.
   * - Persist models to browser storage
   *
   * @param {'create'|'update'|'patch'} method
   * @param {import('./model.js').Model} model
   * @param {SyncOptions} [options]
   */ function sync(method, model, options = {}) {
        let data = options.data;
        // Ensure that we have the appropriate request data.
        if (data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
            data = options.attrs || model.toJSON();
        }
        const type = methodMap[method];
        const params = {
            method: type,
            body: data ? JSON.stringify(data) : '',
            success: options.success,
            error: options.error
        };
        const url = options.url || result(model, 'url') || urlError();
        const xhr = options.xhr = fetch(url, params);
        model.trigger('request', model, xhr, _object_spread_props(_object_spread({}, params), {
            xhr
        }));
        return xhr;
    }
    /**
   * IndexedDB, localStorage and sessionStorage adapter
   */ const IN_MEMORY = _driver;
    localForage.defineDriver(memoryDriver);
    localforageSetitemsExports.extendPrototype(localForage);
    extendPrototype(localForage);
    class Storage {
        /**
     * @param {'local'|'session'|'indexed'|'in_memory'} type
     * @param {boolean} batchedWrites
     */ initStore(type, batchedWrites) {
            return _async_to_generator(function*() {
                if (type === 'session') {
                    yield localForage.setDriver(sessionStorageWrapper._driver);
                } else if (type === 'local') {
                    yield localForage.config({
                        'driver': localForage.LOCALSTORAGE
                    });
                } else if (type === 'in_memory') {
                    yield localForage.config({
                        'driver': IN_MEMORY
                    });
                } else if (type !== 'indexed') {
                    throw new Error('Skeletor.storage: No storage type was specified');
                }
                this.store = localForage;
                if (batchedWrites) {
                    this.store.debouncedSetItems = mergebounce((items)=>this.store.setItems(items), 50, {
                        'promise': true
                    });
                }
            }).call(this);
        }
        flush() {
            var _this$store$debounced;
            return (_this$store$debounced = this.store.debouncedSetItems) === null || _this$store$debounced === void 0 ? void 0 : _this$store$debounced.flush();
        }
        clear() {
            return _async_to_generator(function*() {
                yield this.store.removeItem(this.name).catch((e)=>console.error(e));
                const re = new RegExp(`^${this.name}-`);
                const keys = yield this.store.keys();
                const removed_keys = keys.filter((k)=>re.test(k));
                yield Promise.all(removed_keys.map((k)=>this.store.removeItem(k).catch((e)=>console.error(e))));
            }).call(this);
        }
        sync() {
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const that = this;
            function localSync(method, model, options) {
                return _async_to_generator(function*() {
                    let resp, errorMessage, promise, new_attributes;
                    // We get the collection (and if necessary the model attribute.
                    // Waiting for storeInitialized will cause another iteration of
                    // the event loop, after which the collection reference will
                    // be removed from the model.
                    const collection = model.collection;
                    if ([
                        'patch',
                        'update'
                    ].includes(method)) {
                        new_attributes = cloneDeep(model.attributes);
                    }
                    yield that.storeInitialized;
                    try {
                        const original_attributes = model.attributes;
                        switch(method){
                            case 'read':
                                if (model.id !== undefined) {
                                    resp = yield that.find(model);
                                } else {
                                    resp = yield that.findAll();
                                }
                                break;
                            case 'create':
                                resp = yield that.create(model, options);
                                break;
                            case 'patch':
                            case 'update':
                                if (options.wait) {
                                    // When `wait` is set to true, Skeletor waits until
                                    // confirmation of storage before setting the values on
                                    // the model.
                                    // However, the new attributes needs to be sent, so it
                                    // sets them manually on the model and then removes
                                    // them after calling `sync`.
                                    // Because our `sync` method is asynchronous and we
                                    // wait for `storeInitialized`, the attributes are
                                    // already restored once we get here, so we need to do
                                    // the attributes dance again.
                                    model.attributes = new_attributes;
                                }
                                promise = that.update(model);
                                if (options.wait) {
                                    model.attributes = original_attributes;
                                }
                                resp = yield promise;
                                break;
                            case 'delete':
                                resp = yield that.destroy(model, collection);
                                break;
                        }
                    } catch (error) {
                        if (error.code === 22 && that.getStorageSize() === 0) {
                            errorMessage = 'Private browsing is unsupported';
                        } else {
                            errorMessage = error.message;
                        }
                    }
                    if (resp) {
                        if (options && options.success) {
                            // When storing, we don't pass back the response (which is
                            // the set attributes returned from localforage because
                            // Skeletor sets them again on the model and due to the async
                            // nature of localforage it can cause stale attributes to be
                            // set on a model after it's been updated in the meantime.
                            const data = method === 'read' ? resp : null;
                            options.success(data, options);
                        }
                    } else {
                        errorMessage = errorMessage ? errorMessage : 'Record Not Found';
                        if (options && options.error) {
                            options.error(errorMessage);
                        }
                    }
                })();
            }
            localSync.__name__ = 'localSync';
            return localSync;
        }
        removeCollectionReference(model, collection) {
            if (!collection) {
                return;
            }
            const ids = collection.filter((m)=>m.id !== model.id).map((m)=>this.getItemName(m.id));
            return this.store.setItem(this.name, ids);
        }
        addCollectionReference(model, collection) {
            if (!collection) {
                return;
            }
            const ids = collection.map((m)=>this.getItemName(m.id));
            const new_id = this.getItemName(model.id);
            if (!ids.includes(new_id)) {
                ids.push(new_id);
            }
            return this.store.setItem(this.name, ids);
        }
        getCollectionReferenceData(model) {
            if (!model.collection) {
                return {};
            }
            const ids = model.collection.map((m)=>this.getItemName(m.id));
            const new_id = this.getItemName(model.id);
            if (!ids.includes(new_id)) {
                ids.push(new_id);
            }
            const result = {};
            result[this.name] = ids;
            return result;
        }
        save(model) {
            return _async_to_generator(function*() {
                if (this.store.setItems) {
                    const items = {};
                    items[this.getItemName(model.id)] = model.toJSON();
                    Object.assign(items, this.getCollectionReferenceData(model));
                    return this.store.debouncedSetItems ? this.store.debouncedSetItems(items) : this.store.setItems(items);
                } else {
                    const key = this.getItemName(model.id);
                    const data = yield this.store.setItem(key, model.toJSON());
                    yield this.addCollectionReference(model, model.collection);
                    return data;
                }
            }).call(this);
        }
        create(model, options) {
            /* Add a model, giving it a (hopefully)-unique GUID, if it doesn't already
       * have an id of it's own.
       */ if (!model.id) {
                model.id = guid();
                model.set(model.idAttribute, model.id, options);
            }
            return this.save(model);
        }
        update(model) {
            return this.save(model);
        }
        find(model) {
            return this.store.getItem(this.getItemName(model.id));
        }
        findAll() {
            return _async_to_generator(function*() {
                /* Return the array of all models currently in storage.
       */ const keys = yield this.store.getItem(this.name);
                if (keys !== null && keys !== void 0 && keys.length) {
                    const items = yield this.store.getItems(keys);
                    return Object.values(items);
                }
                return [];
            }).call(this);
        }
        destroy(model, collection) {
            return _async_to_generator(function*() {
                yield this.flush();
                yield this.store.removeItem(this.getItemName(model.id));
                yield this.removeCollectionReference(model, collection);
                return model;
            }).call(this);
        }
        getStorageSize() {
            return this.store.length;
        }
        getItemName(id) {
            return this.name + '-' + id;
        }
        constructor(id, type, batchedWrites = false){
            if (type === 'local' && !window.localStorage) {
                throw new Error('Skeletor.storage: Environment does not support localStorage.');
            } else if (type === 'session' && !window.sessionStorage) {
                throw new Error('Skeletor.storage: Environment does not support sessionStorage.');
            }
            if (isString(type)) {
                this.storeInitialized = this.initStore(type, batchedWrites);
            } else {
                this.store = type;
                if (batchedWrites) {
                    this.store.debouncedSetItems = mergebounce((items)=>this.store.setItems(items), 50, {
                        'promise': true
                    });
                }
                this.storeInitialized = Promise.resolve();
            }
            this.name = id;
        }
    }
    Storage.sessionStorageInitialized = localForage.defineDriver(sessionStorageWrapper);
    Storage.localForage = localForage;
    /** Used to compose bitmasks for cloning. */ var CLONE_SYMBOLS_FLAG$1 = 4;
    /**
   * Creates a shallow clone of `value`.
   *
   * **Note:** This method is loosely based on the
   * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
   * and supports cloning arrays, array buffers, booleans, date objects, maps,
   * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
   * arrays. The own enumerable properties of `arguments` objects are cloned
   * as plain objects. An empty object is returned for uncloneable values such
   * as error objects, functions, DOM nodes, and WeakMaps.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to clone.
   * @returns {*} Returns the cloned value.
   * @see _.cloneDeep
   * @example
   *
   * var objects = [{ 'a': 1 }, { 'b': 2 }];
   *
   * var shallow = _.clone(objects);
   * console.log(shallow[0] === objects[0]);
   * // => true
   */ function clone(value) {
        return baseClone(value, CLONE_SYMBOLS_FLAG$1);
    }
    /** Used for built-in method references. */ var objectProto$5 = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
    /**
   * Assigns own and inherited enumerable string keyed properties of source
   * objects to the destination object for all destination properties that
   * resolve to `undefined`. Source objects are applied from left to right.
   * Once a property is set, additional values of the same property are ignored.
   *
   * **Note:** This method mutates `object`.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Object
   * @param {Object} object The destination object.
   * @param {...Object} [sources] The source objects.
   * @returns {Object} Returns `object`.
   * @see _.defaultsDeep
   * @example
   *
   * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
   * // => { 'a': 1, 'b': 2 }
   */ var defaults = baseRest(function(object, sources) {
        object = Object(object);
        var index = -1;
        var length = sources.length;
        var guard = length > 2 ? sources[2] : undefined;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            length = 1;
        }
        while(++index < length){
            var source = sources[index];
            var props = keysIn(source);
            var propsIndex = -1;
            var propsLength = props.length;
            while(++propsIndex < propsLength){
                var key = props[propsIndex];
                var value = object[key];
                if (value === undefined || eq(value, objectProto$5[key]) && !hasOwnProperty$4.call(object, key)) {
                    object[key] = source[key];
                }
            }
        }
        return object;
    });
    /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function';
    /**
   * The base implementation of `_.delay` and `_.defer` which accepts `args`
   * to provide to `func`.
   *
   * @private
   * @param {Function} func The function to delay.
   * @param {number} wait The number of milliseconds to delay invocation.
   * @param {Array} args The arguments to provide to `func`.
   * @returns {number|Object} Returns the timer id or timeout object.
   */ function baseDelay(func, wait, args) {
        if (typeof func != 'function') {
            throw new TypeError(FUNC_ERROR_TEXT);
        }
        return setTimeout(function() {
            func.apply(undefined, args);
        }, wait);
    }
    /**
   * Defers invoking the `func` until the current call stack has cleared. Any
   * additional arguments are provided to `func` when it's invoked.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Function
   * @param {Function} func The function to defer.
   * @param {...*} [args] The arguments to invoke `func` with.
   * @returns {number} Returns the timer id.
   * @example
   *
   * _.defer(function(text) {
   *   console.log(text);
   * }, 'deferred');
   * // => Logs 'deferred' after one millisecond.
   */ var defer = baseRest(function(func, args) {
        return baseDelay(func, 1, args);
    });
    /**
   * The base implementation of `_.forOwn` without support for iteratee shorthands.
   *
   * @private
   * @param {Object} object The object to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Object} Returns `object`.
   */ function baseForOwn(object, iteratee) {
        return object && baseFor(object, iteratee, keys$2);
    }
    /**
   * The base implementation of `_.invert` and `_.invertBy` which inverts
   * `object` with values transformed by `iteratee` and set by `setter`.
   *
   * @private
   * @param {Object} object The object to iterate over.
   * @param {Function} setter The function to set `accumulator` values.
   * @param {Function} iteratee The iteratee to transform values.
   * @param {Object} accumulator The initial inverted object.
   * @returns {Function} Returns `accumulator`.
   */ function baseInverter(object, setter, iteratee, accumulator) {
        baseForOwn(object, function(value, key, object) {
            setter(accumulator, iteratee(value), key, object);
        });
        return accumulator;
    }
    /**
   * Creates a function like `_.invertBy`.
   *
   * @private
   * @param {Function} setter The function to set accumulator values.
   * @param {Function} toIteratee The function to resolve iteratees.
   * @returns {Function} Returns the new inverter function.
   */ function createInverter(setter, toIteratee) {
        return function(object, iteratee) {
            return baseInverter(object, setter, toIteratee(iteratee), {});
        };
    }
    /** Used for built-in method references. */ var objectProto$4 = Object.prototype;
    /**
   * Used to resolve the
   * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
   * of values.
   */ var nativeObjectToString = objectProto$4.toString;
    /**
   * Creates an object composed of the inverted keys and values of `object`.
   * If `object` contains duplicate values, subsequent values overwrite
   * property assignments of previous values.
   *
   * @static
   * @memberOf _
   * @since 0.7.0
   * @category Object
   * @param {Object} object The object to invert.
   * @returns {Object} Returns the new inverted object.
   * @example
   *
   * var object = { 'a': 1, 'b': 2, 'c': 1 };
   *
   * _.invert(object);
   * // => { '1': 'c', '2': 'b' }
   */ var invert = createInverter(function(result, value, key) {
        if (value != null && typeof value.toString != 'function') {
            value = nativeObjectToString.call(value);
        }
        result[value] = key;
    }, constant(identity));
    /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__';
    /**
   * Adds `value` to the array cache.
   *
   * @private
   * @name add
   * @memberOf SetCache
   * @alias push
   * @param {*} value The value to cache.
   * @returns {Object} Returns the cache instance.
   */ function setCacheAdd(value) {
        this.__data__.set(value, HASH_UNDEFINED);
        return this;
    }
    /**
   * Checks if `value` is in the array cache.
   *
   * @private
   * @name has
   * @memberOf SetCache
   * @param {*} value The value to search for.
   * @returns {number} Returns `true` if `value` is found, else `false`.
   */ function setCacheHas(value) {
        return this.__data__.has(value);
    }
    /**
   *
   * Creates an array cache object to store unique values.
   *
   * @private
   * @constructor
   * @param {Array} [values] The values to cache.
   */ function SetCache(values) {
        var index = -1, length = values == null ? 0 : values.length;
        this.__data__ = new MapCache();
        while(++index < length){
            this.add(values[index]);
        }
    }
    // Add methods to `SetCache`.
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;
    /**
   * A specialized version of `_.some` for arrays without support for iteratee
   * shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} predicate The function invoked per iteration.
   * @returns {boolean} Returns `true` if any element passes the predicate check,
   *  else `false`.
   */ function arraySome(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length;
        while(++index < length){
            if (predicate(array[index], index, array)) {
                return true;
            }
        }
        return false;
    }
    /**
   * Checks if a `cache` value for `key` exists.
   *
   * @private
   * @param {Object} cache The cache to query.
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */ function cacheHas(cache, key) {
        return cache.has(key);
    }
    /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
    /**
   * A specialized version of `baseIsEqualDeep` for arrays with support for
   * partial deep comparisons.
   *
   * @private
   * @param {Array} array The array to compare.
   * @param {Array} other The other array to compare.
   * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
   * @param {Function} customizer The function to customize comparisons.
   * @param {Function} equalFunc The function to determine equivalents of values.
   * @param {Object} stack Tracks traversed `array` and `other` objects.
   * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
   */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
        if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
            return false;
        }
        // Check that cyclic values are equal.
        var arrStacked = stack.get(array);
        var othStacked = stack.get(other);
        if (arrStacked && othStacked) {
            return arrStacked == other && othStacked == array;
        }
        var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : undefined;
        stack.set(array, other);
        stack.set(other, array);
        // Ignore non-index properties.
        while(++index < arrLength){
            var arrValue = array[index], othValue = other[index];
            if (customizer) {
                var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
            }
            if (compared !== undefined) {
                if (compared) {
                    continue;
                }
                result = false;
                break;
            }
            // Recursively compare arrays (susceptible to call stack limits).
            if (seen) {
                if (!arraySome(other, function(othValue, othIndex) {
                    if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                        return seen.push(othIndex);
                    }
                })) {
                    result = false;
                    break;
                }
            } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                result = false;
                break;
            }
        }
        stack['delete'](array);
        stack['delete'](other);
        return result;
    }
    /**
   * Converts `map` to its key-value pairs.
   *
   * @private
   * @param {Object} map The map to convert.
   * @returns {Array} Returns the key-value pairs.
   */ function mapToArray(map) {
        var index = -1, result = Array(map.size);
        map.forEach(function(value, key) {
            result[++index] = [
                key,
                value
            ];
        });
        return result;
    }
    /**
   * Converts `set` to an array of its values.
   *
   * @private
   * @param {Object} set The set to convert.
   * @returns {Array} Returns the values.
   */ function setToArray(set) {
        var index = -1, result = Array(set.size);
        set.forEach(function(value) {
            result[++index] = value;
        });
        return result;
    }
    /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
    /** `Object#toString` result references. */ var boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]';
    var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]';
    /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
    /**
   * A specialized version of `baseIsEqualDeep` for comparing objects of
   * the same `toStringTag`.
   *
   * **Note:** This function only supports comparing values with tags of
   * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
   *
   * @private
   * @param {Object} object The object to compare.
   * @param {Object} other The other object to compare.
   * @param {string} tag The `toStringTag` of the objects to compare.
   * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
   * @param {Function} customizer The function to customize comparisons.
   * @param {Function} equalFunc The function to determine equivalents of values.
   * @param {Object} stack Tracks traversed `object` and `other` objects.
   * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
   */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
        switch(tag){
            case dataViewTag:
                if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
                    return false;
                }
                object = object.buffer;
                other = other.buffer;
            case arrayBufferTag:
                if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
                    return false;
                }
                return true;
            case boolTag:
            case dateTag:
            case numberTag:
                // Coerce booleans to `1` or `0` and dates to milliseconds.
                // Invalid dates are coerced to `NaN`.
                return eq(+object, +other);
            case errorTag:
                return object.name == other.name && object.message == other.message;
            case regexpTag:
            case stringTag:
                // Coerce regexes to strings and treat strings, primitives and objects,
                // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
                // for more details.
                return object == other + '';
            case mapTag:
                var convert = mapToArray;
            case setTag:
                var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
                convert || (convert = setToArray);
                if (object.size != other.size && !isPartial) {
                    return false;
                }
                // Assume cyclic values are equal.
                var stacked = stack.get(object);
                if (stacked) {
                    return stacked == other;
                }
                bitmask |= COMPARE_UNORDERED_FLAG$2;
                // Recursively compare objects (susceptible to call stack limits).
                stack.set(object, other);
                var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
                stack['delete'](object);
                return result;
            case symbolTag:
                if (symbolValueOf) {
                    return symbolValueOf.call(object) == symbolValueOf.call(other);
                }
        }
        return false;
    }
    /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$3 = 1;
    /** Used for built-in method references. */ var objectProto$3 = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
    /**
   * A specialized version of `baseIsEqualDeep` for objects with support for
   * partial deep comparisons.
   *
   * @private
   * @param {Object} object The object to compare.
   * @param {Object} other The other object to compare.
   * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
   * @param {Function} customizer The function to customize comparisons.
   * @param {Function} equalFunc The function to determine equivalents of values.
   * @param {Object} stack Tracks traversed `object` and `other` objects.
   * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
   */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
        if (objLength != othLength && !isPartial) {
            return false;
        }
        var index = objLength;
        while(index--){
            var key = objProps[index];
            if (!(isPartial ? key in other : hasOwnProperty$3.call(other, key))) {
                return false;
            }
        }
        // Check that cyclic values are equal.
        var objStacked = stack.get(object);
        var othStacked = stack.get(other);
        if (objStacked && othStacked) {
            return objStacked == other && othStacked == object;
        }
        var result = true;
        stack.set(object, other);
        stack.set(other, object);
        var skipCtor = isPartial;
        while(++index < objLength){
            key = objProps[index];
            var objValue = object[key], othValue = other[key];
            if (customizer) {
                var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
            }
            // Recursively compare objects (susceptible to call stack limits).
            if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
                result = false;
                break;
            }
            skipCtor || (skipCtor = key == 'constructor');
        }
        if (result && !skipCtor) {
            var objCtor = object.constructor, othCtor = other.constructor;
            // Non `Object` object instances with different constructors are not equal.
            if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
                result = false;
            }
        }
        stack['delete'](object);
        stack['delete'](other);
        return result;
    }
    /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$2 = 1;
    /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]';
    /** Used for built-in method references. */ var objectProto$2 = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
    /**
   * A specialized version of `baseIsEqual` for arrays and objects which performs
   * deep comparisons and tracks traversed objects enabling objects with circular
   * references to be compared.
   *
   * @private
   * @param {Object} object The object to compare.
   * @param {Object} other The other object to compare.
   * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
   * @param {Function} customizer The function to customize comparisons.
   * @param {Function} equalFunc The function to determine equivalents of values.
   * @param {Object} [stack] Tracks traversed `object` and `other` objects.
   * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
   */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
        var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
        objTag = objTag == argsTag ? objectTag : objTag;
        othTag = othTag == argsTag ? objectTag : othTag;
        var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
        if (isSameTag && isBuffer(object)) {
            if (!isBuffer(other)) {
                return false;
            }
            objIsArr = true;
            objIsObj = false;
        }
        if (isSameTag && !objIsObj) {
            stack || (stack = new Stack());
            return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
        }
        if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
            var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
            if (objIsWrapped || othIsWrapped) {
                var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
                stack || (stack = new Stack());
                return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
            }
        }
        if (!isSameTag) {
            return false;
        }
        stack || (stack = new Stack());
        return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
    }
    /**
   * The base implementation of `_.isEqual` which supports partial comparisons
   * and tracks traversed objects.
   *
   * @private
   * @param {*} value The value to compare.
   * @param {*} other The other value to compare.
   * @param {boolean} bitmask The bitmask flags.
   *  1 - Unordered comparison
   *  2 - Partial comparison
   * @param {Function} [customizer] The function to customize comparisons.
   * @param {Object} [stack] Tracks traversed `value` and `other` objects.
   * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
   */ function baseIsEqual(value, other, bitmask, customizer, stack) {
        if (value === other) {
            return true;
        }
        if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
            return value !== value && other !== other;
        }
        return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
    }
    /**
   * Performs a deep comparison between two values to determine if they are
   * equivalent.
   *
   * **Note:** This method supports comparing arrays, array buffers, booleans,
   * date objects, error objects, maps, numbers, `Object` objects, regexes,
   * sets, strings, symbols, and typed arrays. `Object` objects are compared
   * by their own, not inherited, enumerable properties. Functions and DOM
   * nodes are compared by strict equality, i.e. `===`.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to compare.
   * @param {*} other The other value to compare.
   * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
   * @example
   *
   * var object = { 'a': 1 };
   * var other = { 'a': 1 };
   *
   * _.isEqual(object, other);
   * // => true
   *
   * object === other;
   * // => false
   */ function isEqual(value, other) {
        return baseIsEqual(value, other);
    }
    /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
    /**
   * The base implementation of `_.isMatch` without support for iteratee shorthands.
   *
   * @private
   * @param {Object} object The object to inspect.
   * @param {Object} source The object of property values to match.
   * @param {Array} matchData The property names, values, and compare flags to match.
   * @param {Function} [customizer] The function to customize comparisons.
   * @returns {boolean} Returns `true` if `object` is a match, else `false`.
   */ function baseIsMatch(object, source, matchData, customizer) {
        var index = matchData.length, length = index;
        if (object == null) {
            return !length;
        }
        object = Object(object);
        while(index--){
            var data = matchData[index];
            if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
                return false;
            }
        }
        while(++index < length){
            data = matchData[index];
            var key = data[0], objValue = object[key], srcValue = data[1];
            if (data[2]) {
                if (objValue === undefined && !(key in object)) {
                    return false;
                }
            } else {
                var stack = new Stack();
                var result;
                if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
                    return false;
                }
            }
        }
        return true;
    }
    /**
   * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` if suitable for strict
   *  equality comparisons, else `false`.
   */ function isStrictComparable(value) {
        return value === value && !isObject$1(value);
    }
    /**
   * Gets the property names, values, and compare flags of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Array} Returns the match data of `object`.
   */ function getMatchData(object) {
        var result = keys$2(object), length = result.length;
        while(length--){
            var key = result[length], value = object[key];
            result[length] = [
                key,
                value,
                isStrictComparable(value)
            ];
        }
        return result;
    }
    /**
   * A specialized version of `matchesProperty` for source values suitable
   * for strict equality comparisons, i.e. `===`.
   *
   * @private
   * @param {string} key The key of the property to get.
   * @param {*} srcValue The value to match.
   * @returns {Function} Returns the new spec function.
   */ function matchesStrictComparable(key, srcValue) {
        return function(object) {
            if (object == null) {
                return false;
            }
            return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
        };
    }
    /**
   * The base implementation of `_.matches` which doesn't clone `source`.
   *
   * @private
   * @param {Object} source The object of property values to match.
   * @returns {Function} Returns the new spec function.
   */ function baseMatches(source) {
        var matchData = getMatchData(source);
        if (matchData.length == 1 && matchData[0][2]) {
            return matchesStrictComparable(matchData[0][0], matchData[0][1]);
        }
        return function(object) {
            return object === source || baseIsMatch(object, source, matchData);
        };
    }
    /**
   * The base implementation of `_.get` without support for default values.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Array|string} path The path of the property to get.
   * @returns {*} Returns the resolved value.
   */ function baseGet(object, path) {
        path = castPath(path, object);
        var index = 0, length = path.length;
        while(object != null && index < length){
            object = object[toKey(path[index++])];
        }
        return index && index == length ? object : undefined;
    }
    /**
   * Gets the value at `path` of `object`. If the resolved value is
   * `undefined`, the `defaultValue` is returned in its place.
   *
   * @static
   * @memberOf _
   * @since 3.7.0
   * @category Object
   * @param {Object} object The object to query.
   * @param {Array|string} path The path of the property to get.
   * @param {*} [defaultValue] The value returned for `undefined` resolved values.
   * @returns {*} Returns the resolved value.
   * @example
   *
   * var object = { 'a': [{ 'b': { 'c': 3 } }] };
   *
   * _.get(object, 'a[0].b.c');
   * // => 3
   *
   * _.get(object, ['a', '0', 'b', 'c']);
   * // => 3
   *
   * _.get(object, 'a.b.c', 'default');
   * // => 'default'
   */ function get(object, path, defaultValue) {
        var result = object == null ? undefined : baseGet(object, path);
        return result === undefined ? defaultValue : result;
    }
    /**
   * The base implementation of `_.hasIn` without support for deep paths.
   *
   * @private
   * @param {Object} [object] The object to query.
   * @param {Array|string} key The key to check.
   * @returns {boolean} Returns `true` if `key` exists, else `false`.
   */ function baseHasIn(object, key) {
        return object != null && key in Object(object);
    }
    /**
   * Checks if `path` is a direct or inherited property of `object`.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Object
   * @param {Object} object The object to query.
   * @param {Array|string} path The path to check.
   * @returns {boolean} Returns `true` if `path` exists, else `false`.
   * @example
   *
   * var object = _.create({ 'a': _.create({ 'b': 2 }) });
   *
   * _.hasIn(object, 'a');
   * // => true
   *
   * _.hasIn(object, 'a.b');
   * // => true
   *
   * _.hasIn(object, ['a', 'b']);
   * // => true
   *
   * _.hasIn(object, 'b');
   * // => false
   */ function hasIn(object, path) {
        return object != null && hasPath(object, path, baseHasIn);
    }
    /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
    /**
   * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
   *
   * @private
   * @param {string} path The path of the property to get.
   * @param {*} srcValue The value to match.
   * @returns {Function} Returns the new spec function.
   */ function baseMatchesProperty(path, srcValue) {
        if (isKey(path) && isStrictComparable(srcValue)) {
            return matchesStrictComparable(toKey(path), srcValue);
        }
        return function(object) {
            var objValue = get(object, path);
            return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
        };
    }
    /**
   * The base implementation of `_.property` without support for deep paths.
   *
   * @private
   * @param {string} key The key of the property to get.
   * @returns {Function} Returns the new accessor function.
   */ function baseProperty(key) {
        return function(object) {
            return object == null ? undefined : object[key];
        };
    }
    /**
   * A specialized version of `baseProperty` which supports deep paths.
   *
   * @private
   * @param {Array|string} path The path of the property to get.
   * @returns {Function} Returns the new accessor function.
   */ function basePropertyDeep(path) {
        return function(object) {
            return baseGet(object, path);
        };
    }
    /**
   * Creates a function that returns the value at `path` of a given object.
   *
   * @static
   * @memberOf _
   * @since 2.4.0
   * @category Util
   * @param {Array|string} path The path of the property to get.
   * @returns {Function} Returns the new accessor function.
   * @example
   *
   * var objects = [
   *   { 'a': { 'b': 2 } },
   *   { 'a': { 'b': 1 } }
   * ];
   *
   * _.map(objects, _.property('a.b'));
   * // => [2, 1]
   *
   * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
   * // => [1, 2]
   */ function property(path) {
        return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
    }
    /**
   * The base implementation of `_.iteratee`.
   *
   * @private
   * @param {*} [value=_.identity] The value to convert to an iteratee.
   * @returns {Function} Returns the iteratee.
   */ function baseIteratee(value) {
        // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
        // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
        if (typeof value == 'function') {
            return value;
        }
        if (value == null) {
            return identity;
        }
        if (typeof value == 'object') {
            return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
        }
        return property(value);
    }
    /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG$1 = 1;
    /**
   * Creates a function that invokes `func` with the arguments of the created
   * function. If `func` is a property name, the created function returns the
   * property value for a given element. If `func` is an array or object, the
   * created function returns `true` for elements that contain the equivalent
   * source properties, otherwise it returns `false`.
   *
   * @static
   * @since 4.0.0
   * @memberOf _
   * @category Util
   * @param {*} [func=_.identity] The value to convert to a callback.
   * @returns {Function} Returns the callback.
   * @example
   *
   * var users = [
   *   { 'user': 'barney', 'age': 36, 'active': true },
   *   { 'user': 'fred',   'age': 40, 'active': false }
   * ];
   *
   * // The `_.matches` iteratee shorthand.
   * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
   * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
   *
   * // The `_.matchesProperty` iteratee shorthand.
   * _.filter(users, _.iteratee(['user', 'fred']));
   * // => [{ 'user': 'fred', 'age': 40 }]
   *
   * // The `_.property` iteratee shorthand.
   * _.map(users, _.iteratee('user'));
   * // => ['barney', 'fred']
   *
   * // Create custom iteratee shorthands.
   * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
   *   return !_.isRegExp(func) ? iteratee(func) : function(string) {
   *     return func.test(string);
   *   };
   * });
   *
   * _.filter(['abc', 'def'], /ef/);
   * // => ['def']
   */ function iteratee(func) {
        return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG$1));
    }
    /**
   * Gets the last element of `array`.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Array
   * @param {Array} array The array to query.
   * @returns {*} Returns the last element of `array`.
   * @example
   *
   * _.last([1, 2, 3]);
   * // => 3
   */ function last(array) {
        var length = array == null ? 0 : array.length;
        return length ? array[length - 1] : undefined;
    }
    /**
   * The base implementation of `_.slice` without an iteratee call guard.
   *
   * @private
   * @param {Array} array The array to slice.
   * @param {number} [start=0] The start position.
   * @param {number} [end=array.length] The end position.
   * @returns {Array} Returns the slice of `array`.
   */ function baseSlice(array, start, end) {
        var index = -1, length = array.length;
        if (start < 0) {
            start = -start > length ? 0 : length + start;
        }
        end = end > length ? length : end;
        if (end < 0) {
            end += length;
        }
        length = start > end ? 0 : end - start >>> 0;
        start >>>= 0;
        var result = Array(length);
        while(++index < length){
            result[index] = array[index + start];
        }
        return result;
    }
    /**
   * Gets the parent value at `path` of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Array} path The path to get the parent value of.
   * @returns {*} Returns the parent value.
   */ function parent(object, path) {
        return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
    }
    /**
   * The base implementation of `_.unset`.
   *
   * @private
   * @param {Object} object The object to modify.
   * @param {Array|string} path The property path to unset.
   * @returns {boolean} Returns `true` if the property is deleted, else `false`.
   */ function baseUnset(object, path) {
        path = castPath(path, object);
        object = parent(object, path);
        return object == null || delete object[toKey(last(path))];
    }
    /**
   * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
   * objects.
   *
   * @private
   * @param {*} value The value to inspect.
   * @param {string} key The key of the property to inspect.
   * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
   */ function customOmitClone(value) {
        return isPlainObject(value) ? undefined : value;
    }
    /** Built-in value references. */ var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : undefined;
    /**
   * Checks if `value` is a flattenable `arguments` object or array.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
   */ function isFlattenable(value) {
        return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
    }
    /**
   * The base implementation of `_.flatten` with support for restricting flattening.
   *
   * @private
   * @param {Array} array The array to flatten.
   * @param {number} depth The maximum recursion depth.
   * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
   * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
   * @param {Array} [result=[]] The initial result value.
   * @returns {Array} Returns the new flattened array.
   */ function baseFlatten(array, depth, predicate, isStrict, result) {
        var index = -1, length = array.length;
        predicate || (predicate = isFlattenable);
        result || (result = []);
        while(++index < length){
            var value = array[index];
            if (predicate(value)) {
                {
                    arrayPush(result, value);
                }
            } else {
                result[result.length] = value;
            }
        }
        return result;
    }
    /**
   * Flattens `array` a single level deep.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Array
   * @param {Array} array The array to flatten.
   * @returns {Array} Returns the new flattened array.
   * @example
   *
   * _.flatten([1, [2, [3, [4]], 5]]);
   * // => [1, 2, [3, [4]], 5]
   */ function flatten(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseFlatten(array) : [];
    }
    /**
   * A specialized version of `baseRest` which flattens the rest array.
   *
   * @private
   * @param {Function} func The function to apply a rest parameter to.
   * @returns {Function} Returns the new function.
   */ function flatRest(func) {
        return setToString(overRest(func, undefined, flatten), func + '');
    }
    /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
    /**
   * The opposite of `_.pick`; this method creates an object composed of the
   * own and inherited enumerable property paths of `object` that are not omitted.
   *
   * **Note:** This method is considerably slower than `_.pick`.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Object
   * @param {Object} object The source object.
   * @param {...(string|string[])} [paths] The property paths to omit.
   * @returns {Object} Returns the new object.
   * @example
   *
   * var object = { 'a': 1, 'b': '2', 'c': 3 };
   *
   * _.omit(object, ['a', 'c']);
   * // => { 'b': '2' }
   */ var omit = flatRest(function(object, paths) {
        var result = {};
        if (object == null) {
            return result;
        }
        var isDeep = false;
        paths = arrayMap(paths, function(path) {
            path = castPath(path, object);
            isDeep || (isDeep = path.length > 1);
            return path;
        });
        copyObject(object, getAllKeysIn(object), result);
        if (isDeep) {
            result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
        }
        var length = paths.length;
        while(length--){
            baseUnset(result, paths[length]);
        }
        return result;
    });
    /**
   * The base implementation of `_.set`.
   *
   * @private
   * @param {Object} object The object to modify.
   * @param {Array|string} path The path of the property to set.
   * @param {*} value The value to set.
   * @param {Function} [customizer] The function to customize path creation.
   * @returns {Object} Returns `object`.
   */ function baseSet(object, path, value, customizer) {
        if (!isObject$1(object)) {
            return object;
        }
        path = castPath(path, object);
        var index = -1, length = path.length, lastIndex = length - 1, nested = object;
        while(nested != null && ++index < length){
            var key = toKey(path[index]), newValue = value;
            if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
                return object;
            }
            if (index != lastIndex) {
                var objValue = nested[key];
                newValue = undefined;
                if (newValue === undefined) {
                    newValue = isObject$1(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
                }
            }
            assignValue(nested, key, newValue);
            nested = nested[key];
        }
        return object;
    }
    /**
   * The base implementation of  `_.pickBy` without support for iteratee shorthands.
   *
   * @private
   * @param {Object} object The source object.
   * @param {string[]} paths The property paths to pick.
   * @param {Function} predicate The function invoked per property.
   * @returns {Object} Returns the new object.
   */ function basePickBy(object, paths, predicate) {
        var index = -1, length = paths.length, result = {};
        while(++index < length){
            var path = paths[index], value = baseGet(object, path);
            if (predicate(value, path)) {
                baseSet(result, castPath(path, object), value);
            }
        }
        return result;
    }
    /**
   * The base implementation of `_.pick` without support for individual
   * property identifiers.
   *
   * @private
   * @param {Object} object The source object.
   * @param {string[]} paths The property paths to pick.
   * @returns {Object} Returns the new object.
   */ function basePick(object, paths) {
        return basePickBy(object, paths, function(value, path) {
            return hasIn(object, path);
        });
    }
    /**
   * Creates an object composed of the picked `object` properties.
   *
   * @static
   * @since 0.1.0
   * @memberOf _
   * @category Object
   * @param {Object} object The source object.
   * @param {...(string|string[])} [paths] The property paths to pick.
   * @returns {Object} Returns the new object.
   * @example
   *
   * var object = { 'a': 1, 'b': '2', 'c': 3 };
   *
   * _.pick(object, ['a', 'c']);
   * // => { 'a': 1, 'c': 3 }
   */ var pick = flatRest(function(object, paths) {
        return object == null ? {} : basePick(object, paths);
    });
    /**
   * @typedef {import('./collection.js').Collection} Collection
   * @typedef {Record.<string, any>} Attributes
   *
   * @typedef {Record.<string, any>} Options
   * @property {boolean} [validate]
   *
   * @typedef {Record.<string, any>} ModelOptions
   * @property {Collection} [collection]
   * @property {boolean} [parse]
   * @property {boolean} [unset]
   * @property {boolean} [silent]
   */ /**
   * **Models** are the basic data object in the framework --
   * frequently representing a row in a table in a database on your server.
   * A discrete chunk of data and a bunch of useful, related methods for
   * performing computations and transformations on that data.
   */ class Model extends EventEmitter(Object) {
        /**
     * @param {Storage} storage
     */ set browserStorage(storage) {
            this._browserStorage = storage;
        }
        /**
     * @returns {Storage} storage
     */ get browserStorage() {
            return this._browserStorage;
        }
        /**
     * The default name for the JSON `id` attribute is `"id"`. MongoDB and
     * CouchDB users may want to set this to `"_id"` (by overriding this getter
     * in a subclass).
     */ // eslint-disable-next-line class-methods-use-this
        get idAttribute() {
            return 'id';
        }
        /**
     * The prefix is used to create the client id which is used to identify models locally.
     * You may want to override this if you're experiencing name clashes with model ids.
     */ // eslint-disable-next-line class-methods-use-this
        get cidPrefix() {
            return 'c';
        }
        /**
     * preinitialize is an empty function by default. You can override it with a function
     * or object.  preinitialize will run before any instantiation logic is run in the Model.
     */ // eslint-disable-next-line class-methods-use-this
        preinitialize() {}
        /**
     * Initialize is an empty function by default. Override it with your own
     * initialization logic.
     * @param {Attributes} [attrs]
     * @param {ModelOptions} [options]
     */ initialize(attrs, options) {}
        /**
     * @param {object} attrs
     * @param {object} [options]
     * @returns {string} The validation error message
     */ validate(attrs, options) {
            return '';
        }
        /**
     * Return a copy of the model's `attributes` object.
     */ toJSON() {
            return clone(this.attributes);
        }
        /**
     * Override this if you need custom syncing semantics for *this* particular model.
     * @param {'create'|'update'|'patch'|'delete'|'read'} method
     * @param {Model} model
     * @param {Options} options
     */ // eslint-disable-next-line class-methods-use-this
        sync(method, model, options) {
            return getSyncMethod(model)(method, model, options);
        }
        /**
     * Get the value of an attribute.
     * @param {string} attr
     */ get(attr) {
            return this.attributes[attr];
        }
        keys() {
            return Object.keys(this.attributes);
        }
        values() {
            return Object.values(this.attributes);
        }
        pairs() {
            return this.entries();
        }
        entries() {
            return Object.entries(this.attributes);
        }
        invert() {
            return invert(this.attributes);
        }
        pick(...args) {
            if (args.length === 1 && Array.isArray(args[0])) {
                args = args[0];
            }
            return pick(this.attributes, args);
        }
        omit(...args) {
            if (args.length === 1 && Array.isArray(args[0])) {
                args = args[0];
            }
            return omit(this.attributes, args);
        }
        isEmpty() {
            return isEmpty(this.attributes);
        }
        /**
     * Returns `true` if the attribute contains a value that is not null
     * or undefined.
     * @param {string} attr
     */ has(attr) {
            return this.get(attr) != null;
        }
        /**
     * Special-cased proxy to lodash's `matches` method.
     * @param {Attributes} attrs
     */ matches(attrs) {
            return !!iteratee(attrs)(this.attributes);
        }
        /**
     * Set a hash of model attributes on the object, firing `"change"`. This is
     * the core primitive operation of a model, updating the data and notifying
     * anyone who needs to know about the change in state. The heart of the beast.
     * @param {string|Object} key
     * @param {string|Object} [val]
     * @param {Options} [options]
     */ set(key, val, options) {
            if (key == null) return this;
            // Handle both `"key", value` and `{key: value}` -style arguments.
            let attrs;
            if (typeof key === 'object') {
                attrs = key;
                options = val;
            } else {
                (attrs = {})[key] = val;
            }
            options || (options = {});
            // Run validation.
            if (!this._validate(attrs, options)) return false;
            // Extract attributes and options.
            const unset = options.unset;
            const silent = options.silent;
            const changes = [];
            const changing = this._changing;
            this._changing = true;
            if (!changing) {
                this._previousAttributes = clone(this.attributes);
                this.changed = {};
            }
            const current = this.attributes;
            const changed = this.changed;
            const prev = this._previousAttributes;
            // For each `set` attribute, update or delete the current value.
            for(const attr in attrs){
                val = attrs[attr];
                if (!isEqual(current[attr], val)) changes.push(attr);
                if (!isEqual(prev[attr], val)) {
                    changed[attr] = val;
                } else {
                    delete changed[attr];
                }
                unset ? delete current[attr] : current[attr] = val;
            }
            // Update the `id`.
            if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);
            // Trigger all relevant attribute changes.
            if (!silent) {
                if (changes.length) this._pending = options;
                for(let i = 0; i < changes.length; i++){
                    this.trigger('change:' + changes[i], this, current[changes[i]], options);
                }
            }
            // You might be wondering why there's a `while` loop here. Changes can
            // be recursively nested within `"change"` events.
            if (changing) return this;
            if (!silent) {
                while(this._pending){
                    options = /** @type {Options} */ this._pending;
                    this._pending = false;
                    this.trigger('change', this, options);
                }
            }
            this._pending = false;
            this._changing = false;
            return this;
        }
        /**
     * Remove an attribute from the model, firing `"change"`. `unset` is a noop
     * if the attribute doesn't exist.
     * @param {string} attr
     * @param {Options} [options]
     */ unset(attr, options) {
            return this.set(attr, undefined, Object.assign({}, options, {
                unset: true
            }));
        }
        /**
     * Clear all attributes on the model, firing `"change"`.
     * @param {Options} options
     */ clear(options) {
            const attrs = {};
            for(const key in this.attributes)attrs[key] = undefined;
            return this.set(attrs, Object.assign({}, options, {
                unset: true
            }));
        }
        /**
     * Determine if the model has changed since the last `"change"` event.
     * If you specify an attribute name, determine if that attribute has changed.
     * @param {string} [attr]
     */ hasChanged(attr) {
            if (attr == null) return !isEmpty(this.changed);
            return has(this.changed, attr);
        }
        /**
     * Return an object containing all the attributes that have changed, or
     * false if there are no changed attributes. Useful for determining what
     * parts of a view need to be updated and/or what attributes need to be
     * persisted to the server. Unset attributes will be set to undefined.
     * You can also pass an attributes object to diff against the model,
     * determining if there *would be* a change.
     * @param {Object} diff
     */ changedAttributes(diff) {
            if (!diff) {
                return this.hasChanged() ? clone(this.changed) : false;
            }
            const old = this._changing ? this._previousAttributes : this.attributes;
            const changed = {};
            let hasChanged;
            for(const attr in diff){
                const val = diff[attr];
                if (isEqual(old[attr], val)) continue;
                changed[attr] = val;
                hasChanged = true;
            }
            return hasChanged ? changed : false;
        }
        /**
     * Get the previous value of an attribute, recorded at the time the last
     * `"change"` event was fired.
     * @param {string} [attr]
     */ previous(attr) {
            if (attr == null || !this._previousAttributes) return null;
            return this._previousAttributes[attr];
        }
        /**
     * Get all of the attributes of the model at the time of the previous
     * `"change"` event.
     */ previousAttributes() {
            return clone(this._previousAttributes);
        }
        /**
     * Fetch the model from the server, merging the response with the model's
     * local attributes. Any changed attributes will trigger a "change" event.
     * @param {Options} [options={}]
     */ fetch(options = {}) {
            options = Object.assign({
                parse: true
            }, options);
            const success = options.success;
            options.success = (resp)=>{
                const serverAttrs = options.parse ? this.parse(resp, options) : resp;
                if (!this.set(serverAttrs, options)) return false;
                if (success) success.call(options.context, this, resp, options);
                this.trigger('sync', this, resp, options);
            };
            wrapError(this, options);
            return this.sync('read', this, options);
        }
        /**
     * Set a hash of model attributes, and sync the model to the server.
     * If the server returns an attributes hash that differs, the model's
     * state will be `set` again.
     * @param {string|Attributes} [key]
     * @param {boolean|number|string|Options} [val]
     * @param {Options} [options]
     */ save(key, val, options) {
            // Handle both `"key", value` and `{key: value}` -style arguments.
            let attrs;
            if (key == null || typeof key === 'object') {
                attrs = key;
                options = /** @type {Options} */ val;
            } else {
                (attrs = {})[key] = val;
            }
            options = Object.assign({
                validate: true,
                parse: true
            }, options);
            const wait = options.wait;
            const return_promise = options.promise;
            const promise = return_promise && getResolveablePromise();
            // If we're not waiting and attributes exist, save acts as
            // `set(attr).save(null, opts)` with validation. Otherwise, check if
            // the model will be valid when the attributes, if any, are set.
            if (attrs && !wait) {
                if (!this.set(attrs, options)) return false;
            } else if (!this._validate(/** @type {Object} */ attrs, options)) {
                return false;
            }
            // After a successful server-side save, the client is (optionally)
            // updated with the server-side state.
            const success = options.success;
            const error = options.error;
            const attributes = this.attributes;
            options.success = (resp)=>{
                // Ensure attributes are restored during synchronous saves.
                this.attributes = attributes;
                let serverAttrs = options.parse ? this.parse(resp, options) : resp;
                if (wait) serverAttrs = Object.assign({}, attrs, serverAttrs);
                if (serverAttrs && !this.set(serverAttrs, options)) return false;
                if (success) success.call(options.context, this, resp, options);
                this.trigger('sync', this, resp, options);
                return_promise && promise.resolve();
            };
            options.error = (model, e, options)=>{
                error && error.call(options.context, model, e, options);
                return_promise && promise.reject(e);
            };
            wrapError(this, options);
            // Set temporary attributes if `{wait: true}` to properly find new ids.
            if (attrs && wait) this.attributes = Object.assign({}, attributes, attrs);
            const method = this.isNew() ? 'create' : options.patch ? 'patch' : 'update';
            if (method === 'patch' && !options.attrs) options.attrs = attrs;
            const xhr = this.sync(method, this, options);
            // Restore attributes.
            this.attributes = attributes;
            if (return_promise) {
                return promise;
            } else {
                return xhr;
            }
        }
        /**
     * Destroy this model on the server if it was already persisted.
     * Optimistically removes the model from its collection, if it has one.
     * If `wait: true` is passed, waits for the server to respond before removal.
     * @param {Options} [options]
     */ destroy(options) {
            options = options ? clone(options) : {};
            const success = options.success;
            const wait = options.wait;
            const destroy = ()=>{
                this.stopListening();
                this.trigger('destroy', this, this.collection, options);
            };
            options.success = (resp)=>{
                if (wait) destroy();
                if (success) success.call(options.context, this, resp, options);
                if (!this.isNew()) this.trigger('sync', this, resp, options);
            };
            let xhr = false;
            if (this.isNew()) {
                defer(options.success);
            } else {
                wrapError(this, options);
                xhr = this.sync('delete', this, options);
            }
            if (!wait) destroy();
            return xhr;
        }
        /**
     * Default URL for the model's representation on the server -- if you're
     * using Backbone's restful methods, override this to change the endpoint
     * that will be called.
     */ url() {
            const base = result(this, 'urlRoot') || result(this.collection, 'url') || urlError();
            if (this.isNew()) return base;
            const id = this.get(this.idAttribute);
            return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id);
        }
        /**
     * **parse** converts a response into the hash of attributes to be `set` on
     * the model. The default implementation is just to pass the response along.
     * @param {Options} resp
     * @param {Options} [options]
     */ parse(resp, options) {
            return resp;
        }
        /**
     * A model is new if it has never been saved to the server, and lacks an id.
     */ isNew() {
            return !this.has(this.idAttribute);
        }
        /**
     * Check if the model is currently in a valid state.
     * @param {Options} [options]
     */ isValid(options) {
            return this._validate({}, Object.assign({}, options, {
                validate: true
            }));
        }
        /**
     * Run validation against the next complete set of model attributes,
     * returning `true` if all is well. Otherwise, fire an `"invalid"` event.
     * @param {Attributes} attrs
     * @param {Options} [options]
     */ _validate(attrs, options) {
            if (!options.validate || !this.validate) return true;
            attrs = Object.assign({}, this.attributes, attrs);
            const error = this.validationError = this.validate(attrs, options) || null;
            if (!error) return true;
            this.trigger('invalid', this, error, Object.assign(options, {
                validationError: error
            }));
            return false;
        }
        /**
     * Create a new model with the specified attributes. A client id (`cid`)
     * is automatically generated and assigned for you.
     * @param {Attributes} [attributes]
     * @param {ModelOptions} [options]
     */ constructor(attributes, options){
            super();
            let attrs = attributes || {};
            options || (options = {});
            this.preinitialize.apply(this, arguments);
            this.cid = uniqueId(this.cidPrefix);
            this.attributes = {};
            // The value returned during the last failed validation.
            this.validationError = null;
            if (options.collection) this.collection = options.collection;
            if (options.parse) attrs = this.parse(attrs, options) || {};
            const default_attrs = result(this, 'defaults');
            attrs = defaults(Object.assign({}, default_attrs, attrs), default_attrs);
            this.set(attrs, options);
            this.initialize.apply(this, arguments);
            // A hash of attributes whose current and previous value differ.
            this.changed = {};
        }
    }
    /**
   * A specialized version of `baseAggregator` for arrays.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} setter The function to set `accumulator` values.
   * @param {Function} iteratee The iteratee to transform keys.
   * @param {Object} accumulator The initial aggregated object.
   * @returns {Function} Returns `accumulator`.
   */ function arrayAggregator(array, setter, iteratee, accumulator) {
        var index = -1, length = array == null ? 0 : array.length;
        while(++index < length){
            var value = array[index];
            setter(accumulator, value, iteratee(value), array);
        }
        return accumulator;
    }
    /**
   * Creates a `baseEach` or `baseEachRight` function.
   *
   * @private
   * @param {Function} eachFunc The function to iterate over a collection.
   * @param {boolean} [fromRight] Specify iterating from right to left.
   * @returns {Function} Returns the new base function.
   */ function createBaseEach(eachFunc, fromRight) {
        return function(collection, iteratee) {
            if (collection == null) {
                return collection;
            }
            if (!isArrayLike(collection)) {
                return eachFunc(collection, iteratee);
            }
            var length = collection.length, index = -1, iterable = Object(collection);
            while(++index < length){
                if (iteratee(iterable[index], index, iterable) === false) {
                    break;
                }
            }
            return collection;
        };
    }
    /**
   * The base implementation of `_.forEach` without support for iteratee shorthands.
   *
   * @private
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array|Object} Returns `collection`.
   */ var baseEach = createBaseEach(baseForOwn);
    /**
   * Aggregates elements of `collection` on `accumulator` with keys transformed
   * by `iteratee` and values set by `setter`.
   *
   * @private
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} setter The function to set `accumulator` values.
   * @param {Function} iteratee The iteratee to transform keys.
   * @param {Object} accumulator The initial aggregated object.
   * @returns {Function} Returns `accumulator`.
   */ function baseAggregator(collection, setter, iteratee, accumulator) {
        baseEach(collection, function(value, key, collection) {
            setter(accumulator, value, iteratee(value), collection);
        });
        return accumulator;
    }
    /**
   * Creates a function like `_.groupBy`.
   *
   * @private
   * @param {Function} setter The function to set accumulator values.
   * @param {Function} [initializer] The accumulator object initializer.
   * @returns {Function} Returns the new aggregator function.
   */ function createAggregator(setter, initializer) {
        return function(collection, iteratee) {
            var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = {};
            return func(collection, setter, baseIteratee(iteratee), accumulator);
        };
    }
    /** Used for built-in method references. */ var objectProto$1 = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
    /**
   * Creates an object composed of keys generated from the results of running
   * each element of `collection` thru `iteratee`. The corresponding value of
   * each key is the number of times the key was returned by `iteratee`. The
   * iteratee is invoked with one argument: (value).
   *
   * @static
   * @memberOf _
   * @since 0.5.0
   * @category Collection
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
   * @returns {Object} Returns the composed aggregate object.
   * @example
   *
   * _.countBy([6.1, 4.2, 6.3], Math.floor);
   * // => { '4': 1, '6': 2 }
   *
   * // The `_.property` iteratee shorthand.
   * _.countBy(['one', 'two', 'three'], 'length');
   * // => { '3': 2, '5': 1 }
   */ var countBy = createAggregator(function(result, value, key) {
        if (hasOwnProperty$1.call(result, key)) {
            ++result[key];
        } else {
            baseAssignValue(result, key, 1);
        }
    });
    /** Used for built-in method references. */ var objectProto = Object.prototype;
    /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty;
    /**
   * Creates an object composed of keys generated from the results of running
   * each element of `collection` thru `iteratee`. The order of grouped values
   * is determined by the order they occur in `collection`. The corresponding
   * value of each key is an array of elements responsible for generating the
   * key. The iteratee is invoked with one argument: (value).
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Collection
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
   * @returns {Object} Returns the composed aggregate object.
   * @example
   *
   * _.groupBy([6.1, 4.2, 6.3], Math.floor);
   * // => { '4': [4.2], '6': [6.1, 6.3] }
   *
   * // The `_.property` iteratee shorthand.
   * _.groupBy(['one', 'two', 'three'], 'length');
   * // => { '3': ['one', 'two'], '5': ['three'] }
   */ var groupBy = createAggregator(function(result, value, key) {
        if (hasOwnProperty.call(result, key)) {
            result[key].push(value);
        } else {
            baseAssignValue(result, key, [
                value
            ]);
        }
    });
    /**
   * Creates an object composed of keys generated from the results of running
   * each element of `collection` thru `iteratee`. The corresponding value of
   * each key is the last element responsible for generating the key. The
   * iteratee is invoked with one argument: (value).
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Collection
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
   * @returns {Object} Returns the composed aggregate object.
   * @example
   *
   * var array = [
   *   { 'dir': 'left', 'code': 97 },
   *   { 'dir': 'right', 'code': 100 }
   * ];
   *
   * _.keyBy(array, function(o) {
   *   return String.fromCharCode(o.code);
   * });
   * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
   *
   * _.keyBy(array, 'dir');
   * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
   */ var keyBy = createAggregator(function(result, value, key) {
        baseAssignValue(result, key, value);
    });
    /**
   * The base implementation of `_.map` without support for iteratee shorthands.
   *
   * @private
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns the new mapped array.
   */ function baseMap(collection, iteratee) {
        var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
        baseEach(collection, function(value, key, collection) {
            result[++index] = iteratee(value, key, collection);
        });
        return result;
    }
    /**
   * The base implementation of `_.sortBy` which uses `comparer` to define the
   * sort order of `array` and replaces criteria objects with their corresponding
   * values.
   *
   * @private
   * @param {Array} array The array to sort.
   * @param {Function} comparer The function to define sort order.
   * @returns {Array} Returns `array`.
   */ function baseSortBy(array, comparer) {
        var length = array.length;
        array.sort(comparer);
        while(length--){
            array[length] = array[length].value;
        }
        return array;
    }
    /**
   * Compares values to sort them in ascending order.
   *
   * @private
   * @param {*} value The value to compare.
   * @param {*} other The other value to compare.
   * @returns {number} Returns the sort order indicator for `value`.
   */ function compareAscending(value, other) {
        if (value !== other) {
            var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
            var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
            if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
                return 1;
            }
            if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
                return -1;
            }
        }
        return 0;
    }
    /**
   * Used by `_.orderBy` to compare multiple properties of a value to another
   * and stable sort them.
   *
   * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
   * specify an order of "desc" for descending or "asc" for ascending sort order
   * of corresponding values.
   *
   * @private
   * @param {Object} object The object to compare.
   * @param {Object} other The other object to compare.
   * @param {boolean[]|string[]} orders The order to sort by for each property.
   * @returns {number} Returns the sort order indicator for `object`.
   */ function compareMultiple(object, other, orders) {
        var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
        while(++index < length){
            var result = compareAscending(objCriteria[index], othCriteria[index]);
            if (result) {
                if (index >= ordersLength) {
                    return result;
                }
                var order = orders[index];
                return result * (order == 'desc' ? -1 : 1);
            }
        }
        // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
        // that causes it, under certain circumstances, to provide the same value for
        // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
        // for more details.
        //
        // This also ensures a stable sort in V8 and other engines.
        // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
        return object.index - other.index;
    }
    /**
   * The base implementation of `_.orderBy` without param guards.
   *
   * @private
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
   * @param {string[]} orders The sort orders of `iteratees`.
   * @returns {Array} Returns the new sorted array.
   */ function baseOrderBy(collection, iteratees, orders) {
        if (iteratees.length) {
            iteratees = arrayMap(iteratees, function(iteratee) {
                if (isArray(iteratee)) {
                    return function(value) {
                        return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
                    };
                }
                return iteratee;
            });
        } else {
            iteratees = [
                identity
            ];
        }
        var index = -1;
        iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
        var result = baseMap(collection, function(value, key, collection) {
            var criteria = arrayMap(iteratees, function(iteratee) {
                return iteratee(value);
            });
            return {
                'criteria': criteria,
                'index': ++index,
                'value': value
            };
        });
        return baseSortBy(result, function(object, other) {
            return compareMultiple(object, other, orders);
        });
    }
    /**
   * Creates an array of elements, sorted in ascending order by the results of
   * running each element in a collection thru each iteratee. This method
   * performs a stable sort, that is, it preserves the original sort order of
   * equal elements. The iteratees are invoked with one argument: (value).
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Collection
   * @param {Array|Object} collection The collection to iterate over.
   * @param {...(Function|Function[])} [iteratees=[_.identity]]
   *  The iteratees to sort by.
   * @returns {Array} Returns the new sorted array.
   * @example
   *
   * var users = [
   *   { 'user': 'fred',   'age': 48 },
   *   { 'user': 'barney', 'age': 36 },
   *   { 'user': 'fred',   'age': 30 },
   *   { 'user': 'barney', 'age': 34 }
   * ];
   *
   * _.sortBy(users, [function(o) { return o.user; }]);
   * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
   *
   * _.sortBy(users, ['user', 'age']);
   * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
   */ var sortBy = baseRest(function(collection, iteratees) {
        if (collection == null) {
            return [];
        }
        var length = iteratees.length;
        if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
            iteratees = [];
        } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
            iteratees = [
                iteratees[0]
            ];
        }
        return baseOrderBy(collection, baseFlatten(iteratees), []);
    });
    const slice = Array.prototype.slice;
    // Default options for `Collection#set`.
    const setOptions = {
        add: true,
        remove: true,
        merge: true
    };
    const addOptions = {
        add: true,
        remove: false
    };
    /**
   * @typedef {Record.<string, any>} Options
   * @typedef {Record.<string, any>} Attributes
   *
   * @typedef {import('./storage.js').default} Storage
   *
   * @typedef {Record.<string, any>} CollectionOptions
   * @property {Model} [model]
   * @property {Function} [comparator]
   */ /**
   * If models tend to represent a single row of data, a Collection is
   * more analogous to a table full of data ... or a small slice or page of that
   * table, or a collection of rows that belong together for a particular reason
   * -- all of the messages in this particular folder, all of the documents
   * belonging to this particular author, and so on. Collections maintain
   * indexes of their models, both in order, and for lookup by `id`.
   */ class Collection extends EventEmitter(Object) {
        /**
     * @param {Storage} storage
     */ set browserStorage(storage) {
            this._browserStorage = storage;
        }
        /**
     * @returns {Storage} storage
     */ get browserStorage() {
            return this._browserStorage;
        }
        /**
     * The default model for a collection is just a **Model**.
     * This should be overridden in most cases.
     * @returns {typeof Model}
     */ get model() {
            var _this$_model;
            return (_this$_model = this._model) !== null && _this$_model !== void 0 ? _this$_model : Model;
        }
        /**
     * @param {Model} model
     */ set model(model) {
            this._model = model;
        }
        get length() {
            return this.models.length;
        }
        /**
     * preinitialize is an empty function by default. You can override it with a function
     * or object.  preinitialize will run before any instantiation logic is run in the Collection.
     */ preinitialize() {}
        /**
     * Initialize is an empty function by default. Override it with your own
     * initialization logic.
     */ initialize() {}
        /**
     * The JSON representation of a Collection is an array of the
     * models' attributes.
     *@param {Options} options
     */ toJSON(options) {
            return this.map(function(model) {
                return model.toJSON(options);
            });
        }
        /**
     *@param {string} method
     *@param {Model|Collection} model
     *@param {Options} options
     */ sync(method, model, options) {
            return getSyncMethod(this)(method, model, options);
        }
        /**
     * Add a model, or list of models to the set. `models` may be
     * Models or raw JavaScript objects to be converted to Models, or any
     * combination of the two.
     *@param {Model[]|Model|Attributes|Attributes[]} models
     *@param {Options} options
     */ add(models, options) {
            return this.set(models, Object.assign({
                merge: false
            }, options, addOptions));
        }
        /**
     * Remove a model, or a list of models from the set.
     * @param {Model|Model[]} models
     * @param {Options} options
     */ remove(models, options) {
            options = Object.assign({}, options);
            const singular = !Array.isArray(models);
            const modelsArray = singular ? [
                models
            ] : /** @type {Model[]} */ models.slice();
            const removed = this._removeModels(modelsArray, options);
            if (!options.silent && removed.length) {
                options.changes = {
                    added: [],
                    merged: [],
                    removed: removed
                };
                this.trigger('update', this, options);
            }
            return singular ? removed[0] : removed;
        }
        /**
     * Update a collection by `set`-ing a new list of models, adding new ones,
     * removing models that are no longer present, and merging models that
     * already exist in the collection, as necessary. Similar to **Model#set**,
     * the core operation for updating the data contained by the collection.
     *@param {Model[]|Model|Attributes|Attributes[]} models
     * @param {Options} options
     */ set(models, options) {
            if (models == null) return;
            options = Object.assign({}, setOptions, options);
            if (options.parse && !this._isModel(models)) {
                models = this.parse(models, options) || [];
            }
            const singular = !Array.isArray(models);
            models = singular ? [
                /** @type {Model} */ models
            ] : /** @type {Model[]} */ models.slice();
            let at = options.at;
            if (at != null) at = +at;
            if (at > this.length) at = this.length;
            if (at < 0) at += this.length + 1;
            const set = [];
            const toAdd = [];
            const toMerge = [];
            const toRemove = [];
            const modelMap = {};
            const add = options.add;
            const merge = options.merge;
            const remove = options.remove;
            let sort = false;
            const sortable = this.comparator && at == null && options.sort !== false;
            const sortAttr = isString(this.comparator) ? this.comparator : null;
            // Turn bare objects into model references, and prevent invalid models
            // from being added.
            let model, i;
            for(i = 0; i < models.length; i++){
                model = models[i];
                // If a duplicate is found, prevent it from being added and
                // optionally merge it into the existing model.
                const existing = this.get(model);
                if (existing) {
                    if (merge && model !== existing) {
                        let attrs = this._isModel(model) ? model.attributes : model;
                        if (options.parse) attrs = existing.parse(attrs, options);
                        existing.set(attrs, options);
                        toMerge.push(existing);
                        if (sortable && !sort) sort = existing.hasChanged(sortAttr);
                    }
                    if (!modelMap[existing.cid]) {
                        modelMap[existing.cid] = true;
                        set.push(existing);
                    }
                    models[i] = existing;
                // If this is a new, valid model, push it to the `toAdd` list.
                } else if (add) {
                    model = models[i] = this._prepareModel(model, options);
                    if (model) {
                        toAdd.push(model);
                        this._addReference(model, options);
                        modelMap[model.cid] = true;
                        set.push(model);
                    }
                }
            }
            // Remove stale models.
            if (remove) {
                for(i = 0; i < this.length; i++){
                    model = this.models[i];
                    if (!modelMap[model.cid]) toRemove.push(model);
                }
                if (toRemove.length) this._removeModels(toRemove, options);
            }
            // See if sorting is needed, update `length` and splice in new models.
            let orderChanged = false;
            const replace = !sortable && add && remove;
            if (set.length && replace) {
                orderChanged = this.length !== set.length || this.models.some((m, idx)=>m !== set[idx]);
                this.models.length = 0;
                this.models.splice(0, 0, ...set);
            } else if (toAdd.length) {
                if (sortable) sort = true;
                let idx = at == null ? this.length : at;
                idx = Math.min(Math.max(idx, 0), this.models.length);
                this.models.splice(idx, 0, ...toAdd);
            }
            // Silently sort the collection if appropriate.
            if (sort) this.sort({
                silent: true
            });
            // Unless silenced, it's time to fire all appropriate add/sort/update events.
            if (!options.silent) {
                for(i = 0; i < toAdd.length; i++){
                    if (at != null) options.index = at + i;
                    model = toAdd[i];
                    model.trigger('add', model, this, options);
                }
                if (sort || orderChanged) this.trigger('sort', this, options);
                if (toAdd.length || toRemove.length || toMerge.length) {
                    options.changes = {
                        added: toAdd,
                        removed: toRemove,
                        merged: toMerge
                    };
                    this.trigger('update', this, options);
                }
            }
            // Return the added (or merged) model (or models).
            return singular ? models[0] : models;
        }
        clearStore() {
            return _async_to_generator(function*(options = {}, filter = (o)=>o) {
                yield Promise.all(this.models.filter(filter).map((m)=>{
                    return new Promise((resolve)=>{
                        m.destroy(Object.assign(options, {
                            'success': resolve,
                            'error': (m, e)=>{
                                console.error(e);
                                resolve();
                            }
                        }));
                    });
                }));
                yield this.browserStorage.clear();
                this.reset();
            }).apply(this, arguments);
        }
        /**
     * When you have more items than you want to add or remove individually,
     * you can reset the entire set with a new list of models, without firing
     * any granular `add` or `remove` events. Fires `reset` when finished.
     * Useful for bulk operations and optimizations.
     * @param {Model|Model[]} [models]
     * @param {Options} [options]
     */ reset(models, options) {
            options = options ? clone(options) : {};
            for(let i = 0; i < this.models.length; i++){
                this._removeReference(this.models[i], options);
            }
            options.previousModels = this.models;
            this._reset();
            models = this.add(models, Object.assign({
                silent: true
            }, options));
            if (!options.silent) this.trigger('reset', this, options);
            return models;
        }
        /**
     * Add a model to the end of the collection.
     * @param {Model} model
     * @param {Options} [options]
     */ push(model, options) {
            return this.add(model, Object.assign({
                at: this.length
            }, options));
        }
        /**
     * Remove a model from the end of the collection.
     * @param {Options} [options]
     */ pop(options) {
            const model = this.at(this.length - 1);
            return this.remove(model, options);
        }
        /**
     * Add a model to the beginning of the collection.
     * @param {Model} model
     * @param {Options} [options]
     */ unshift(model, options) {
            return this.add(model, Object.assign({
                at: 0
            }, options));
        }
        /**
     * Remove a model from the beginning of the collection.
     * @param {Options} [options]
     */ shift(options) {
            const model = this.at(0);
            return this.remove(model, options);
        }
        /** Slice out a sub-array of models from the collection. */ slice() {
            return slice.apply(this.models, arguments);
        }
        /**
     * @param {Function|Object} callback
     * @param {any} thisArg
     */ filter(callback, thisArg) {
            return this.models.filter(isFunction(callback) ? callback : (m)=>m.matches(callback), thisArg);
        }
        /**
     * @param {Function} pred
     */ every(pred) {
            if (isFunction(pred)) {
                return this.models.map((m)=>m.attributes).every(pred);
            } else {
                return this.models.every((m)=>m.matches(pred));
            }
        }
        /**
     * @param {Model[]} values
     */ difference(values) {
            return this.models.filter((m)=>!values.includes(m));
        }
        max() {
            return Math.max.apply(Math, this.models);
        }
        min() {
            return Math.min.apply(Math, this.models);
        }
        drop(n = 1) {
            return this.models.slice(n);
        }
        /**
     * @param {Function|Object} pred
     */ some(pred) {
            if (isFunction(pred)) {
                return this.models.map((m)=>m.attributes).some(pred);
            } else {
                return this.models.some((m)=>m.matches(pred));
            }
        }
        sortBy(iteratee) {
            return sortBy(this.models, isFunction(iteratee) ? iteratee : (m)=>isString(iteratee) ? m.get(iteratee) : m.matches(iteratee));
        }
        isEmpty() {
            return !this.models.length;
        }
        keyBy(iteratee) {
            return keyBy(this.models, iteratee);
        }
        each(callback, thisArg) {
            return this.forEach(callback, thisArg);
        }
        forEach(callback, thisArg) {
            return this.models.forEach(callback, thisArg);
        }
        includes(item) {
            return this.models.includes(item);
        }
        size() {
            return this.models.length;
        }
        countBy(f) {
            return countBy(this.models, isFunction(f) ? f : (m)=>isString(f) ? m.get(f) : m.matches(f));
        }
        groupBy(pred) {
            return groupBy(this.models, isFunction(pred) ? pred : (m)=>isString(pred) ? m.get(pred) : m.matches(pred));
        }
        /**
     * @param {number} fromIndex
     */ indexOf(fromIndex) {
            return this.models.indexOf(fromIndex);
        }
        /**
     * @param {Function|string|RegExp} pred
     * @param {number} fromIndex
     */ findLastIndex(pred, fromIndex) {
            return this.models.findLastIndex(isFunction(pred) ? pred : (m)=>isString(pred) ? m.get(pred) : m.matches(pred), fromIndex);
        }
        /**
     * @param {number} fromIndex
     */ lastIndexOf(fromIndex) {
            return this.models.lastIndexOf(fromIndex);
        }
        /**
     * @param {Function|string|RegExp} pred
     */ findIndex(pred) {
            return this.models.findIndex(isFunction(pred) ? pred : (m)=>isString(pred) ? m.get(pred) : m.matches(pred));
        }
        last() {
            const length = this.models == null ? 0 : this.models.length;
            return length ? this.models[length - 1] : undefined;
        }
        head() {
            return this.models[0];
        }
        first() {
            return this.head();
        }
        map(cb, thisArg) {
            return this.models.map(isFunction(cb) ? cb : (m)=>isString(cb) ? m.get(cb) : m.matches(cb), thisArg);
        }
        reduce(callback, initialValue) {
            return this.models.reduce(callback, initialValue || this.models[0]);
        }
        reduceRight(callback, initialValue) {
            return this.models.reduceRight(callback, initialValue || this.models[0]);
        }
        toArray() {
            return Array.from(this.models);
        }
        /**
     * Get a model from the set by id, cid, model object with id or cid
     * properties, or an attributes object that is transformed through modelId.
     * @param {string|number|Object|Model} obj
     */ get(obj) {
            if (obj == null) return undefined;
            return this._byId[obj] || this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj)] || obj.cid && this._byId[obj.cid];
        }
        /**
     * Returns `true` if the model is in the collection.
     * @param {string|number|Object|Model} obj
     */ has(obj) {
            return this.get(obj) != null;
        }
        /**
     * Get the model at the given index.
     * @param {number} index
     */ at(index) {
            if (index < 0) index += this.length;
            return this.models[index];
        }
        /**
     * Return models with matching attributes. Useful for simple cases of
     * `filter`.
     * @param {Attributes} attrs
     * @param {boolean} [first]
     */ where(attrs, first) {
            return this[first ? 'find' : 'filter'](attrs);
        }
        /**
     * Return the first model with matching attributes. Useful for simple cases
     * of `find`.
     * @param {Attributes} attrs
     */ findWhere(attrs) {
            return this.where(attrs, true);
        }
        /**
     * @param {Attributes} predicate
     * @param {number} [fromIndex]
     */ find(predicate, fromIndex) {
            const pred = isFunction(predicate) ? predicate : (m)=>m.matches(predicate);
            return this.models.find(pred, fromIndex);
        }
        /**
     * Force the collection to re-sort itself. You don't need to call this under
     * normal circumstances, as the set will maintain sort order as each item
     * is added.
     * @param {Options} [options]
     */ sort(options) {
            let comparator = this.comparator;
            if (!comparator) throw new Error('Cannot sort a set without a comparator');
            options || (options = {});
            const length = comparator.length;
            if (isFunction(comparator)) comparator = comparator.bind(this);
            // Run sort based on type of `comparator`.
            if (length === 1 || isString(comparator)) {
                this.models = this.sortBy(comparator);
            } else {
                this.models.sort(comparator);
            }
            if (!options.silent) this.trigger('sort', this, options);
            return this;
        }
        /**
     * Pluck an attribute from each model in the collection.
     * @param {string} attr
     */ pluck(attr) {
            return this.map(attr + '');
        }
        /**
     * Fetch the default set of models for this collection, resetting the
     * collection when they arrive. If `reset: true` is passed, the response
     * data will be passed through the `reset` method instead of `set`.
     * @param {Options} options
     */ fetch(options) {
            options = Object.assign({
                parse: true
            }, options);
            const success = options.success;
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const collection = this;
            const promise = options.promise && getResolveablePromise();
            options.success = function(resp) {
                const method = options.reset ? 'reset' : 'set';
                collection[method](resp, options);
                if (success) success.call(options.context, collection, resp, options);
                promise && promise.resolve();
                collection.trigger('sync', collection, resp, options);
            };
            wrapError(this, options);
            return promise ? promise : this.sync('read', this, options);
        }
        /**
     * Create a new instance of a model in this collection. Add the model to the
     * collection immediately, unless `wait: true` is passed, in which case we
     * wait for the server to agree.
     * @param {Model|Attributes} model
     * @param {Options} [options]
     */ create(model, options) {
            options = options ? clone(options) : {};
            const wait = options.wait;
            const return_promise = options.promise;
            const promise = return_promise && getResolveablePromise();
            model = this._prepareModel(model, options);
            if (!model) return false;
            if (!wait) this.add(model, options);
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const collection = this;
            const success = options.success;
            const error = options.error;
            options.success = function(m, resp, callbackOpts) {
                if (wait) {
                    collection.add(m, callbackOpts);
                }
                if (success) {
                    success.call(callbackOpts.context, m, resp, callbackOpts);
                }
                if (return_promise) {
                    promise.resolve(m);
                }
            };
            options.error = function(model, e, options) {
                error && error.call(options.context, model, e, options);
                return_promise && promise.reject(e);
            };
            model.save(null, Object.assign(options, {
                'promise': false
            }));
            if (return_promise) {
                return promise;
            } else {
                return model;
            }
        }
        /**
     * **parse** converts a response into a list of models to be added to the
     * collection. The default implementation is just to pass it through.
     * @param {Object} resp
     * @param {Options} [options]
     */ parse(resp, options) {
            return resp;
        }
        /**
     * Define how to uniquely identify models in the collection.
     * @param {Attributes} attrs
     */ modelId(attrs) {
            var _this$model$prototype;
            return attrs[((_this$model$prototype = this.model.prototype) === null || _this$model$prototype === void 0 ? void 0 : _this$model$prototype.idAttribute) || 'id'];
        }
        /** Get an iterator of all models in this collection. */ values() {
            return new CollectionIterator(this, ITERATOR_VALUES);
        }
        /** Get an iterator of all model IDs in this collection. */ keys() {
            return new CollectionIterator(this, ITERATOR_KEYS);
        }
        /** Get an iterator of all [ID, model] tuples in this collection. */ entries() {
            return new CollectionIterator(this, ITERATOR_KEYSVALUES);
        }
        /**
     * Private method to reset all internal state. Called when the collection
     * is first initialized or reset.
     */ _reset() {
            this.models = [];
            this._byId = {};
        }
        /**
     * @param {Attributes} attrs
     * @param {Options} [options]
     */ createModel(attrs, options) {
            const Klass = this.model;
            return new Klass(attrs, options);
        }
        /**
     * Prepare a hash of attributes (or other model) to be added to this
     * collection.
     * @param {Attributes|Model} attrs
     * @param {Options} [options]
     * @return {Model}
     */ _prepareModel(attrs, options) {
            if (this._isModel(attrs)) {
                if (!attrs.collection) attrs.collection = this;
                return /** @type {Model} */ attrs;
            }
            options = options ? clone(options) : {};
            options.collection = this;
            const model = this.createModel(attrs, options);
            if (!model.validationError) return model;
            this.trigger('invalid', this, model.validationError, options);
            return null;
        }
        /**
     * Internal method called by both remove and set.
     * @param {Model[]} models
     * @param {Options} [options]
     */ _removeModels(models, options) {
            const removed = [];
            for(let i = 0; i < models.length; i++){
                const model = this.get(models[i]);
                if (!model) continue;
                const index = this.indexOf(model);
                this.models.splice(index, 1);
                // Remove references before triggering 'remove' event to prevent an
                // infinite loop. #3693
                delete this._byId[model.cid];
                const id = this.modelId(model.attributes);
                if (id != null) delete this._byId[id];
                if (!options.silent) {
                    options.index = index;
                    model.trigger('remove', model, this, options);
                }
                removed.push(model);
                this._removeReference(model, options);
            }
            return removed;
        }
        /**
     * Method for checking whether an object should be considered a model for
     * the purposes of adding to the collection.
     * @param {any} model
     */ _isModel(model) {
            return model instanceof Model;
        }
        /**
     * Internal method to create a model's ties to a collection.
     * @param {Model} model
     * @param {Options} [options]
     */ _addReference(model, options) {
            this._byId[model.cid] = model;
            const id = this.modelId(model.attributes);
            if (id != null) this._byId[id] = model;
            model.on('all', this._onModelEvent, this);
        }
        /**
     * Internal method to sever a model's ties to a collection.
     * @private
     * @param {Model} model
     * @param {Options} [options]
     */ _removeReference(model, options) {
            delete this._byId[model.cid];
            const id = this.modelId(model.attributes);
            if (id != null) delete this._byId[id];
            if (this === model.collection) delete model.collection;
            model.off('all', this._onModelEvent, this);
        }
        /**
     * Internal method called every time a model in the set fires an event.
     * Sets need to update their indexes when models change ids. All other
     * events simply proxy through. "add" and "remove" events that originate
     * in other collections are ignored.
     * @private
     * @param {any} event
     * @param {Model} model
     * @param {Collection} collection
     * @param {Options} [options]
     */ _onModelEvent(event, model, collection, options) {
            if (model) {
                if ((event === 'add' || event === 'remove') && collection !== this) return;
                if (event === 'destroy') this.remove(model, options);
                if (event === 'change') {
                    const prevId = this.modelId(model.previousAttributes());
                    const id = this.modelId(model.attributes);
                    if (prevId !== id) {
                        if (prevId != null) delete this._byId[prevId];
                        if (id != null) this._byId[id] = model;
                    }
                }
            }
            this.trigger.apply(this, arguments);
        }
        /**
     * Create a new **Collection**, perhaps to contain a specific type of `model`.
     * If a `comparator` is specified, the Collection will maintain
     * its models in sort order, as they're added and removed.
     * @param {Model[]} [models]
     * @param {CollectionOptions} [options]
     */ constructor(models, options){
            super();
            options || (options = {});
            this.preinitialize.apply(this, arguments);
            if (options.model) this._model = options.model;
            if (options.comparator !== undefined) this.comparator = options.comparator;
            this._reset();
            this.initialize.apply(this, arguments);
            if (models) this.reset(models, Object.assign({
                silent: true
            }, options));
            this[Symbol.iterator] = this.values;
        }
    }
    // This "enum" defines the three possible kinds of values which can be emitted
    // by a CollectionIterator that correspond to the values(), keys() and entries()
    // methods on Collection, respectively.
    const ITERATOR_VALUES = 1;
    const ITERATOR_KEYS = 2;
    const ITERATOR_KEYSVALUES = 3;
    class CollectionIterator {
        next() {
            if (this._collection) {
                // Only continue iterating if the iterated collection is long enough.
                if (this._index < this._collection.length) {
                    const model = this._collection.at(this._index);
                    this._index++;
                    // Construct a value depending on what kind of values should be iterated.
                    let value;
                    if (this._kind === ITERATOR_VALUES) {
                        value = model;
                    } else {
                        const id = this._collection.modelId(model.attributes);
                        if (this._kind === ITERATOR_KEYS) {
                            value = id;
                        } else {
                            // ITERATOR_KEYSVALUES
                            value = [
                                id,
                                model
                            ];
                        }
                    }
                    return {
                        value: value,
                        done: false
                    };
                }
                // Once exhausted, remove the reference to the collection so future
                // calls to the next method always return done.
                this._collection = undefined;
            }
            return {
                value: undefined,
                done: true
            };
        }
        [Symbol.iterator]() {
            return this;
        }
        /**
     * A CollectionIterator implements JavaScript's Iterator protocol, allowing the
     * use of `for of` loops in modern browsers and interoperation between
     * Collection and other JavaScript functions and third-party libraries
     * which can operate on Iterables.
     * @param {Collection} collection
     * @param {Number} kind
     */ constructor(collection, kind){
            this._collection = collection;
            this._kind = kind;
            this._index = 0;
        }
    }
    /* global global */ const skeletor = {
        Collection,
        ElementView,
        EventEmitter,
        Model,
        sync
    };
    // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
    // We use `self` instead of `window` for `WebWorker` support.
    const root = typeof self == 'object' && self.self === self && self || typeof __webpack_require__.g == 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g;
    // Current version of the library. Keep in sync with `package.json`.
    skeletor.VERSION = '0.0.1';
    // Save the previous value of the `Skeletor` variable, so that it can be
    // restored later on, if `noConflict` is used.
    const previousSkeletor = root.Skeletor;
    // Runs Skeletor.js in *noConflict* mode, returning the `Skeletor` variable
    // to its previous owner. Returns a reference to this Skeletor object.
    skeletor.noConflict = function() {
        root.Skeletor = previousSkeletor;
        return this;
    };
    root.Skeletor = skeletor;
    exports1.Collection = Collection;
    exports1.ElementView = ElementView;
    exports1.EventEmitter = EventEmitter;
    exports1.Model = Model;
    exports1.Storage = Storage;
    exports1.default = skeletor;
    exports1.sync = sync;
    Object.defineProperty(exports1, '__esModule', {
        value: true
    });
}); //# sourceMappingURL=skeletor.js.map


/***/ }),

/***/ "./node_modules/@converse/skeletor/src/drivers/sessionStorage.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@converse/skeletor/src/drivers/sessionStorage.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! localforage/src/utils/executeCallback */ "./node_modules/localforage/src/utils/executeCallback.js");
/* harmony import */ var localforage_src_utils_getCallback__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! localforage/src/utils/getCallback */ "./node_modules/localforage/src/utils/getCallback.js");
/* harmony import */ var localforage_src_utils_normalizeKey__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! localforage/src/utils/normalizeKey */ "./node_modules/localforage/src/utils/normalizeKey.js");
/* harmony import */ var localforage_src_utils_serializer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! localforage/src/utils/serializer */ "./node_modules/localforage/src/utils/serializer.js");
// Copyright 2014 Mozilla
// Copyright 2015 Thodoris Greasidis
// Copyright 2018 JC Brand
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




const serialize = localforage_src_utils_serializer__WEBPACK_IMPORTED_MODULE_3__["default"]['serialize'];
const deserialize = localforage_src_utils_serializer__WEBPACK_IMPORTED_MODULE_3__["default"]['deserialize'];
function isSessionStorageValid() {
    // If the app is running inside a Google Chrome packaged webapp, or some
    // other context where sessionStorage isn't available, we don't use
    // sessionStorage. This feature detection is preferred over the old
    // `if (window.chrome && window.chrome.runtime)` code.
    // See: https://github.com/mozilla/localForage/issues/68
    try {
        // If sessionStorage isn't available, we get outta here!
        // This should be inside a try catch
        if (sessionStorage && 'setItem' in sessionStorage) {
            return true;
        }
    } catch (e) {
        console.log(e);
    }
    return false;
}
function _getKeyPrefix(options, defaultConfig) {
    let keyPrefix = options.name + '/';
    if (options.storeName !== defaultConfig.storeName) {
        keyPrefix += options.storeName + '/';
    }
    return keyPrefix;
}
const dbInfo = {
    'serializer': {
        'serialize': serialize,
        'deserialize': deserialize
    }
};
function _initStorage(options) {
    dbInfo.keyPrefix = _getKeyPrefix(options, this._defaultConfig);
    if (options) {
        for(const i in options){
            // eslint-disable-line guard-for-in
            dbInfo[i] = options[i];
        }
    }
}
// Remove all keys from the datastore, effectively destroying all data in
// the app's key/value store!
function clear(callback) {
    const promise = this.ready().then(function() {
        const keyPrefix = dbInfo.keyPrefix;
        for(let i = sessionStorage.length - 1; i >= 0; i--){
            const key = sessionStorage.key(i);
            if (key.indexOf(keyPrefix) === 0) {
                sessionStorage.removeItem(key);
            }
        }
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
// Retrieve an item from the store. Unlike the original async_storage
// library in Gaia, we don't modify return values at all. If a key's value
// is `undefined`, we pass that value to the callback function.
function getItem(key, callback) {
    key = (0,localforage_src_utils_normalizeKey__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
    const promise = this.ready().then(function() {
        let result = sessionStorage.getItem(dbInfo.keyPrefix + key);
        // If a result was found, parse it from the serialized
        // string into a JS object. If result isn't truthy, the key
        // is likely undefined and we'll pass it straight to the
        // callback.
        if (result) {
            result = dbInfo.serializer.deserialize(result);
        }
        return result;
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
// Iterate over all items in the store.
function iterate(iterator, callback) {
    const self = this;
    const promise = self.ready().then(function() {
        const keyPrefix = dbInfo.keyPrefix;
        const keyPrefixLength = keyPrefix.length;
        const length = sessionStorage.length;
        // We use a dedicated iterator instead of the `i` variable below
        // so other keys we fetch in sessionStorage aren't counted in
        // the `iterationNumber` argument passed to the `iterate()`
        // callback.
        //
        // See: github.com/mozilla/localForage/pull/435#discussion_r38061530
        let iterationNumber = 1;
        for(let i = 0; i < length; i++){
            const key = sessionStorage.key(i);
            if (key.indexOf(keyPrefix) !== 0) {
                continue;
            }
            let value = sessionStorage.getItem(key);
            // If a result was found, parse it from the serialized
            // string into a JS object. If result isn't truthy, the
            // key is likely undefined and we'll pass it straight
            // to the iterator.
            if (value) {
                value = dbInfo.serializer.deserialize(value);
            }
            value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);
            if (value !== void 0) {
                // eslint-disable-line no-void
                return value;
            }
        }
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
// Same as sessionStorage's key() method, except takes a callback.
function key(n, callback) {
    const self = this;
    const promise = self.ready().then(function() {
        let result;
        try {
            result = sessionStorage.key(n);
        } catch (error) {
            result = null;
        }
        // Remove the prefix from the key, if a key is found.
        if (result) {
            result = result.substring(dbInfo.keyPrefix.length);
        }
        return result;
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
function keys(callback) {
    const self = this;
    const promise = self.ready().then(function() {
        const length = sessionStorage.length;
        const keys = [];
        for(let i = 0; i < length; i++){
            const itemKey = sessionStorage.key(i);
            if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {
                keys.push(itemKey.substring(dbInfo.keyPrefix.length));
            }
        }
        return keys;
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
// Supply the number of keys in the datastore to the callback function.
function length(callback) {
    const self = this;
    const promise = self.keys().then(function(keys) {
        return keys.length;
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
// Remove an item from the store, nice and simple.
function removeItem(key, callback) {
    key = (0,localforage_src_utils_normalizeKey__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
    const promise = this.ready().then(function() {
        sessionStorage.removeItem(dbInfo.keyPrefix + key);
    });
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
/**
 * Set a key's value and run an optional callback once the value is set.
 * Unlike Gaia's implementation, the callback function is passed the value,
 * in case you want to operate on that value only after you're sure it
 * saved, or something like that.
 * @template T
 * @param {string} key - The key under which the value is stored.
 * @param {T} value - The value to be stored, can be of any type.
 * @param {(err: any, value: T) => void} [callback] - Optional callback function to be called after the value is set.
 * @returns {Promise<T>}
 */ function setItem(key, value, callback) {
    return _async_to_generator(function*() {
        key = (0,localforage_src_utils_normalizeKey__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
        yield this.ready();
        // Convert undefined values to null.
        // https://github.com/mozilla/localForage/pull/42
        value = value !== null && value !== void 0 ? value : null;
        // Save the original value to pass to the callback.
        const originalValue = value;
        dbInfo.serializer.serialize(value, (value, error)=>{
            if (error) {
                throw error;
            } else {
                try {
                    sessionStorage.setItem(dbInfo.keyPrefix + key, value);
                    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(Promise.resolve(originalValue), callback);
                } catch (e) {
                    if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
                        console.error('Your sesionStorage capacity is used up.');
                        throw e;
                    }
                    throw e;
                }
            }
        });
        return value;
    }).call(this);
}
function dropInstance(options, callback) {
    callback = localforage_src_utils_getCallback__WEBPACK_IMPORTED_MODULE_1__["default"].apply(this, arguments);
    options = typeof options !== 'function' && options || {};
    if (!options.name) {
        const currentConfig = this.config();
        options.name = options.name || currentConfig.name;
        options.storeName = options.storeName || currentConfig.storeName;
    }
    const self = this;
    let promise;
    if (!options.name) {
        promise = Promise.reject(new Error('Invalid arguments'));
    } else {
        promise = new Promise(function(resolve) {
            if (!options.storeName) {
                resolve(`${options.name}/`);
            } else {
                resolve(_getKeyPrefix(options, self._defaultConfig));
            }
        }).then(function(keyPrefix) {
            for(let i = sessionStorage.length - 1; i >= 0; i--){
                const key = sessionStorage.key(i);
                if (key.indexOf(keyPrefix) === 0) {
                    sessionStorage.removeItem(key);
                }
            }
        });
    }
    (0,localforage_src_utils_executeCallback__WEBPACK_IMPORTED_MODULE_0__["default"])(promise, callback);
    return promise;
}
const sessionStorageWrapper = {
    _driver: 'sessionStorageWrapper',
    _initStorage: _initStorage,
    _support: isSessionStorageValid(),
    iterate,
    getItem,
    setItem,
    removeItem,
    clear,
    length,
    key,
    keys,
    dropInstance
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sessionStorageWrapper);


/***/ }),

/***/ "./node_modules/@converse/skeletor/src/helpers.js":
/*!********************************************************!*\
  !*** ./node_modules/@converse/skeletor/src/helpers.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   NotImplementedError: () => (/* binding */ NotImplementedError),
/* harmony export */   getResolveablePromise: () => (/* binding */ getResolveablePromise),
/* harmony export */   getSyncMethod: () => (/* binding */ getSyncMethod),
/* harmony export */   guid: () => (/* binding */ guid),
/* harmony export */   inherits: () => (/* binding */ inherits),
/* harmony export */   sync: () => (/* binding */ sync),
/* harmony export */   urlError: () => (/* binding */ urlError),
/* harmony export */   wrapError: () => (/* binding */ wrapError)
/* harmony export */ });
/* harmony import */ var lodash_es_create_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es/create.js */ "./node_modules/lodash-es/create.js");
/* harmony import */ var lodash_es_extend_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es/extend.js */ "./node_modules/lodash-es/assignIn.js");
/* harmony import */ var lodash_es_has_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es/has.js */ "./node_modules/lodash-es/has.js");
/* harmony import */ var lodash_es_result_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es/result.js */ "./node_modules/lodash-es/result.js");
//     (c) 2010-2019 Jeremy Ashkenas and DocumentCloud
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}




/**
 * Custom error for indicating timeouts
 * @namespace _converse
 */ class NotImplementedError extends Error {
}
function S4() {
    // Generate four random hex digits.
    return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
}
function guid() {
    // Generate a pseudo-GUID by concatenating random hexadecimal.
    return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4();
}
// Helpers
// -------
// Helper function to correctly set up the prototype chain for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
//
function inherits(protoProps, staticProps) {
    // eslint-disable-next-line @typescript-eslint/no-this-alias
    const parent = this;
    let child;
    // The constructor function for the new subclass is either defined by you
    // (the "constructor" property in your `extend` definition), or defaulted
    // by us to simply call the parent constructor.
    if (protoProps && (0,lodash_es_has_js__WEBPACK_IMPORTED_MODULE_0__["default"])(protoProps, 'constructor')) {
        child = protoProps.constructor;
    } else {
        child = function() {
            return parent.apply(this, arguments);
        };
    }
    // Add static properties to the constructor function, if supplied.
    (0,lodash_es_extend_js__WEBPACK_IMPORTED_MODULE_1__["default"])(child, parent, staticProps);
    // Set the prototype chain to inherit from `parent`, without calling
    // `parent`'s constructor function and add the prototype properties.
    child.prototype = (0,lodash_es_create_js__WEBPACK_IMPORTED_MODULE_2__["default"])(parent.prototype, protoProps);
    child.prototype.constructor = child;
    // Set a convenience property in case the parent's prototype is needed
    // later.
    child.__super__ = parent.prototype;
    return child;
}
function getResolveablePromise() {
    /**
   * @typedef {Object} PromiseWrapper
   * @property {boolean} isResolved
   * @property {boolean} isPending
   * @property {boolean} isRejected
   * @property {Function} resolve
   * @property {Function} reject
   */ /** @type {PromiseWrapper} */ const wrapper = {
        isResolved: false,
        isPending: true,
        isRejected: false,
        resolve: null,
        reject: null
    };
    /**
   * @typedef {Promise & PromiseWrapper} ResolveablePromise
   */ const promise = /** @type {ResolveablePromise} */ new Promise((resolve, reject)=>{
        wrapper.resolve = resolve;
        wrapper.reject = reject;
    });
    Object.assign(promise, wrapper);
    promise.then(function(v) {
        promise.isResolved = true;
        promise.isPending = false;
        promise.isRejected = false;
        return v;
    }, function(e) {
        promise.isResolved = false;
        promise.isPending = false;
        promise.isRejected = true;
        throw e;
    });
    return promise;
}
// Throw an error when a URL is needed, and none is supplied.
function urlError() {
    throw new Error('A "url" property or function must be specified');
}
// Wrap an optional error callback with a fallback error event.
function wrapError(model, options) {
    const error = options.error;
    options.error = function(resp) {
        if (error) error.call(options.context, model, resp, options);
        model.trigger('error', model, resp, options);
    };
}
// Map from CRUD to HTTP for our default `sync` implementation.
const methodMap = {
    create: 'POST',
    update: 'PUT',
    patch: 'PATCH',
    delete: 'DELETE',
    read: 'GET'
};
/**
 * @typedef {import('./model.js').Model} Model
 * @typedef {import('./collection.js').Collection} Collection
 */ /**
 * @param {Model | Collection} model
 */ function getSyncMethod(model) {
    const store = (0,lodash_es_result_js__WEBPACK_IMPORTED_MODULE_3__["default"])(model, 'browserStorage') || (0,lodash_es_result_js__WEBPACK_IMPORTED_MODULE_3__["default"])(/** @type {Model} */ model.collection, 'browserStorage');
    return store ? store.sync() : sync;
}
/**
 * @typedef {Object} SyncOptions
 * @property {string} [url]
 * @property {any} [data]
 * @property {any} [attrs]
 * @property {Function} [success]
 * @property {Function} [error]
 * @property {any} [xhr]
 */ /**
 * Override this function to change the manner in which Backbone persists
 * models to the server. You will be passed the type of request, and the
 * model in question. By default makes a `fetch()` API call
 * to the model's `url()`.
 *
 * Some possible customizations could be:
 *
 * - Use `setTimeout` to batch rapid-fire updates into a single request.
 * - Persist models via WebSockets instead of Ajax.
 * - Persist models to browser storage
 *
 * @param {'create'|'update'|'patch'} method
 * @param {import('./model.js').Model} model
 * @param {SyncOptions} [options]
 */ function sync(method, model, options = {}) {
    let data = options.data;
    // Ensure that we have the appropriate request data.
    if (data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
        data = options.attrs || model.toJSON();
    }
    const type = methodMap[method];
    const params = {
        method: type,
        body: data ? JSON.stringify(data) : '',
        success: options.success,
        error: options.error
    };
    const url = options.url || (0,lodash_es_result_js__WEBPACK_IMPORTED_MODULE_3__["default"])(model, 'url') || urlError();
    const xhr = options.xhr = fetch(url, params);
    model.trigger('request', model, xhr, _object_spread_props(_object_spread({}, params), {
        xhr
    }));
    return xhr;
}


/***/ }),

/***/ "./node_modules/@converse/skeletor/src/storage.js":
/*!********************************************************!*\
  !*** ./node_modules/@converse/skeletor/src/storage.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var localforage_driver_memory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! localforage-driver-memory */ "./node_modules/localforage-driver-memory/_bundle/umd.js");
/* harmony import */ var localforage_driver_memory__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(localforage_driver_memory__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash_es_cloneDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es/cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
/* harmony import */ var lodash_es_isString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es/isString.js */ "./node_modules/lodash-es/isString.js");
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! localforage */ "./node_modules/localforage/dist/localforage.js");
/* harmony import */ var localforage__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(localforage__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var mergebounce__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mergebounce */ "./node_modules/mergebounce/mergebounce.js");
/* harmony import */ var _drivers_sessionStorage_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./drivers/sessionStorage.js */ "./node_modules/@converse/skeletor/src/drivers/sessionStorage.js");
/* harmony import */ var localforage_setitems__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! localforage-setitems */ "./node_modules/localforage-setitems/dist/localforage-setitems.js");
/* harmony import */ var localforage_setitems__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(localforage_setitems__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _converse_localforage_getitems_dist_localforage_getitems_es6__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/localforage-getitems/dist/localforage-getitems.es6 */ "./node_modules/@converse/localforage-getitems/dist/localforage-getitems.es6.js");
/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers.js */ "./node_modules/@converse/skeletor/src/helpers.js");
/**
 * IndexedDB, localStorage and sessionStorage adapter
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









const IN_MEMORY = localforage_driver_memory__WEBPACK_IMPORTED_MODULE_0__._driver;
localforage__WEBPACK_IMPORTED_MODULE_1___default().defineDriver(localforage_driver_memory__WEBPACK_IMPORTED_MODULE_0__);
(0,localforage_setitems__WEBPACK_IMPORTED_MODULE_4__.extendPrototype)((localforage__WEBPACK_IMPORTED_MODULE_1___default()));
(0,_converse_localforage_getitems_dist_localforage_getitems_es6__WEBPACK_IMPORTED_MODULE_5__.extendPrototype)((localforage__WEBPACK_IMPORTED_MODULE_1___default()));
class Storage {
    /**
   * @param {'local'|'session'|'indexed'|'in_memory'} type
   * @param {boolean} batchedWrites
   */ initStore(type, batchedWrites) {
        return _async_to_generator(function*() {
            if (type === 'session') {
                yield localforage__WEBPACK_IMPORTED_MODULE_1___default().setDriver(_drivers_sessionStorage_js__WEBPACK_IMPORTED_MODULE_3__["default"]._driver);
            } else if (type === 'local') {
                yield localforage__WEBPACK_IMPORTED_MODULE_1___default().config({
                    'driver': (localforage__WEBPACK_IMPORTED_MODULE_1___default().LOCALSTORAGE)
                });
            } else if (type === 'in_memory') {
                yield localforage__WEBPACK_IMPORTED_MODULE_1___default().config({
                    'driver': IN_MEMORY
                });
            } else if (type !== 'indexed') {
                throw new Error('Skeletor.storage: No storage type was specified');
            }
            this.store = (localforage__WEBPACK_IMPORTED_MODULE_1___default());
            if (batchedWrites) {
                this.store.debouncedSetItems = (0,mergebounce__WEBPACK_IMPORTED_MODULE_2__["default"])((items)=>this.store.setItems(items), 50, {
                    'promise': true
                });
            }
        }).call(this);
    }
    flush() {
        var _this_store_debouncedSetItems;
        return (_this_store_debouncedSetItems = this.store.debouncedSetItems) === null || _this_store_debouncedSetItems === void 0 ? void 0 : _this_store_debouncedSetItems.flush();
    }
    clear() {
        return _async_to_generator(function*() {
            yield this.store.removeItem(this.name).catch((e)=>console.error(e));
            const re = new RegExp(`^${this.name}-`);
            const keys = yield this.store.keys();
            const removed_keys = keys.filter((k)=>re.test(k));
            yield Promise.all(removed_keys.map((k)=>this.store.removeItem(k).catch((e)=>console.error(e))));
        }).call(this);
    }
    sync() {
        // eslint-disable-next-line @typescript-eslint/no-this-alias
        const that = this;
        function localSync(method, model, options) {
            return _async_to_generator(function*() {
                let resp, errorMessage, promise, new_attributes;
                // We get the collection (and if necessary the model attribute.
                // Waiting for storeInitialized will cause another iteration of
                // the event loop, after which the collection reference will
                // be removed from the model.
                const collection = model.collection;
                if ([
                    'patch',
                    'update'
                ].includes(method)) {
                    new_attributes = (0,lodash_es_cloneDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"])(model.attributes);
                }
                yield that.storeInitialized;
                try {
                    const original_attributes = model.attributes;
                    switch(method){
                        case 'read':
                            if (model.id !== undefined) {
                                resp = yield that.find(model);
                            } else {
                                resp = yield that.findAll();
                            }
                            break;
                        case 'create':
                            resp = yield that.create(model, options);
                            break;
                        case 'patch':
                        case 'update':
                            if (options.wait) {
                                // When `wait` is set to true, Skeletor waits until
                                // confirmation of storage before setting the values on
                                // the model.
                                // However, the new attributes needs to be sent, so it
                                // sets them manually on the model and then removes
                                // them after calling `sync`.
                                // Because our `sync` method is asynchronous and we
                                // wait for `storeInitialized`, the attributes are
                                // already restored once we get here, so we need to do
                                // the attributes dance again.
                                model.attributes = new_attributes;
                            }
                            promise = that.update(model);
                            if (options.wait) {
                                model.attributes = original_attributes;
                            }
                            resp = yield promise;
                            break;
                        case 'delete':
                            resp = yield that.destroy(model, collection);
                            break;
                    }
                } catch (error) {
                    if (error.code === 22 && that.getStorageSize() === 0) {
                        errorMessage = 'Private browsing is unsupported';
                    } else {
                        errorMessage = error.message;
                    }
                }
                if (resp) {
                    if (options && options.success) {
                        // When storing, we don't pass back the response (which is
                        // the set attributes returned from localforage because
                        // Skeletor sets them again on the model and due to the async
                        // nature of localforage it can cause stale attributes to be
                        // set on a model after it's been updated in the meantime.
                        const data = method === 'read' ? resp : null;
                        options.success(data, options);
                    }
                } else {
                    errorMessage = errorMessage ? errorMessage : 'Record Not Found';
                    if (options && options.error) {
                        options.error(errorMessage);
                    }
                }
            })();
        }
        localSync.__name__ = 'localSync';
        return localSync;
    }
    removeCollectionReference(model, collection) {
        if (!collection) {
            return;
        }
        const ids = collection.filter((m)=>m.id !== model.id).map((m)=>this.getItemName(m.id));
        return this.store.setItem(this.name, ids);
    }
    addCollectionReference(model, collection) {
        if (!collection) {
            return;
        }
        const ids = collection.map((m)=>this.getItemName(m.id));
        const new_id = this.getItemName(model.id);
        if (!ids.includes(new_id)) {
            ids.push(new_id);
        }
        return this.store.setItem(this.name, ids);
    }
    getCollectionReferenceData(model) {
        if (!model.collection) {
            return {};
        }
        const ids = model.collection.map((m)=>this.getItemName(m.id));
        const new_id = this.getItemName(model.id);
        if (!ids.includes(new_id)) {
            ids.push(new_id);
        }
        const result = {};
        result[this.name] = ids;
        return result;
    }
    save(model) {
        return _async_to_generator(function*() {
            if (this.store.setItems) {
                const items = {};
                items[this.getItemName(model.id)] = model.toJSON();
                Object.assign(items, this.getCollectionReferenceData(model));
                return this.store.debouncedSetItems ? this.store.debouncedSetItems(items) : this.store.setItems(items);
            } else {
                const key = this.getItemName(model.id);
                const data = yield this.store.setItem(key, model.toJSON());
                yield this.addCollectionReference(model, model.collection);
                return data;
            }
        }).call(this);
    }
    create(model, options) {
        /* Add a model, giving it a (hopefully)-unique GUID, if it doesn't already
     * have an id of it's own.
     */ if (!model.id) {
            model.id = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_6__.guid)();
            model.set(model.idAttribute, model.id, options);
        }
        return this.save(model);
    }
    update(model) {
        return this.save(model);
    }
    find(model) {
        return this.store.getItem(this.getItemName(model.id));
    }
    findAll() {
        return _async_to_generator(function*() {
            /* Return the array of all models currently in storage.
     */ const keys = yield this.store.getItem(this.name);
            if (keys === null || keys === void 0 ? void 0 : keys.length) {
                const items = yield this.store.getItems(keys);
                return Object.values(items);
            }
            return [];
        }).call(this);
    }
    destroy(model, collection) {
        return _async_to_generator(function*() {
            yield this.flush();
            yield this.store.removeItem(this.getItemName(model.id));
            yield this.removeCollectionReference(model, collection);
            return model;
        }).call(this);
    }
    getStorageSize() {
        return this.store.length;
    }
    getItemName(id) {
        return this.name + '-' + id;
    }
    constructor(id, type, batchedWrites = false){
        if (type === 'local' && !window.localStorage) {
            throw new Error('Skeletor.storage: Environment does not support localStorage.');
        } else if (type === 'session' && !window.sessionStorage) {
            throw new Error('Skeletor.storage: Environment does not support sessionStorage.');
        }
        if ((0,lodash_es_isString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(type)) {
            this.storeInitialized = this.initStore(type, batchedWrites);
        } else {
            this.store = type;
            if (batchedWrites) {
                this.store.debouncedSetItems = (0,mergebounce__WEBPACK_IMPORTED_MODULE_2__["default"])((items)=>this.store.setItems(items), 50, {
                    'promise': true
                });
            }
            this.storeInitialized = Promise.resolve();
        }
        this.name = id;
    }
}
Storage.sessionStorageInitialized = localforage__WEBPACK_IMPORTED_MODULE_1___default().defineDriver(_drivers_sessionStorage_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
Storage.localForage = (localforage__WEBPACK_IMPORTED_MODULE_1___default());
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Storage);


/***/ }),

/***/ "./node_modules/@lit/reactive-element/development/css-tag.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@lit/reactive-element/development/css-tag.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSSResult: () => (/* binding */ CSSResult),
/* harmony export */   adoptStyles: () => (/* binding */ adoptStyles),
/* harmony export */   css: () => (/* binding */ css),
/* harmony export */   getCompatibleStyle: () => (/* binding */ getCompatibleStyle),
/* harmony export */   supportsAdoptingStyleSheets: () => (/* binding */ supportsAdoptingStyleSheets),
/* harmony export */   unsafeCSS: () => (/* binding */ unsafeCSS)
/* harmony export */ });
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const NODE_MODE = false;
// Allows minifiers to rename references to globalThis
const global = globalThis;
/**
 * Whether the current browser supports `adoptedStyleSheets`.
 */
const supportsAdoptingStyleSheets = global.ShadowRoot &&
    (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&
    'adoptedStyleSheets' in Document.prototype &&
    'replace' in CSSStyleSheet.prototype;
const constructionToken = Symbol();
const cssTagCache = new WeakMap();
/**
 * A container for a string of CSS text, that may be used to create a CSSStyleSheet.
 *
 * CSSResult is the return value of `css`-tagged template literals and
 * `unsafeCSS()`. In order to ensure that CSSResults are only created via the
 * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.
 */
class CSSResult {
    constructor(cssText, strings, safeToken) {
        // This property needs to remain unminified.
        this['_$cssResult$'] = true;
        if (safeToken !== constructionToken) {
            throw new Error('CSSResult is not constructable. Use `unsafeCSS` or `css` instead.');
        }
        this.cssText = cssText;
        this._strings = strings;
    }
    // This is a getter so that it's lazy. In practice, this means stylesheets
    // are not created until the first element instance is made.
    get styleSheet() {
        // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is
        // constructable.
        let styleSheet = this._styleSheet;
        const strings = this._strings;
        if (supportsAdoptingStyleSheets && styleSheet === undefined) {
            const cacheable = strings !== undefined && strings.length === 1;
            if (cacheable) {
                styleSheet = cssTagCache.get(strings);
            }
            if (styleSheet === undefined) {
                (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(this.cssText);
                if (cacheable) {
                    cssTagCache.set(strings, styleSheet);
                }
            }
        }
        return styleSheet;
    }
    toString() {
        return this.cssText;
    }
}
const textFromCSSResult = (value) => {
    // This property needs to remain unminified.
    if (value['_$cssResult$'] === true) {
        return value.cssText;
    }
    else if (typeof value === 'number') {
        return value;
    }
    else {
        throw new Error(`Value passed to 'css' function must be a 'css' function result: ` +
            `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +
            `to ensure page security.`);
    }
};
/**
 * Wrap a value for interpolation in a {@linkcode css} tagged template literal.
 *
 * This is unsafe because untrusted CSS text can be used to phone home
 * or exfiltrate data to an attacker controlled site. Take care to only use
 * this with trusted input.
 */
const unsafeCSS = (value) => new CSSResult(typeof value === 'string' ? value : String(value), undefined, constructionToken);
/**
 * A template literal tag which can be used with LitElement's
 * {@linkcode LitElement.styles} property to set element styles.
 *
 * For security reasons, only literal string values and number may be used in
 * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}
 * may be used inside an expression.
 */
const css = (strings, ...values) => {
    const cssText = strings.length === 1
        ? strings[0]
        : values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);
    return new CSSResult(cssText, strings, constructionToken);
};
/**
 * Applies the given styles to a `shadowRoot`. When Shadow DOM is
 * available but `adoptedStyleSheets` is not, styles are appended to the
 * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).
 * Note, when shimming is used, any styles that are subsequently placed into
 * the shadowRoot should be placed *before* any shimmed adopted styles. This
 * will match spec behavior that gives adopted sheets precedence over styles in
 * shadowRoot.
 */
const adoptStyles = (renderRoot, styles) => {
    if (supportsAdoptingStyleSheets) {
        renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
    }
    else {
        for (const s of styles) {
            const style = document.createElement('style');
            // eslint-disable-next-line @typescript-eslint/no-explicit-any
            const nonce = global['litNonce'];
            if (nonce !== undefined) {
                style.setAttribute('nonce', nonce);
            }
            style.textContent = s.cssText;
            renderRoot.appendChild(style);
        }
    }
};
const cssResultFromStyleSheet = (sheet) => {
    let cssText = '';
    for (const rule of sheet.cssRules) {
        cssText += rule.cssText;
    }
    return unsafeCSS(cssText);
};
const getCompatibleStyle = supportsAdoptingStyleSheets ||
    (NODE_MODE && global.CSSStyleSheet === undefined)
    ? (s) => s
    : (s) => s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;
//# sourceMappingURL=css-tag.js.map

/***/ }),

/***/ "./node_modules/@lit/reactive-element/development/reactive-element.js":
/*!****************************************************************************!*\
  !*** ./node_modules/@lit/reactive-element/development/reactive-element.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSSResult: () => (/* reexport safe */ _css_tag_js__WEBPACK_IMPORTED_MODULE_0__.CSSResult),
/* harmony export */   ReactiveElement: () => (/* binding */ ReactiveElement),
/* harmony export */   adoptStyles: () => (/* reexport safe */ _css_tag_js__WEBPACK_IMPORTED_MODULE_0__.adoptStyles),
/* harmony export */   css: () => (/* reexport safe */ _css_tag_js__WEBPACK_IMPORTED_MODULE_0__.css),
/* harmony export */   defaultConverter: () => (/* binding */ defaultConverter),
/* harmony export */   getCompatibleStyle: () => (/* reexport safe */ _css_tag_js__WEBPACK_IMPORTED_MODULE_0__.getCompatibleStyle),
/* harmony export */   notEqual: () => (/* binding */ notEqual),
/* harmony export */   supportsAdoptingStyleSheets: () => (/* reexport safe */ _css_tag_js__WEBPACK_IMPORTED_MODULE_0__.supportsAdoptingStyleSheets),
/* harmony export */   unsafeCSS: () => (/* reexport safe */ _css_tag_js__WEBPACK_IMPORTED_MODULE_0__.unsafeCSS)
/* harmony export */ });
/* harmony import */ var _css_tag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./css-tag.js */ "./node_modules/@lit/reactive-element/development/css-tag.js");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * Use this module if you want to create your own base class extending
 * {@link ReactiveElement}.
 * @packageDocumentation
 */

// In the Node build, this import will be injected by Rollup:
// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';

// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022
const { is, defineProperty, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, } = Object;
const NODE_MODE = false;
// Lets a minifier replace globalThis references with a minified name
const global = globalThis;
if (NODE_MODE) {
    global.customElements ??= customElements;
}
const DEV_MODE = true;
let issueWarning;
const trustedTypes = global
    .trustedTypes;
// Temporary workaround for https://crbug.com/993268
// Currently, any attribute starting with "on" is considered to be a
// TrustedScript source. Such boolean attributes must be set to the equivalent
// trusted emptyScript value.
const emptyStringForBooleanAttribute = trustedTypes
    ? trustedTypes.emptyScript
    : '';
const polyfillSupport = DEV_MODE
    ? global.reactiveElementPolyfillSupportDevMode
    : global.reactiveElementPolyfillSupport;
if (DEV_MODE) {
    // Ensure warnings are issued only 1x, even if multiple versions of Lit
    // are loaded.
    global.litIssuedWarnings ??= new Set();
    /**
     * Issue a warning if we haven't already, based either on `code` or `warning`.
     * Warnings are disabled automatically only by `warning`; disabling via `code`
     * can be done by users.
     */
    issueWarning = (code, warning) => {
        warning += ` See https://lit.dev/msg/${code} for more information.`;
        if (!global.litIssuedWarnings.has(warning) &&
            !global.litIssuedWarnings.has(code)) {
            console.warn(warning);
            global.litIssuedWarnings.add(warning);
        }
    };
    queueMicrotask(() => {
        issueWarning('dev-mode', `Lit is in dev mode. Not recommended for production!`);
        // Issue polyfill support warning.
        if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {
            issueWarning('polyfill-support-missing', `Shadow DOM is being polyfilled via \`ShadyDOM\` but ` +
                `the \`polyfill-support\` module has not been loaded.`);
        }
    });
}
/**
 * Useful for visualizing and logging insights into what the Lit template system is doing.
 *
 * Compiled out of prod mode builds.
 */
const debugLogEvent = DEV_MODE
    ? (event) => {
        const shouldEmit = global
            .emitLitDebugLogEvents;
        if (!shouldEmit) {
            return;
        }
        global.dispatchEvent(new CustomEvent('lit-debug', {
            detail: event,
        }));
    }
    : undefined;
/*
 * When using Closure Compiler, JSCompiler_renameProperty(property, object) is
 * replaced at compile time by the munged name for object[property]. We cannot
 * alias this function, so we have to use a small shim that has the same
 * behavior when not compiling.
 */
/*@__INLINE__*/
const JSCompiler_renameProperty = (prop, _obj) => prop;
const defaultConverter = {
    toAttribute(value, type) {
        switch (type) {
            case Boolean:
                value = value ? emptyStringForBooleanAttribute : null;
                break;
            case Object:
            case Array:
                // if the value is `null` or `undefined` pass this through
                // to allow removing/no change behavior.
                value = value == null ? value : JSON.stringify(value);
                break;
        }
        return value;
    },
    fromAttribute(value, type) {
        let fromValue = value;
        switch (type) {
            case Boolean:
                fromValue = value !== null;
                break;
            case Number:
                fromValue = value === null ? null : Number(value);
                break;
            case Object:
            case Array:
                // Do *not* generate exception when invalid JSON is set as elements
                // don't normally complain on being mis-configured.
                // TODO(sorvell): Do generate exception in *dev mode*.
                try {
                    // Assert to adhere to Bazel's "must type assert JSON parse" rule.
                    fromValue = JSON.parse(value);
                }
                catch (e) {
                    fromValue = null;
                }
                break;
        }
        return fromValue;
    },
};
/**
 * Change function that returns true if `value` is different from `oldValue`.
 * This method is used as the default for a property's `hasChanged` function.
 */
const notEqual = (value, old) => !is(value, old);
const defaultPropertyDeclaration = {
    attribute: true,
    type: String,
    converter: defaultConverter,
    reflect: false,
    useDefault: false,
    hasChanged: notEqual,
};
// Ensure metadata is enabled. TypeScript does not polyfill
// Symbol.metadata, so we must ensure that it exists.
Symbol.metadata ??= Symbol('metadata');
// Map from a class's metadata object to property options
// Note that we must use nullish-coalescing assignment so that we only use one
// map even if we load multiple version of this module.
global.litPropertyMetadata ??= new WeakMap();
/**
 * Base element class which manages element properties and attributes. When
 * properties change, the `update` method is asynchronously called. This method
 * should be supplied by subclasses to render updates as desired.
 * @noInheritDoc
 */
class ReactiveElement
// In the Node build, this `extends` clause will be substituted with
// `(globalThis.HTMLElement ?? HTMLElement)`.
//
// This way, we will first prefer any global `HTMLElement` polyfill that the
// user has assigned, and then fall back to the `HTMLElement` shim which has
// been imported (see note at the top of this file about how this import is
// generated by Rollup). Note that the `HTMLElement` variable has been
// shadowed by this import, so it no longer refers to the global.
 extends HTMLElement {
    /**
     * Adds an initializer function to the class that is called during instance
     * construction.
     *
     * This is useful for code that runs against a `ReactiveElement`
     * subclass, such as a decorator, that needs to do work for each
     * instance, such as setting up a `ReactiveController`.
     *
     * ```ts
     * const myDecorator = (target: typeof ReactiveElement, key: string) => {
     *   target.addInitializer((instance: ReactiveElement) => {
     *     // This is run during construction of the element
     *     new MyController(instance);
     *   });
     * }
     * ```
     *
     * Decorating a field will then cause each instance to run an initializer
     * that adds a controller:
     *
     * ```ts
     * class MyElement extends LitElement {
     *   @myDecorator foo;
     * }
     * ```
     *
     * Initializers are stored per-constructor. Adding an initializer to a
     * subclass does not add it to a superclass. Since initializers are run in
     * constructors, initializers will run in order of the class hierarchy,
     * starting with superclasses and progressing to the instance's class.
     *
     * @nocollapse
     */
    static addInitializer(initializer) {
        this.__prepare();
        (this._initializers ??= []).push(initializer);
    }
    /**
     * Returns a list of attributes corresponding to the registered properties.
     * @nocollapse
     * @category attributes
     */
    static get observedAttributes() {
        // Ensure we've created all properties
        this.finalize();
        // this.__attributeToPropertyMap is only undefined after finalize() in
        // ReactiveElement itself. ReactiveElement.observedAttributes is only
        // accessed with ReactiveElement as the receiver when a subclass or mixin
        // calls super.observedAttributes
        return (this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]);
    }
    /**
     * Creates a property accessor on the element prototype if one does not exist
     * and stores a {@linkcode PropertyDeclaration} for the property with the
     * given options. The property setter calls the property's `hasChanged`
     * property option or uses a strict identity check to determine whether or not
     * to request an update.
     *
     * This method may be overridden to customize properties; however,
     * when doing so, it's important to call `super.createProperty` to ensure
     * the property is setup correctly. This method calls
     * `getPropertyDescriptor` internally to get a descriptor to install.
     * To customize what properties do when they are get or set, override
     * `getPropertyDescriptor`. To customize the options for a property,
     * implement `createProperty` like this:
     *
     * ```ts
     * static createProperty(name, options) {
     *   options = Object.assign(options, {myOption: true});
     *   super.createProperty(name, options);
     * }
     * ```
     *
     * @nocollapse
     * @category properties
     */
    static createProperty(name, options = defaultPropertyDeclaration) {
        // If this is a state property, force the attribute to false.
        if (options.state) {
            options.attribute = false;
        }
        this.__prepare();
        // Whether this property is wrapping accessors.
        // Helps control the initial value change and reflection logic.
        if (this.prototype.hasOwnProperty(name)) {
            options = Object.create(options);
            options.wrapped = true;
        }
        this.elementProperties.set(name, options);
        if (!options.noAccessor) {
            const key = DEV_MODE
                ? // Use Symbol.for in dev mode to make it easier to maintain state
                    // when doing HMR.
                    Symbol.for(`${String(name)} (@property() cache)`)
                : Symbol();
            const descriptor = this.getPropertyDescriptor(name, key, options);
            if (descriptor !== undefined) {
                defineProperty(this.prototype, name, descriptor);
            }
        }
    }
    /**
     * Returns a property descriptor to be defined on the given named property.
     * If no descriptor is returned, the property will not become an accessor.
     * For example,
     *
     * ```ts
     * class MyElement extends LitElement {
     *   static getPropertyDescriptor(name, key, options) {
     *     const defaultDescriptor =
     *         super.getPropertyDescriptor(name, key, options);
     *     const setter = defaultDescriptor.set;
     *     return {
     *       get: defaultDescriptor.get,
     *       set(value) {
     *         setter.call(this, value);
     *         // custom action.
     *       },
     *       configurable: true,
     *       enumerable: true
     *     }
     *   }
     * }
     * ```
     *
     * @nocollapse
     * @category properties
     */
    static getPropertyDescriptor(name, key, options) {
        const { get, set } = getOwnPropertyDescriptor(this.prototype, name) ?? {
            get() {
                return this[key];
            },
            set(v) {
                this[key] = v;
            },
        };
        if (DEV_MODE && get == null) {
            if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {
                throw new Error(`Field ${JSON.stringify(String(name))} on ` +
                    `${this.name} was declared as a reactive property ` +
                    `but it's actually declared as a value on the prototype. ` +
                    `Usually this is due to using @property or @state on a method.`);
            }
            issueWarning('reactive-property-without-getter', `Field ${JSON.stringify(String(name))} on ` +
                `${this.name} was declared as a reactive property ` +
                `but it does not have a getter. This will be an error in a ` +
                `future version of Lit.`);
        }
        return {
            get,
            set(value) {
                const oldValue = get?.call(this);
                set?.call(this, value);
                this.requestUpdate(name, oldValue, options);
            },
            configurable: true,
            enumerable: true,
        };
    }
    /**
     * Returns the property options associated with the given property.
     * These options are defined with a `PropertyDeclaration` via the `properties`
     * object or the `@property` decorator and are registered in
     * `createProperty(...)`.
     *
     * Note, this method should be considered "final" and not overridden. To
     * customize the options for a given property, override
     * {@linkcode createProperty}.
     *
     * @nocollapse
     * @final
     * @category properties
     */
    static getPropertyOptions(name) {
        return this.elementProperties.get(name) ?? defaultPropertyDeclaration;
    }
    /**
     * Initializes static own properties of the class used in bookkeeping
     * for element properties, initializers, etc.
     *
     * Can be called multiple times by code that needs to ensure these
     * properties exist before using them.
     *
     * This method ensures the superclass is finalized so that inherited
     * property metadata can be copied down.
     * @nocollapse
     */
    static __prepare() {
        if (this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))) {
            // Already prepared
            return;
        }
        // Finalize any superclasses
        const superCtor = getPrototypeOf(this);
        superCtor.finalize();
        // Create own set of initializers for this class if any exist on the
        // superclass and copy them down. Note, for a small perf boost, avoid
        // creating initializers unless needed.
        if (superCtor._initializers !== undefined) {
            this._initializers = [...superCtor._initializers];
        }
        // Initialize elementProperties from the superclass
        this.elementProperties = new Map(superCtor.elementProperties);
    }
    /**
     * Finishes setting up the class so that it's ready to be registered
     * as a custom element and instantiated.
     *
     * This method is called by the ReactiveElement.observedAttributes getter.
     * If you override the observedAttributes getter, you must either call
     * super.observedAttributes to trigger finalization, or call finalize()
     * yourself.
     *
     * @nocollapse
     */
    static finalize() {
        if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {
            return;
        }
        this.finalized = true;
        this.__prepare();
        // Create properties from the static properties block:
        if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {
            const props = this.properties;
            const propKeys = [
                ...getOwnPropertyNames(props),
                ...getOwnPropertySymbols(props),
            ];
            for (const p of propKeys) {
                this.createProperty(p, props[p]);
            }
        }
        // Create properties from standard decorator metadata:
        const metadata = this[Symbol.metadata];
        if (metadata !== null) {
            const properties = litPropertyMetadata.get(metadata);
            if (properties !== undefined) {
                for (const [p, options] of properties) {
                    this.elementProperties.set(p, options);
                }
            }
        }
        // Create the attribute-to-property map
        this.__attributeToPropertyMap = new Map();
        for (const [p, options] of this.elementProperties) {
            const attr = this.__attributeNameForProperty(p, options);
            if (attr !== undefined) {
                this.__attributeToPropertyMap.set(attr, p);
            }
        }
        this.elementStyles = this.finalizeStyles(this.styles);
        if (DEV_MODE) {
            if (this.hasOwnProperty('createProperty')) {
                issueWarning('no-override-create-property', 'Overriding ReactiveElement.createProperty() is deprecated. ' +
                    'The override will not be called with standard decorators');
            }
            if (this.hasOwnProperty('getPropertyDescriptor')) {
                issueWarning('no-override-get-property-descriptor', 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +
                    'The override will not be called with standard decorators');
            }
        }
    }
    /**
     * Takes the styles the user supplied via the `static styles` property and
     * returns the array of styles to apply to the element.
     * Override this method to integrate into a style management system.
     *
     * Styles are deduplicated preserving the _last_ instance in the list. This
     * is a performance optimization to avoid duplicated styles that can occur
     * especially when composing via subclassing. The last item is kept to try
     * to preserve the cascade order with the assumption that it's most important
     * that last added styles override previous styles.
     *
     * @nocollapse
     * @category styles
     */
    static finalizeStyles(styles) {
        const elementStyles = [];
        if (Array.isArray(styles)) {
            // Dedupe the flattened array in reverse order to preserve the last items.
            // Casting to Array<unknown> works around TS error that
            // appears to come from trying to flatten a type CSSResultArray.
            const set = new Set(styles.flat(Infinity).reverse());
            // Then preserve original order by adding the set items in reverse order.
            for (const s of set) {
                elementStyles.unshift((0,_css_tag_js__WEBPACK_IMPORTED_MODULE_0__.getCompatibleStyle)(s));
            }
        }
        else if (styles !== undefined) {
            elementStyles.push((0,_css_tag_js__WEBPACK_IMPORTED_MODULE_0__.getCompatibleStyle)(styles));
        }
        return elementStyles;
    }
    /**
     * Returns the property name for the given attribute `name`.
     * @nocollapse
     */
    static __attributeNameForProperty(name, options) {
        const attribute = options.attribute;
        return attribute === false
            ? undefined
            : typeof attribute === 'string'
                ? attribute
                : typeof name === 'string'
                    ? name.toLowerCase()
                    : undefined;
    }
    constructor() {
        super();
        this.__instanceProperties = undefined;
        /**
         * True if there is a pending update as a result of calling `requestUpdate()`.
         * Should only be read.
         * @category updates
         */
        this.isUpdatePending = false;
        /**
         * Is set to `true` after the first update. The element code cannot assume
         * that `renderRoot` exists before the element `hasUpdated`.
         * @category updates
         */
        this.hasUpdated = false;
        /**
         * Name of currently reflecting property
         */
        this.__reflectingProperty = null;
        this.__initialize();
    }
    /**
     * Internal only override point for customizing work done when elements
     * are constructed.
     */
    __initialize() {
        this.__updatePromise = new Promise((res) => (this.enableUpdating = res));
        this._$changedProperties = new Map();
        // This enqueues a microtask that must run before the first update, so it
        // must be called before requestUpdate()
        this.__saveInstanceProperties();
        // ensures first update will be caught by an early access of
        // `updateComplete`
        this.requestUpdate();
        this.constructor._initializers?.forEach((i) => i(this));
    }
    /**
     * Registers a `ReactiveController` to participate in the element's reactive
     * update cycle. The element automatically calls into any registered
     * controllers during its lifecycle callbacks.
     *
     * If the element is connected when `addController()` is called, the
     * controller's `hostConnected()` callback will be immediately called.
     * @category controllers
     */
    addController(controller) {
        (this.__controllers ??= new Set()).add(controller);
        // If a controller is added after the element has been connected,
        // call hostConnected. Note, re-using existence of `renderRoot` here
        // (which is set in connectedCallback) to avoid the need to track a
        // first connected state.
        if (this.renderRoot !== undefined && this.isConnected) {
            controller.hostConnected?.();
        }
    }
    /**
     * Removes a `ReactiveController` from the element.
     * @category controllers
     */
    removeController(controller) {
        this.__controllers?.delete(controller);
    }
    /**
     * Fixes any properties set on the instance before upgrade time.
     * Otherwise these would shadow the accessor and break these properties.
     * The properties are stored in a Map which is played back after the
     * constructor runs.
     */
    __saveInstanceProperties() {
        const instanceProperties = new Map();
        const elementProperties = this.constructor
            .elementProperties;
        for (const p of elementProperties.keys()) {
            if (this.hasOwnProperty(p)) {
                instanceProperties.set(p, this[p]);
                delete this[p];
            }
        }
        if (instanceProperties.size > 0) {
            this.__instanceProperties = instanceProperties;
        }
    }
    /**
     * Returns the node into which the element should render and by default
     * creates and returns an open shadowRoot. Implement to customize where the
     * element's DOM is rendered. For example, to render into the element's
     * childNodes, return `this`.
     *
     * @return Returns a node into which to render.
     * @category rendering
     */
    createRenderRoot() {
        const renderRoot = this.shadowRoot ??
            this.attachShadow(this.constructor.shadowRootOptions);
        (0,_css_tag_js__WEBPACK_IMPORTED_MODULE_0__.adoptStyles)(renderRoot, this.constructor.elementStyles);
        return renderRoot;
    }
    /**
     * On first connection, creates the element's renderRoot, sets up
     * element styling, and enables updating.
     * @category lifecycle
     */
    connectedCallback() {
        // Create renderRoot before controllers `hostConnected`
        this.renderRoot ??=
            this.createRenderRoot();
        this.enableUpdating(true);
        this.__controllers?.forEach((c) => c.hostConnected?.());
    }
    /**
     * Note, this method should be considered final and not overridden. It is
     * overridden on the element instance with a function that triggers the first
     * update.
     * @category updates
     */
    enableUpdating(_requestedUpdate) { }
    /**
     * Allows for `super.disconnectedCallback()` in extensions while
     * reserving the possibility of making non-breaking feature additions
     * when disconnecting at some point in the future.
     * @category lifecycle
     */
    disconnectedCallback() {
        this.__controllers?.forEach((c) => c.hostDisconnected?.());
    }
    /**
     * Synchronizes property values when attributes change.
     *
     * Specifically, when an attribute is set, the corresponding property is set.
     * You should rarely need to implement this callback. If this method is
     * overridden, `super.attributeChangedCallback(name, _old, value)` must be
     * called.
     *
     * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)
     * on MDN for more information about the `attributeChangedCallback`.
     * @category attributes
     */
    attributeChangedCallback(name, _old, value) {
        this._$attributeToProperty(name, value);
    }
    __propertyToAttribute(name, value) {
        const elemProperties = this.constructor.elementProperties;
        const options = elemProperties.get(name);
        const attr = this.constructor.__attributeNameForProperty(name, options);
        if (attr !== undefined && options.reflect === true) {
            const converter = options.converter?.toAttribute !==
                undefined
                ? options.converter
                : defaultConverter;
            const attrValue = converter.toAttribute(value, options.type);
            if (DEV_MODE &&
                this.constructor.enabledWarnings.includes('migration') &&
                attrValue === undefined) {
                issueWarning('undefined-attribute-value', `The attribute value for the ${name} property is ` +
                    `undefined on element ${this.localName}. The attribute will be ` +
                    `removed, but in the previous version of \`ReactiveElement\`, ` +
                    `the attribute would not have changed.`);
            }
            // Track if the property is being reflected to avoid
            // setting the property again via `attributeChangedCallback`. Note:
            // 1. this takes advantage of the fact that the callback is synchronous.
            // 2. will behave incorrectly if multiple attributes are in the reaction
            // stack at time of calling. However, since we process attributes
            // in `update` this should not be possible (or an extreme corner case
            // that we'd like to discover).
            // mark state reflecting
            this.__reflectingProperty = name;
            if (attrValue == null) {
                this.removeAttribute(attr);
            }
            else {
                this.setAttribute(attr, attrValue);
            }
            // mark state not reflecting
            this.__reflectingProperty = null;
        }
    }
    /** @internal */
    _$attributeToProperty(name, value) {
        const ctor = this.constructor;
        // Note, hint this as an `AttributeMap` so closure clearly understands
        // the type; it has issues with tracking types through statics
        const propName = ctor.__attributeToPropertyMap.get(name);
        // Use tracking info to avoid reflecting a property value to an attribute
        // if it was just set because the attribute changed.
        if (propName !== undefined && this.__reflectingProperty !== propName) {
            const options = ctor.getPropertyOptions(propName);
            const converter = typeof options.converter === 'function'
                ? { fromAttribute: options.converter }
                : options.converter?.fromAttribute !== undefined
                    ? options.converter
                    : defaultConverter;
            // mark state reflecting
            this.__reflectingProperty = propName;
            this[propName] =
                converter.fromAttribute(value, options.type) ??
                    this.__defaultValues?.get(propName) ??
                    // eslint-disable-next-line @typescript-eslint/no-explicit-any
                    null;
            // mark state not reflecting
            this.__reflectingProperty = null;
        }
    }
    /**
     * Requests an update which is processed asynchronously. This should be called
     * when an element should update based on some state not triggered by setting
     * a reactive property. In this case, pass no arguments. It should also be
     * called when manually implementing a property setter. In this case, pass the
     * property `name` and `oldValue` to ensure that any configured property
     * options are honored.
     *
     * @param name name of requesting property
     * @param oldValue old value of requesting property
     * @param options property options to use instead of the previously
     *     configured options
     * @category updates
     */
    requestUpdate(name, oldValue, options) {
        // If we have a property key, perform property update steps.
        if (name !== undefined) {
            if (DEV_MODE && name instanceof Event) {
                issueWarning(``, `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`);
            }
            const ctor = this.constructor;
            const newValue = this[name];
            options ??= ctor.getPropertyOptions(name);
            const changed = (options.hasChanged ?? notEqual)(newValue, oldValue) ||
                // When there is no change, check a corner case that can occur when
                // 1. there's a initial value which was not reflected
                // 2. the property is subsequently set to this value.
                // For example, `prop: {useDefault: true, reflect: true}`
                // and el.prop = 'foo'. This should be considered a change if the
                // attribute is not set because we will now reflect the property to the attribute.
                (options.useDefault &&
                    options.reflect &&
                    newValue === this.__defaultValues?.get(name) &&
                    !this.hasAttribute(ctor.__attributeNameForProperty(name, options)));
            if (changed) {
                this._$changeProperty(name, oldValue, options);
            }
            else {
                // Abort the request if the property should not be considered changed.
                return;
            }
        }
        if (this.isUpdatePending === false) {
            this.__updatePromise = this.__enqueueUpdate();
        }
    }
    /**
     * @internal
     */
    _$changeProperty(name, oldValue, { useDefault, reflect, wrapped }, initializeValue) {
        // Record default value when useDefault is used. This allows us to
        // restore this value when the attribute is removed.
        if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {
            this.__defaultValues.set(name, initializeValue ?? oldValue ?? this[name]);
            // if this is not wrapping an accessor, it must be an initial setting
            // and in this case we do not want to record the change or reflect.
            if (wrapped !== true || initializeValue !== undefined) {
                return;
            }
        }
        // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(
        // vs just Map.set()
        if (!this._$changedProperties.has(name)) {
            // On the initial change, the old value should be `undefined`, except
            // with `useDefault`
            if (!this.hasUpdated && !useDefault) {
                oldValue = undefined;
            }
            this._$changedProperties.set(name, oldValue);
        }
        // Add to reflecting properties set.
        // Note, it's important that every change has a chance to add the
        // property to `__reflectingProperties`. This ensures setting
        // attribute + property reflects correctly.
        if (reflect === true && this.__reflectingProperty !== name) {
            (this.__reflectingProperties ??= new Set()).add(name);
        }
    }
    /**
     * Sets up the element to asynchronously update.
     */
    async __enqueueUpdate() {
        this.isUpdatePending = true;
        try {
            // Ensure any previous update has resolved before updating.
            // This `await` also ensures that property changes are batched.
            await this.__updatePromise;
        }
        catch (e) {
            // Refire any previous errors async so they do not disrupt the update
            // cycle. Errors are refired so developers have a chance to observe
            // them, and this can be done by implementing
            // `window.onunhandledrejection`.
            Promise.reject(e);
        }
        const result = this.scheduleUpdate();
        // If `scheduleUpdate` returns a Promise, we await it. This is done to
        // enable coordinating updates with a scheduler. Note, the result is
        // checked to avoid delaying an additional microtask unless we need to.
        if (result != null) {
            await result;
        }
        return !this.isUpdatePending;
    }
    /**
     * Schedules an element update. You can override this method to change the
     * timing of updates by returning a Promise. The update will await the
     * returned Promise, and you should resolve the Promise to allow the update
     * to proceed. If this method is overridden, `super.scheduleUpdate()`
     * must be called.
     *
     * For instance, to schedule updates to occur just before the next frame:
     *
     * ```ts
     * override protected async scheduleUpdate(): Promise<unknown> {
     *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));
     *   super.scheduleUpdate();
     * }
     * ```
     * @category updates
     */
    scheduleUpdate() {
        const result = this.performUpdate();
        if (DEV_MODE &&
            this.constructor.enabledWarnings.includes('async-perform-update') &&
            typeof result?.then ===
                'function') {
            issueWarning('async-perform-update', `Element ${this.localName} returned a Promise from performUpdate(). ` +
                `This behavior is deprecated and will be removed in a future ` +
                `version of ReactiveElement.`);
        }
        return result;
    }
    /**
     * Performs an element update. Note, if an exception is thrown during the
     * update, `firstUpdated` and `updated` will not be called.
     *
     * Call `performUpdate()` to immediately process a pending update. This should
     * generally not be needed, but it can be done in rare cases when you need to
     * update synchronously.
     *
     * @category updates
     */
    performUpdate() {
        // Abort any update if one is not pending when this is called.
        // This can happen if `performUpdate` is called early to "flush"
        // the update.
        if (!this.isUpdatePending) {
            return;
        }
        debugLogEvent?.({ kind: 'update' });
        if (!this.hasUpdated) {
            // Create renderRoot before first update. This occurs in `connectedCallback`
            // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.
            this.renderRoot ??=
                this.createRenderRoot();
            if (DEV_MODE) {
                // Produce warning if any reactive properties on the prototype are
                // shadowed by class fields. Instance fields set before upgrade are
                // deleted by this point, so any own property is caused by class field
                // initialization in the constructor.
                const ctor = this.constructor;
                const shadowedProperties = [...ctor.elementProperties.keys()].filter((p) => this.hasOwnProperty(p) && p in getPrototypeOf(this));
                if (shadowedProperties.length) {
                    throw new Error(`The following properties on element ${this.localName} will not ` +
                        `trigger updates as expected because they are set using class ` +
                        `fields: ${shadowedProperties.join(', ')}. ` +
                        `Native class fields and some compiled output will overwrite ` +
                        `accessors used for detecting changes. See ` +
                        `https://lit.dev/msg/class-field-shadowing ` +
                        `for more information.`);
                }
            }
            // Mixin instance properties once, if they exist.
            if (this.__instanceProperties) {
                // TODO (justinfagnani): should we use the stored value? Could a new value
                // have been set since we stored the own property value?
                for (const [p, value] of this.__instanceProperties) {
                    this[p] = value;
                }
                this.__instanceProperties = undefined;
            }
            // Trigger initial value reflection and populate the initial
            // `changedProperties` map, but only for the case of properties created
            // via `createProperty` on accessors, which will not have already
            // populated the `changedProperties` map since they are not set.
            // We can't know if these accessors had initializers, so we just set
            // them anyway - a difference from experimental decorators on fields and
            // standard decorators on auto-accessors.
            // For context see:
            // https://github.com/lit/lit/pull/4183#issuecomment-1711959635
            const elementProperties = this.constructor
                .elementProperties;
            if (elementProperties.size > 0) {
                for (const [p, options] of elementProperties) {
                    const { wrapped } = options;
                    const value = this[p];
                    if (wrapped === true &&
                        !this._$changedProperties.has(p) &&
                        value !== undefined) {
                        this._$changeProperty(p, undefined, options, value);
                    }
                }
            }
        }
        let shouldUpdate = false;
        const changedProperties = this._$changedProperties;
        try {
            shouldUpdate = this.shouldUpdate(changedProperties);
            if (shouldUpdate) {
                this.willUpdate(changedProperties);
                this.__controllers?.forEach((c) => c.hostUpdate?.());
                this.update(changedProperties);
            }
            else {
                this.__markUpdated();
            }
        }
        catch (e) {
            // Prevent `firstUpdated` and `updated` from running when there's an
            // update exception.
            shouldUpdate = false;
            // Ensure element can accept additional updates after an exception.
            this.__markUpdated();
            throw e;
        }
        // The update is no longer considered pending and further updates are now allowed.
        if (shouldUpdate) {
            this._$didUpdate(changedProperties);
        }
    }
    /**
     * Invoked before `update()` to compute values needed during the update.
     *
     * Implement `willUpdate` to compute property values that depend on other
     * properties and are used in the rest of the update process.
     *
     * ```ts
     * willUpdate(changedProperties) {
     *   // only need to check changed properties for an expensive computation.
     *   if (changedProperties.has('firstName') || changedProperties.has('lastName')) {
     *     this.sha = computeSHA(`${this.firstName} ${this.lastName}`);
     *   }
     * }
     *
     * render() {
     *   return html`SHA: ${this.sha}`;
     * }
     * ```
     *
     * @category updates
     */
    willUpdate(_changedProperties) { }
    // Note, this is an override point for polyfill-support.
    // @internal
    _$didUpdate(changedProperties) {
        this.__controllers?.forEach((c) => c.hostUpdated?.());
        if (!this.hasUpdated) {
            this.hasUpdated = true;
            this.firstUpdated(changedProperties);
        }
        this.updated(changedProperties);
        if (DEV_MODE &&
            this.isUpdatePending &&
            this.constructor.enabledWarnings.includes('change-in-update')) {
            issueWarning('change-in-update', `Element ${this.localName} scheduled an update ` +
                `(generally because a property was set) ` +
                `after an update completed, causing a new update to be scheduled. ` +
                `This is inefficient and should be avoided unless the next update ` +
                `can only be scheduled as a side effect of the previous update.`);
        }
    }
    __markUpdated() {
        this._$changedProperties = new Map();
        this.isUpdatePending = false;
    }
    /**
     * Returns a Promise that resolves when the element has completed updating.
     * The Promise value is a boolean that is `true` if the element completed the
     * update without triggering another update. The Promise result is `false` if
     * a property was set inside `updated()`. If the Promise is rejected, an
     * exception was thrown during the update.
     *
     * To await additional asynchronous work, override the `getUpdateComplete`
     * method. For example, it is sometimes useful to await a rendered element
     * before fulfilling this Promise. To do this, first await
     * `super.getUpdateComplete()`, then any subsequent state.
     *
     * @return A promise of a boolean that resolves to true if the update completed
     *     without triggering another update.
     * @category updates
     */
    get updateComplete() {
        return this.getUpdateComplete();
    }
    /**
     * Override point for the `updateComplete` promise.
     *
     * It is not safe to override the `updateComplete` getter directly due to a
     * limitation in TypeScript which means it is not possible to call a
     * superclass getter (e.g. `super.updateComplete.then(...)`) when the target
     * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).
     * This method should be overridden instead. For example:
     *
     * ```ts
     * class MyElement extends LitElement {
     *   override async getUpdateComplete() {
     *     const result = await super.getUpdateComplete();
     *     await this._myChild.updateComplete;
     *     return result;
     *   }
     * }
     * ```
     *
     * @return A promise of a boolean that resolves to true if the update completed
     *     without triggering another update.
     * @category updates
     */
    getUpdateComplete() {
        return this.__updatePromise;
    }
    /**
     * Controls whether or not `update()` should be called when the element requests
     * an update. By default, this method always returns `true`, but this can be
     * customized to control when to update.
     *
     * @param _changedProperties Map of changed properties with old values
     * @category updates
     */
    shouldUpdate(_changedProperties) {
        return true;
    }
    /**
     * Updates the element. This method reflects property values to attributes.
     * It can be overridden to render and keep updated element DOM.
     * Setting properties inside this method will *not* trigger
     * another update.
     *
     * @param _changedProperties Map of changed properties with old values
     * @category updates
     */
    update(_changedProperties) {
        // The forEach() expression will only run when __reflectingProperties is
        // defined, and it returns undefined, setting __reflectingProperties to
        // undefined
        this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) => this.__propertyToAttribute(p, this[p]));
        this.__markUpdated();
    }
    /**
     * Invoked whenever the element is updated. Implement to perform
     * post-updating tasks via DOM APIs, for example, focusing an element.
     *
     * Setting properties inside this method will trigger the element to update
     * again after this update cycle completes.
     *
     * @param _changedProperties Map of changed properties with old values
     * @category updates
     */
    updated(_changedProperties) { }
    /**
     * Invoked when the element is first updated. Implement to perform one time
     * work on the element after update.
     *
     * ```ts
     * firstUpdated() {
     *   this.renderRoot.getElementById('my-text-area').focus();
     * }
     * ```
     *
     * Setting properties inside this method will trigger the element to update
     * again after this update cycle completes.
     *
     * @param _changedProperties Map of changed properties with old values
     * @category updates
     */
    firstUpdated(_changedProperties) { }
}
/**
 * Memoized list of all element styles.
 * Created lazily on user subclasses when finalizing the class.
 * @nocollapse
 * @category styles
 */
ReactiveElement.elementStyles = [];
/**
 * Options used when calling `attachShadow`. Set this property to customize
 * the options for the shadowRoot; for example, to create a closed
 * shadowRoot: `{mode: 'closed'}`.
 *
 * Note, these options are used in `createRenderRoot`. If this method
 * is customized, options should be respected if possible.
 * @nocollapse
 * @category rendering
 */
ReactiveElement.shadowRootOptions = { mode: 'open' };
// Assigned here to work around a jscompiler bug with static fields
// when compiling to ES5.
// https://github.com/google/closure-compiler/issues/3177
ReactiveElement[JSCompiler_renameProperty('elementProperties', ReactiveElement)] = new Map();
ReactiveElement[JSCompiler_renameProperty('finalized', ReactiveElement)] = new Map();
// Apply polyfills if available
polyfillSupport?.({ ReactiveElement });
// Dev mode warnings...
if (DEV_MODE) {
    // Default warning set.
    ReactiveElement.enabledWarnings = [
        'change-in-update',
        'async-perform-update',
    ];
    const ensureOwnWarnings = function (ctor) {
        if (!ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))) {
            ctor.enabledWarnings = ctor.enabledWarnings.slice();
        }
    };
    ReactiveElement.enableWarning = function (warning) {
        ensureOwnWarnings(this);
        if (!this.enabledWarnings.includes(warning)) {
            this.enabledWarnings.push(warning);
        }
    };
    ReactiveElement.disableWarning = function (warning) {
        ensureOwnWarnings(this);
        const i = this.enabledWarnings.indexOf(warning);
        if (i >= 0) {
            this.enabledWarnings.splice(i, 1);
        }
    };
}
// IMPORTANT: do not change the property name or the assignment expression.
// This line will be used in regexes to search for ReactiveElement usage.
(global.reactiveElementVersions ??= []).push('2.1.0');
if (DEV_MODE && global.reactiveElementVersions.length > 1) {
    queueMicrotask(() => {
        issueWarning('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
            `is not recommended.`);
    });
}
//# sourceMappingURL=reactive-element.js.map

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/createPopper.js":
/*!*********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/createPopper.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createPopper: () => (/* binding */ createPopper),
/* harmony export */   detectOverflow: () => (/* reexport safe */ _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   popperGenerator: () => (/* binding */ popperGenerator)
/* harmony export */ });
/* harmony import */ var _dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dom-utils/getCompositeRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js");
/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js");
/* harmony import */ var _dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom-utils/listScrollParents.js */ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/orderModifiers.js */ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js");
/* harmony import */ var _utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/debounce.js */ "./node_modules/@popperjs/core/lib/utils/debounce.js");
/* harmony import */ var _utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/mergeByName.js */ "./node_modules/@popperjs/core/lib/utils/mergeByName.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");









var DEFAULT_OPTIONS = {
  placement: 'bottom',
  modifiers: [],
  strategy: 'absolute'
};

function areValidElements() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  return !args.some(function (element) {
    return !(element && typeof element.getBoundingClientRect === 'function');
  });
}

function popperGenerator(generatorOptions) {
  if (generatorOptions === void 0) {
    generatorOptions = {};
  }

  var _generatorOptions = generatorOptions,
      _generatorOptions$def = _generatorOptions.defaultModifiers,
      defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
      _generatorOptions$def2 = _generatorOptions.defaultOptions,
      defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  return function createPopper(reference, popper, options) {
    if (options === void 0) {
      options = defaultOptions;
    }

    var state = {
      placement: 'bottom',
      orderedModifiers: [],
      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
      modifiersData: {},
      elements: {
        reference: reference,
        popper: popper
      },
      attributes: {},
      styles: {}
    };
    var effectCleanupFns = [];
    var isDestroyed = false;
    var instance = {
      state: state,
      setOptions: function setOptions(setOptionsAction) {
        var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
        cleanupModifierEffects();
        state.options = Object.assign({}, defaultOptions, state.options, options);
        state.scrollParents = {
          reference: (0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(reference) ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reference) : reference.contextElement ? (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reference.contextElement) : [],
          popper: (0,_dom_utils_listScrollParents_js__WEBPACK_IMPORTED_MODULE_1__["default"])(popper)
        }; // Orders the modifiers based on their dependencies and `phase`
        // properties

        var orderedModifiers = (0,_utils_orderModifiers_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_utils_mergeByName_js__WEBPACK_IMPORTED_MODULE_3__["default"])([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers

        state.orderedModifiers = orderedModifiers.filter(function (m) {
          return m.enabled;
        });
        runModifierEffects();
        return instance.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function forceUpdate() {
        if (isDestroyed) {
          return;
        }

        var _state$elements = state.elements,
            reference = _state$elements.reference,
            popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
        // anymore

        if (!areValidElements(reference, popper)) {
          return;
        } // Store the reference and popper rects to be read by modifiers


        state.rects = {
          reference: (0,_dom_utils_getCompositeRect_js__WEBPACK_IMPORTED_MODULE_4__["default"])(reference, (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_5__["default"])(popper), state.options.strategy === 'fixed'),
          popper: (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(popper)
        }; // Modifiers have the ability to reset the current update cycle. The
        // most common use case for this is the `flip` modifier changing the
        // placement, which then needs to re-run all the modifiers, because the
        // logic was previously ran for the previous placement and is therefore
        // stale/incorrect

        state.reset = false;
        state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
        // is filled with the initial data specified by the modifier. This means
        // it doesn't persist and is fresh on each update.
        // To ensure persistent data, use `${name}#persistent`

        state.orderedModifiers.forEach(function (modifier) {
          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
        });

        for (var index = 0; index < state.orderedModifiers.length; index++) {
          if (state.reset === true) {
            state.reset = false;
            index = -1;
            continue;
          }

          var _state$orderedModifie = state.orderedModifiers[index],
              fn = _state$orderedModifie.fn,
              _state$orderedModifie2 = _state$orderedModifie.options,
              _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
              name = _state$orderedModifie.name;

          if (typeof fn === 'function') {
            state = fn({
              state: state,
              options: _options,
              name: name,
              instance: instance
            }) || state;
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: (0,_utils_debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"])(function () {
        return new Promise(function (resolve) {
          instance.forceUpdate();
          resolve(state);
        });
      }),
      destroy: function destroy() {
        cleanupModifierEffects();
        isDestroyed = true;
      }
    };

    if (!areValidElements(reference, popper)) {
      return instance;
    }

    instance.setOptions(options).then(function (state) {
      if (!isDestroyed && options.onFirstUpdate) {
        options.onFirstUpdate(state);
      }
    }); // Modifiers have the ability to execute arbitrary code before the first
    // update cycle runs. They will be executed in the same order as the update
    // cycle. This is useful when a modifier adds some persistent data that
    // other modifiers need to use, but the modifier is run after the dependent
    // one.

    function runModifierEffects() {
      state.orderedModifiers.forEach(function (_ref) {
        var name = _ref.name,
            _ref$options = _ref.options,
            options = _ref$options === void 0 ? {} : _ref$options,
            effect = _ref.effect;

        if (typeof effect === 'function') {
          var cleanupFn = effect({
            state: state,
            name: name,
            instance: instance,
            options: options
          });

          var noopFn = function noopFn() {};

          effectCleanupFns.push(cleanupFn || noopFn);
        }
      });
    }

    function cleanupModifierEffects() {
      effectCleanupFns.forEach(function (fn) {
        return fn();
      });
      effectCleanupFns = [];
    }

    return instance;
  };
}
var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules



/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/contains.js":
/*!***************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/contains.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ contains)
/* harmony export */ });
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");

function contains(parent, child) {
  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method

  if (parent.contains(child)) {
    return true;
  } // then fallback to custom implementation with Shadow DOM support
  else if (rootNode && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(rootNode)) {
      var next = child;

      do {
        if (next && parent.isSameNode(next)) {
          return true;
        } // $FlowFixMe[prop-missing]: need a better way to handle this...


        next = next.parentNode || next.host;
      } while (next);
    } // Give up, the result is false


  return false;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js":
/*!****************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getBoundingClientRect)
/* harmony export */ });
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isLayoutViewport.js */ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js");




function getBoundingClientRect(element, includeScale, isFixedStrategy) {
  if (includeScale === void 0) {
    includeScale = false;
  }

  if (isFixedStrategy === void 0) {
    isFixedStrategy = false;
  }

  var clientRect = element.getBoundingClientRect();
  var scaleX = 1;
  var scaleY = 1;

  if (includeScale && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) {
    scaleX = element.offsetWidth > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.width) / element.offsetWidth || 1 : 1;
    scaleY = element.offsetHeight > 0 ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_1__.round)(clientRect.height) / element.offsetHeight || 1 : 1;
  }

  var _ref = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element) : window,
      visualViewport = _ref.visualViewport;

  var addVisualOffsets = !(0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_3__["default"])() && isFixedStrategy;
  var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
  var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
  var width = clientRect.width / scaleX;
  var height = clientRect.height / scaleY;
  return {
    width: width,
    height: height,
    top: y,
    right: x + width,
    bottom: y + height,
    left: x,
    x: x,
    y: y
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getClippingRect)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getViewportRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js");
/* harmony import */ var _getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getDocumentRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js");
/* harmony import */ var _listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./listScrollParents.js */ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js");
/* harmony import */ var _getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./contains.js */ "./node_modules/@popperjs/core/lib/dom-utils/contains.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/rectToClientRect.js */ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");















function getInnerBoundingClientRect(element, strategy) {
  var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element, false, strategy === 'fixed');
  rect.top = rect.top + element.clientTop;
  rect.left = rect.left + element.clientLeft;
  rect.bottom = rect.top + element.clientHeight;
  rect.right = rect.left + element.clientWidth;
  rect.width = element.clientWidth;
  rect.height = element.clientHeight;
  rect.x = rect.left;
  rect.y = rect.top;
  return rect;
}

function getClientRectFromMixedType(element, clippingParent, strategy) {
  return clippingParent === _enums_js__WEBPACK_IMPORTED_MODULE_1__.viewport ? (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_getViewportRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element, strategy)) : (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : (0,_utils_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_getDocumentRect_js__WEBPACK_IMPORTED_MODULE_5__["default"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(element)));
} // A "clipping parent" is an overflowable container with the characteristic of
// clipping (or hiding) overflowing elements with a position different from
// `initial`


function getClippingParents(element) {
  var clippingParents = (0,_listScrollParents_js__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_8__["default"])(element));
  var canEscapeClipping = ['absolute', 'fixed'].indexOf((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_9__["default"])(element).position) >= 0;
  var clipperElement = canEscapeClipping && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isHTMLElement)(element) ? (0,_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_10__["default"])(element) : element;

  if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clipperElement)) {
    return [];
  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414


  return clippingParents.filter(function (clippingParent) {
    return (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(clippingParent) && (0,_contains_js__WEBPACK_IMPORTED_MODULE_11__["default"])(clippingParent, clipperElement) && (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_12__["default"])(clippingParent) !== 'body';
  });
} // Gets the maximum area that the element is visible in due to any number of
// clipping parents


function getClippingRect(element, boundary, rootBoundary, strategy) {
  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
  var firstClippingParent = clippingParents[0];
  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
    var rect = getClientRectFromMixedType(element, clippingParent, strategy);
    accRect.top = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.top, accRect.top);
    accRect.right = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.right, accRect.right);
    accRect.bottom = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.min)(rect.bottom, accRect.bottom);
    accRect.left = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_13__.max)(rect.left, accRect.left);
    return accRect;
  }, getClientRectFromMixedType(element, firstClippingParent, strategy));
  clippingRect.width = clippingRect.right - clippingRect.left;
  clippingRect.height = clippingRect.bottom - clippingRect.top;
  clippingRect.x = clippingRect.left;
  clippingRect.y = clippingRect.top;
  return clippingRect;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getCompositeRect)
/* harmony export */ });
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getNodeScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");









function isElementScaled(element) {
  var rect = element.getBoundingClientRect();
  var scaleX = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.width) / element.offsetWidth || 1;
  var scaleY = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(rect.height) / element.offsetHeight || 1;
  return scaleX !== 1 || scaleY !== 1;
} // Returns the composite rect of an element relative to its offsetParent.
// Composite means it takes into account transforms as well as layout.


function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  if (isFixed === void 0) {
    isFixed = false;
  }

  var isOffsetParentAnElement = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent);
  var offsetParentIsScaled = (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent) && isElementScaled(offsetParent);
  var documentElement = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(offsetParent);
  var rect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(elementOrVirtualElement, offsetParentIsScaled, isFixed);
  var scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  var offsets = {
    x: 0,
    y: 0
  };

  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
    (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_5__["default"])(documentElement)) {
      scroll = (0,_getNodeScroll_js__WEBPACK_IMPORTED_MODULE_6__["default"])(offsetParent);
    }

    if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(offsetParent)) {
      offsets = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])(offsetParent, true);
      offsets.x += offsetParent.clientLeft;
      offsets.y += offsetParent.clientTop;
    } else if (documentElement) {
      offsets.x = (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_7__["default"])(documentElement);
    }
  }

  return {
    x: rect.left + scroll.scrollLeft - offsets.x,
    y: rect.top + scroll.scrollTop - offsets.y,
    width: rect.width,
    height: rect.height
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getComputedStyle)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");

function getComputedStyle(element) {
  return (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element).getComputedStyle(element);
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js":
/*!*************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getDocumentElement)
/* harmony export */ });
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");

function getDocumentElement(element) {
  // $FlowFixMe[incompatible-return]: assume body is always available
  return (((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
  element.document) || window.document).documentElement;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getDocumentRect)
/* harmony export */ });
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js");
/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");




 // Gets the entire size of the scrollable document area, even extending outside
// of the `<html>` and `<body>` rect bounds if horizontally scrollable

function getDocumentRect(element) {
  var _element$ownerDocumen;

  var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element);
  var winScroll = (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
  var width = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  var height = (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  var x = -winScroll.scrollLeft + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element);
  var y = -winScroll.scrollTop;

  if ((0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_4__["default"])(body || html).direction === 'rtl') {
    x += (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_2__.max)(html.clientWidth, body ? body.clientWidth : 0) - width;
  }

  return {
    width: width,
    height: height,
    x: x,
    y: y
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js":
/*!***************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getHTMLElementScroll)
/* harmony export */ });
function getHTMLElementScroll(element) {
  return {
    scrollLeft: element.scrollLeft,
    scrollTop: element.scrollTop
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getLayoutRect)
/* harmony export */ });
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
 // Returns the layout rect of an element relative to its offsetParent. Layout
// means it doesn't take into account transforms.

function getLayoutRect(element) {
  var clientRect = (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element); // Use the clientRect sizes if it's not been transformed.
  // Fixes https://github.com/popperjs/popper-core/issues/1223

  var width = element.offsetWidth;
  var height = element.offsetHeight;

  if (Math.abs(clientRect.width - width) <= 1) {
    width = clientRect.width;
  }

  if (Math.abs(clientRect.height - height) <= 1) {
    height = clientRect.height;
  }

  return {
    x: element.offsetLeft,
    y: element.offsetTop,
    width: width,
    height: height
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js":
/*!******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getNodeName)
/* harmony export */ });
function getNodeName(element) {
  return element ? (element.nodeName || '').toLowerCase() : null;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getNodeScroll)
/* harmony export */ });
/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js");
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getHTMLElementScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js");




function getNodeScroll(node) {
  if (node === (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node) || !(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node)) {
    return (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node);
  } else {
    return (0,_getHTMLElementScroll_js__WEBPACK_IMPORTED_MODULE_3__["default"])(node);
  }
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getOffsetParent)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _isTableElement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isTableElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js");
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/userAgent.js */ "./node_modules/@popperjs/core/lib/utils/userAgent.js");








function getTrueOffsetParent(element) {
  if (!(0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || // https://github.com/popperjs/popper-core/issues/837
  (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element).position === 'fixed') {
    return null;
  }

  return element.offsetParent;
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
// return the containing block


function getContainingBlock(element) {
  var isFirefox = /firefox/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__["default"])());
  var isIE = /Trident/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_2__["default"])());

  if (isIE && (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element)) {
    // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
    var elementCss = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element);

    if (elementCss.position === 'fixed') {
      return null;
    }
  }

  var currentNode = (0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element);

  if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isShadowRoot)(currentNode)) {
    currentNode = currentNode.host;
  }

  while ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(currentNode) && ['html', 'body'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(currentNode)) < 0) {
    var css = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(currentNode); // This is non-exhaustive but covers the most common CSS properties that
    // create a containing block.
    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block

    if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
      return currentNode;
    } else {
      currentNode = currentNode.parentNode;
    }
  }

  return null;
} // Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.


function getOffsetParent(element) {
  var window = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_5__["default"])(element);
  var offsetParent = getTrueOffsetParent(element);

  while (offsetParent && (0,_isTableElement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(offsetParent) && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(offsetParent).position === 'static') {
    offsetParent = getTrueOffsetParent(offsetParent);
  }

  if (offsetParent && ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) === 'html' || (0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_4__["default"])(offsetParent) === 'body' && (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(offsetParent).position === 'static')) {
    return window;
  }

  return offsetParent || getContainingBlock(element) || window;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getParentNode)
/* harmony export */ });
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");



function getParentNode(element) {
  if ((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element) === 'html') {
    return element;
  }

  return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    element.parentNode || ( // DOM Element detected
    (0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isShadowRoot)(element) ? element.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element) // fallback

  );
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getScrollParent)
/* harmony export */ });
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js");
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _instanceOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");




function getScrollParent(node) {
  if (['html', 'body', '#document'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node)) >= 0) {
    // $FlowFixMe[incompatible-return]: assume body is always available
    return node.ownerDocument.body;
  }

  if ((0,_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__.isHTMLElement)(node) && (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node)) {
    return node;
  }

  return getScrollParent((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(node));
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getViewportRect)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getWindowScrollBarX.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js");
/* harmony import */ var _isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isLayoutViewport.js */ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js");




function getViewportRect(element, strategy) {
  var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element);
  var html = (0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
  var visualViewport = win.visualViewport;
  var width = html.clientWidth;
  var height = html.clientHeight;
  var x = 0;
  var y = 0;

  if (visualViewport) {
    width = visualViewport.width;
    height = visualViewport.height;
    var layoutViewport = (0,_isLayoutViewport_js__WEBPACK_IMPORTED_MODULE_2__["default"])();

    if (layoutViewport || !layoutViewport && strategy === 'fixed') {
      x = visualViewport.offsetLeft;
      y = visualViewport.offsetTop;
    }
  }

  return {
    width: width,
    height: height,
    x: x + (0,_getWindowScrollBarX_js__WEBPACK_IMPORTED_MODULE_3__["default"])(element),
    y: y
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js":
/*!****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getWindow)
/* harmony export */ });
function getWindow(node) {
  if (node == null) {
    return window;
  }

  if (node.toString() !== '[object Window]') {
    var ownerDocument = node.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView || window : window;
  }

  return node;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getWindowScroll)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");

function getWindowScroll(node) {
  var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node);
  var scrollLeft = win.pageXOffset;
  var scrollTop = win.pageYOffset;
  return {
    scrollLeft: scrollLeft,
    scrollTop: scrollTop
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js":
/*!**************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getWindowScrollBarX)
/* harmony export */ });
/* harmony import */ var _getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getWindowScroll.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js");



function getWindowScrollBarX(element) {
  // If <html> has a CSS width greater than the viewport, then this will be
  // incorrect for RTL.
  // Popper 1 is broken in this case and never had a bug report so let's assume
  // it's not an issue. I don't think anyone ever specifies width on <html>
  // anyway.
  // Browsers where the left scrollbar doesn't cause an issue report `0` for
  // this (e.g. Edge 2019, IE11, Safari)
  return (0,_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)).left + (0,_getWindowScroll_js__WEBPACK_IMPORTED_MODULE_2__["default"])(element).scrollLeft;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isElement: () => (/* binding */ isElement),
/* harmony export */   isHTMLElement: () => (/* binding */ isHTMLElement),
/* harmony export */   isShadowRoot: () => (/* binding */ isShadowRoot)
/* harmony export */ });
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");


function isElement(node) {
  var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).Element;
  return node instanceof OwnElement || node instanceof Element;
}

function isHTMLElement(node) {
  var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).HTMLElement;
  return node instanceof OwnElement || node instanceof HTMLElement;
}

function isShadowRoot(node) {
  // IE 11 has no ShadowRoot
  if (typeof ShadowRoot === 'undefined') {
    return false;
  }

  var OwnElement = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(node).ShadowRoot;
  return node instanceof OwnElement || node instanceof ShadowRoot;
}



/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ isLayoutViewport)
/* harmony export */ });
/* harmony import */ var _utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/userAgent.js */ "./node_modules/@popperjs/core/lib/utils/userAgent.js");

function isLayoutViewport() {
  return !/^((?!chrome|android).)*safari/i.test((0,_utils_userAgent_js__WEBPACK_IMPORTED_MODULE_0__["default"])());
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ isScrollParent)
/* harmony export */ });
/* harmony import */ var _getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");

function isScrollParent(element) {
  // Firefox wants us to check `-x` and `-y` variations as well
  var _getComputedStyle = (0,_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element),
      overflow = _getComputedStyle.overflow,
      overflowX = _getComputedStyle.overflowX,
      overflowY = _getComputedStyle.overflowY;

  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ isTableElement)
/* harmony export */ });
/* harmony import */ var _getNodeName_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");

function isTableElement(element) {
  return ['table', 'td', 'th'].indexOf((0,_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element)) >= 0;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js":
/*!************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ listScrollParents)
/* harmony export */ });
/* harmony import */ var _getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js");
/* harmony import */ var _getParentNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getParentNode.js */ "./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js");
/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isScrollParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js");




/*
given a DOM element, return the list of all scroll parents, up the list of ancesors
until we get to the top window object. This list is what we attach scroll listeners
to, because if any of these parent elements scroll, we'll need to re-calculate the
reference element's position.
*/

function listScrollParents(element, list) {
  var _element$ownerDocumen;

  if (list === void 0) {
    list = [];
  }

  var scrollParent = (0,_getScrollParent_js__WEBPACK_IMPORTED_MODULE_0__["default"])(element);
  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  var win = (0,_getWindow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(scrollParent);
  var target = isBody ? [win].concat(win.visualViewport || [], (0,_isScrollParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(scrollParent) ? scrollParent : []) : scrollParent;
  var updatedList = list.concat(target);
  return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
  updatedList.concat(listScrollParents((0,_getParentNode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(target)));
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/enums.js":
/*!**************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/enums.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   afterMain: () => (/* binding */ afterMain),
/* harmony export */   afterRead: () => (/* binding */ afterRead),
/* harmony export */   afterWrite: () => (/* binding */ afterWrite),
/* harmony export */   auto: () => (/* binding */ auto),
/* harmony export */   basePlacements: () => (/* binding */ basePlacements),
/* harmony export */   beforeMain: () => (/* binding */ beforeMain),
/* harmony export */   beforeRead: () => (/* binding */ beforeRead),
/* harmony export */   beforeWrite: () => (/* binding */ beforeWrite),
/* harmony export */   bottom: () => (/* binding */ bottom),
/* harmony export */   clippingParents: () => (/* binding */ clippingParents),
/* harmony export */   end: () => (/* binding */ end),
/* harmony export */   left: () => (/* binding */ left),
/* harmony export */   main: () => (/* binding */ main),
/* harmony export */   modifierPhases: () => (/* binding */ modifierPhases),
/* harmony export */   placements: () => (/* binding */ placements),
/* harmony export */   popper: () => (/* binding */ popper),
/* harmony export */   read: () => (/* binding */ read),
/* harmony export */   reference: () => (/* binding */ reference),
/* harmony export */   right: () => (/* binding */ right),
/* harmony export */   start: () => (/* binding */ start),
/* harmony export */   top: () => (/* binding */ top),
/* harmony export */   variationPlacements: () => (/* binding */ variationPlacements),
/* harmony export */   viewport: () => (/* binding */ viewport),
/* harmony export */   write: () => (/* binding */ write)
/* harmony export */ });
var top = 'top';
var bottom = 'bottom';
var right = 'right';
var left = 'left';
var auto = 'auto';
var basePlacements = [top, bottom, right, left];
var start = 'start';
var end = 'end';
var clippingParents = 'clippingParents';
var viewport = 'viewport';
var popper = 'popper';
var reference = 'reference';
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
  return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
  return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []); // modifiers that need to read the DOM

var beforeRead = 'beforeRead';
var read = 'read';
var afterRead = 'afterRead'; // pure-logic modifiers

var beforeMain = 'beforeMain';
var main = 'main';
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)

var beforeWrite = 'beforeWrite';
var write = 'write';
var afterWrite = 'afterWrite';
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/index.js":
/*!**************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   afterMain: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.afterMain),
/* harmony export */   afterRead: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.afterRead),
/* harmony export */   afterWrite: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.afterWrite),
/* harmony export */   applyStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.applyStyles),
/* harmony export */   arrow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.arrow),
/* harmony export */   auto: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.auto),
/* harmony export */   basePlacements: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements),
/* harmony export */   beforeMain: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.beforeMain),
/* harmony export */   beforeRead: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.beforeRead),
/* harmony export */   beforeWrite: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.beforeWrite),
/* harmony export */   bottom: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom),
/* harmony export */   clippingParents: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.clippingParents),
/* harmony export */   computeStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.computeStyles),
/* harmony export */   createPopper: () => (/* reexport safe */ _popper_js__WEBPACK_IMPORTED_MODULE_4__.createPopper),
/* harmony export */   createPopperBase: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_2__.createPopper),
/* harmony export */   createPopperLite: () => (/* reexport safe */ _popper_lite_js__WEBPACK_IMPORTED_MODULE_5__.createPopper),
/* harmony export */   detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   end: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.end),
/* harmony export */   eventListeners: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.eventListeners),
/* harmony export */   flip: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.flip),
/* harmony export */   hide: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.hide),
/* harmony export */   left: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.left),
/* harmony export */   main: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.main),
/* harmony export */   modifierPhases: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.modifierPhases),
/* harmony export */   offset: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.offset),
/* harmony export */   placements: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.placements),
/* harmony export */   popper: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper),
/* harmony export */   popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_2__.popperGenerator),
/* harmony export */   popperOffsets: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.popperOffsets),
/* harmony export */   preventOverflow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__.preventOverflow),
/* harmony export */   read: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.read),
/* harmony export */   reference: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.reference),
/* harmony export */   right: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.right),
/* harmony export */   start: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.start),
/* harmony export */   top: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.top),
/* harmony export */   variationPlacements: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements),
/* harmony export */   viewport: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.viewport),
/* harmony export */   write: () => (/* reexport safe */ _enums_js__WEBPACK_IMPORTED_MODULE_0__.write)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _modifiers_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/index.js */ "./node_modules/@popperjs/core/lib/modifiers/index.js");
/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/createPopper.js");
/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _popper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./popper.js */ "./node_modules/@popperjs/core/lib/popper.js");
/* harmony import */ var _popper_lite_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./popper-lite.js */ "./node_modules/@popperjs/core/lib/popper-lite.js");

 // eslint-disable-next-line import/no-unused-modules

 // eslint-disable-next-line import/no-unused-modules

 // eslint-disable-next-line import/no-unused-modules



/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js":
/*!******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-utils/getNodeName.js */ "./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js");
/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");

 // This modifier takes the styles prepared by the `computeStyles` modifier
// and applies them to the HTMLElements such as popper and arrow

function applyStyles(_ref) {
  var state = _ref.state;
  Object.keys(state.elements).forEach(function (name) {
    var style = state.styles[name] || {};
    var attributes = state.attributes[name] || {};
    var element = state.elements[name]; // arrow is optional + virtual elements

    if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)) {
      return;
    } // Flow doesn't support to extend this property, but it's the most
    // effective way to apply styles to an HTMLElement
    // $FlowFixMe[cannot-write]


    Object.assign(element.style, style);
    Object.keys(attributes).forEach(function (name) {
      var value = attributes[name];

      if (value === false) {
        element.removeAttribute(name);
      } else {
        element.setAttribute(name, value === true ? '' : value);
      }
    });
  });
}

function effect(_ref2) {
  var state = _ref2.state;
  var initialStyles = {
    popper: {
      position: state.options.strategy,
      left: '0',
      top: '0',
      margin: '0'
    },
    arrow: {
      position: 'absolute'
    },
    reference: {}
  };
  Object.assign(state.elements.popper.style, initialStyles.popper);
  state.styles = initialStyles;

  if (state.elements.arrow) {
    Object.assign(state.elements.arrow.style, initialStyles.arrow);
  }

  return function () {
    Object.keys(state.elements).forEach(function (name) {
      var element = state.elements[name];
      var attributes = state.attributes[name] || {};
      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them

      var style = styleProperties.reduce(function (style, property) {
        style[property] = '';
        return style;
      }, {}); // arrow is optional + virtual elements

      if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__["default"])(element)) {
        return;
      }

      Object.assign(element.style, style);
      Object.keys(attributes).forEach(function (attribute) {
        element.removeAttribute(attribute);
      });
    });
  };
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'applyStyles',
  enabled: true,
  phase: 'write',
  fn: applyStyles,
  effect: effect,
  requires: ['computeStyles']
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/arrow.js":
/*!************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/arrow.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js");
/* harmony import */ var _dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../dom-utils/contains.js */ "./node_modules/@popperjs/core/lib/dom-utils/contains.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js");
/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/within.js */ "./node_modules/@popperjs/core/lib/utils/within.js");
/* harmony import */ var _utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/mergePaddingObject.js */ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js");
/* harmony import */ var _utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/expandToHashMap.js */ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");








 // eslint-disable-next-line import/no-unused-modules

var toPaddingObject = function toPaddingObject(padding, state) {
  padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
    placement: state.placement
  })) : padding;
  return (0,_utils_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typeof padding !== 'number' ? padding : (0,_utils_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_2__.basePlacements));
};

function arrow(_ref) {
  var _state$modifiersData$;

  var state = _ref.state,
      name = _ref.name,
      options = _ref.options;
  var arrowElement = state.elements.arrow;
  var popperOffsets = state.modifiersData.popperOffsets;
  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(state.placement);
  var axis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(basePlacement);
  var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_2__.left, _enums_js__WEBPACK_IMPORTED_MODULE_2__.right].indexOf(basePlacement) >= 0;
  var len = isVertical ? 'height' : 'width';

  if (!arrowElement || !popperOffsets) {
    return;
  }

  var paddingObject = toPaddingObject(options.padding, state);
  var arrowRect = (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrowElement);
  var minProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.top : _enums_js__WEBPACK_IMPORTED_MODULE_2__.left;
  var maxProp = axis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_2__.right;
  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
  var startDiff = popperOffsets[axis] - state.rects.reference[axis];
  var arrowOffsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_6__["default"])(arrowElement);
  var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
  // outside of the popper bounds

  var min = paddingObject[minProp];
  var max = clientSize - arrowRect[len] - paddingObject[maxProp];
  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
  var offset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_7__.within)(min, center, max); // Prevents breaking syntax highlighting...

  var axisProp = axis;
  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
}

function effect(_ref2) {
  var state = _ref2.state,
      options = _ref2.options;
  var _options$element = options.element,
      arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;

  if (arrowElement == null) {
    return;
  } // CSS selector


  if (typeof arrowElement === 'string') {
    arrowElement = state.elements.popper.querySelector(arrowElement);

    if (!arrowElement) {
      return;
    }
  }

  if (!(0,_dom_utils_contains_js__WEBPACK_IMPORTED_MODULE_8__["default"])(state.elements.popper, arrowElement)) {
    return;
  }

  state.elements.arrow = arrowElement;
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'arrow',
  enabled: true,
  phase: 'main',
  fn: arrow,
  effect: effect,
  requires: ['popperOffsets'],
  requiresIfExists: ['preventOverflow']
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   mapToStyles: () => (/* binding */ mapToStyles)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getComputedStyle.js */ "./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js");
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");







 // eslint-disable-next-line import/no-unused-modules

var unsetSides = {
  top: 'auto',
  right: 'auto',
  bottom: 'auto',
  left: 'auto'
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
// Zooming can change the DPR, but it seems to report a value that will
// cleanly divide the values into the appropriate subpixels.

function roundOffsetsByDPR(_ref, win) {
  var x = _ref.x,
      y = _ref.y;
  var dpr = win.devicePixelRatio || 1;
  return {
    x: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(x * dpr) / dpr || 0,
    y: (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_0__.round)(y * dpr) / dpr || 0
  };
}

function mapToStyles(_ref2) {
  var _Object$assign2;

  var popper = _ref2.popper,
      popperRect = _ref2.popperRect,
      placement = _ref2.placement,
      variation = _ref2.variation,
      offsets = _ref2.offsets,
      position = _ref2.position,
      gpuAcceleration = _ref2.gpuAcceleration,
      adaptive = _ref2.adaptive,
      roundOffsets = _ref2.roundOffsets,
      isFixed = _ref2.isFixed;
  var _offsets$x = offsets.x,
      x = _offsets$x === void 0 ? 0 : _offsets$x,
      _offsets$y = offsets.y,
      y = _offsets$y === void 0 ? 0 : _offsets$y;

  var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
    x: x,
    y: y
  }) : {
    x: x,
    y: y
  };

  x = _ref3.x;
  y = _ref3.y;
  var hasX = offsets.hasOwnProperty('x');
  var hasY = offsets.hasOwnProperty('y');
  var sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.left;
  var sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.top;
  var win = window;

  if (adaptive) {
    var offsetParent = (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(popper);
    var heightProp = 'clientHeight';
    var widthProp = 'clientWidth';

    if (offsetParent === (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__["default"])(popper)) {
      offsetParent = (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(popper);

      if ((0,_dom_utils_getComputedStyle_js__WEBPACK_IMPORTED_MODULE_5__["default"])(offsetParent).position !== 'static' && position === 'absolute') {
        heightProp = 'scrollHeight';
        widthProp = 'scrollWidth';
      }
    } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it


    offsetParent = offsetParent;

    if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.right) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) {
      sideY = _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom;
      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
      offsetParent[heightProp];
      y -= offsetY - popperRect.height;
      y *= gpuAcceleration ? 1 : -1;
    }

    if (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.left || (placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.top || placement === _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom) && variation === _enums_js__WEBPACK_IMPORTED_MODULE_1__.end) {
      sideX = _enums_js__WEBPACK_IMPORTED_MODULE_1__.right;
      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
      offsetParent[widthProp];
      x -= offsetX - popperRect.width;
      x *= gpuAcceleration ? 1 : -1;
    }
  }

  var commonStyles = Object.assign({
    position: position
  }, adaptive && unsetSides);

  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
    x: x,
    y: y
  }, (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_3__["default"])(popper)) : {
    x: x,
    y: y
  };

  x = _ref4.x;
  y = _ref4.y;

  if (gpuAcceleration) {
    var _Object$assign;

    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
  }

  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
}

function computeStyles(_ref5) {
  var state = _ref5.state,
      options = _ref5.options;
  var _options$gpuAccelerat = options.gpuAcceleration,
      gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
      _options$adaptive = options.adaptive,
      adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
      _options$roundOffsets = options.roundOffsets,
      roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  var commonStyles = {
    placement: (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state.placement),
    variation: (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_7__["default"])(state.placement),
    popper: state.elements.popper,
    popperRect: state.rects.popper,
    gpuAcceleration: gpuAcceleration,
    isFixed: state.options.strategy === 'fixed'
  };

  if (state.modifiersData.popperOffsets != null) {
    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.popperOffsets,
      position: state.options.strategy,
      adaptive: adaptive,
      roundOffsets: roundOffsets
    })));
  }

  if (state.modifiersData.arrow != null) {
    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.arrow,
      position: 'absolute',
      adaptive: false,
      roundOffsets: roundOffsets
    })));
  }

  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    'data-popper-placement': state.placement
  });
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'computeStyles',
  enabled: true,
  phase: 'beforeWrite',
  fn: computeStyles,
  data: {}
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-utils/getWindow.js */ "./node_modules/@popperjs/core/lib/dom-utils/getWindow.js");
 // eslint-disable-next-line import/no-unused-modules

var passive = {
  passive: true
};

function effect(_ref) {
  var state = _ref.state,
      instance = _ref.instance,
      options = _ref.options;
  var _options$scroll = options.scroll,
      scroll = _options$scroll === void 0 ? true : _options$scroll,
      _options$resize = options.resize,
      resize = _options$resize === void 0 ? true : _options$resize;
  var window = (0,_dom_utils_getWindow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(state.elements.popper);
  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);

  if (scroll) {
    scrollParents.forEach(function (scrollParent) {
      scrollParent.addEventListener('scroll', instance.update, passive);
    });
  }

  if (resize) {
    window.addEventListener('resize', instance.update, passive);
  }

  return function () {
    if (scroll) {
      scrollParents.forEach(function (scrollParent) {
        scrollParent.removeEventListener('scroll', instance.update, passive);
      });
    }

    if (resize) {
      window.removeEventListener('resize', instance.update, passive);
    }
  };
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'eventListeners',
  enabled: true,
  phase: 'write',
  fn: function fn() {},
  effect: effect,
  data: {}
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/flip.js":
/*!***********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/flip.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getOppositePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js");
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getOppositeVariationPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/computeAutoPlacement.js */ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");






 // eslint-disable-next-line import/no-unused-modules

function getExpandedFallbackPlacements(placement) {
  if ((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto) {
    return [];
  }

  var oppositePlacement = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(placement);
  return [(0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(placement), oppositePlacement, (0,_utils_getOppositeVariationPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(oppositePlacement)];
}

function flip(_ref) {
  var state = _ref.state,
      options = _ref.options,
      name = _ref.name;

  if (state.modifiersData[name]._skip) {
    return;
  }

  var _options$mainAxis = options.mainAxis,
      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
      _options$altAxis = options.altAxis,
      checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
      specifiedFallbackPlacements = options.fallbackPlacements,
      padding = options.padding,
      boundary = options.boundary,
      rootBoundary = options.rootBoundary,
      altBoundary = options.altBoundary,
      _options$flipVariatio = options.flipVariations,
      flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
      allowedAutoPlacements = options.allowedAutoPlacements;
  var preferredPlacement = state.options.placement;
  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(preferredPlacement);
  var isBasePlacement = basePlacement === preferredPlacement;
  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [(0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
  var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
    return acc.concat((0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.auto ? (0,_utils_computeAutoPlacement_js__WEBPACK_IMPORTED_MODULE_4__["default"])(state, {
      placement: placement,
      boundary: boundary,
      rootBoundary: rootBoundary,
      padding: padding,
      flipVariations: flipVariations,
      allowedAutoPlacements: allowedAutoPlacements
    }) : placement);
  }, []);
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var checksMap = new Map();
  var makeFallbackChecks = true;
  var firstFittingPlacement = placements[0];

  for (var i = 0; i < placements.length; i++) {
    var placement = placements[i];

    var _basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement);

    var isStartVariation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_5__["default"])(placement) === _enums_js__WEBPACK_IMPORTED_MODULE_1__.start;
    var isVertical = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.top, _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom].indexOf(_basePlacement) >= 0;
    var len = isVertical ? 'width' : 'height';
    var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state, {
      placement: placement,
      boundary: boundary,
      rootBoundary: rootBoundary,
      altBoundary: altBoundary,
      padding: padding
    });
    var mainVariationSide = isVertical ? isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.right : _enums_js__WEBPACK_IMPORTED_MODULE_1__.left : isStartVariation ? _enums_js__WEBPACK_IMPORTED_MODULE_1__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_1__.top;

    if (referenceRect[len] > popperRect[len]) {
      mainVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(mainVariationSide);
    }

    var altVariationSide = (0,_utils_getOppositePlacement_js__WEBPACK_IMPORTED_MODULE_2__["default"])(mainVariationSide);
    var checks = [];

    if (checkMainAxis) {
      checks.push(overflow[_basePlacement] <= 0);
    }

    if (checkAltAxis) {
      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
    }

    if (checks.every(function (check) {
      return check;
    })) {
      firstFittingPlacement = placement;
      makeFallbackChecks = false;
      break;
    }

    checksMap.set(placement, checks);
  }

  if (makeFallbackChecks) {
    // `2` may be desired in some cases – research later
    var numberOfChecks = flipVariations ? 3 : 1;

    var _loop = function _loop(_i) {
      var fittingPlacement = placements.find(function (placement) {
        var checks = checksMap.get(placement);

        if (checks) {
          return checks.slice(0, _i).every(function (check) {
            return check;
          });
        }
      });

      if (fittingPlacement) {
        firstFittingPlacement = fittingPlacement;
        return "break";
      }
    };

    for (var _i = numberOfChecks; _i > 0; _i--) {
      var _ret = _loop(_i);

      if (_ret === "break") break;
    }
  }

  if (state.placement !== firstFittingPlacement) {
    state.modifiersData[name]._skip = true;
    state.placement = firstFittingPlacement;
    state.reset = true;
  }
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'flip',
  enabled: true,
  phase: 'main',
  fn: flip,
  requiresIfExists: ['offset'],
  data: {
    _skip: false
  }
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/hide.js":
/*!***********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/hide.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");



function getSideOffsets(overflow, rect, preventedOffsets) {
  if (preventedOffsets === void 0) {
    preventedOffsets = {
      x: 0,
      y: 0
    };
  }

  return {
    top: overflow.top - rect.height - preventedOffsets.y,
    right: overflow.right - rect.width + preventedOffsets.x,
    bottom: overflow.bottom - rect.height + preventedOffsets.y,
    left: overflow.left - rect.width - preventedOffsets.x
  };
}

function isAnySideFullyClipped(overflow) {
  return [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom, _enums_js__WEBPACK_IMPORTED_MODULE_0__.left].some(function (side) {
    return overflow[side] >= 0;
  });
}

function hide(_ref) {
  var state = _ref.state,
      name = _ref.name;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var preventedOffsets = state.modifiersData.preventOverflow;
  var referenceOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, {
    elementContext: 'reference'
  });
  var popperAltOverflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state, {
    altBoundary: true
  });
  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
  state.modifiersData[name] = {
    referenceClippingOffsets: referenceClippingOffsets,
    popperEscapeOffsets: popperEscapeOffsets,
    isReferenceHidden: isReferenceHidden,
    hasPopperEscaped: hasPopperEscaped
  };
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    'data-popper-reference-hidden': isReferenceHidden,
    'data-popper-escaped': hasPopperEscaped
  });
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'hide',
  enabled: true,
  phase: 'main',
  requiresIfExists: ['preventOverflow'],
  fn: hide
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/index.js":
/*!************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/index.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   applyStyles: () => (/* reexport safe */ _applyStyles_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   arrow: () => (/* reexport safe */ _arrow_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   computeStyles: () => (/* reexport safe */ _computeStyles_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   eventListeners: () => (/* reexport safe */ _eventListeners_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   flip: () => (/* reexport safe */ _flip_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   hide: () => (/* reexport safe */ _hide_js__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   offset: () => (/* reexport safe */ _offset_js__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   popperOffsets: () => (/* reexport safe */ _popperOffsets_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   preventOverflow: () => (/* reexport safe */ _preventOverflow_js__WEBPACK_IMPORTED_MODULE_8__["default"])
/* harmony export */ });
/* harmony import */ var _applyStyles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./applyStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js");
/* harmony import */ var _arrow_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./arrow.js */ "./node_modules/@popperjs/core/lib/modifiers/arrow.js");
/* harmony import */ var _computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./computeStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js");
/* harmony import */ var _eventListeners_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eventListeners.js */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js");
/* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flip.js */ "./node_modules/@popperjs/core/lib/modifiers/flip.js");
/* harmony import */ var _hide_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hide.js */ "./node_modules/@popperjs/core/lib/modifiers/hide.js");
/* harmony import */ var _offset_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./offset.js */ "./node_modules/@popperjs/core/lib/modifiers/offset.js");
/* harmony import */ var _popperOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./popperOffsets.js */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js");
/* harmony import */ var _preventOverflow_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./preventOverflow.js */ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js");










/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/offset.js":
/*!*************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/offset.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   distanceAndSkiddingToXY: () => (/* binding */ distanceAndSkiddingToXY)
/* harmony export */ });
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");

 // eslint-disable-next-line import/no-unused-modules

function distanceAndSkiddingToXY(placement, rects, offset) {
  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement);
  var invertDistance = [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.top].indexOf(basePlacement) >= 0 ? -1 : 1;

  var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
    placement: placement
  })) : offset,
      skidding = _ref[0],
      distance = _ref[1];

  skidding = skidding || 0;
  distance = (distance || 0) * invertDistance;
  return [_enums_js__WEBPACK_IMPORTED_MODULE_1__.left, _enums_js__WEBPACK_IMPORTED_MODULE_1__.right].indexOf(basePlacement) >= 0 ? {
    x: distance,
    y: skidding
  } : {
    x: skidding,
    y: distance
  };
}

function offset(_ref2) {
  var state = _ref2.state,
      options = _ref2.options,
      name = _ref2.name;
  var _options$offset = options.offset,
      offset = _options$offset === void 0 ? [0, 0] : _options$offset;
  var data = _enums_js__WEBPACK_IMPORTED_MODULE_1__.placements.reduce(function (acc, placement) {
    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
    return acc;
  }, {});
  var _data$state$placement = data[state.placement],
      x = _data$state$placement.x,
      y = _data$state$placement.y;

  if (state.modifiersData.popperOffsets != null) {
    state.modifiersData.popperOffsets.x += x;
    state.modifiersData.popperOffsets.y += y;
  }

  state.modifiersData[name] = data;
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'offset',
  enabled: true,
  phase: 'main',
  requires: ['popperOffsets'],
  fn: offset
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js":
/*!********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/computeOffsets.js */ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js");


function popperOffsets(_ref) {
  var state = _ref.state,
      name = _ref.name;
  // Offsets are the actual position the popper needs to have to be
  // properly positioned near its reference element
  // This is the most basic placement, and will be adjusted by
  // the modifiers in the next step
  state.modifiersData[name] = (0,_utils_computeOffsets_js__WEBPACK_IMPORTED_MODULE_0__["default"])({
    reference: state.rects.reference,
    element: state.rects.popper,
    strategy: 'absolute',
    placement: state.placement
  });
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'popperOffsets',
  enabled: true,
  phase: 'read',
  fn: popperOffsets,
  data: {}
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js");
/* harmony import */ var _utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/getAltAxis.js */ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js");
/* harmony import */ var _utils_within_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/within.js */ "./node_modules/@popperjs/core/lib/utils/within.js");
/* harmony import */ var _dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getLayoutRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js");
/* harmony import */ var _dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom-utils/getOffsetParent.js */ "./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js");
/* harmony import */ var _utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/getFreshSideObject.js */ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js");
/* harmony import */ var _utils_math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");












function preventOverflow(_ref) {
  var state = _ref.state,
      options = _ref.options,
      name = _ref.name;
  var _options$mainAxis = options.mainAxis,
      checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
      _options$altAxis = options.altAxis,
      checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
      boundary = options.boundary,
      rootBoundary = options.rootBoundary,
      altBoundary = options.altBoundary,
      padding = options.padding,
      _options$tether = options.tether,
      tether = _options$tether === void 0 ? true : _options$tether,
      _options$tetherOffset = options.tetherOffset,
      tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
  var overflow = (0,_utils_detectOverflow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(state, {
    boundary: boundary,
    rootBoundary: rootBoundary,
    padding: padding,
    altBoundary: altBoundary
  });
  var basePlacement = (0,_utils_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_1__["default"])(state.placement);
  var variation = (0,_utils_getVariation_js__WEBPACK_IMPORTED_MODULE_2__["default"])(state.placement);
  var isBasePlacement = !variation;
  var mainAxis = (0,_utils_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(basePlacement);
  var altAxis = (0,_utils_getAltAxis_js__WEBPACK_IMPORTED_MODULE_4__["default"])(mainAxis);
  var popperOffsets = state.modifiersData.popperOffsets;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
    placement: state.placement
  })) : tetherOffset;
  var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
    mainAxis: tetherOffsetValue,
    altAxis: tetherOffsetValue
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, tetherOffsetValue);
  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
  var data = {
    x: 0,
    y: 0
  };

  if (!popperOffsets) {
    return;
  }

  if (checkMainAxis) {
    var _offsetModifierState$;

    var mainSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left;
    var altSide = mainAxis === 'y' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right;
    var len = mainAxis === 'y' ? 'height' : 'width';
    var offset = popperOffsets[mainAxis];
    var min = offset + overflow[mainSide];
    var max = offset - overflow[altSide];
    var additive = tether ? -popperRect[len] / 2 : 0;
    var minLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? referenceRect[len] : popperRect[len];
    var maxLen = variation === _enums_js__WEBPACK_IMPORTED_MODULE_5__.start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
    // outside the reference bounds

    var arrowElement = state.elements.arrow;
    var arrowRect = tether && arrowElement ? (0,_dom_utils_getLayoutRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(arrowElement) : {
      width: 0,
      height: 0
    };
    var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : (0,_utils_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])();
    var arrowPaddingMin = arrowPaddingObject[mainSide];
    var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
    // to include its full size in the calculation. If the reference is small
    // and near the edge of a boundary, the popper can overflow even if the
    // reference is not overflowing as well (e.g. virtual elements with no
    // width or height)

    var arrowLen = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(0, referenceRect[len], arrowRect[len]);
    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
    var arrowOffsetParent = state.elements.arrow && (0,_dom_utils_getOffsetParent_js__WEBPACK_IMPORTED_MODULE_9__["default"])(state.elements.arrow);
    var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
    var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
    var tetherMax = offset + maxOffset - offsetModifierValue;
    var preventedOffset = (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.min)(min, tetherMin) : min, offset, tether ? (0,_utils_math_js__WEBPACK_IMPORTED_MODULE_10__.max)(max, tetherMax) : max);
    popperOffsets[mainAxis] = preventedOffset;
    data[mainAxis] = preventedOffset - offset;
  }

  if (checkAltAxis) {
    var _offsetModifierState$2;

    var _mainSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.top : _enums_js__WEBPACK_IMPORTED_MODULE_5__.left;

    var _altSide = mainAxis === 'x' ? _enums_js__WEBPACK_IMPORTED_MODULE_5__.bottom : _enums_js__WEBPACK_IMPORTED_MODULE_5__.right;

    var _offset = popperOffsets[altAxis];

    var _len = altAxis === 'y' ? 'height' : 'width';

    var _min = _offset + overflow[_mainSide];

    var _max = _offset - overflow[_altSide];

    var isOriginSide = [_enums_js__WEBPACK_IMPORTED_MODULE_5__.top, _enums_js__WEBPACK_IMPORTED_MODULE_5__.left].indexOf(basePlacement) !== -1;

    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;

    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;

    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;

    var _preventedOffset = tether && isOriginSide ? (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.withinMaxClamp)(_tetherMin, _offset, _tetherMax) : (0,_utils_within_js__WEBPACK_IMPORTED_MODULE_8__.within)(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);

    popperOffsets[altAxis] = _preventedOffset;
    data[altAxis] = _preventedOffset - _offset;
  }

  state.modifiersData[name] = data;
} // eslint-disable-next-line import/no-unused-modules


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  name: 'preventOverflow',
  enabled: true,
  phase: 'main',
  fn: preventOverflow,
  requiresIfExists: ['offset']
});

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/popper-lite.js":
/*!********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/popper-lite.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createPopper: () => (/* binding */ createPopper),
/* harmony export */   defaultModifiers: () => (/* binding */ defaultModifiers),
/* harmony export */   detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_4__.popperGenerator)
/* harmony export */ });
/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/createPopper.js");
/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modifiers/eventListeners.js */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js");
/* harmony import */ var _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/popperOffsets.js */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js");
/* harmony import */ var _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifiers/computeStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js");
/* harmony import */ var _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/applyStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js");





var defaultModifiers = [_modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__["default"], _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__["default"], _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__["default"], _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__["default"]];
var createPopper = /*#__PURE__*/(0,_createPopper_js__WEBPACK_IMPORTED_MODULE_4__.popperGenerator)({
  defaultModifiers: defaultModifiers
}); // eslint-disable-next-line import/no-unused-modules



/***/ }),

/***/ "./node_modules/@popperjs/core/lib/popper.js":
/*!***************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/popper.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   applyStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.applyStyles),
/* harmony export */   arrow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.arrow),
/* harmony export */   computeStyles: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.computeStyles),
/* harmony export */   createPopper: () => (/* binding */ createPopper),
/* harmony export */   createPopperLite: () => (/* reexport safe */ _popper_lite_js__WEBPACK_IMPORTED_MODULE_11__.createPopper),
/* harmony export */   defaultModifiers: () => (/* binding */ defaultModifiers),
/* harmony export */   detectOverflow: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   eventListeners: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.eventListeners),
/* harmony export */   flip: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.flip),
/* harmony export */   hide: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.hide),
/* harmony export */   offset: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.offset),
/* harmony export */   popperGenerator: () => (/* reexport safe */ _createPopper_js__WEBPACK_IMPORTED_MODULE_9__.popperGenerator),
/* harmony export */   popperOffsets: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.popperOffsets),
/* harmony export */   preventOverflow: () => (/* reexport safe */ _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__.preventOverflow)
/* harmony export */ });
/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/createPopper.js");
/* harmony import */ var _createPopper_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./createPopper.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modifiers/eventListeners.js */ "./node_modules/@popperjs/core/lib/modifiers/eventListeners.js");
/* harmony import */ var _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modifiers/popperOffsets.js */ "./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js");
/* harmony import */ var _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modifiers/computeStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/computeStyles.js");
/* harmony import */ var _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modifiers/applyStyles.js */ "./node_modules/@popperjs/core/lib/modifiers/applyStyles.js");
/* harmony import */ var _modifiers_offset_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modifiers/offset.js */ "./node_modules/@popperjs/core/lib/modifiers/offset.js");
/* harmony import */ var _modifiers_flip_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modifiers/flip.js */ "./node_modules/@popperjs/core/lib/modifiers/flip.js");
/* harmony import */ var _modifiers_preventOverflow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modifiers/preventOverflow.js */ "./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js");
/* harmony import */ var _modifiers_arrow_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modifiers/arrow.js */ "./node_modules/@popperjs/core/lib/modifiers/arrow.js");
/* harmony import */ var _modifiers_hide_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modifiers/hide.js */ "./node_modules/@popperjs/core/lib/modifiers/hide.js");
/* harmony import */ var _popper_lite_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./popper-lite.js */ "./node_modules/@popperjs/core/lib/popper-lite.js");
/* harmony import */ var _modifiers_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modifiers/index.js */ "./node_modules/@popperjs/core/lib/modifiers/index.js");










var defaultModifiers = [_modifiers_eventListeners_js__WEBPACK_IMPORTED_MODULE_0__["default"], _modifiers_popperOffsets_js__WEBPACK_IMPORTED_MODULE_1__["default"], _modifiers_computeStyles_js__WEBPACK_IMPORTED_MODULE_2__["default"], _modifiers_applyStyles_js__WEBPACK_IMPORTED_MODULE_3__["default"], _modifiers_offset_js__WEBPACK_IMPORTED_MODULE_4__["default"], _modifiers_flip_js__WEBPACK_IMPORTED_MODULE_5__["default"], _modifiers_preventOverflow_js__WEBPACK_IMPORTED_MODULE_6__["default"], _modifiers_arrow_js__WEBPACK_IMPORTED_MODULE_7__["default"], _modifiers_hide_js__WEBPACK_IMPORTED_MODULE_8__["default"]];
var createPopper = /*#__PURE__*/(0,_createPopper_js__WEBPACK_IMPORTED_MODULE_9__.popperGenerator)({
  defaultModifiers: defaultModifiers
}); // eslint-disable-next-line import/no-unused-modules

 // eslint-disable-next-line import/no-unused-modules

 // eslint-disable-next-line import/no-unused-modules



/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ computeAutoPlacement)
/* harmony export */ });
/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./detectOverflow.js */ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js");
/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");




function computeAutoPlacement(state, options) {
  if (options === void 0) {
    options = {};
  }

  var _options = options,
      placement = _options.placement,
      boundary = _options.boundary,
      rootBoundary = _options.rootBoundary,
      padding = _options.padding,
      flipVariations = _options.flipVariations,
      _options$allowedAutoP = _options.allowedAutoPlacements,
      allowedAutoPlacements = _options$allowedAutoP === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.placements : _options$allowedAutoP;
  var variation = (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement);
  var placements = variation ? flipVariations ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements : _enums_js__WEBPACK_IMPORTED_MODULE_0__.variationPlacements.filter(function (placement) {
    return (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement) === variation;
  }) : _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements;
  var allowedPlacements = placements.filter(function (placement) {
    return allowedAutoPlacements.indexOf(placement) >= 0;
  });

  if (allowedPlacements.length === 0) {
    allowedPlacements = placements;
  } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...


  var overflows = allowedPlacements.reduce(function (acc, placement) {
    acc[placement] = (0,_detectOverflow_js__WEBPACK_IMPORTED_MODULE_2__["default"])(state, {
      placement: placement,
      boundary: boundary,
      rootBoundary: rootBoundary,
      padding: padding
    })[(0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(placement)];
    return acc;
  }, {});
  return Object.keys(overflows).sort(function (a, b) {
    return overflows[a] - overflows[b];
  });
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/computeOffsets.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ computeOffsets)
/* harmony export */ });
/* harmony import */ var _getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getBasePlacement.js */ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js");
/* harmony import */ var _getVariation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVariation.js */ "./node_modules/@popperjs/core/lib/utils/getVariation.js");
/* harmony import */ var _getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMainAxisFromPlacement.js */ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");




function computeOffsets(_ref) {
  var reference = _ref.reference,
      element = _ref.element,
      placement = _ref.placement;
  var basePlacement = placement ? (0,_getBasePlacement_js__WEBPACK_IMPORTED_MODULE_0__["default"])(placement) : null;
  var variation = placement ? (0,_getVariation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(placement) : null;
  var commonX = reference.x + reference.width / 2 - element.width / 2;
  var commonY = reference.y + reference.height / 2 - element.height / 2;
  var offsets;

  switch (basePlacement) {
    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.top:
      offsets = {
        x: commonX,
        y: reference.y - element.height
      };
      break;

    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.bottom:
      offsets = {
        x: commonX,
        y: reference.y + reference.height
      };
      break;

    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.right:
      offsets = {
        x: reference.x + reference.width,
        y: commonY
      };
      break;

    case _enums_js__WEBPACK_IMPORTED_MODULE_2__.left:
      offsets = {
        x: reference.x - element.width,
        y: commonY
      };
      break;

    default:
      offsets = {
        x: reference.x,
        y: reference.y
      };
  }

  var mainAxis = basePlacement ? (0,_getMainAxisFromPlacement_js__WEBPACK_IMPORTED_MODULE_3__["default"])(basePlacement) : null;

  if (mainAxis != null) {
    var len = mainAxis === 'y' ? 'height' : 'width';

    switch (variation) {
      case _enums_js__WEBPACK_IMPORTED_MODULE_2__.start:
        offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
        break;

      case _enums_js__WEBPACK_IMPORTED_MODULE_2__.end:
        offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
        break;

      default:
    }
  }

  return offsets;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/debounce.js":
/*!***********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/debounce.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ debounce)
/* harmony export */ });
function debounce(fn) {
  var pending;
  return function () {
    if (!pending) {
      pending = new Promise(function (resolve) {
        Promise.resolve().then(function () {
          pending = undefined;
          resolve(fn());
        });
      });
    }

    return pending;
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/detectOverflow.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/detectOverflow.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ detectOverflow)
/* harmony export */ });
/* harmony import */ var _dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../dom-utils/getClippingRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js");
/* harmony import */ var _dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom-utils/getDocumentElement.js */ "./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js");
/* harmony import */ var _dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../dom-utils/getBoundingClientRect.js */ "./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js");
/* harmony import */ var _computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./computeOffsets.js */ "./node_modules/@popperjs/core/lib/utils/computeOffsets.js");
/* harmony import */ var _rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rectToClientRect.js */ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js");
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
/* harmony import */ var _dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../dom-utils/instanceOf.js */ "./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js");
/* harmony import */ var _mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergePaddingObject.js */ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js");
/* harmony import */ var _expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./expandToHashMap.js */ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js");








 // eslint-disable-next-line import/no-unused-modules

function detectOverflow(state, options) {
  if (options === void 0) {
    options = {};
  }

  var _options = options,
      _options$placement = _options.placement,
      placement = _options$placement === void 0 ? state.placement : _options$placement,
      _options$strategy = _options.strategy,
      strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
      _options$boundary = _options.boundary,
      boundary = _options$boundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.clippingParents : _options$boundary,
      _options$rootBoundary = _options.rootBoundary,
      rootBoundary = _options$rootBoundary === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.viewport : _options$rootBoundary,
      _options$elementConte = _options.elementContext,
      elementContext = _options$elementConte === void 0 ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper : _options$elementConte,
      _options$altBoundary = _options.altBoundary,
      altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
      _options$padding = _options.padding,
      padding = _options$padding === void 0 ? 0 : _options$padding;
  var paddingObject = (0,_mergePaddingObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(typeof padding !== 'number' ? padding : (0,_expandToHashMap_js__WEBPACK_IMPORTED_MODULE_2__["default"])(padding, _enums_js__WEBPACK_IMPORTED_MODULE_0__.basePlacements));
  var altContext = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? _enums_js__WEBPACK_IMPORTED_MODULE_0__.reference : _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper;
  var popperRect = state.rects.popper;
  var element = state.elements[altBoundary ? altContext : elementContext];
  var clippingClientRect = (0,_dom_utils_getClippingRect_js__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(element) ? element : element.contextElement || (0,_dom_utils_getDocumentElement_js__WEBPACK_IMPORTED_MODULE_5__["default"])(state.elements.popper), boundary, rootBoundary, strategy);
  var referenceClientRect = (0,_dom_utils_getBoundingClientRect_js__WEBPACK_IMPORTED_MODULE_6__["default"])(state.elements.reference);
  var popperOffsets = (0,_computeOffsets_js__WEBPACK_IMPORTED_MODULE_7__["default"])({
    reference: referenceClientRect,
    element: popperRect,
    strategy: 'absolute',
    placement: placement
  });
  var popperClientRect = (0,_rectToClientRect_js__WEBPACK_IMPORTED_MODULE_8__["default"])(Object.assign({}, popperRect, popperOffsets));
  var elementClientRect = elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
  // 0 or negative = within the clipping rect

  var overflowOffsets = {
    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
    right: elementClientRect.right - clippingClientRect.right + paddingObject.right
  };
  var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element

  if (elementContext === _enums_js__WEBPACK_IMPORTED_MODULE_0__.popper && offsetData) {
    var offset = offsetData[placement];
    Object.keys(overflowOffsets).forEach(function (key) {
      var multiply = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.right, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 1 : -1;
      var axis = [_enums_js__WEBPACK_IMPORTED_MODULE_0__.top, _enums_js__WEBPACK_IMPORTED_MODULE_0__.bottom].indexOf(key) >= 0 ? 'y' : 'x';
      overflowOffsets[key] += offset[axis] * multiply;
    });
  }

  return overflowOffsets;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/expandToHashMap.js":
/*!******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ expandToHashMap)
/* harmony export */ });
function expandToHashMap(value, keys) {
  return keys.reduce(function (hashMap, key) {
    hashMap[key] = value;
    return hashMap;
  }, {});
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getAltAxis.js":
/*!*************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getAltAxis.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getAltAxis)
/* harmony export */ });
function getAltAxis(axis) {
  return axis === 'x' ? 'y' : 'x';
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getBasePlacement.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getBasePlacement)
/* harmony export */ });

function getBasePlacement(placement) {
  return placement.split('-')[0];
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getFreshSideObject)
/* harmony export */ });
function getFreshSideObject() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js":
/*!***************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getMainAxisFromPlacement)
/* harmony export */ });
function getMainAxisFromPlacement(placement) {
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js":
/*!***********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getOppositePlacement)
/* harmony export */ });
var hash = {
  left: 'right',
  right: 'left',
  bottom: 'top',
  top: 'bottom'
};
function getOppositePlacement(placement) {
  return placement.replace(/left|right|bottom|top/g, function (matched) {
    return hash[matched];
  });
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js":
/*!********************************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getOppositeVariationPlacement)
/* harmony export */ });
var hash = {
  start: 'end',
  end: 'start'
};
function getOppositeVariationPlacement(placement) {
  return placement.replace(/start|end/g, function (matched) {
    return hash[matched];
  });
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/getVariation.js":
/*!***************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/getVariation.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getVariation)
/* harmony export */ });
function getVariation(placement) {
  return placement.split('-')[1];
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/math.js":
/*!*******************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/math.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   max: () => (/* binding */ max),
/* harmony export */   min: () => (/* binding */ min),
/* harmony export */   round: () => (/* binding */ round)
/* harmony export */ });
var max = Math.max;
var min = Math.min;
var round = Math.round;

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/mergeByName.js":
/*!**************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/mergeByName.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ mergeByName)
/* harmony export */ });
function mergeByName(modifiers) {
  var merged = modifiers.reduce(function (merged, current) {
    var existing = merged[current.name];
    merged[current.name] = existing ? Object.assign({}, existing, current, {
      options: Object.assign({}, existing.options, current.options),
      data: Object.assign({}, existing.data, current.data)
    }) : current;
    return merged;
  }, {}); // IE11 does not support Object.values

  return Object.keys(merged).map(function (key) {
    return merged[key];
  });
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js":
/*!*********************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ mergePaddingObject)
/* harmony export */ });
/* harmony import */ var _getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getFreshSideObject.js */ "./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js");

function mergePaddingObject(paddingObject) {
  return Object.assign({}, (0,_getFreshSideObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(), paddingObject);
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/orderModifiers.js":
/*!*****************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/orderModifiers.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ orderModifiers)
/* harmony export */ });
/* harmony import */ var _enums_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums.js */ "./node_modules/@popperjs/core/lib/enums.js");
 // source: https://stackoverflow.com/questions/49875255

function order(modifiers) {
  var map = new Map();
  var visited = new Set();
  var result = [];
  modifiers.forEach(function (modifier) {
    map.set(modifier.name, modifier);
  }); // On visiting object, check for its dependencies and visit them recursively

  function sort(modifier) {
    visited.add(modifier.name);
    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
    requires.forEach(function (dep) {
      if (!visited.has(dep)) {
        var depModifier = map.get(dep);

        if (depModifier) {
          sort(depModifier);
        }
      }
    });
    result.push(modifier);
  }

  modifiers.forEach(function (modifier) {
    if (!visited.has(modifier.name)) {
      // check for visited object
      sort(modifier);
    }
  });
  return result;
}

function orderModifiers(modifiers) {
  // order based on dependencies
  var orderedModifiers = order(modifiers); // order based on phase

  return _enums_js__WEBPACK_IMPORTED_MODULE_0__.modifierPhases.reduce(function (acc, phase) {
    return acc.concat(orderedModifiers.filter(function (modifier) {
      return modifier.phase === phase;
    }));
  }, []);
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/rectToClientRect.js":
/*!*******************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ rectToClientRect)
/* harmony export */ });
function rectToClientRect(rect) {
  return Object.assign({}, rect, {
    left: rect.x,
    top: rect.y,
    right: rect.x + rect.width,
    bottom: rect.y + rect.height
  });
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/userAgent.js":
/*!************************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/userAgent.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getUAString)
/* harmony export */ });
function getUAString() {
  var uaData = navigator.userAgentData;

  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
    return uaData.brands.map(function (item) {
      return item.brand + "/" + item.version;
    }).join(' ');
  }

  return navigator.userAgent;
}

/***/ }),

/***/ "./node_modules/@popperjs/core/lib/utils/within.js":
/*!*********************************************************!*\
  !*** ./node_modules/@popperjs/core/lib/utils/within.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   within: () => (/* binding */ within),
/* harmony export */   withinMaxClamp: () => (/* binding */ withinMaxClamp)
/* harmony export */ });
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ "./node_modules/@popperjs/core/lib/utils/math.js");

function within(min, value, max) {
  return (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.max)(min, (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.min)(value, max));
}
function withinMaxClamp(min, value, max) {
  var v = within(min, value, max);
  return v > max ? max : v;
}

/***/ }),

/***/ "./node_modules/bootstrap/js/src/base-component.js":
/*!*********************************************************!*\
  !*** ./node_modules/bootstrap/js/src/base-component.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/data.js */ "./node_modules/bootstrap/js/src/dom/data.js");
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _util_config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/config.js */ "./node_modules/bootstrap/js/src/util/config.js");
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap base-component.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 



/**
 * Constants
 */ const VERSION = '5.3.6';
/**
 * Class definition
 */ class BaseComponent extends _util_config_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    // Public
    dispose() {
        _dom_data_js__WEBPACK_IMPORTED_MODULE_0__["default"].remove(this._element, this.constructor.DATA_KEY);
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(this._element, this.constructor.EVENT_KEY);
        for (const propertyName of Object.getOwnPropertyNames(this)){
            this[propertyName] = null;
        }
    }
    // Private
    _queueCallback(callback, element, isAnimated = true) {
        (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.executeAfterTransition)(callback, element, isAnimated);
    }
    _getConfig(config) {
        config = this._mergeConfigObj(config, this._element);
        config = this._configAfterMerge(config);
        this._typeCheckConfig(config);
        return config;
    }
    // Static
    static getInstance(element) {
        return _dom_data_js__WEBPACK_IMPORTED_MODULE_0__["default"].get((0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.getElement)(element), this.DATA_KEY);
    }
    static getOrCreateInstance(element, config = {}) {
        return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
    }
    static get VERSION() {
        return VERSION;
    }
    static get DATA_KEY() {
        return `bs.${this.NAME}`;
    }
    static get EVENT_KEY() {
        return `.${this.DATA_KEY}`;
    }
    static eventName(name) {
        return `${name}${this.EVENT_KEY}`;
    }
    constructor(element, config){
        super();
        element = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.getElement)(element);
        if (!element) {
            return;
        }
        this._element = element;
        this._config = this._getConfig(config);
        _dom_data_js__WEBPACK_IMPORTED_MODULE_0__["default"].set(this._element, this.constructor.DATA_KEY, this);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseComponent);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/dom/data.js":
/*!***************************************************!*\
  !*** ./node_modules/bootstrap/js/src/dom/data.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * --------------------------------------------------------------------------
 * Bootstrap dom/data.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ /**
 * Constants
 */ const elementMap = new Map();
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    set (element, key, instance) {
        if (!elementMap.has(element)) {
            elementMap.set(element, new Map());
        }
        const instanceMap = elementMap.get(element);
        // make it clear we only want one instance per element
        // can be removed later when multiple key/instances are fine to be used
        if (!instanceMap.has(key) && instanceMap.size !== 0) {
            // eslint-disable-next-line no-console
            console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
            return;
        }
        instanceMap.set(key, instance);
    },
    get (element, key) {
        if (elementMap.has(element)) {
            return elementMap.get(element).get(key) || null;
        }
        return null;
    },
    remove (element, key) {
        if (!elementMap.has(element)) {
            return;
        }
        const instanceMap = elementMap.get(element);
        instanceMap.delete(key);
        // free up element references if there are no instances left for an element
        if (instanceMap.size === 0) {
            elementMap.delete(element);
        }
    }
});


/***/ }),

/***/ "./node_modules/bootstrap/js/src/dom/event-handler.js":
/*!************************************************************!*\
  !*** ./node_modules/bootstrap/js/src/dom/event-handler.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap dom/event-handler.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 
/**
 * Constants
 */ const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
const stripNameRegex = /\..*/;
const stripUidRegex = /::\d+$/;
const eventRegistry = {} // Events storage
;
let uidEvent = 1;
const customEvents = {
    mouseenter: 'mouseover',
    mouseleave: 'mouseout'
};
const nativeEvents = new Set([
    'click',
    'dblclick',
    'mouseup',
    'mousedown',
    'contextmenu',
    'mousewheel',
    'DOMMouseScroll',
    'mouseover',
    'mouseout',
    'mousemove',
    'selectstart',
    'selectend',
    'keydown',
    'keypress',
    'keyup',
    'orientationchange',
    'touchstart',
    'touchmove',
    'touchend',
    'touchcancel',
    'pointerdown',
    'pointermove',
    'pointerup',
    'pointerleave',
    'pointercancel',
    'gesturestart',
    'gesturechange',
    'gestureend',
    'focus',
    'blur',
    'change',
    'reset',
    'select',
    'submit',
    'focusin',
    'focusout',
    'load',
    'unload',
    'beforeunload',
    'resize',
    'move',
    'DOMContentLoaded',
    'readystatechange',
    'error',
    'abort',
    'scroll'
]);
/**
 * Private methods
 */ function makeEventUid(element, uid) {
    return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
}
function getElementEvents(element) {
    const uid = makeEventUid(element);
    element.uidEvent = uid;
    eventRegistry[uid] = eventRegistry[uid] || {};
    return eventRegistry[uid];
}
function bootstrapHandler(element, fn) {
    return function handler(event) {
        hydrateObj(event, {
            delegateTarget: element
        });
        if (handler.oneOff) {
            EventHandler.off(element, event.type, fn);
        }
        return fn.apply(element, [
            event
        ]);
    };
}
function bootstrapDelegationHandler(element, selector, fn) {
    return function handler(event) {
        const domElements = element.querySelectorAll(selector);
        for(let { target } = event; target && target !== this; target = target.parentNode){
            for (const domElement of domElements){
                if (domElement !== target) {
                    continue;
                }
                hydrateObj(event, {
                    delegateTarget: target
                });
                if (handler.oneOff) {
                    EventHandler.off(element, event.type, selector, fn);
                }
                return fn.apply(target, [
                    event
                ]);
            }
        }
    };
}
function findHandler(events, callable, delegationSelector = null) {
    return Object.values(events).find((event)=>event.callable === callable && event.delegationSelector === delegationSelector);
}
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
    const isDelegated = typeof handler === 'string';
    // TODO: tooltip passes `false` instead of selector, so we need to check
    const callable = isDelegated ? delegationFunction : handler || delegationFunction;
    let typeEvent = getTypeEvent(originalTypeEvent);
    if (!nativeEvents.has(typeEvent)) {
        typeEvent = originalTypeEvent;
    }
    return [
        isDelegated,
        callable,
        typeEvent
    ];
}
function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
    if (typeof originalTypeEvent !== 'string' || !element) {
        return;
    }
    let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
    // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
    // this prevents the handler from being dispatched the same way as mouseover or mouseout does
    if (originalTypeEvent in customEvents) {
        const wrapFunction = (fn)=>{
            return function(event) {
                if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
                    return fn.call(this, event);
                }
            };
        };
        callable = wrapFunction(callable);
    }
    const events = getElementEvents(element);
    const handlers = events[typeEvent] || (events[typeEvent] = {});
    const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
    if (previousFunction) {
        previousFunction.oneOff = previousFunction.oneOff && oneOff;
        return;
    }
    const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
    const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
    fn.delegationSelector = isDelegated ? handler : null;
    fn.callable = callable;
    fn.oneOff = oneOff;
    fn.uidEvent = uid;
    handlers[uid] = fn;
    element.addEventListener(typeEvent, fn, isDelegated);
}
function removeHandler(element, events, typeEvent, handler, delegationSelector) {
    const fn = findHandler(events[typeEvent], handler, delegationSelector);
    if (!fn) {
        return;
    }
    element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
    delete events[typeEvent][fn.uidEvent];
}
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
    const storeElementEvent = events[typeEvent] || {};
    for (const [handlerKey, event] of Object.entries(storeElementEvent)){
        if (handlerKey.includes(namespace)) {
            removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
        }
    }
}
function getTypeEvent(event) {
    // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
    event = event.replace(stripNameRegex, '');
    return customEvents[event] || event;
}
const EventHandler = {
    on (element, event, handler, delegationFunction) {
        addHandler(element, event, handler, delegationFunction, false);
    },
    one (element, event, handler, delegationFunction) {
        addHandler(element, event, handler, delegationFunction, true);
    },
    off (element, originalTypeEvent, handler, delegationFunction) {
        if (typeof originalTypeEvent !== 'string' || !element) {
            return;
        }
        const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
        const inNamespace = typeEvent !== originalTypeEvent;
        const events = getElementEvents(element);
        const storeElementEvent = events[typeEvent] || {};
        const isNamespace = originalTypeEvent.startsWith('.');
        if (typeof callable !== 'undefined') {
            // Simplest case: handler is passed, remove that listener ONLY.
            if (!Object.keys(storeElementEvent).length) {
                return;
            }
            removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
            return;
        }
        if (isNamespace) {
            for (const elementEvent of Object.keys(events)){
                removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
            }
        }
        for (const [keyHandlers, event] of Object.entries(storeElementEvent)){
            const handlerKey = keyHandlers.replace(stripUidRegex, '');
            if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
                removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
            }
        }
    },
    trigger (element, event, args) {
        if (typeof event !== 'string' || !element) {
            return null;
        }
        const $ = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_0__.getjQuery)();
        const typeEvent = getTypeEvent(event);
        const inNamespace = event !== typeEvent;
        let jQueryEvent = null;
        let bubbles = true;
        let nativeDispatch = true;
        let defaultPrevented = false;
        if (inNamespace && $) {
            jQueryEvent = $.Event(event, args);
            $(element).trigger(jQueryEvent);
            bubbles = !jQueryEvent.isPropagationStopped();
            nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
            defaultPrevented = jQueryEvent.isDefaultPrevented();
        }
        const evt = hydrateObj(new Event(event, {
            bubbles,
            cancelable: true
        }), args);
        if (defaultPrevented) {
            evt.preventDefault();
        }
        if (nativeDispatch) {
            element.dispatchEvent(evt);
        }
        if (evt.defaultPrevented && jQueryEvent) {
            jQueryEvent.preventDefault();
        }
        return evt;
    }
};
function hydrateObj(obj, meta = {}) {
    for (const [key, value] of Object.entries(meta)){
        try {
            obj[key] = value;
        } catch (e) {
            Object.defineProperty(obj, key, {
                configurable: true,
                get () {
                    return value;
                }
            });
        }
    }
    return obj;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EventHandler);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/dom/manipulator.js":
/*!**********************************************************!*\
  !*** ./node_modules/bootstrap/js/src/dom/manipulator.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * --------------------------------------------------------------------------
 * Bootstrap dom/manipulator.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ function normalizeData(value) {
    if (value === 'true') {
        return true;
    }
    if (value === 'false') {
        return false;
    }
    if (value === Number(value).toString()) {
        return Number(value);
    }
    if (value === '' || value === 'null') {
        return null;
    }
    if (typeof value !== 'string') {
        return value;
    }
    try {
        return JSON.parse(decodeURIComponent(value));
    } catch (e) {
        return value;
    }
}
function normalizeDataKey(key) {
    return key.replace(/[A-Z]/g, (chr)=>`-${chr.toLowerCase()}`);
}
const Manipulator = {
    setDataAttribute (element, key, value) {
        element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
    },
    removeDataAttribute (element, key) {
        element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
    },
    getDataAttributes (element) {
        if (!element) {
            return {};
        }
        const attributes = {};
        const bsKeys = Object.keys(element.dataset).filter((key)=>key.startsWith('bs') && !key.startsWith('bsConfig'));
        for (const key of bsKeys){
            let pureKey = key.replace(/^bs/, '');
            pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1);
            attributes[pureKey] = normalizeData(element.dataset[key]);
        }
        return attributes;
    },
    getDataAttribute (element, key) {
        return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Manipulator);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/dom/selector-engine.js":
/*!**************************************************************!*\
  !*** ./node_modules/bootstrap/js/src/dom/selector-engine.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap dom/selector-engine.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 
const getSelector = (element)=>{
    let selector = element.getAttribute('data-bs-target');
    if (!selector || selector === '#') {
        let hrefAttribute = element.getAttribute('href');
        // The only valid content that could double as a selector are IDs or classes,
        // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
        // `document.querySelector` will rightfully complain it is invalid.
        // See https://github.com/twbs/bootstrap/issues/32273
        if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
            return null;
        }
        // Just in case some CMS puts out a full URL with the anchor appended
        if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
            hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
        }
        selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
    }
    return selector ? selector.split(',').map((sel)=>(0,_util_index_js__WEBPACK_IMPORTED_MODULE_0__.parseSelector)(sel)).join(',') : null;
};
const SelectorEngine = {
    find (selector, element = document.documentElement) {
        return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
    },
    findOne (selector, element = document.documentElement) {
        return Element.prototype.querySelector.call(element, selector);
    },
    children (element, selector) {
        return [].concat(...element.children).filter((child)=>child.matches(selector));
    },
    parents (element, selector) {
        const parents = [];
        let ancestor = element.parentNode.closest(selector);
        while(ancestor){
            parents.push(ancestor);
            ancestor = ancestor.parentNode.closest(selector);
        }
        return parents;
    },
    prev (element, selector) {
        let previous = element.previousElementSibling;
        while(previous){
            if (previous.matches(selector)) {
                return [
                    previous
                ];
            }
            previous = previous.previousElementSibling;
        }
        return [];
    },
    // TODO: this is now unused; remove later along with prev()
    next (element, selector) {
        let next = element.nextElementSibling;
        while(next){
            if (next.matches(selector)) {
                return [
                    next
                ];
            }
            next = next.nextElementSibling;
        }
        return [];
    },
    focusableChildren (element) {
        const focusables = [
            'a',
            'button',
            'input',
            'textarea',
            'select',
            'details',
            '[tabindex]',
            '[contenteditable="true"]'
        ].map((selector)=>`${selector}:not([tabindex^="-"])`).join(',');
        return this.find(focusables, element).filter((el)=>!(0,_util_index_js__WEBPACK_IMPORTED_MODULE_0__.isDisabled)(el) && (0,_util_index_js__WEBPACK_IMPORTED_MODULE_0__.isVisible)(el));
    },
    getSelectorFromElement (element) {
        const selector = getSelector(element);
        if (selector) {
            return SelectorEngine.findOne(selector) ? selector : null;
        }
        return null;
    },
    getElementFromSelector (element) {
        const selector = getSelector(element);
        return selector ? SelectorEngine.findOne(selector) : null;
    },
    getMultipleElementsFromSelector (element) {
        const selector = getSelector(element);
        return selector ? SelectorEngine.find(selector) : [];
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SelectorEngine);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/dropdown.js":
/*!***************************************************!*\
  !*** ./node_modules/bootstrap/js/src/dropdown.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/index.js");
/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/popper.js");
/* harmony import */ var _base_component_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-component.js */ "./node_modules/bootstrap/js/src/base-component.js");
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom/manipulator.js */ "./node_modules/bootstrap/js/src/dom/manipulator.js");
/* harmony import */ var _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dom/selector-engine.js */ "./node_modules/bootstrap/js/src/dom/selector-engine.js");
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap dropdown.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}






/**
 * Constants
 */ const NAME = 'dropdown';
const DATA_KEY = 'bs.dropdown';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';
const ESCAPE_KEY = 'Escape';
const TAB_KEY = 'Tab';
const ARROW_UP_KEY = 'ArrowUp';
const ARROW_DOWN_KEY = 'ArrowDown';
const RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button
;
const EVENT_HIDE = `hide${EVENT_KEY}`;
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
const EVENT_SHOW = `show${EVENT_KEY}`;
const EVENT_SHOWN = `shown${EVENT_KEY}`;
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`;
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`;
const CLASS_NAME_SHOW = 'show';
const CLASS_NAME_DROPUP = 'dropup';
const CLASS_NAME_DROPEND = 'dropend';
const CLASS_NAME_DROPSTART = 'dropstart';
const CLASS_NAME_DROPUP_CENTER = 'dropup-center';
const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center';
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';
const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`;
const SELECTOR_MENU = '.dropdown-menu';
const SELECTOR_NAVBAR = '.navbar';
const SELECTOR_NAVBAR_NAV = '.navbar-nav';
const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
const PLACEMENT_TOP = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? 'top-end' : 'top-start';
const PLACEMENT_TOPEND = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? 'top-start' : 'top-end';
const PLACEMENT_BOTTOM = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? 'bottom-end' : 'bottom-start';
const PLACEMENT_BOTTOMEND = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? 'bottom-start' : 'bottom-end';
const PLACEMENT_RIGHT = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? 'left-start' : 'right-start';
const PLACEMENT_LEFT = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isRTL)() ? 'right-start' : 'left-start';
const PLACEMENT_TOPCENTER = 'top';
const PLACEMENT_BOTTOMCENTER = 'bottom';
const Default = {
    autoClose: true,
    boundary: 'clippingParents',
    display: 'dynamic',
    offset: [
        0,
        2
    ],
    popperConfig: null,
    reference: 'toggle'
};
const DefaultType = {
    autoClose: '(boolean|string)',
    boundary: '(string|element)',
    display: 'string',
    offset: '(array|string|function)',
    popperConfig: '(null|object|function)',
    reference: '(string|element|object)'
};
/**
 * Class definition
 */ class Dropdown extends _base_component_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Public
    toggle() {
        return this._isShown() ? this.hide() : this.show();
    }
    show() {
        if ((0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isDisabled)(this._element) || this._isShown()) {
            return;
        }
        const relatedTarget = {
            relatedTarget: this._element
        };
        const showEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_SHOW, relatedTarget);
        if (showEvent.defaultPrevented) {
            return;
        }
        this._createPopper();
        // If this is a touch-enabled device we add extra
        // empty mouseover listeners to the body's immediate children;
        // only needed because of broken event delegation on iOS
        // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
        if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {
            for (const element of [].concat(...document.body.children)){
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(element, 'mouseover', _util_index_js__WEBPACK_IMPORTED_MODULE_4__.noop);
            }
        }
        this._element.focus();
        this._element.setAttribute('aria-expanded', true);
        this._menu.classList.add(CLASS_NAME_SHOW);
        this._element.classList.add(CLASS_NAME_SHOW);
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_SHOWN, relatedTarget);
    }
    hide() {
        if ((0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isDisabled)(this._element) || !this._isShown()) {
            return;
        }
        const relatedTarget = {
            relatedTarget: this._element
        };
        this._completeHide(relatedTarget);
    }
    dispose() {
        if (this._popper) {
            this._popper.destroy();
        }
        super.dispose();
    }
    update() {
        this._inNavbar = this._detectNavbar();
        if (this._popper) {
            this._popper.update();
        }
    }
    // Private
    _completeHide(relatedTarget) {
        const hideEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_HIDE, relatedTarget);
        if (hideEvent.defaultPrevented) {
            return;
        }
        // If this is a touch-enabled device we remove the extra
        // empty mouseover listeners we added for iOS support
        if ('ontouchstart' in document.documentElement) {
            for (const element of [].concat(...document.body.children)){
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(element, 'mouseover', _util_index_js__WEBPACK_IMPORTED_MODULE_4__.noop);
            }
        }
        if (this._popper) {
            this._popper.destroy();
        }
        this._menu.classList.remove(CLASS_NAME_SHOW);
        this._element.classList.remove(CLASS_NAME_SHOW);
        this._element.setAttribute('aria-expanded', 'false');
        _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_2__["default"].removeDataAttribute(this._menu, 'popper');
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_HIDDEN, relatedTarget);
        // Explicitly return focus to the trigger element
        this._element.focus();
    }
    _getConfig(config) {
        config = super._getConfig(config);
        if (typeof config.reference === 'object' && !(0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
            // Popper virtual elements require a getBoundingClientRect method
            throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
        }
        return config;
    }
    _createPopper() {
        if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_5__ === 'undefined') {
            throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org/docs/v2/)');
        }
        let referenceElement = this._element;
        if (this._config.reference === 'parent') {
            referenceElement = this._parent;
        } else if ((0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isElement)(this._config.reference)) {
            referenceElement = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.getElement)(this._config.reference);
        } else if (typeof this._config.reference === 'object') {
            referenceElement = this._config.reference;
        }
        const popperConfig = this._getPopperConfig();
        this._popper = _popperjs_core__WEBPACK_IMPORTED_MODULE_6__.createPopper(referenceElement, this._menu, popperConfig);
    }
    _isShown() {
        return this._menu.classList.contains(CLASS_NAME_SHOW);
    }
    _getPlacement() {
        const parentDropdown = this._parent;
        if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {
            return PLACEMENT_RIGHT;
        }
        if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {
            return PLACEMENT_LEFT;
        }
        if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {
            return PLACEMENT_TOPCENTER;
        }
        if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {
            return PLACEMENT_BOTTOMCENTER;
        }
        // We need to trim the value because custom properties can also include spaces
        const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end';
        if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
            return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP;
        }
        return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM;
    }
    _detectNavbar() {
        return this._element.closest(SELECTOR_NAVBAR) !== null;
    }
    _getOffset() {
        const { offset } = this._config;
        if (typeof offset === 'string') {
            return offset.split(',').map((value)=>Number.parseInt(value, 10));
        }
        if (typeof offset === 'function') {
            return (popperData)=>offset(popperData, this._element);
        }
        return offset;
    }
    _getPopperConfig() {
        const defaultBsPopperConfig = {
            placement: this._getPlacement(),
            modifiers: [
                {
                    name: 'preventOverflow',
                    options: {
                        boundary: this._config.boundary
                    }
                },
                {
                    name: 'offset',
                    options: {
                        offset: this._getOffset()
                    }
                }
            ]
        };
        // Disable Popper if we have a static display or Dropdown is in Navbar
        if (this._inNavbar || this._config.display === 'static') {
            _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_2__["default"].setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
            defaultBsPopperConfig.modifiers = [
                {
                    name: 'applyStyles',
                    enabled: false
                }
            ];
        }
        return _object_spread({}, defaultBsPopperConfig, (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.execute)(this._config.popperConfig, [
            undefined,
            defaultBsPopperConfig
        ]));
    }
    _selectMenuItem({ key, target }) {
        const items = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].find(SELECTOR_VISIBLE_ITEMS, this._menu).filter((element)=>(0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.isVisible)(element));
        if (!items.length) {
            return;
        }
        // if target isn't included in items (e.g. when expanding the dropdown)
        // allow cycling to get the last item in case key equals ARROW_UP_KEY
        (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.getNextActiveElement)(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
    }
    // Static
    static jQueryInterface(config) {
        return this.each(function() {
            const data = Dropdown.getOrCreateInstance(this, config);
            if (typeof config !== 'string') {
                return;
            }
            if (typeof data[config] === 'undefined') {
                throw new TypeError(`No method named "${config}"`);
            }
            data[config]();
        });
    }
    static clearMenus(event) {
        if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY) {
            return;
        }
        const openToggles = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].find(SELECTOR_DATA_TOGGLE_SHOWN);
        for (const toggle of openToggles){
            const context = Dropdown.getInstance(toggle);
            if (!context || context._config.autoClose === false) {
                continue;
            }
            const composedPath = event.composedPath();
            const isMenuTarget = composedPath.includes(context._menu);
            if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
                continue;
            }
            // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
            if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
                continue;
            }
            const relatedTarget = {
                relatedTarget: context._element
            };
            if (event.type === 'click') {
                relatedTarget.clickEvent = event;
            }
            context._completeHide(relatedTarget);
        }
    }
    static dataApiKeydownHandler(event) {
        // If not an UP | DOWN | ESCAPE key => not a dropdown command
        // If input/textarea && if key is other than ESCAPE => not a dropdown command
        const isInput = /input|textarea/i.test(event.target.tagName);
        const isEscapeEvent = event.key === ESCAPE_KEY;
        const isUpOrDownEvent = [
            ARROW_UP_KEY,
            ARROW_DOWN_KEY
        ].includes(event.key);
        if (!isUpOrDownEvent && !isEscapeEvent) {
            return;
        }
        if (isInput && !isEscapeEvent) {
            return;
        }
        event.preventDefault();
        // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
        const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].prev(this, SELECTOR_DATA_TOGGLE)[0] || _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].next(this, SELECTOR_DATA_TOGGLE)[0] || _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode);
        const instance = Dropdown.getOrCreateInstance(getToggleButton);
        if (isUpOrDownEvent) {
            event.stopPropagation();
            instance.show();
            instance._selectMenuItem(event);
            return;
        }
        if (instance._isShown()) {
            event.stopPropagation();
            instance.hide();
            getToggleButton.focus();
        }
    }
    constructor(element, config){
        super(element, config);
        this._popper = null;
        this._parent = this._element.parentNode; // dropdown wrapper
        // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
        this._menu = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].next(this._element, SELECTOR_MENU)[0] || _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].prev(this._element, SELECTOR_MENU)[0] || _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_3__["default"].findOne(SELECTOR_MENU, this._parent);
        this._inNavbar = this._detectNavbar();
    }
}
/**
 * Data API implementation
 */ _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler);
_dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
_dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
_dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
_dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function(event) {
    event.preventDefault();
    Dropdown.getOrCreateInstance(this).toggle();
});
/**
 * jQuery
 */ (0,_util_index_js__WEBPACK_IMPORTED_MODULE_4__.defineJQueryPlugin)(Dropdown);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Dropdown);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/modal.js":
/*!************************************************!*\
  !*** ./node_modules/bootstrap/js/src/modal.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _base_component_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-component.js */ "./node_modules/bootstrap/js/src/base-component.js");
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom/selector-engine.js */ "./node_modules/bootstrap/js/src/dom/selector-engine.js");
/* harmony import */ var _util_backdrop_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/backdrop.js */ "./node_modules/bootstrap/js/src/util/backdrop.js");
/* harmony import */ var _util_component_functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/component-functions.js */ "./node_modules/bootstrap/js/src/util/component-functions.js");
/* harmony import */ var _util_focustrap_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/focustrap.js */ "./node_modules/bootstrap/js/src/util/focustrap.js");
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/* harmony import */ var _util_scrollbar_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/scrollbar.js */ "./node_modules/bootstrap/js/src/util/scrollbar.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap modal.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 







/**
 * Constants
 */ const NAME = 'modal';
const DATA_KEY = 'bs.modal';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';
const ESCAPE_KEY = 'Escape';
const EVENT_HIDE = `hide${EVENT_KEY}`;
const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`;
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
const EVENT_SHOW = `show${EVENT_KEY}`;
const EVENT_SHOWN = `shown${EVENT_KEY}`;
const EVENT_RESIZE = `resize${EVENT_KEY}`;
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`;
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`;
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
const CLASS_NAME_OPEN = 'modal-open';
const CLASS_NAME_FADE = 'fade';
const CLASS_NAME_SHOW = 'show';
const CLASS_NAME_STATIC = 'modal-static';
const OPEN_SELECTOR = '.modal.show';
const SELECTOR_DIALOG = '.modal-dialog';
const SELECTOR_MODAL_BODY = '.modal-body';
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]';
const Default = {
    backdrop: true,
    focus: true,
    keyboard: true
};
const DefaultType = {
    backdrop: '(boolean|string)',
    focus: 'boolean',
    keyboard: 'boolean'
};
/**
 * Class definition
 */ class Modal extends _base_component_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Public
    toggle(relatedTarget) {
        return this._isShown ? this.hide() : this.show(relatedTarget);
    }
    show(relatedTarget) {
        if (this._isShown || this._isTransitioning) {
            return;
        }
        const showEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_SHOW, {
            relatedTarget
        });
        if (showEvent.defaultPrevented) {
            return;
        }
        this._isShown = true;
        this._isTransitioning = true;
        this._scrollBar.hide();
        document.body.classList.add(CLASS_NAME_OPEN);
        this._adjustDialog();
        this._backdrop.show(()=>this._showElement(relatedTarget));
    }
    hide() {
        if (!this._isShown || this._isTransitioning) {
            return;
        }
        const hideEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_HIDE);
        if (hideEvent.defaultPrevented) {
            return;
        }
        this._isShown = false;
        this._isTransitioning = true;
        this._focustrap.deactivate();
        this._element.classList.remove(CLASS_NAME_SHOW);
        this._queueCallback(()=>this._hideModal(), this._element, this._isAnimated());
    }
    dispose() {
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(window, EVENT_KEY);
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(this._dialog, EVENT_KEY);
        this._backdrop.dispose();
        this._focustrap.deactivate();
        super.dispose();
    }
    handleUpdate() {
        this._adjustDialog();
    }
    // Private
    _initializeBackDrop() {
        return new _util_backdrop_js__WEBPACK_IMPORTED_MODULE_3__["default"]({
            isVisible: Boolean(this._config.backdrop),
            isAnimated: this._isAnimated()
        });
    }
    _initializeFocusTrap() {
        return new _util_focustrap_js__WEBPACK_IMPORTED_MODULE_5__["default"]({
            trapElement: this._element
        });
    }
    _showElement(relatedTarget) {
        // try to append dynamic modal
        if (!document.body.contains(this._element)) {
            document.body.append(this._element);
        }
        this._element.style.display = 'block';
        this._element.removeAttribute('aria-hidden');
        this._element.setAttribute('aria-modal', true);
        this._element.setAttribute('role', 'dialog');
        this._element.scrollTop = 0;
        const modalBody = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_2__["default"].findOne(SELECTOR_MODAL_BODY, this._dialog);
        if (modalBody) {
            modalBody.scrollTop = 0;
        }
        (0,_util_index_js__WEBPACK_IMPORTED_MODULE_6__.reflow)(this._element);
        this._element.classList.add(CLASS_NAME_SHOW);
        const transitionComplete = ()=>{
            if (this._config.focus) {
                this._focustrap.activate();
            }
            this._isTransitioning = false;
            _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_SHOWN, {
                relatedTarget
            });
        };
        this._queueCallback(transitionComplete, this._dialog, this._isAnimated());
    }
    _addEventListeners() {
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(this._element, EVENT_KEYDOWN_DISMISS, (event)=>{
            if (event.key !== ESCAPE_KEY) {
                return;
            }
            if (this._config.keyboard) {
                this.hide();
                return;
            }
            this._triggerBackdropTransition();
        });
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(window, EVENT_RESIZE, ()=>{
            if (this._isShown && !this._isTransitioning) {
                this._adjustDialog();
            }
        });
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(this._element, EVENT_MOUSEDOWN_DISMISS, (event)=>{
            // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks
            _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].one(this._element, EVENT_CLICK_DISMISS, (event2)=>{
                if (this._element !== event.target || this._element !== event2.target) {
                    return;
                }
                if (this._config.backdrop === 'static') {
                    this._triggerBackdropTransition();
                    return;
                }
                if (this._config.backdrop) {
                    this.hide();
                }
            });
        });
    }
    _hideModal() {
        this._element.style.display = 'none';
        this._element.setAttribute('aria-hidden', true);
        this._element.removeAttribute('aria-modal');
        this._element.removeAttribute('role');
        this._isTransitioning = false;
        this._backdrop.hide(()=>{
            document.body.classList.remove(CLASS_NAME_OPEN);
            this._resetAdjustments();
            this._scrollBar.reset();
            _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_HIDDEN);
        });
    }
    _isAnimated() {
        return this._element.classList.contains(CLASS_NAME_FADE);
    }
    _triggerBackdropTransition() {
        const hideEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, EVENT_HIDE_PREVENTED);
        if (hideEvent.defaultPrevented) {
            return;
        }
        const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
        const initialOverflowY = this._element.style.overflowY;
        // return if the following background transition hasn't yet completed
        if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {
            return;
        }
        if (!isModalOverflowing) {
            this._element.style.overflowY = 'hidden';
        }
        this._element.classList.add(CLASS_NAME_STATIC);
        this._queueCallback(()=>{
            this._element.classList.remove(CLASS_NAME_STATIC);
            this._queueCallback(()=>{
                this._element.style.overflowY = initialOverflowY;
            }, this._dialog);
        }, this._dialog);
        this._element.focus();
    }
    /**
   * The following methods are used to handle overflowing modals
   */ _adjustDialog() {
        const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
        const scrollbarWidth = this._scrollBar.getWidth();
        const isBodyOverflowing = scrollbarWidth > 0;
        if (isBodyOverflowing && !isModalOverflowing) {
            const property = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_6__.isRTL)() ? 'paddingLeft' : 'paddingRight';
            this._element.style[property] = `${scrollbarWidth}px`;
        }
        if (!isBodyOverflowing && isModalOverflowing) {
            const property = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_6__.isRTL)() ? 'paddingRight' : 'paddingLeft';
            this._element.style[property] = `${scrollbarWidth}px`;
        }
    }
    _resetAdjustments() {
        this._element.style.paddingLeft = '';
        this._element.style.paddingRight = '';
    }
    // Static
    static jQueryInterface(config, relatedTarget) {
        return this.each(function() {
            const data = Modal.getOrCreateInstance(this, config);
            if (typeof config !== 'string') {
                return;
            }
            if (typeof data[config] === 'undefined') {
                throw new TypeError(`No method named "${config}"`);
            }
            data[config](relatedTarget);
        });
    }
    constructor(element, config){
        super(element, config);
        this._dialog = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_2__["default"].findOne(SELECTOR_DIALOG, this._element);
        this._backdrop = this._initializeBackDrop();
        this._focustrap = this._initializeFocusTrap();
        this._isShown = false;
        this._isTransitioning = false;
        this._scrollBar = new _util_scrollbar_js__WEBPACK_IMPORTED_MODULE_7__["default"]();
        this._addEventListeners();
    }
}
/**
 * Data API implementation
 */ _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function(event) {
    const target = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_2__["default"].getElementFromSelector(this);
    if ([
        'A',
        'AREA'
    ].includes(this.tagName)) {
        event.preventDefault();
    }
    _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].one(target, EVENT_SHOW, (showEvent)=>{
        if (showEvent.defaultPrevented) {
            // only register focus restorer if modal will actually get shown
            return;
        }
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].one(target, EVENT_HIDDEN, ()=>{
            if ((0,_util_index_js__WEBPACK_IMPORTED_MODULE_6__.isVisible)(this)) {
                this.focus();
            }
        });
    });
    // avoid conflict when clicking modal toggler while another one is open
    const alreadyOpen = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_2__["default"].findOne(OPEN_SELECTOR);
    if (alreadyOpen) {
        Modal.getInstance(alreadyOpen).hide();
    }
    const data = Modal.getOrCreateInstance(target);
    data.toggle(this);
});
(0,_util_component_functions_js__WEBPACK_IMPORTED_MODULE_4__.enableDismissTrigger)(Modal);
/**
 * jQuery
 */ (0,_util_index_js__WEBPACK_IMPORTED_MODULE_6__.defineJQueryPlugin)(Modal);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Modal);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/popover.js":
/*!**************************************************!*\
  !*** ./node_modules/bootstrap/js/src/popover.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _tooltip_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tooltip.js */ "./node_modules/bootstrap/js/src/tooltip.js");
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap popover.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}


/**
 * Constants
 */ const NAME = 'popover';
const SELECTOR_TITLE = '.popover-header';
const SELECTOR_CONTENT = '.popover-body';
const Default = _object_spread_props(_object_spread({}, _tooltip_js__WEBPACK_IMPORTED_MODULE_0__["default"].Default), {
    content: '',
    offset: [
        0,
        8
    ],
    placement: 'right',
    template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>',
    trigger: 'click'
});
const DefaultType = _object_spread_props(_object_spread({}, _tooltip_js__WEBPACK_IMPORTED_MODULE_0__["default"].DefaultType), {
    content: '(null|string|element|function)'
});
/**
 * Class definition
 */ class Popover extends _tooltip_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Overrides
    _isWithContent() {
        return this._getTitle() || this._getContent();
    }
    // Private
    _getContentForTemplate() {
        return {
            [SELECTOR_TITLE]: this._getTitle(),
            [SELECTOR_CONTENT]: this._getContent()
        };
    }
    _getContent() {
        return this._resolvePossibleFunction(this._config.content);
    }
    // Static
    static jQueryInterface(config) {
        return this.each(function() {
            const data = Popover.getOrCreateInstance(this, config);
            if (typeof config !== 'string') {
                return;
            }
            if (typeof data[config] === 'undefined') {
                throw new TypeError(`No method named "${config}"`);
            }
            data[config]();
        });
    }
}
/**
 * jQuery
 */ (0,_util_index_js__WEBPACK_IMPORTED_MODULE_1__.defineJQueryPlugin)(Popover);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popover);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/tooltip.js":
/*!**************************************************!*\
  !*** ./node_modules/bootstrap/js/src/tooltip.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/popper.js");
/* harmony import */ var _popperjs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @popperjs/core */ "./node_modules/@popperjs/core/lib/index.js");
/* harmony import */ var _base_component_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base-component.js */ "./node_modules/bootstrap/js/src/base-component.js");
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom/manipulator.js */ "./node_modules/bootstrap/js/src/dom/manipulator.js");
/* harmony import */ var _util_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/* harmony import */ var _util_sanitizer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/sanitizer.js */ "./node_modules/bootstrap/js/src/util/sanitizer.js");
/* harmony import */ var _util_template_factory_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/template-factory.js */ "./node_modules/bootstrap/js/src/util/template-factory.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap tooltip.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}







/**
 * Constants
 */ const NAME = 'tooltip';
const DISALLOWED_ATTRIBUTES = new Set([
    'sanitize',
    'allowList',
    'sanitizeFn'
]);
const CLASS_NAME_FADE = 'fade';
const CLASS_NAME_MODAL = 'modal';
const CLASS_NAME_SHOW = 'show';
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
const EVENT_MODAL_HIDE = 'hide.bs.modal';
const TRIGGER_HOVER = 'hover';
const TRIGGER_FOCUS = 'focus';
const TRIGGER_CLICK = 'click';
const TRIGGER_MANUAL = 'manual';
const EVENT_HIDE = 'hide';
const EVENT_HIDDEN = 'hidden';
const EVENT_SHOW = 'show';
const EVENT_SHOWN = 'shown';
const EVENT_INSERTED = 'inserted';
const EVENT_CLICK = 'click';
const EVENT_FOCUSIN = 'focusin';
const EVENT_FOCUSOUT = 'focusout';
const EVENT_MOUSEENTER = 'mouseenter';
const EVENT_MOUSELEAVE = 'mouseleave';
const AttachmentMap = {
    AUTO: 'auto',
    TOP: 'top',
    RIGHT: (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.isRTL)() ? 'left' : 'right',
    BOTTOM: 'bottom',
    LEFT: (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.isRTL)() ? 'right' : 'left'
};
const Default = {
    allowList: _util_sanitizer_js__WEBPACK_IMPORTED_MODULE_4__.DefaultAllowlist,
    animation: true,
    boundary: 'clippingParents',
    container: false,
    customClass: '',
    delay: 0,
    fallbackPlacements: [
        'top',
        'right',
        'bottom',
        'left'
    ],
    html: false,
    offset: [
        0,
        6
    ],
    placement: 'top',
    popperConfig: null,
    sanitize: true,
    sanitizeFn: null,
    selector: false,
    template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
    title: '',
    trigger: 'hover focus'
};
const DefaultType = {
    allowList: 'object',
    animation: 'boolean',
    boundary: '(string|element)',
    container: '(string|element|boolean)',
    customClass: '(string|function)',
    delay: '(number|object)',
    fallbackPlacements: 'array',
    html: 'boolean',
    offset: '(array|string|function)',
    placement: '(string|function)',
    popperConfig: '(null|object|function)',
    sanitize: 'boolean',
    sanitizeFn: '(null|function)',
    selector: '(string|boolean)',
    template: 'string',
    title: '(string|element|function)',
    trigger: 'string'
};
/**
 * Class definition
 */ class Tooltip extends _base_component_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Public
    enable() {
        this._isEnabled = true;
    }
    disable() {
        this._isEnabled = false;
    }
    toggleEnabled() {
        this._isEnabled = !this._isEnabled;
    }
    toggle() {
        if (!this._isEnabled) {
            return;
        }
        if (this._isShown()) {
            this._leave();
            return;
        }
        this._enter();
    }
    dispose() {
        clearTimeout(this._timeout);
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
        if (this._element.getAttribute('data-bs-original-title')) {
            this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));
        }
        this._disposePopper();
        super.dispose();
    }
    show() {
        if (this._element.style.display === 'none') {
            throw new Error('Please use show on visible elements');
        }
        if (!(this._isWithContent() && this._isEnabled)) {
            return;
        }
        const showEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, this.constructor.eventName(EVENT_SHOW));
        const shadowRoot = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.findShadowRoot)(this._element);
        const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element);
        if (showEvent.defaultPrevented || !isInTheDom) {
            return;
        }
        // TODO: v6 remove this or make it optional
        this._disposePopper();
        const tip = this._getTipElement();
        this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
        const { container } = this._config;
        if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
            container.append(tip);
            _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, this.constructor.eventName(EVENT_INSERTED));
        }
        this._popper = this._createPopper(tip);
        tip.classList.add(CLASS_NAME_SHOW);
        // If this is a touch-enabled device we add extra
        // empty mouseover listeners to the body's immediate children;
        // only needed because of broken event delegation on iOS
        // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
        if ('ontouchstart' in document.documentElement) {
            for (const element of [].concat(...document.body.children)){
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(element, 'mouseover', _util_index_js__WEBPACK_IMPORTED_MODULE_3__.noop);
            }
        }
        const complete = ()=>{
            _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, this.constructor.eventName(EVENT_SHOWN));
            if (this._isHovered === false) {
                this._leave();
            }
            this._isHovered = false;
        };
        this._queueCallback(complete, this.tip, this._isAnimated());
    }
    hide() {
        if (!this._isShown()) {
            return;
        }
        const hideEvent = _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, this.constructor.eventName(EVENT_HIDE));
        if (hideEvent.defaultPrevented) {
            return;
        }
        const tip = this._getTipElement();
        tip.classList.remove(CLASS_NAME_SHOW);
        // If this is a touch-enabled device we remove the extra
        // empty mouseover listeners we added for iOS support
        if ('ontouchstart' in document.documentElement) {
            for (const element of [].concat(...document.body.children)){
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(element, 'mouseover', _util_index_js__WEBPACK_IMPORTED_MODULE_3__.noop);
            }
        }
        this._activeTrigger[TRIGGER_CLICK] = false;
        this._activeTrigger[TRIGGER_FOCUS] = false;
        this._activeTrigger[TRIGGER_HOVER] = false;
        this._isHovered = null; // it is a trick to support manual triggering
        const complete = ()=>{
            if (this._isWithActiveTrigger()) {
                return;
            }
            if (!this._isHovered) {
                this._disposePopper();
            }
            this._element.removeAttribute('aria-describedby');
            _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger(this._element, this.constructor.eventName(EVENT_HIDDEN));
        };
        this._queueCallback(complete, this.tip, this._isAnimated());
    }
    update() {
        if (this._popper) {
            this._popper.update();
        }
    }
    // Protected
    _isWithContent() {
        return Boolean(this._getTitle());
    }
    _getTipElement() {
        if (!this.tip) {
            this.tip = this._createTipElement(this._newContent || this._getContentForTemplate());
        }
        return this.tip;
    }
    _createTipElement(content) {
        const tip = this._getTemplateFactory(content).toHtml();
        // TODO: remove this check in v6
        if (!tip) {
            return null;
        }
        tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
        // TODO: v6 the following can be achieved with CSS only
        tip.classList.add(`bs-${this.constructor.NAME}-auto`);
        const tipId = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.getUID)(this.constructor.NAME).toString();
        tip.setAttribute('id', tipId);
        if (this._isAnimated()) {
            tip.classList.add(CLASS_NAME_FADE);
        }
        return tip;
    }
    setContent(content) {
        this._newContent = content;
        if (this._isShown()) {
            this._disposePopper();
            this.show();
        }
    }
    _getTemplateFactory(content) {
        if (this._templateFactory) {
            this._templateFactory.changeContent(content);
        } else {
            this._templateFactory = new _util_template_factory_js__WEBPACK_IMPORTED_MODULE_5__["default"](_object_spread_props(_object_spread({}, this._config), {
                // the `content` var has to be after `this._config`
                // to override config.content in case of popover
                content,
                extraClass: this._resolvePossibleFunction(this._config.customClass)
            }));
        }
        return this._templateFactory;
    }
    _getContentForTemplate() {
        return {
            [SELECTOR_TOOLTIP_INNER]: this._getTitle()
        };
    }
    _getTitle() {
        return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');
    }
    // Private
    _initializeOnDelegatedTarget(event) {
        return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
    }
    _isAnimated() {
        return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE);
    }
    _isShown() {
        return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW);
    }
    _createPopper(tip) {
        const placement = (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.execute)(this._config.placement, [
            this,
            tip,
            this._element
        ]);
        const attachment = AttachmentMap[placement.toUpperCase()];
        return _popperjs_core__WEBPACK_IMPORTED_MODULE_6__.createPopper(this._element, tip, this._getPopperConfig(attachment));
    }
    _getOffset() {
        const { offset } = this._config;
        if (typeof offset === 'string') {
            return offset.split(',').map((value)=>Number.parseInt(value, 10));
        }
        if (typeof offset === 'function') {
            return (popperData)=>offset(popperData, this._element);
        }
        return offset;
    }
    _resolvePossibleFunction(arg) {
        return (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.execute)(arg, [
            this._element,
            this._element
        ]);
    }
    _getPopperConfig(attachment) {
        const defaultBsPopperConfig = {
            placement: attachment,
            modifiers: [
                {
                    name: 'flip',
                    options: {
                        fallbackPlacements: this._config.fallbackPlacements
                    }
                },
                {
                    name: 'offset',
                    options: {
                        offset: this._getOffset()
                    }
                },
                {
                    name: 'preventOverflow',
                    options: {
                        boundary: this._config.boundary
                    }
                },
                {
                    name: 'arrow',
                    options: {
                        element: `.${this.constructor.NAME}-arrow`
                    }
                },
                {
                    name: 'preSetPlacement',
                    enabled: true,
                    phase: 'beforeMain',
                    fn: (data)=>{
                        // Pre-set Popper's placement attribute in order to read the arrow sizes properly.
                        // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement
                        this._getTipElement().setAttribute('data-popper-placement', data.state.placement);
                    }
                }
            ]
        };
        return _object_spread({}, defaultBsPopperConfig, (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.execute)(this._config.popperConfig, [
            undefined,
            defaultBsPopperConfig
        ]));
    }
    _setListeners() {
        const triggers = this._config.trigger.split(' ');
        for (const trigger of triggers){
            if (trigger === 'click') {
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, (event)=>{
                    const context = this._initializeOnDelegatedTarget(event);
                    context.toggle();
                });
            } else if (trigger !== TRIGGER_MANUAL) {
                const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN);
                const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT);
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(this._element, eventIn, this._config.selector, (event)=>{
                    const context = this._initializeOnDelegatedTarget(event);
                    context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
                    context._enter();
                });
                _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(this._element, eventOut, this._config.selector, (event)=>{
                    const context = this._initializeOnDelegatedTarget(event);
                    context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget);
                    context._leave();
                });
            }
        }
        this._hideModalHandler = ()=>{
            if (this._element) {
                this.hide();
            }
        };
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
    }
    _fixTitle() {
        const title = this._element.getAttribute('title');
        if (!title) {
            return;
        }
        if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
            this._element.setAttribute('aria-label', title);
        }
        this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility
        this._element.removeAttribute('title');
    }
    _enter() {
        if (this._isShown() || this._isHovered) {
            this._isHovered = true;
            return;
        }
        this._isHovered = true;
        this._setTimeout(()=>{
            if (this._isHovered) {
                this.show();
            }
        }, this._config.delay.show);
    }
    _leave() {
        if (this._isWithActiveTrigger()) {
            return;
        }
        this._isHovered = false;
        this._setTimeout(()=>{
            if (!this._isHovered) {
                this.hide();
            }
        }, this._config.delay.hide);
    }
    _setTimeout(handler, timeout) {
        clearTimeout(this._timeout);
        this._timeout = setTimeout(handler, timeout);
    }
    _isWithActiveTrigger() {
        return Object.values(this._activeTrigger).includes(true);
    }
    _getConfig(config) {
        const dataAttributes = _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_2__["default"].getDataAttributes(this._element);
        for (const dataAttribute of Object.keys(dataAttributes)){
            if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {
                delete dataAttributes[dataAttribute];
            }
        }
        config = _object_spread({}, dataAttributes, typeof config === 'object' && config ? config : {});
        config = this._mergeConfigObj(config);
        config = this._configAfterMerge(config);
        this._typeCheckConfig(config);
        return config;
    }
    _configAfterMerge(config) {
        config.container = config.container === false ? document.body : (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.getElement)(config.container);
        if (typeof config.delay === 'number') {
            config.delay = {
                show: config.delay,
                hide: config.delay
            };
        }
        if (typeof config.title === 'number') {
            config.title = config.title.toString();
        }
        if (typeof config.content === 'number') {
            config.content = config.content.toString();
        }
        return config;
    }
    _getDelegateConfig() {
        const config = {};
        for (const [key, value] of Object.entries(this._config)){
            if (this.constructor.Default[key] !== value) {
                config[key] = value;
            }
        }
        config.selector = false;
        config.trigger = 'manual';
        // In the future can be replaced with:
        // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
        // `Object.fromEntries(keysWithDifferentValues)`
        return config;
    }
    _disposePopper() {
        if (this._popper) {
            this._popper.destroy();
            this._popper = null;
        }
        if (this.tip) {
            this.tip.remove();
            this.tip = null;
        }
    }
    // Static
    static jQueryInterface(config) {
        return this.each(function() {
            const data = Tooltip.getOrCreateInstance(this, config);
            if (typeof config !== 'string') {
                return;
            }
            if (typeof data[config] === 'undefined') {
                throw new TypeError(`No method named "${config}"`);
            }
            data[config]();
        });
    }
    constructor(element, config){
        if (typeof _popperjs_core__WEBPACK_IMPORTED_MODULE_7__ === 'undefined') {
            throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org/docs/v2/)');
        }
        super(element, config);
        // Private
        this._isEnabled = true;
        this._timeout = 0;
        this._isHovered = null;
        this._activeTrigger = {};
        this._popper = null;
        this._templateFactory = null;
        this._newContent = null;
        // Protected
        this.tip = null;
        this._setListeners();
        if (!this._config.selector) {
            this._fixTitle();
        }
    }
}
/**
 * jQuery
 */ (0,_util_index_js__WEBPACK_IMPORTED_MODULE_3__.defineJQueryPlugin)(Tooltip);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tooltip);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/backdrop.js":
/*!********************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/backdrop.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config.js */ "./node_modules/bootstrap/js/src/util/config.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/backdrop.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 


/**
 * Constants
 */ const NAME = 'backdrop';
const CLASS_NAME_FADE = 'fade';
const CLASS_NAME_SHOW = 'show';
const EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`;
const Default = {
    className: 'modal-backdrop',
    clickCallback: null,
    isAnimated: false,
    isVisible: true,
    rootElement: 'body' // give the choice to place backdrop under different elements
};
const DefaultType = {
    className: 'string',
    clickCallback: '(function|null)',
    isAnimated: 'boolean',
    isVisible: 'boolean',
    rootElement: '(element|string)'
};
/**
 * Class definition
 */ class Backdrop extends _config_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Public
    show(callback) {
        if (!this._config.isVisible) {
            (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(callback);
            return;
        }
        this._append();
        const element = this._getElement();
        if (this._config.isAnimated) {
            (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.reflow)(element);
        }
        element.classList.add(CLASS_NAME_SHOW);
        this._emulateAnimation(()=>{
            (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(callback);
        });
    }
    hide(callback) {
        if (!this._config.isVisible) {
            (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(callback);
            return;
        }
        this._getElement().classList.remove(CLASS_NAME_SHOW);
        this._emulateAnimation(()=>{
            this.dispose();
            (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(callback);
        });
    }
    dispose() {
        if (!this._isAppended) {
            return;
        }
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].off(this._element, EVENT_MOUSEDOWN);
        this._element.remove();
        this._isAppended = false;
    }
    // Private
    _getElement() {
        if (!this._element) {
            const backdrop = document.createElement('div');
            backdrop.className = this._config.className;
            if (this._config.isAnimated) {
                backdrop.classList.add(CLASS_NAME_FADE);
            }
            this._element = backdrop;
        }
        return this._element;
    }
    _configAfterMerge(config) {
        // use getElement() with the default "body" to get a fresh Element on each instantiation
        config.rootElement = (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.getElement)(config.rootElement);
        return config;
    }
    _append() {
        if (this._isAppended) {
            return;
        }
        const element = this._getElement();
        this._config.rootElement.append(element);
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].on(element, EVENT_MOUSEDOWN, ()=>{
            (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.execute)(this._config.clickCallback);
        });
        this._isAppended = true;
    }
    _emulateAnimation(callback) {
        (0,_index_js__WEBPACK_IMPORTED_MODULE_2__.executeAfterTransition)(callback, this._getElement(), this._config.isAnimated);
    }
    constructor(config){
        super();
        this._config = this._getConfig(config);
        this._isAppended = false;
        this._element = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Backdrop);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/component-functions.js":
/*!*******************************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/component-functions.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   enableDismissTrigger: () => (/* binding */ enableDismissTrigger)
/* harmony export */ });
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom/selector-engine.js */ "./node_modules/bootstrap/js/src/dom/selector-engine.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/component-functions.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 


const enableDismissTrigger = (component, method = 'hide')=>{
    const clickEvent = `click.dismiss${component.EVENT_KEY}`;
    const name = component.NAME;
    _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function(event) {
        if ([
            'A',
            'AREA'
        ].includes(this.tagName)) {
            event.preventDefault();
        }
        if ((0,_index_js__WEBPACK_IMPORTED_MODULE_2__.isDisabled)(this)) {
            return;
        }
        const target = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_1__["default"].getElementFromSelector(this) || this.closest(`.${name}`);
        const instance = component.getOrCreateInstance(target);
        // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
        instance[method]();
    });
};



/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/config.js":
/*!******************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/config.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom/manipulator.js */ "./node_modules/bootstrap/js/src/dom/manipulator.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/config.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}


/**
 * Class definition
 */ class Config {
    // Getters
    static get Default() {
        return {};
    }
    static get DefaultType() {
        return {};
    }
    static get NAME() {
        throw new Error('You have to implement the static method "NAME", for each component!');
    }
    _getConfig(config) {
        config = this._mergeConfigObj(config);
        config = this._configAfterMerge(config);
        this._typeCheckConfig(config);
        return config;
    }
    _configAfterMerge(config) {
        return config;
    }
    _mergeConfigObj(config, element) {
        const jsonConfig = (0,_index_js__WEBPACK_IMPORTED_MODULE_1__.isElement)(element) ? _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__["default"].getDataAttribute(element, 'config') : {} // try to parse
        ;
        return _object_spread({}, this.constructor.Default, typeof jsonConfig === 'object' ? jsonConfig : {}, (0,_index_js__WEBPACK_IMPORTED_MODULE_1__.isElement)(element) ? _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__["default"].getDataAttributes(element) : {}, typeof config === 'object' ? config : {});
    }
    _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
        for (const [property, expectedTypes] of Object.entries(configTypes)){
            const value = config[property];
            const valueType = (0,_index_js__WEBPACK_IMPORTED_MODULE_1__.isElement)(value) ? 'element' : (0,_index_js__WEBPACK_IMPORTED_MODULE_1__.toType)(value);
            if (!new RegExp(expectedTypes).test(valueType)) {
                throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
            }
        }
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Config);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/focustrap.js":
/*!*********************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/focustrap.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom/selector-engine.js */ "./node_modules/bootstrap/js/src/dom/selector-engine.js");
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config.js */ "./node_modules/bootstrap/js/src/util/config.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/focustrap.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 


/**
 * Constants
 */ const NAME = 'focustrap';
const DATA_KEY = 'bs.focustrap';
const EVENT_KEY = `.${DATA_KEY}`;
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`;
const TAB_KEY = 'Tab';
const TAB_NAV_FORWARD = 'forward';
const TAB_NAV_BACKWARD = 'backward';
const Default = {
    autofocus: true,
    trapElement: null // The element to trap focus inside of
};
const DefaultType = {
    autofocus: 'boolean',
    trapElement: 'element'
};
/**
 * Class definition
 */ class FocusTrap extends _config_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Public
    activate() {
        if (this._isActive) {
            return;
        }
        if (this._config.autofocus) {
            this._config.trapElement.focus();
        }
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].off(document, EVENT_KEY); // guard against infinite focus loop
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].on(document, EVENT_FOCUSIN, (event)=>this._handleFocusin(event));
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].on(document, EVENT_KEYDOWN_TAB, (event)=>this._handleKeydown(event));
        this._isActive = true;
    }
    deactivate() {
        if (!this._isActive) {
            return;
        }
        this._isActive = false;
        _dom_event_handler_js__WEBPACK_IMPORTED_MODULE_0__["default"].off(document, EVENT_KEY);
    }
    // Private
    _handleFocusin(event) {
        const { trapElement } = this._config;
        if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {
            return;
        }
        const elements = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_1__["default"].focusableChildren(trapElement);
        if (elements.length === 0) {
            trapElement.focus();
        } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
            elements[elements.length - 1].focus();
        } else {
            elements[0].focus();
        }
    }
    _handleKeydown(event) {
        if (event.key !== TAB_KEY) {
            return;
        }
        this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
    }
    constructor(config){
        super();
        this._config = this._getConfig(config);
        this._isActive = false;
        this._lastTabNavDirection = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FocusTrap);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/index.js":
/*!*****************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/index.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   defineJQueryPlugin: () => (/* binding */ defineJQueryPlugin),
/* harmony export */   execute: () => (/* binding */ execute),
/* harmony export */   executeAfterTransition: () => (/* binding */ executeAfterTransition),
/* harmony export */   findShadowRoot: () => (/* binding */ findShadowRoot),
/* harmony export */   getElement: () => (/* binding */ getElement),
/* harmony export */   getNextActiveElement: () => (/* binding */ getNextActiveElement),
/* harmony export */   getTransitionDurationFromElement: () => (/* binding */ getTransitionDurationFromElement),
/* harmony export */   getUID: () => (/* binding */ getUID),
/* harmony export */   getjQuery: () => (/* binding */ getjQuery),
/* harmony export */   isDisabled: () => (/* binding */ isDisabled),
/* harmony export */   isElement: () => (/* binding */ isElement),
/* harmony export */   isRTL: () => (/* binding */ isRTL),
/* harmony export */   isVisible: () => (/* binding */ isVisible),
/* harmony export */   noop: () => (/* binding */ noop),
/* harmony export */   onDOMContentLoaded: () => (/* binding */ onDOMContentLoaded),
/* harmony export */   parseSelector: () => (/* binding */ parseSelector),
/* harmony export */   reflow: () => (/* binding */ reflow),
/* harmony export */   toType: () => (/* binding */ toType),
/* harmony export */   triggerTransitionEnd: () => (/* binding */ triggerTransitionEnd)
/* harmony export */ });
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/index.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ const MAX_UID = 1000000;
const MILLISECONDS_MULTIPLIER = 1000;
const TRANSITION_END = 'transitionend';
/**
 * Properly escape IDs selectors to handle weird IDs
 * @param {string} selector
 * @returns {string}
 */ const parseSelector = (selector)=>{
    if (selector && window.CSS && window.CSS.escape) {
        // document.querySelector needs escaping to handle IDs (html5+) containing for instance /
        selector = selector.replace(/#([^\s"#']+)/g, (match, id)=>`#${CSS.escape(id)}`);
    }
    return selector;
};
// Shout-out Angus Croll (https://goo.gl/pxwQGp)
const toType = (object)=>{
    if (object === null || object === undefined) {
        return `${object}`;
    }
    return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
};
/**
 * Public Util API
 */ const getUID = (prefix)=>{
    do {
        prefix += Math.floor(Math.random() * MAX_UID);
    }while (document.getElementById(prefix))
    return prefix;
};
const getTransitionDurationFromElement = (element)=>{
    if (!element) {
        return 0;
    }
    // Get transition-duration of the element
    let { transitionDuration, transitionDelay } = window.getComputedStyle(element);
    const floatTransitionDuration = Number.parseFloat(transitionDuration);
    const floatTransitionDelay = Number.parseFloat(transitionDelay);
    // Return 0 if element or transition duration is not found
    if (!floatTransitionDuration && !floatTransitionDelay) {
        return 0;
    }
    // If multiple durations are defined, take the first
    transitionDuration = transitionDuration.split(',')[0];
    transitionDelay = transitionDelay.split(',')[0];
    return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
};
const triggerTransitionEnd = (element)=>{
    element.dispatchEvent(new Event(TRANSITION_END));
};
const isElement = (object)=>{
    if (!object || typeof object !== 'object') {
        return false;
    }
    if (typeof object.jquery !== 'undefined') {
        object = object[0];
    }
    return typeof object.nodeType !== 'undefined';
};
const getElement = (object)=>{
    // it's a jQuery object or a node element
    if (isElement(object)) {
        return object.jquery ? object[0] : object;
    }
    if (typeof object === 'string' && object.length > 0) {
        return document.querySelector(parseSelector(object));
    }
    return null;
};
const isVisible = (element)=>{
    if (!isElement(element) || element.getClientRects().length === 0) {
        return false;
    }
    const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
    // Handle `details` element as its content may falsie appear visible when it is closed
    const closedDetails = element.closest('details:not([open])');
    if (!closedDetails) {
        return elementIsVisible;
    }
    if (closedDetails !== element) {
        const summary = element.closest('summary');
        if (summary && summary.parentNode !== closedDetails) {
            return false;
        }
        if (summary === null) {
            return false;
        }
    }
    return elementIsVisible;
};
const isDisabled = (element)=>{
    if (!element || element.nodeType !== Node.ELEMENT_NODE) {
        return true;
    }
    if (element.classList.contains('disabled')) {
        return true;
    }
    if (typeof element.disabled !== 'undefined') {
        return element.disabled;
    }
    return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
};
const findShadowRoot = (element)=>{
    if (!document.documentElement.attachShadow) {
        return null;
    }
    // Can find the shadow root otherwise it'll return the document
    if (typeof element.getRootNode === 'function') {
        const root = element.getRootNode();
        return root instanceof ShadowRoot ? root : null;
    }
    if (element instanceof ShadowRoot) {
        return element;
    }
    // when we don't find a shadow root
    if (!element.parentNode) {
        return null;
    }
    return findShadowRoot(element.parentNode);
};
const noop = ()=>{};
/**
 * Trick to restart an element's animation
 *
 * @param {HTMLElement} element
 * @return void
 *
 * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
 */ const reflow = (element)=>{
    element.offsetHeight; // eslint-disable-line no-unused-expressions
};
const getjQuery = ()=>{
    if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
        return window.jQuery;
    }
    return null;
};
const DOMContentLoadedCallbacks = [];
const onDOMContentLoaded = (callback)=>{
    if (document.readyState === 'loading') {
        // add listener on the first call when the document is in loading state
        if (!DOMContentLoadedCallbacks.length) {
            document.addEventListener('DOMContentLoaded', ()=>{
                for (const callback of DOMContentLoadedCallbacks){
                    callback();
                }
            });
        }
        DOMContentLoadedCallbacks.push(callback);
    } else {
        callback();
    }
};
const isRTL = ()=>document.documentElement.dir === 'rtl';
const defineJQueryPlugin = (plugin)=>{
    onDOMContentLoaded(()=>{
        const $ = getjQuery();
        /* istanbul ignore if */ if ($) {
            const name = plugin.NAME;
            const JQUERY_NO_CONFLICT = $.fn[name];
            $.fn[name] = plugin.jQueryInterface;
            $.fn[name].Constructor = plugin;
            $.fn[name].noConflict = ()=>{
                $.fn[name] = JQUERY_NO_CONFLICT;
                return plugin.jQueryInterface;
            };
        }
    });
};
const execute = (possibleCallback, args = [], defaultValue = possibleCallback)=>{
    return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue;
};
const executeAfterTransition = (callback, transitionElement, waitForTransition = true)=>{
    if (!waitForTransition) {
        execute(callback);
        return;
    }
    const durationPadding = 5;
    const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
    let called = false;
    const handler = ({ target })=>{
        if (target !== transitionElement) {
            return;
        }
        called = true;
        transitionElement.removeEventListener(TRANSITION_END, handler);
        execute(callback);
    };
    transitionElement.addEventListener(TRANSITION_END, handler);
    setTimeout(()=>{
        if (!called) {
            triggerTransitionEnd(transitionElement);
        }
    }, emulatedDuration);
};
/**
 * Return the previous/next element of a list.
 *
 * @param {array} list    The list of elements
 * @param activeElement   The active element
 * @param shouldGetNext   Choose to get next or previous element
 * @param isCycleAllowed
 * @return {Element|elem} The proper element
 */ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed)=>{
    const listLength = list.length;
    let index = list.indexOf(activeElement);
    // if the element does not exist in the list return an element
    // depending on the direction and if cycle is allowed
    if (index === -1) {
        return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0];
    }
    index += shouldGetNext ? 1 : -1;
    if (isCycleAllowed) {
        index = (index + listLength) % listLength;
    }
    return list[Math.max(0, Math.min(index, listLength - 1))];
};



/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/sanitizer.js":
/*!*********************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/sanitizer.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DefaultAllowlist: () => (/* binding */ DefaultAllowlist),
/* harmony export */   sanitizeHtml: () => (/* binding */ sanitizeHtml)
/* harmony export */ });
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/sanitizer.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ // js-docs-start allow-list
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
const DefaultAllowlist = {
    // Global attributes allowed on any supplied element below.
    '*': [
        'class',
        'dir',
        'id',
        'lang',
        'role',
        ARIA_ATTRIBUTE_PATTERN
    ],
    a: [
        'target',
        'href',
        'title',
        'rel'
    ],
    area: [],
    b: [],
    br: [],
    col: [],
    code: [],
    dd: [],
    div: [],
    dl: [],
    dt: [],
    em: [],
    hr: [],
    h1: [],
    h2: [],
    h3: [],
    h4: [],
    h5: [],
    h6: [],
    i: [],
    img: [
        'src',
        'srcset',
        'alt',
        'title',
        'width',
        'height'
    ],
    li: [],
    ol: [],
    p: [],
    pre: [],
    s: [],
    small: [],
    span: [],
    sub: [],
    sup: [],
    strong: [],
    u: [],
    ul: []
};
// js-docs-end allow-list
const uriAttributes = new Set([
    'background',
    'cite',
    'href',
    'itemtype',
    'longdesc',
    'poster',
    'src',
    'xlink:href'
]);
/**
 * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
 * contexts.
 *
 * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
 */ // eslint-disable-next-line unicorn/better-regex
const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
const allowedAttribute = (attribute, allowedAttributeList)=>{
    const attributeName = attribute.nodeName.toLowerCase();
    if (allowedAttributeList.includes(attributeName)) {
        if (uriAttributes.has(attributeName)) {
            return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
        }
        return true;
    }
    // Check if a regular expression validates the attribute.
    return allowedAttributeList.filter((attributeRegex)=>attributeRegex instanceof RegExp).some((regex)=>regex.test(attributeName));
};
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
    if (!unsafeHtml.length) {
        return unsafeHtml;
    }
    if (sanitizeFunction && typeof sanitizeFunction === 'function') {
        return sanitizeFunction(unsafeHtml);
    }
    const domParser = new window.DOMParser();
    const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
    const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
    for (const element of elements){
        const elementName = element.nodeName.toLowerCase();
        if (!Object.keys(allowList).includes(elementName)) {
            element.remove();
            continue;
        }
        const attributeList = [].concat(...element.attributes);
        const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
        for (const attribute of attributeList){
            if (!allowedAttribute(attribute, allowedAttributes)) {
                element.removeAttribute(attribute.nodeName);
            }
        }
    }
    return createdDocument.body.innerHTML;
}


/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/scrollbar.js":
/*!*********************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/scrollbar.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom/manipulator.js */ "./node_modules/bootstrap/js/src/dom/manipulator.js");
/* harmony import */ var _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom/selector-engine.js */ "./node_modules/bootstrap/js/src/dom/selector-engine.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/scrollBar.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ 


/**
 * Constants
 */ const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
const SELECTOR_STICKY_CONTENT = '.sticky-top';
const PROPERTY_PADDING = 'padding-right';
const PROPERTY_MARGIN = 'margin-right';
/**
 * Class definition
 */ class ScrollBarHelper {
    // Public
    getWidth() {
        // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
        const documentWidth = document.documentElement.clientWidth;
        return Math.abs(window.innerWidth - documentWidth);
    }
    hide() {
        const width = this.getWidth();
        this._disableOverFlow();
        // give padding to element to balance the hidden scrollbar width
        this._setElementAttributes(this._element, PROPERTY_PADDING, (calculatedValue)=>calculatedValue + width);
        // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
        this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, (calculatedValue)=>calculatedValue + width);
        this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, (calculatedValue)=>calculatedValue - width);
    }
    reset() {
        this._resetElementAttributes(this._element, 'overflow');
        this._resetElementAttributes(this._element, PROPERTY_PADDING);
        this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
        this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
    }
    isOverflowing() {
        return this.getWidth() > 0;
    }
    // Private
    _disableOverFlow() {
        this._saveInitialAttribute(this._element, 'overflow');
        this._element.style.overflow = 'hidden';
    }
    _setElementAttributes(selector, styleProperty, callback) {
        const scrollbarWidth = this.getWidth();
        const manipulationCallBack = (element)=>{
            if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
                return;
            }
            this._saveInitialAttribute(element, styleProperty);
            const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
            element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
        };
        this._applyManipulationCallback(selector, manipulationCallBack);
    }
    _saveInitialAttribute(element, styleProperty) {
        const actualValue = element.style.getPropertyValue(styleProperty);
        if (actualValue) {
            _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__["default"].setDataAttribute(element, styleProperty, actualValue);
        }
    }
    _resetElementAttributes(selector, styleProperty) {
        const manipulationCallBack = (element)=>{
            const value = _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__["default"].getDataAttribute(element, styleProperty);
            // We only want to remove the property if the value is `null`; the value can also be zero
            if (value === null) {
                element.style.removeProperty(styleProperty);
                return;
            }
            _dom_manipulator_js__WEBPACK_IMPORTED_MODULE_0__["default"].removeDataAttribute(element, styleProperty);
            element.style.setProperty(styleProperty, value);
        };
        this._applyManipulationCallback(selector, manipulationCallBack);
    }
    _applyManipulationCallback(selector, callBack) {
        if ((0,_index_js__WEBPACK_IMPORTED_MODULE_2__.isElement)(selector)) {
            callBack(selector);
            return;
        }
        for (const sel of _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_1__["default"].find(selector, this._element)){
            callBack(sel);
        }
    }
    constructor(){
        this._element = document.body;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ScrollBarHelper);


/***/ }),

/***/ "./node_modules/bootstrap/js/src/util/template-factory.js":
/*!****************************************************************!*\
  !*** ./node_modules/bootstrap/js/src/util/template-factory.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom/selector-engine.js */ "./node_modules/bootstrap/js/src/dom/selector-engine.js");
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config.js */ "./node_modules/bootstrap/js/src/util/config.js");
/* harmony import */ var _sanitizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sanitizer.js */ "./node_modules/bootstrap/js/src/util/sanitizer.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.js */ "./node_modules/bootstrap/js/src/util/index.js");
/**
 * --------------------------------------------------------------------------
 * Bootstrap util/template-factory.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 * --------------------------------------------------------------------------
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}




/**
 * Constants
 */ const NAME = 'TemplateFactory';
const Default = {
    allowList: _sanitizer_js__WEBPACK_IMPORTED_MODULE_2__.DefaultAllowlist,
    content: {},
    extraClass: '',
    html: false,
    sanitize: true,
    sanitizeFn: null,
    template: '<div></div>'
};
const DefaultType = {
    allowList: 'object',
    content: 'object',
    extraClass: '(string|function)',
    html: 'boolean',
    sanitize: 'boolean',
    sanitizeFn: '(null|function)',
    template: 'string'
};
const DefaultContentType = {
    entry: '(string|element|function|null)',
    selector: '(string|element)'
};
/**
 * Class definition
 */ class TemplateFactory extends _config_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    // Getters
    static get Default() {
        return Default;
    }
    static get DefaultType() {
        return DefaultType;
    }
    static get NAME() {
        return NAME;
    }
    // Public
    getContent() {
        return Object.values(this._config.content).map((config)=>this._resolvePossibleFunction(config)).filter(Boolean);
    }
    hasContent() {
        return this.getContent().length > 0;
    }
    changeContent(content) {
        this._checkContent(content);
        this._config.content = _object_spread({}, this._config.content, content);
        return this;
    }
    toHtml() {
        const templateWrapper = document.createElement('div');
        templateWrapper.innerHTML = this._maybeSanitize(this._config.template);
        for (const [selector, text] of Object.entries(this._config.content)){
            this._setContent(templateWrapper, text, selector);
        }
        const template = templateWrapper.children[0];
        const extraClass = this._resolvePossibleFunction(this._config.extraClass);
        if (extraClass) {
            template.classList.add(...extraClass.split(' '));
        }
        return template;
    }
    // Private
    _typeCheckConfig(config) {
        super._typeCheckConfig(config);
        this._checkContent(config.content);
    }
    _checkContent(arg) {
        for (const [selector, content] of Object.entries(arg)){
            super._typeCheckConfig({
                selector,
                entry: content
            }, DefaultContentType);
        }
    }
    _setContent(template, content, selector) {
        const templateElement = _dom_selector_engine_js__WEBPACK_IMPORTED_MODULE_0__["default"].findOne(selector, template);
        if (!templateElement) {
            return;
        }
        content = this._resolvePossibleFunction(content);
        if (!content) {
            templateElement.remove();
            return;
        }
        if ((0,_index_js__WEBPACK_IMPORTED_MODULE_3__.isElement)(content)) {
            this._putElementInTemplate((0,_index_js__WEBPACK_IMPORTED_MODULE_3__.getElement)(content), templateElement);
            return;
        }
        if (this._config.html) {
            templateElement.innerHTML = this._maybeSanitize(content);
            return;
        }
        templateElement.textContent = content;
    }
    _maybeSanitize(arg) {
        return this._config.sanitize ? (0,_sanitizer_js__WEBPACK_IMPORTED_MODULE_2__.sanitizeHtml)(arg, this._config.allowList, this._config.sanitizeFn) : arg;
    }
    _resolvePossibleFunction(arg) {
        return (0,_index_js__WEBPACK_IMPORTED_MODULE_3__.execute)(arg, [
            undefined,
            this
        ]);
    }
    _putElementInTemplate(element, templateElement) {
        if (this._config.html) {
            templateElement.innerHTML = '';
            templateElement.append(element);
            return;
        }
        templateElement.textContent = element.textContent;
    }
    constructor(config){
        super();
        this._config = this._getConfig(config);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TemplateFactory);


/***/ }),

/***/ "./node_modules/client-compress/dist/index.js":
/*!****************************************************!*\
  !*** ./node_modules/client-compress/dist/index.js ***!
  \****************************************************/
/***/ ((module) => {

!function(t,e){ true?module.exports=e():0}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.loadImageElement=function(t,e){return new Promise(function(r,n){t.addEventListener("load",function(){r(t)},!1),t.addEventListener("error",function(t){n(t)},!1),t.src=e})},e.resize=function(t,e,r,n){if(!r&&!n)return{currentWidth:t,currentHeight:e};var i=t/e,o=void 0,a=void 0;return i>r/n?a=(o=Math.min(t,r))/i:o=(a=Math.min(e,n))*i,{width:o,height:a}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.base64ToFile=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/jpeg",r=window.atob(t),n=[],i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return new window.Blob([new Uint8Array(n)],{type:e})},e.imageToCanvas=function(t,e,r,n){var i=document.createElement("canvas"),o=i.getContext("2d");if(i.width=e,i.height=r,!n||n>8)return o.drawImage(t,0,0,i.width,i.height),i;switch(n>4&&(i.width=r,i.height=e),n){case 2:o.translate(e,0),o.scale(-1,1);break;case 3:o.translate(e,r),o.rotate(Math.PI);break;case 4:o.translate(0,r),o.scale(1,-1);break;case 5:o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:o.rotate(.5*Math.PI),o.translate(0,-r);break;case 7:o.rotate(.5*Math.PI),o.translate(e,-r),o.scale(-1,1);break;case 8:o.rotate(-.5*Math.PI),o.translate(-e,0)}return n>4?o.drawImage(t,0,0,i.height,i.width):o.drawImage(t,0,0,i.width,i.height),i},e.canvasToBlob=function(t,e){return new Promise(function(r,n){t.toBlob(function(t){r(t)},"image/jpeg",e)})},e.size=function(t){return{kB:.001*t,MB:1e-6*t}},e.blobToBase64=function(t){return new Promise(function(e,r){var n=new window.FileReader;n.addEventListener("load",function(t){e(t.target.result)},!1),n.addEventListener("error",function(t){r(t)},!1),n.readAsDataURL(t)})}},function(t,e,r){t.exports=r(6)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.extractOrientation=function(t){return new Promise(function(e,r){var n=new window.FileReader;n.onload=function(t){var r=new DataView(t.target.result);65496!==r.getUint16(0,!1)&&e(-2);for(var n=r.byteLength,i=2;i<n;){var o=r.getUint16(i,!1);if(i+=2,65505===o){1165519206!==r.getUint32(i+=2,!1)&&e(-1);var a=18761===r.getUint16(i+=6,!1);i+=r.getUint32(i+4,a);var u=r.getUint16(i,a);i+=2;for(var s=0;s<u;s++)274===r.getUint16(i+12*s,a)&&e(r.getUint16(i+12*s+8,a))}else{if(65280!=(65280&o))break;i+=r.getUint16(i,!1)}}e(-1)},n.readAsArrayBuffer(t.slice(0,65536))})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2),o=(n=i)&&n.__esModule?n:{default:n},a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),u=r(3),s=r(0),c=r(1);function f(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,r){return function n(i,o){try{var a=e[i](o),u=a.value}catch(t){return void r(t)}if(!a.done)return Promise.resolve(u).then(function(t){n("next",t)},function(t){n("throw",t)});t(u)}("next")})}}var l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.name=e.name,this.type=e.type,this.size=e.size}return a(t,[{key:"setData",value:function(t){this.data=t,this.size=t.size,this.type=t.type}},{key:"_calculateOrientation",value:function(){var t=f(o.default.mark(function t(){var e;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,u.extractOrientation)(this.data);case 2:e=t.sent,this.orientation=e;case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"load",value:function(){var t=f(o.default.mark(function t(){var e,r;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._calculateOrientation();case 2:return e=URL.createObjectURL(this.data),r=new window.Image,t.next=6,(0,s.loadImageElement)(r,e);case 6:URL.revokeObjectURL(e),this._img=r,this.width=r.naturalWidth,this.height=r.naturalHeight;case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getCanvas",value:function(t,e,r){return void 0!==r?(0,c.imageToCanvas)(this._img,t,e,r):(0,c.imageToCanvas)(this._img,t,e,this.orientation)}}]),t}();e.default=l,t.exports=e.default},function(t,e){!function(e){"use strict";var r,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag",c="object"==typeof t,f=e.regeneratorRuntime;if(f)c&&(t.exports=f);else{(f=e.regeneratorRuntime=c?t.exports:{}).wrap=w;var l="suspendedStart",h="suspendedYield",p="executing",d="completed",A={},v={};v[a]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(z([])));g&&g!==n&&i.call(g,a)&&(v=g);var m=B.prototype=x.prototype=Object.create(v);b.prototype=m.constructor=B,B.constructor=b,B[s]=b.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,B):(t.__proto__=B,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(m),t},f.awrap=function(t){return{__await:t}},Q(_.prototype),_.prototype[u]=function(){return this},f.AsyncIterator=_,f.async=function(t,e,r,n){var i=new _(w(t,e,r,n));return f.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},Q(m),m[s]="Generator",m[a]=function(){return this},m.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},f.values=z,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return u.type="throw",u.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,A):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),A},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),A}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:z(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),A}}}function w(t,e,r,n){var i=e&&e.prototype instanceof x?e:x,o=Object.create(i.prototype),a=new O(n||[]);return o._invoke=function(t,e,r){var n=l;return function(i,o){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===i)throw o;return j()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var u=k(a,r);if(u){if(u===A)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=E(t,e,r);if("normal"===s.type){if(n=r.done?d:h,s.arg===A)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(t,r,a),o}function E(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function x(){}function b(){}function B(){}function Q(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function _(t){var e;this._invoke=function(r,n){function o(){return new Promise(function(e,o){!function e(r,n,o,a){var u=E(t[r],t,n);if("throw"!==u.type){var s=u.arg,c=s.value;return c&&"object"==typeof c&&i.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(c).then(function(t){s.value=t,o(s)},a)}a(u.arg)}(r,n,e,o)})}return e=e?e.then(o,o):o()}}function k(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,k(t,e),"throw"===e.method))return A;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var i=E(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,A;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,A):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,A)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function z(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())},function(t,e,r){var n=function(){return this}()||Function("return this")(),i=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,o=i&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=r(5),i)n.regeneratorRuntime=o;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=s(r(2)),i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(1)),a=r(0),u=s(r(4));function s(t){return t&&t.__esModule?t:{default:t}}function c(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,r){return function n(i,o){try{var a=e[i](o),u=a.value}catch(t){return void r(t)}if(!a.done)return Promise.resolve(u).then(function(t){n("next",t)},function(t){n("throw",t)});t(u)}("next")})}}var f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setOptions(e)}return i(t,[{key:"setOptions",value:function(t){var e={targetSize:1/0,quality:.75,minQuality:.5,qualityStepSize:.1,maxWidth:1920,maxHeight:1920,resize:!0,throwIfSizeNotReached:!1,autoRotate:!0},r=new Proxy(t,{get:function(t,r){return r in t?t[r]:e[r]}});this.options=r}},{key:"_compressFile",value:function(){var t=c(n.default.mark(function t(e){var r,i;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=new u.default(e),(i={}).start=window.performance.now(),i.quality=this.options.quality,i.startType=r.type,t.next=7,r.load();case 7:return t.next=9,this._compressImage(r,i);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_compressImage",value:function(){var t=c(n.default.mark(function t(e,r){var i,u,s,c,f;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r.startWidth=e.width,r.startHeight=e.height,i=void 0,u=void 0,this.options.resize?(s=(0,a.resize)(e.width,e.height,this.options.maxWidth,this.options.maxHeight),i=s.width,u=s.height):(i=e.width,u=e.height),r.endWidth=i,r.endHeight=u,c=this.doAutoRotation?void 0:1,f=e.getCanvas(i,u,c),r.iterations=0,r.startSizeMB=o.size(e.size).MB,t.next=12,this._loopCompression(f,e,r);case 12:return r.endSizeMB=o.size(e.size).MB,r.sizeReducedInPercent=(r.startSizeMB-r.endSizeMB)/r.startSizeMB*100,r.end=window.performance.now(),r.elapsedTimeInSeconds=(r.end-r.start)/1e3,r.endType=e.type,t.abrupt("return",{photo:e,info:r});case 18:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"_loopCompression",value:function(){var t=c(n.default.mark(function t(e,r,i){var a;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i.iterations++,t.t0=r,t.next=4,o.canvasToBlob(e,i.quality);case 4:if(t.t1=t.sent,t.t0.setData.call(t.t0,t.t1),1==i.iterations&&(r.width=i.endWidth,r.height=i.endHeight),!(o.size(r.size).MB>this.options.targetSize)){t.next=24;break}if(!(i.quality.toFixed(10)-.1<this.options.minQuality)){t.next=18;break}if(a="Couldn't compress image to target size while maintaining quality.\n        Target size: "+this.options.targetSize+"\n        Actual size: "+o.size(r.size).MB,this.options.throwIfSizeNotReached){t.next=14;break}console.error(a),t.next=15;break;case 14:throw new Error(a);case 15:return t.abrupt("return");case 18:return i.quality-=this.options.qualityStepSize,t.next=21,this._loopCompression(e,r,i);case 21:return t.abrupt("return",t.sent);case 22:t.next=25;break;case 24:return t.abrupt("return");case 25:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"setAutoRotate",value:function(){var e=c(n.default.mark(function e(){var r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.automaticRotationFeatureTest();case 2:r=e.sent,this.doAutoRotation=this.options.autoRotate&&!r;case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"compress",value:function(){var t=c(n.default.mark(function t(e){var r=this;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.setAutoRotate();case 2:return t.abrupt("return",Promise.all(e.map(function(t){return r._compressFile(t)})));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()}],[{key:"blobToBase64",value:function(){var t=c(n.default.mark(function t(){var e=arguments;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.blobToBase64.apply(o,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"loadImageElement",value:function(){var t=c(n.default.mark(function t(){var e=arguments;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.loadImageElement.apply(void 0,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"automaticRotationFeatureTest",value:function(){return new Promise(function(t){var e=new Image;e.onload=function(){var r=1===e.width&&2===e.height;t(r)},e.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=="})}}]),t}();e.default=f,t.exports=e.default}])});

/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/bookmark-views/styles/bookmarks.scss":
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/bookmark-views/styles/bookmarks.scss ***!
  \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatboxviews/styles/chats.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatboxviews/styles/chats.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/chat-bottom-panel.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/chat-bottom-panel.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/chat-head.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/chat-head.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/index.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/index.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/_controlbox.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/_controlbox.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/buttons.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/buttons.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/loginform.scss":
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/loginform.scss ***!
  \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/disco-views/styles/disco-browser.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/disco-views/styles/disco-browser.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/fullscreen/styles/fullscreen.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/fullscreen/styles/fullscreen.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/headlines-view/styles/headlines-head.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/headlines-view/styles/headlines-head.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/headlines-view/styles/headlines.scss":
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/headlines-view/styles/headlines.scss ***!
  \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/mam-views/styles/placeholder.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/mam-views/styles/placeholder.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/minimize/styles/minimize.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/minimize/styles/minimize.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/_modal.scss":
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/_modal.scss ***!
  \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/popover.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/popover.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/toast.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/toast.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/modals/styles/config.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/modals/styles/config.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/modals/styles/occupant.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/modals/styles/occupant.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/add-muc-modal.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/add-muc-modal.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/affiliation-form.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/affiliation-form.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/index.scss":
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/index.scss ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/moderator-tools.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/moderator-tools.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-bottom-panel.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-bottom-panel.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-chat-content.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-chat-content.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-details-modal.scss":
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-details-modal.scss ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-head.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-head.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-occupant.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-occupant.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-occupants.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-occupants.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-sidebar.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-sidebar.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/nickname-form.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/nickname-form.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/occupant-bottom-panel.scss":
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/occupant-bottom-panel.scss ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/role-form.scss":
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/role-form.scss ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/omemo/styles/omemo.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/omemo/styles/omemo.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/modals/styles/profile.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/modals/styles/profile.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/modals/styles/user-settings.scss":
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/modals/styles/user-settings.scss ***!
  \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/styles/profile.scss":
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/styles/profile.scss ***!
  \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/register/styles/register.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/register/styles/register.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/roomslist/styles/roomsgroups.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/roomslist/styles/roomsgroups.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rootview/styles/background.scss":
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rootview/styles/background.scss ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rootview/styles/root.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rootview/styles/root.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/modals/styles/add-contact.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/modals/styles/add-contact.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/styles/approval-alert.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/styles/approval-alert.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/styles/roster.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/styles/roster.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/singleton/singleton.scss":
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/singleton/singleton.scss ***!
  \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/autocomplete/styles/_autocomplete.scss":
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/autocomplete/styles/_autocomplete.scss ***!
  \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/avatar/avatar.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/avatar/avatar.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/chat-content.scss":
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/chat-content.scss ***!
  \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/emoji.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/emoji.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/message-actions.scss":
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/message-actions.scss ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/message-body.scss":
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/message-body.scss ***!
  \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/retraction.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/retraction.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/toolbar.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/toolbar.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/unfurl.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/unfurl.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/dropdown.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/dropdown.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/icon.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/icon.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/image-picker.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/image-picker.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/list-filter.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/list-filter.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/message-versions.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/message-versions.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/split-resize.scss":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/split-resize.scss ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/gif/styles.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/gif/styles.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/modals/styles/image.scss":
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/modals/styles/image.scss ***!
  \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/modals/styles/user-details.scss":
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/modals/styles/user-details.scss ***!
  \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/qrcode/qrcode.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/qrcode/qrcode.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/styles/index.scss":
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/styles/index.scss ***!
  \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/styles/status.scss":
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/styles/status.scss ***!
  \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/texture/styles/audio.scss":
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/texture/styles/audio.scss ***!
  \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/texture/styles/texture.scss":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/texture/styles/texture.scss ***!
  \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/templates/styles/spinner.scss":
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/templates/styles/spinner.scss ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/runtime/api.js":
/*!*****************************************************!*\
  !*** ./node_modules/css-loader/dist/runtime/api.js ***!
  \*****************************************************/
/***/ ((module) => {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js":
/*!************************************************************!*\
  !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
  \************************************************************/
/***/ ((module) => {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ "./node_modules/dayjs/dayjs.min.js":
/*!*****************************************!*\
  !*** ./node_modules/dayjs/dayjs.min.js ***!
  \*****************************************/
/***/ (function(module) {

!function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));

/***/ }),

/***/ "./node_modules/dayjs/locale lazy recursive ^\\.\\/.*\\.js$":
/*!**********************************************************************************************************!*\
  !*** ./node_modules/dayjs/locale/ lazy ^\.\/.*\.js$ chunkName: locales/dayjs/[request] namespace object ***!
  \**********************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var map = {
	"./af.js": [
		"./node_modules/dayjs/locale/af.js",
		"locales/dayjs/af-js"
	],
	"./am.js": [
		"./node_modules/dayjs/locale/am.js",
		"locales/dayjs/am-js"
	],
	"./ar-dz.js": [
		"./node_modules/dayjs/locale/ar-dz.js",
		"locales/dayjs/ar-dz-js"
	],
	"./ar-iq.js": [
		"./node_modules/dayjs/locale/ar-iq.js",
		"locales/dayjs/ar-iq-js"
	],
	"./ar-kw.js": [
		"./node_modules/dayjs/locale/ar-kw.js",
		"locales/dayjs/ar-kw-js"
	],
	"./ar-ly.js": [
		"./node_modules/dayjs/locale/ar-ly.js",
		"locales/dayjs/ar-ly-js"
	],
	"./ar-ma.js": [
		"./node_modules/dayjs/locale/ar-ma.js",
		"locales/dayjs/ar-ma-js"
	],
	"./ar-sa.js": [
		"./node_modules/dayjs/locale/ar-sa.js",
		"locales/dayjs/ar-sa-js"
	],
	"./ar-tn.js": [
		"./node_modules/dayjs/locale/ar-tn.js",
		"locales/dayjs/ar-tn-js"
	],
	"./ar.js": [
		"./node_modules/dayjs/locale/ar.js",
		"locales/dayjs/ar-js"
	],
	"./az.js": [
		"./node_modules/dayjs/locale/az.js",
		"locales/dayjs/az-js"
	],
	"./be.js": [
		"./node_modules/dayjs/locale/be.js",
		"locales/dayjs/be-js"
	],
	"./bg.js": [
		"./node_modules/dayjs/locale/bg.js",
		"locales/dayjs/bg-js"
	],
	"./bi.js": [
		"./node_modules/dayjs/locale/bi.js",
		"locales/dayjs/bi-js"
	],
	"./bm.js": [
		"./node_modules/dayjs/locale/bm.js",
		"locales/dayjs/bm-js"
	],
	"./bn-bd.js": [
		"./node_modules/dayjs/locale/bn-bd.js",
		"locales/dayjs/bn-bd-js"
	],
	"./bn.js": [
		"./node_modules/dayjs/locale/bn.js",
		"locales/dayjs/bn-js"
	],
	"./bo.js": [
		"./node_modules/dayjs/locale/bo.js",
		"locales/dayjs/bo-js"
	],
	"./br.js": [
		"./node_modules/dayjs/locale/br.js",
		"locales/dayjs/br-js"
	],
	"./bs.js": [
		"./node_modules/dayjs/locale/bs.js",
		"locales/dayjs/bs-js"
	],
	"./ca.js": [
		"./node_modules/dayjs/locale/ca.js",
		"locales/dayjs/ca-js"
	],
	"./cs.js": [
		"./node_modules/dayjs/locale/cs.js",
		"locales/dayjs/cs-js"
	],
	"./cv.js": [
		"./node_modules/dayjs/locale/cv.js",
		"locales/dayjs/cv-js"
	],
	"./cy.js": [
		"./node_modules/dayjs/locale/cy.js",
		"locales/dayjs/cy-js"
	],
	"./da.js": [
		"./node_modules/dayjs/locale/da.js",
		"locales/dayjs/da-js"
	],
	"./de-at.js": [
		"./node_modules/dayjs/locale/de-at.js",
		"locales/dayjs/de-at-js"
	],
	"./de-ch.js": [
		"./node_modules/dayjs/locale/de-ch.js",
		"locales/dayjs/de-ch-js"
	],
	"./de.js": [
		"./node_modules/dayjs/locale/de.js",
		"locales/dayjs/de-js"
	],
	"./dv.js": [
		"./node_modules/dayjs/locale/dv.js",
		"locales/dayjs/dv-js"
	],
	"./el.js": [
		"./node_modules/dayjs/locale/el.js",
		"locales/dayjs/el-js"
	],
	"./en-au.js": [
		"./node_modules/dayjs/locale/en-au.js",
		"locales/dayjs/en-au-js"
	],
	"./en-ca.js": [
		"./node_modules/dayjs/locale/en-ca.js",
		"locales/dayjs/en-ca-js"
	],
	"./en-gb.js": [
		"./node_modules/dayjs/locale/en-gb.js",
		"locales/dayjs/en-gb-js"
	],
	"./en-ie.js": [
		"./node_modules/dayjs/locale/en-ie.js",
		"locales/dayjs/en-ie-js"
	],
	"./en-il.js": [
		"./node_modules/dayjs/locale/en-il.js",
		"locales/dayjs/en-il-js"
	],
	"./en-in.js": [
		"./node_modules/dayjs/locale/en-in.js",
		"locales/dayjs/en-in-js"
	],
	"./en-nz.js": [
		"./node_modules/dayjs/locale/en-nz.js",
		"locales/dayjs/en-nz-js"
	],
	"./en-sg.js": [
		"./node_modules/dayjs/locale/en-sg.js",
		"locales/dayjs/en-sg-js"
	],
	"./en-tt.js": [
		"./node_modules/dayjs/locale/en-tt.js",
		"locales/dayjs/en-tt-js"
	],
	"./en.js": [
		"./node_modules/dayjs/locale/en.js",
		"locales/dayjs/en-js"
	],
	"./eo.js": [
		"./node_modules/dayjs/locale/eo.js",
		"locales/dayjs/eo-js"
	],
	"./es-do.js": [
		"./node_modules/dayjs/locale/es-do.js",
		"locales/dayjs/es-do-js"
	],
	"./es-mx.js": [
		"./node_modules/dayjs/locale/es-mx.js",
		"locales/dayjs/es-mx-js"
	],
	"./es-pr.js": [
		"./node_modules/dayjs/locale/es-pr.js",
		"locales/dayjs/es-pr-js"
	],
	"./es-us.js": [
		"./node_modules/dayjs/locale/es-us.js",
		"locales/dayjs/es-us-js"
	],
	"./es.js": [
		"./node_modules/dayjs/locale/es.js",
		"locales/dayjs/es-js"
	],
	"./et.js": [
		"./node_modules/dayjs/locale/et.js",
		"locales/dayjs/et-js"
	],
	"./eu.js": [
		"./node_modules/dayjs/locale/eu.js",
		"locales/dayjs/eu-js"
	],
	"./fa.js": [
		"./node_modules/dayjs/locale/fa.js",
		"locales/dayjs/fa-js"
	],
	"./fi.js": [
		"./node_modules/dayjs/locale/fi.js",
		"locales/dayjs/fi-js"
	],
	"./fo.js": [
		"./node_modules/dayjs/locale/fo.js",
		"locales/dayjs/fo-js"
	],
	"./fr-ca.js": [
		"./node_modules/dayjs/locale/fr-ca.js",
		"locales/dayjs/fr-ca-js"
	],
	"./fr-ch.js": [
		"./node_modules/dayjs/locale/fr-ch.js",
		"locales/dayjs/fr-ch-js"
	],
	"./fr.js": [
		"./node_modules/dayjs/locale/fr.js",
		"locales/dayjs/fr-js"
	],
	"./fy.js": [
		"./node_modules/dayjs/locale/fy.js",
		"locales/dayjs/fy-js"
	],
	"./ga.js": [
		"./node_modules/dayjs/locale/ga.js",
		"locales/dayjs/ga-js"
	],
	"./gd.js": [
		"./node_modules/dayjs/locale/gd.js",
		"locales/dayjs/gd-js"
	],
	"./gl.js": [
		"./node_modules/dayjs/locale/gl.js",
		"locales/dayjs/gl-js"
	],
	"./gom-latn.js": [
		"./node_modules/dayjs/locale/gom-latn.js",
		"locales/dayjs/gom-latn-js"
	],
	"./gu.js": [
		"./node_modules/dayjs/locale/gu.js",
		"locales/dayjs/gu-js"
	],
	"./he.js": [
		"./node_modules/dayjs/locale/he.js",
		"locales/dayjs/he-js"
	],
	"./hi.js": [
		"./node_modules/dayjs/locale/hi.js",
		"locales/dayjs/hi-js"
	],
	"./hr.js": [
		"./node_modules/dayjs/locale/hr.js",
		"locales/dayjs/hr-js"
	],
	"./ht.js": [
		"./node_modules/dayjs/locale/ht.js",
		"locales/dayjs/ht-js"
	],
	"./hu.js": [
		"./node_modules/dayjs/locale/hu.js",
		"locales/dayjs/hu-js"
	],
	"./hy-am.js": [
		"./node_modules/dayjs/locale/hy-am.js",
		"locales/dayjs/hy-am-js"
	],
	"./id.js": [
		"./node_modules/dayjs/locale/id.js",
		"locales/dayjs/id-js"
	],
	"./is.js": [
		"./node_modules/dayjs/locale/is.js",
		"locales/dayjs/is-js"
	],
	"./it-ch.js": [
		"./node_modules/dayjs/locale/it-ch.js",
		"locales/dayjs/it-ch-js"
	],
	"./it.js": [
		"./node_modules/dayjs/locale/it.js",
		"locales/dayjs/it-js"
	],
	"./ja.js": [
		"./node_modules/dayjs/locale/ja.js",
		"locales/dayjs/ja-js"
	],
	"./jv.js": [
		"./node_modules/dayjs/locale/jv.js",
		"locales/dayjs/jv-js"
	],
	"./ka.js": [
		"./node_modules/dayjs/locale/ka.js",
		"locales/dayjs/ka-js"
	],
	"./kk.js": [
		"./node_modules/dayjs/locale/kk.js",
		"locales/dayjs/kk-js"
	],
	"./km.js": [
		"./node_modules/dayjs/locale/km.js",
		"locales/dayjs/km-js"
	],
	"./kn.js": [
		"./node_modules/dayjs/locale/kn.js",
		"locales/dayjs/kn-js"
	],
	"./ko.js": [
		"./node_modules/dayjs/locale/ko.js",
		"locales/dayjs/ko-js"
	],
	"./ku.js": [
		"./node_modules/dayjs/locale/ku.js",
		"locales/dayjs/ku-js"
	],
	"./ky.js": [
		"./node_modules/dayjs/locale/ky.js",
		"locales/dayjs/ky-js"
	],
	"./lb.js": [
		"./node_modules/dayjs/locale/lb.js",
		"locales/dayjs/lb-js"
	],
	"./lo.js": [
		"./node_modules/dayjs/locale/lo.js",
		"locales/dayjs/lo-js"
	],
	"./lt.js": [
		"./node_modules/dayjs/locale/lt.js",
		"locales/dayjs/lt-js"
	],
	"./lv.js": [
		"./node_modules/dayjs/locale/lv.js",
		"locales/dayjs/lv-js"
	],
	"./me.js": [
		"./node_modules/dayjs/locale/me.js",
		"locales/dayjs/me-js"
	],
	"./mi.js": [
		"./node_modules/dayjs/locale/mi.js",
		"locales/dayjs/mi-js"
	],
	"./mk.js": [
		"./node_modules/dayjs/locale/mk.js",
		"locales/dayjs/mk-js"
	],
	"./ml.js": [
		"./node_modules/dayjs/locale/ml.js",
		"locales/dayjs/ml-js"
	],
	"./mn.js": [
		"./node_modules/dayjs/locale/mn.js",
		"locales/dayjs/mn-js"
	],
	"./mr.js": [
		"./node_modules/dayjs/locale/mr.js",
		"locales/dayjs/mr-js"
	],
	"./ms-my.js": [
		"./node_modules/dayjs/locale/ms-my.js",
		"locales/dayjs/ms-my-js"
	],
	"./ms.js": [
		"./node_modules/dayjs/locale/ms.js",
		"locales/dayjs/ms-js"
	],
	"./mt.js": [
		"./node_modules/dayjs/locale/mt.js",
		"locales/dayjs/mt-js"
	],
	"./my.js": [
		"./node_modules/dayjs/locale/my.js",
		"locales/dayjs/my-js"
	],
	"./nb.js": [
		"./node_modules/dayjs/locale/nb.js",
		"locales/dayjs/nb-js"
	],
	"./ne.js": [
		"./node_modules/dayjs/locale/ne.js",
		"locales/dayjs/ne-js"
	],
	"./nl-be.js": [
		"./node_modules/dayjs/locale/nl-be.js",
		"locales/dayjs/nl-be-js"
	],
	"./nl.js": [
		"./node_modules/dayjs/locale/nl.js",
		"locales/dayjs/nl-js"
	],
	"./nn.js": [
		"./node_modules/dayjs/locale/nn.js",
		"locales/dayjs/nn-js"
	],
	"./oc-lnc.js": [
		"./node_modules/dayjs/locale/oc-lnc.js",
		"locales/dayjs/oc-lnc-js"
	],
	"./pa-in.js": [
		"./node_modules/dayjs/locale/pa-in.js",
		"locales/dayjs/pa-in-js"
	],
	"./pl.js": [
		"./node_modules/dayjs/locale/pl.js",
		"locales/dayjs/pl-js"
	],
	"./pt-br.js": [
		"./node_modules/dayjs/locale/pt-br.js",
		"locales/dayjs/pt-br-js"
	],
	"./pt.js": [
		"./node_modules/dayjs/locale/pt.js",
		"locales/dayjs/pt-js"
	],
	"./rn.js": [
		"./node_modules/dayjs/locale/rn.js",
		"locales/dayjs/rn-js"
	],
	"./ro.js": [
		"./node_modules/dayjs/locale/ro.js",
		"locales/dayjs/ro-js"
	],
	"./ru.js": [
		"./node_modules/dayjs/locale/ru.js",
		"locales/dayjs/ru-js"
	],
	"./rw.js": [
		"./node_modules/dayjs/locale/rw.js",
		"locales/dayjs/rw-js"
	],
	"./sd.js": [
		"./node_modules/dayjs/locale/sd.js",
		"locales/dayjs/sd-js"
	],
	"./se.js": [
		"./node_modules/dayjs/locale/se.js",
		"locales/dayjs/se-js"
	],
	"./si.js": [
		"./node_modules/dayjs/locale/si.js",
		"locales/dayjs/si-js"
	],
	"./sk.js": [
		"./node_modules/dayjs/locale/sk.js",
		"locales/dayjs/sk-js"
	],
	"./sl.js": [
		"./node_modules/dayjs/locale/sl.js",
		"locales/dayjs/sl-js"
	],
	"./sq.js": [
		"./node_modules/dayjs/locale/sq.js",
		"locales/dayjs/sq-js"
	],
	"./sr-cyrl.js": [
		"./node_modules/dayjs/locale/sr-cyrl.js",
		"locales/dayjs/sr-cyrl-js"
	],
	"./sr.js": [
		"./node_modules/dayjs/locale/sr.js",
		"locales/dayjs/sr-js"
	],
	"./ss.js": [
		"./node_modules/dayjs/locale/ss.js",
		"locales/dayjs/ss-js"
	],
	"./sv-fi.js": [
		"./node_modules/dayjs/locale/sv-fi.js",
		"locales/dayjs/sv-fi-js"
	],
	"./sv.js": [
		"./node_modules/dayjs/locale/sv.js",
		"locales/dayjs/sv-js"
	],
	"./sw.js": [
		"./node_modules/dayjs/locale/sw.js",
		"locales/dayjs/sw-js"
	],
	"./ta.js": [
		"./node_modules/dayjs/locale/ta.js",
		"locales/dayjs/ta-js"
	],
	"./te.js": [
		"./node_modules/dayjs/locale/te.js",
		"locales/dayjs/te-js"
	],
	"./tet.js": [
		"./node_modules/dayjs/locale/tet.js",
		"locales/dayjs/tet-js"
	],
	"./tg.js": [
		"./node_modules/dayjs/locale/tg.js",
		"locales/dayjs/tg-js"
	],
	"./th.js": [
		"./node_modules/dayjs/locale/th.js",
		"locales/dayjs/th-js"
	],
	"./tk.js": [
		"./node_modules/dayjs/locale/tk.js",
		"locales/dayjs/tk-js"
	],
	"./tl-ph.js": [
		"./node_modules/dayjs/locale/tl-ph.js",
		"locales/dayjs/tl-ph-js"
	],
	"./tlh.js": [
		"./node_modules/dayjs/locale/tlh.js",
		"locales/dayjs/tlh-js"
	],
	"./tr.js": [
		"./node_modules/dayjs/locale/tr.js",
		"locales/dayjs/tr-js"
	],
	"./tzl.js": [
		"./node_modules/dayjs/locale/tzl.js",
		"locales/dayjs/tzl-js"
	],
	"./tzm-latn.js": [
		"./node_modules/dayjs/locale/tzm-latn.js",
		"locales/dayjs/tzm-latn-js"
	],
	"./tzm.js": [
		"./node_modules/dayjs/locale/tzm.js",
		"locales/dayjs/tzm-js"
	],
	"./ug-cn.js": [
		"./node_modules/dayjs/locale/ug-cn.js",
		"locales/dayjs/ug-cn-js"
	],
	"./uk.js": [
		"./node_modules/dayjs/locale/uk.js",
		"locales/dayjs/uk-js"
	],
	"./ur.js": [
		"./node_modules/dayjs/locale/ur.js",
		"locales/dayjs/ur-js"
	],
	"./uz-latn.js": [
		"./node_modules/dayjs/locale/uz-latn.js",
		"locales/dayjs/uz-latn-js"
	],
	"./uz.js": [
		"./node_modules/dayjs/locale/uz.js",
		"locales/dayjs/uz-js"
	],
	"./vi.js": [
		"./node_modules/dayjs/locale/vi.js",
		"locales/dayjs/vi-js"
	],
	"./x-pseudo.js": [
		"./node_modules/dayjs/locale/x-pseudo.js",
		"locales/dayjs/x-pseudo-js"
	],
	"./yo.js": [
		"./node_modules/dayjs/locale/yo.js",
		"locales/dayjs/yo-js"
	],
	"./zh-cn.js": [
		"./node_modules/dayjs/locale/zh-cn.js",
		"locales/dayjs/zh-cn-js"
	],
	"./zh-hk.js": [
		"./node_modules/dayjs/locale/zh-hk.js",
		"locales/dayjs/zh-hk-js"
	],
	"./zh-tw.js": [
		"./node_modules/dayjs/locale/zh-tw.js",
		"locales/dayjs/zh-tw-js"
	],
	"./zh.js": [
		"./node_modules/dayjs/locale/zh.js",
		"locales/dayjs/zh-js"
	]
};
function webpackAsyncContext(req) {
	if(!__webpack_require__.o(map, req)) {
		return Promise.resolve().then(() => {
			var e = new Error("Cannot find module '" + req + "'");
			e.code = 'MODULE_NOT_FOUND';
			throw e;
		});
	}

	var ids = map[req], id = ids[0];
	return __webpack_require__.e(ids[1]).then(() => {
		return __webpack_require__.t(id, 7 | 16);
	});
}
webpackAsyncContext.keys = () => (Object.keys(map));
webpackAsyncContext.id = "./node_modules/dayjs/locale lazy recursive ^\\.\\/.*\\.js$";
module.exports = webpackAsyncContext;

/***/ }),

/***/ "./node_modules/dayjs/plugin/advancedFormat.js":
/*!*****************************************************!*\
  !*** ./node_modules/dayjs/plugin/advancedFormat.js ***!
  \*****************************************************/
/***/ (function(module) {

!function(e,t){ true?module.exports=t():0}(this,(function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return n.bind(this)(e);var s=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return r.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return r.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return n.bind(this)(a)}}}));

/***/ }),

/***/ "./node_modules/dompurify/dist/purify.es.mjs":
/*!***************************************************!*\
  !*** ./node_modules/dompurify/dist/purify.es.mjs ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ purify)
/* harmony export */ });
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */

const {
  entries,
  setPrototypeOf,
  isFrozen,
  getPrototypeOf,
  getOwnPropertyDescriptor
} = Object;
let {
  freeze,
  seal,
  create
} = Object; // eslint-disable-line import/no-mutable-exports
let {
  apply,
  construct
} = typeof Reflect !== 'undefined' && Reflect;
if (!freeze) {
  freeze = function freeze(x) {
    return x;
  };
}
if (!seal) {
  seal = function seal(x) {
    return x;
  };
}
if (!apply) {
  apply = function apply(fun, thisValue, args) {
    return fun.apply(thisValue, args);
  };
}
if (!construct) {
  construct = function construct(Func, args) {
    return new Func(...args);
  };
}
const arrayForEach = unapply(Array.prototype.forEach);
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
const arrayPop = unapply(Array.prototype.pop);
const arrayPush = unapply(Array.prototype.push);
const arraySplice = unapply(Array.prototype.splice);
const stringToLowerCase = unapply(String.prototype.toLowerCase);
const stringToString = unapply(String.prototype.toString);
const stringMatch = unapply(String.prototype.match);
const stringReplace = unapply(String.prototype.replace);
const stringIndexOf = unapply(String.prototype.indexOf);
const stringTrim = unapply(String.prototype.trim);
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
const regExpTest = unapply(RegExp.prototype.test);
const typeErrorCreate = unconstruct(TypeError);
/**
 * Creates a new function that calls the given function with a specified thisArg and arguments.
 *
 * @param func - The function to be wrapped and called.
 * @returns A new function that calls the given function with a specified thisArg and arguments.
 */
function unapply(func) {
  return function (thisArg) {
    if (thisArg instanceof RegExp) {
      thisArg.lastIndex = 0;
    }
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    return apply(func, thisArg, args);
  };
}
/**
 * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
 *
 * @param func - The constructor function to be wrapped and called.
 * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
 */
function unconstruct(func) {
  return function () {
    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      args[_key2] = arguments[_key2];
    }
    return construct(func, args);
  };
}
/**
 * Add properties to a lookup table
 *
 * @param set - The set to which elements will be added.
 * @param array - The array containing elements to be added to the set.
 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
 * @returns The modified set with added elements.
 */
function addToSet(set, array) {
  let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
  if (setPrototypeOf) {
    // Make 'in' and truthy checks like Boolean(set.constructor)
    // independent of any properties defined on Object.prototype.
    // Prevent prototype setters from intercepting set as a this value.
    setPrototypeOf(set, null);
  }
  let l = array.length;
  while (l--) {
    let element = array[l];
    if (typeof element === 'string') {
      const lcElement = transformCaseFunc(element);
      if (lcElement !== element) {
        // Config presets (e.g. tags.js, attrs.js) are immutable.
        if (!isFrozen(array)) {
          array[l] = lcElement;
        }
        element = lcElement;
      }
    }
    set[element] = true;
  }
  return set;
}
/**
 * Clean up an array to harden against CSPP
 *
 * @param array - The array to be cleaned.
 * @returns The cleaned version of the array
 */
function cleanArray(array) {
  for (let index = 0; index < array.length; index++) {
    const isPropertyExist = objectHasOwnProperty(array, index);
    if (!isPropertyExist) {
      array[index] = null;
    }
  }
  return array;
}
/**
 * Shallow clone an object
 *
 * @param object - The object to be cloned.
 * @returns A new object that copies the original.
 */
function clone(object) {
  const newObject = create(null);
  for (const [property, value] of entries(object)) {
    const isPropertyExist = objectHasOwnProperty(object, property);
    if (isPropertyExist) {
      if (Array.isArray(value)) {
        newObject[property] = cleanArray(value);
      } else if (value && typeof value === 'object' && value.constructor === Object) {
        newObject[property] = clone(value);
      } else {
        newObject[property] = value;
      }
    }
  }
  return newObject;
}
/**
 * This method automatically checks if the prop is function or getter and behaves accordingly.
 *
 * @param object - The object to look up the getter function in its prototype chain.
 * @param prop - The property name for which to find the getter function.
 * @returns The getter function found in the prototype chain or a fallback function.
 */
function lookupGetter(object, prop) {
  while (object !== null) {
    const desc = getOwnPropertyDescriptor(object, prop);
    if (desc) {
      if (desc.get) {
        return unapply(desc.get);
      }
      if (typeof desc.value === 'function') {
        return unapply(desc.value);
      }
    }
    object = getPrototypeOf(object);
  }
  function fallbackValue() {
    return null;
  }
  return fallbackValue;
}

const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
// List of SVG elements that are disallowed by default.
// We still need to know them so that we can do namespace
// checks properly in case one wants to add them to
// allow-list.
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
// Similarly to SVG, we want to know all MathML elements,
// even those that we disallow by default.
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
const text = freeze(['#text']);

const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);

// eslint-disable-next-line unicorn/better-regex
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
);
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
);
const DOCTYPE_NAME = seal(/^html$/i);
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);

var EXPRESSIONS = /*#__PURE__*/Object.freeze({
  __proto__: null,
  ARIA_ATTR: ARIA_ATTR,
  ATTR_WHITESPACE: ATTR_WHITESPACE,
  CUSTOM_ELEMENT: CUSTOM_ELEMENT,
  DATA_ATTR: DATA_ATTR,
  DOCTYPE_NAME: DOCTYPE_NAME,
  ERB_EXPR: ERB_EXPR,
  IS_ALLOWED_URI: IS_ALLOWED_URI,
  IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
  MUSTACHE_EXPR: MUSTACHE_EXPR,
  TMPLIT_EXPR: TMPLIT_EXPR
});

/* eslint-disable @typescript-eslint/indent */
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
const NODE_TYPE = {
  element: 1,
  attribute: 2,
  text: 3,
  cdataSection: 4,
  entityReference: 5,
  // Deprecated
  entityNode: 6,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9,
  documentType: 10,
  documentFragment: 11,
  notation: 12 // Deprecated
};
const getGlobal = function getGlobal() {
  return typeof window === 'undefined' ? null : window;
};
/**
 * Creates a no-op policy for internal use only.
 * Don't export this function outside this module!
 * @param trustedTypes The policy factory.
 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
 * @return The policy created (or null, if Trusted Types
 * are not supported or creating the policy failed).
 */
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
  if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
    return null;
  }
  // Allow the callers to control the unique policy name
  // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
  // Policy creation with duplicate names throws in Trusted Types.
  let suffix = null;
  const ATTR_NAME = 'data-tt-policy-suffix';
  if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
    suffix = purifyHostElement.getAttribute(ATTR_NAME);
  }
  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
  try {
    return trustedTypes.createPolicy(policyName, {
      createHTML(html) {
        return html;
      },
      createScriptURL(scriptUrl) {
        return scriptUrl;
      }
    });
  } catch (_) {
    // Policy creation failed (most likely another DOMPurify script has
    // already run). Skip creating the policy, as this will only cause errors
    // if TT are enforced.
    console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
    return null;
  }
};
const _createHooksMap = function _createHooksMap() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
};
function createDOMPurify() {
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
  const DOMPurify = root => createDOMPurify(root);
  DOMPurify.version = '3.2.6';
  DOMPurify.removed = [];
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
    // Not running in a browser, provide a factory function
    // so that you can pass your own Window
    DOMPurify.isSupported = false;
    return DOMPurify;
  }
  let {
    document
  } = window;
  const originalDocument = document;
  const currentScript = originalDocument.currentScript;
  const {
    DocumentFragment,
    HTMLTemplateElement,
    Node,
    Element,
    NodeFilter,
    NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
    HTMLFormElement,
    DOMParser,
    trustedTypes
  } = window;
  const ElementPrototype = Element.prototype;
  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
  const remove = lookupGetter(ElementPrototype, 'remove');
  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
  // As per issue #47, the web-components registry is inherited by a
  // new document created via createHTMLDocument. As per the spec
  // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
  // a new empty registry is used when creating a template contents owner
  // document, so we use that as our parent document to ensure nothing
  // is inherited.
  if (typeof HTMLTemplateElement === 'function') {
    const template = document.createElement('template');
    if (template.content && template.content.ownerDocument) {
      document = template.content.ownerDocument;
    }
  }
  let trustedTypesPolicy;
  let emptyHTML = '';
  const {
    implementation,
    createNodeIterator,
    createDocumentFragment,
    getElementsByTagName
  } = document;
  const {
    importNode
  } = originalDocument;
  let hooks = _createHooksMap();
  /**
   * Expose whether this browser supports running the full DOMPurify.
   */
  DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
  const {
    MUSTACHE_EXPR,
    ERB_EXPR,
    TMPLIT_EXPR,
    DATA_ATTR,
    ARIA_ATTR,
    IS_SCRIPT_OR_DATA,
    ATTR_WHITESPACE,
    CUSTOM_ELEMENT
  } = EXPRESSIONS;
  let {
    IS_ALLOWED_URI: IS_ALLOWED_URI$1
  } = EXPRESSIONS;
  /**
   * We consider the elements and attributes below to be safe. Ideally
   * don't add any new ones but feel free to remove unwanted ones.
   */
  /* allowed element names */
  let ALLOWED_TAGS = null;
  const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
  /* Allowed attribute names */
  let ALLOWED_ATTR = null;
  const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
  /*
   * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
   * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
   * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
   * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
   */
  let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
    tagNameCheck: {
      writable: true,
      configurable: false,
      enumerable: true,
      value: null
    },
    attributeNameCheck: {
      writable: true,
      configurable: false,
      enumerable: true,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: true,
      configurable: false,
      enumerable: true,
      value: false
    }
  }));
  /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
  let FORBID_TAGS = null;
  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
  let FORBID_ATTR = null;
  /* Decide if ARIA attributes are okay */
  let ALLOW_ARIA_ATTR = true;
  /* Decide if custom data attributes are okay */
  let ALLOW_DATA_ATTR = true;
  /* Decide if unknown protocols are okay */
  let ALLOW_UNKNOWN_PROTOCOLS = false;
  /* Decide if self-closing tags in attributes are allowed.
   * Usually removed due to a mXSS issue in jQuery 3.0 */
  let ALLOW_SELF_CLOSE_IN_ATTR = true;
  /* Output should be safe for common template engines.
   * This means, DOMPurify removes data attributes, mustaches and ERB
   */
  let SAFE_FOR_TEMPLATES = false;
  /* Output should be safe even for XML used within HTML and alike.
   * This means, DOMPurify removes comments when containing risky content.
   */
  let SAFE_FOR_XML = true;
  /* Decide if document with <html>... should be returned */
  let WHOLE_DOCUMENT = false;
  /* Track whether config is already set on this instance of DOMPurify. */
  let SET_CONFIG = false;
  /* Decide if all elements (e.g. style, script) must be children of
   * document.body. By default, browsers might move them to document.head */
  let FORCE_BODY = false;
  /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
   * string (or a TrustedHTML object if Trusted Types are supported).
   * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
   */
  let RETURN_DOM = false;
  /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
   * string  (or a TrustedHTML object if Trusted Types are supported) */
  let RETURN_DOM_FRAGMENT = false;
  /* Try to return a Trusted Type object instead of a string, return a string in
   * case Trusted Types are not supported  */
  let RETURN_TRUSTED_TYPE = false;
  /* Output should be free from DOM clobbering attacks?
   * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
   */
  let SANITIZE_DOM = true;
  /* Achieve full DOM Clobbering protection by isolating the namespace of named
   * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
   *
   * HTML/DOM spec rules that enable DOM Clobbering:
   *   - Named Access on Window (§7.3.3)
   *   - DOM Tree Accessors (§3.1.5)
   *   - Form Element Parent-Child Relations (§4.10.3)
   *   - Iframe srcdoc / Nested WindowProxies (§4.8.5)
   *   - HTMLCollection (§4.2.10.2)
   *
   * Namespace isolation is implemented by prefixing `id` and `name` attributes
   * with a constant string, i.e., `user-content-`
   */
  let SANITIZE_NAMED_PROPS = false;
  const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
  /* Keep element content when removing element? */
  let KEEP_CONTENT = true;
  /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
   * of importing it into a new Document and returning a sanitized copy */
  let IN_PLACE = false;
  /* Allow usage of profiles like html, svg and mathMl */
  let USE_PROFILES = {};
  /* Tags to ignore content of when KEEP_CONTENT is true */
  let FORBID_CONTENTS = null;
  const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
  /* Tags that are safe for data: URIs */
  let DATA_URI_TAGS = null;
  const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
  /* Attributes safe for values like "javascript:" */
  let URI_SAFE_ATTRIBUTES = null;
  const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
  const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
  /* Document namespace */
  let NAMESPACE = HTML_NAMESPACE;
  let IS_EMPTY_INPUT = false;
  /* Allowed XHTML+XML namespaces */
  let ALLOWED_NAMESPACES = null;
  const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
  let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
  let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
  // Certain elements are allowed in both SVG and HTML
  // namespace. We need to specify them explicitly
  // so that they don't get erroneously deleted from
  // HTML namespace.
  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
  /* Parsing of strict XHTML documents */
  let PARSER_MEDIA_TYPE = null;
  const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
  const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
  let transformCaseFunc = null;
  /* Keep a reference to config to pass to hooks */
  let CONFIG = null;
  /* Ideally, do not touch anything below this line */
  /* ______________________________________________ */
  const formElement = document.createElement('form');
  const isRegexOrFunction = function isRegexOrFunction(testValue) {
    return testValue instanceof RegExp || testValue instanceof Function;
  };
  /**
   * _parseConfig
   *
   * @param cfg optional config literal
   */
  // eslint-disable-next-line complexity
  const _parseConfig = function _parseConfig() {
    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    if (CONFIG && CONFIG === cfg) {
      return;
    }
    /* Shield configuration object from tampering */
    if (!cfg || typeof cfg !== 'object') {
      cfg = {};
    }
    /* Shield configuration object from prototype pollution */
    cfg = clone(cfg);
    PARSER_MEDIA_TYPE =
    // eslint-disable-next-line unicorn/prefer-includes
    SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
    // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
    transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
    /* Set configuration parameters */
    ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
    ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
    ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
    URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
    DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
    FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
    FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
    FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
    USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
    ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
    ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
    ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
    ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
    SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
    SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
    WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
    RETURN_DOM = cfg.RETURN_DOM || false; // Default false
    RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
    RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
    FORCE_BODY = cfg.FORCE_BODY || false; // Default false
    SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
    SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
    KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
    IN_PLACE = cfg.IN_PLACE || false; // Default false
    IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
    NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
    MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
    HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
    CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
      CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
    }
    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
      CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
    }
    if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
      CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
    }
    if (SAFE_FOR_TEMPLATES) {
      ALLOW_DATA_ATTR = false;
    }
    if (RETURN_DOM_FRAGMENT) {
      RETURN_DOM = true;
    }
    /* Parse profile info */
    if (USE_PROFILES) {
      ALLOWED_TAGS = addToSet({}, text);
      ALLOWED_ATTR = [];
      if (USE_PROFILES.html === true) {
        addToSet(ALLOWED_TAGS, html$1);
        addToSet(ALLOWED_ATTR, html);
      }
      if (USE_PROFILES.svg === true) {
        addToSet(ALLOWED_TAGS, svg$1);
        addToSet(ALLOWED_ATTR, svg);
        addToSet(ALLOWED_ATTR, xml);
      }
      if (USE_PROFILES.svgFilters === true) {
        addToSet(ALLOWED_TAGS, svgFilters);
        addToSet(ALLOWED_ATTR, svg);
        addToSet(ALLOWED_ATTR, xml);
      }
      if (USE_PROFILES.mathMl === true) {
        addToSet(ALLOWED_TAGS, mathMl$1);
        addToSet(ALLOWED_ATTR, mathMl);
        addToSet(ALLOWED_ATTR, xml);
      }
    }
    /* Merge configuration parameters */
    if (cfg.ADD_TAGS) {
      if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
        ALLOWED_TAGS = clone(ALLOWED_TAGS);
      }
      addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
    }
    if (cfg.ADD_ATTR) {
      if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
        ALLOWED_ATTR = clone(ALLOWED_ATTR);
      }
      addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
    }
    if (cfg.ADD_URI_SAFE_ATTR) {
      addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
    }
    if (cfg.FORBID_CONTENTS) {
      if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
        FORBID_CONTENTS = clone(FORBID_CONTENTS);
      }
      addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
    }
    /* Add #text in case KEEP_CONTENT is set to true */
    if (KEEP_CONTENT) {
      ALLOWED_TAGS['#text'] = true;
    }
    /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
    if (WHOLE_DOCUMENT) {
      addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
    }
    /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
    if (ALLOWED_TAGS.table) {
      addToSet(ALLOWED_TAGS, ['tbody']);
      delete FORBID_TAGS.tbody;
    }
    if (cfg.TRUSTED_TYPES_POLICY) {
      if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
      }
      if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
      }
      // Overwrite existing TrustedTypes policy.
      trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
      // Sign local variables required by `sanitize`.
      emptyHTML = trustedTypesPolicy.createHTML('');
    } else {
      // Uninitialized policy, attempt to initialize the internal dompurify policy.
      if (trustedTypesPolicy === undefined) {
        trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
      }
      // If creating the internal policy succeeded sign internal variables.
      if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
        emptyHTML = trustedTypesPolicy.createHTML('');
      }
    }
    // Prevent further manipulation of configuration.
    // Not available in IE8, Safari 5, etc.
    if (freeze) {
      freeze(cfg);
    }
    CONFIG = cfg;
  };
  /* Keep track of all possible SVG and MathML tags
   * so that we can perform the namespace checks
   * correctly. */
  const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
  /**
   * @param element a DOM element whose namespace is being checked
   * @returns Return false if the element has a
   *  namespace that a spec-compliant parser would never
   *  return. Return true otherwise.
   */
  const _checkValidNamespace = function _checkValidNamespace(element) {
    let parent = getParentNode(element);
    // In JSDOM, if we're inside shadow DOM, then parentNode
    // can be null. We just simulate parent in this case.
    if (!parent || !parent.tagName) {
      parent = {
        namespaceURI: NAMESPACE,
        tagName: 'template'
      };
    }
    const tagName = stringToLowerCase(element.tagName);
    const parentTagName = stringToLowerCase(parent.tagName);
    if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
      return false;
    }
    if (element.namespaceURI === SVG_NAMESPACE) {
      // The only way to switch from HTML namespace to SVG
      // is via <svg>. If it happens via any other tag, then
      // it should be killed.
      if (parent.namespaceURI === HTML_NAMESPACE) {
        return tagName === 'svg';
      }
      // The only way to switch from MathML to SVG is via`
      // svg if parent is either <annotation-xml> or MathML
      // text integration points.
      if (parent.namespaceURI === MATHML_NAMESPACE) {
        return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
      }
      // We only allow elements that are defined in SVG
      // spec. All others are disallowed in SVG namespace.
      return Boolean(ALL_SVG_TAGS[tagName]);
    }
    if (element.namespaceURI === MATHML_NAMESPACE) {
      // The only way to switch from HTML namespace to MathML
      // is via <math>. If it happens via any other tag, then
      // it should be killed.
      if (parent.namespaceURI === HTML_NAMESPACE) {
        return tagName === 'math';
      }
      // The only way to switch from SVG to MathML is via
      // <math> and HTML integration points
      if (parent.namespaceURI === SVG_NAMESPACE) {
        return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
      }
      // We only allow elements that are defined in MathML
      // spec. All others are disallowed in MathML namespace.
      return Boolean(ALL_MATHML_TAGS[tagName]);
    }
    if (element.namespaceURI === HTML_NAMESPACE) {
      // The only way to switch from SVG to HTML is via
      // HTML integration points, and from MathML to HTML
      // is via MathML text integration points
      if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
        return false;
      }
      if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
        return false;
      }
      // We disallow tags that are specific for MathML
      // or SVG and should never appear in HTML namespace
      return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
    }
    // For XHTML and XML documents that support custom namespaces
    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
      return true;
    }
    // The code should never reach this place (this means
    // that the element somehow got namespace that is not
    // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
    // Return false just in case.
    return false;
  };
  /**
   * _forceRemove
   *
   * @param node a DOM node
   */
  const _forceRemove = function _forceRemove(node) {
    arrayPush(DOMPurify.removed, {
      element: node
    });
    try {
      // eslint-disable-next-line unicorn/prefer-dom-node-remove
      getParentNode(node).removeChild(node);
    } catch (_) {
      remove(node);
    }
  };
  /**
   * _removeAttribute
   *
   * @param name an Attribute name
   * @param element a DOM node
   */
  const _removeAttribute = function _removeAttribute(name, element) {
    try {
      arrayPush(DOMPurify.removed, {
        attribute: element.getAttributeNode(name),
        from: element
      });
    } catch (_) {
      arrayPush(DOMPurify.removed, {
        attribute: null,
        from: element
      });
    }
    element.removeAttribute(name);
    // We void attribute values for unremovable "is" attributes
    if (name === 'is') {
      if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
        try {
          _forceRemove(element);
        } catch (_) {}
      } else {
        try {
          element.setAttribute(name, '');
        } catch (_) {}
      }
    }
  };
  /**
   * _initDocument
   *
   * @param dirty - a string of dirty markup
   * @return a DOM, filled with the dirty markup
   */
  const _initDocument = function _initDocument(dirty) {
    /* Create a HTML document */
    let doc = null;
    let leadingWhitespace = null;
    if (FORCE_BODY) {
      dirty = '<remove></remove>' + dirty;
    } else {
      /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
      const matches = stringMatch(dirty, /^[\r\n\t ]+/);
      leadingWhitespace = matches && matches[0];
    }
    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
      // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
      dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
    }
    const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
    /*
     * Use the DOMParser API by default, fallback later if needs be
     * DOMParser not work for svg when has multiple root element.
     */
    if (NAMESPACE === HTML_NAMESPACE) {
      try {
        doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
      } catch (_) {}
    }
    /* Use createHTMLDocument in case DOMParser is not available */
    if (!doc || !doc.documentElement) {
      doc = implementation.createDocument(NAMESPACE, 'template', null);
      try {
        doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
      } catch (_) {
        // Syntax error if dirtyPayload is invalid xml
      }
    }
    const body = doc.body || doc.documentElement;
    if (dirty && leadingWhitespace) {
      body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
    }
    /* Work on whole document or just its body */
    if (NAMESPACE === HTML_NAMESPACE) {
      return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
    }
    return WHOLE_DOCUMENT ? doc.documentElement : body;
  };
  /**
   * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
   *
   * @param root The root element or node to start traversing on.
   * @return The created NodeIterator
   */
  const _createNodeIterator = function _createNodeIterator(root) {
    return createNodeIterator.call(root.ownerDocument || root, root,
    // eslint-disable-next-line no-bitwise
    NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
  };
  /**
   * _isClobbered
   *
   * @param element element to check for clobbering attacks
   * @return true if clobbered, false if safe
   */
  const _isClobbered = function _isClobbered(element) {
    return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
  };
  /**
   * Checks whether the given object is a DOM node.
   *
   * @param value object to check whether it's a DOM node
   * @return true is object is a DOM node
   */
  const _isNode = function _isNode(value) {
    return typeof Node === 'function' && value instanceof Node;
  };
  function _executeHooks(hooks, currentNode, data) {
    arrayForEach(hooks, hook => {
      hook.call(DOMPurify, currentNode, data, CONFIG);
    });
  }
  /**
   * _sanitizeElements
   *
   * @protect nodeName
   * @protect textContent
   * @protect removeChild
   * @param currentNode to check for permission to exist
   * @return true if node was killed, false if left alive
   */
  const _sanitizeElements = function _sanitizeElements(currentNode) {
    let content = null;
    /* Execute a hook if present */
    _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
    /* Check if element is clobbered or can clobber */
    if (_isClobbered(currentNode)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Now let's check the element's type and name */
    const tagName = transformCaseFunc(currentNode.nodeName);
    /* Execute a hook if present */
    _executeHooks(hooks.uponSanitizeElement, currentNode, {
      tagName,
      allowedTags: ALLOWED_TAGS
    });
    /* Detect mXSS attempts abusing namespace confusion */
    if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Remove any occurrence of processing instructions */
    if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
      _forceRemove(currentNode);
      return true;
    }
    /* Remove any kind of possibly harmful comments */
    if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Remove element if anything forbids its presence */
    if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
      /* Check if we have a custom element to handle */
      if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
          return false;
        }
        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
          return false;
        }
      }
      /* Keep content except for bad-listed elements */
      if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
        const parentNode = getParentNode(currentNode) || currentNode.parentNode;
        const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
        if (childNodes && parentNode) {
          const childCount = childNodes.length;
          for (let i = childCount - 1; i >= 0; --i) {
            const childClone = cloneNode(childNodes[i], true);
            childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
            parentNode.insertBefore(childClone, getNextSibling(currentNode));
          }
        }
      }
      _forceRemove(currentNode);
      return true;
    }
    /* Check whether element has a valid namespace */
    if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Make sure that older browsers don't get fallback-tag mXSS */
    if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Sanitize element content to be template-safe */
    if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
      /* Get the element's text content */
      content = currentNode.textContent;
      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
        content = stringReplace(content, expr, ' ');
      });
      if (currentNode.textContent !== content) {
        arrayPush(DOMPurify.removed, {
          element: currentNode.cloneNode()
        });
        currentNode.textContent = content;
      }
    }
    /* Execute a hook if present */
    _executeHooks(hooks.afterSanitizeElements, currentNode, null);
    return false;
  };
  /**
   * _isValidAttribute
   *
   * @param lcTag Lowercase tag name of containing element.
   * @param lcName Lowercase attribute name.
   * @param value Attribute value.
   * @return Returns true if `value` is valid, otherwise false.
   */
  // eslint-disable-next-line complexity
  const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
    /* Make sure attribute cannot clobber */
    if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
      return false;
    }
    /* Allow valid data-* attributes: At least one character after "-"
        (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
        XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
        We don't need to check the value; it's always URI safe. */
    if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
      if (
      // First condition does a very basic check if a) it's basically a valid custom element tagname AND
      // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
      // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
      _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
      // Alternative, second condition checks if it's an `is`-attribute, AND
      // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
      lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
        return false;
      }
      /* Check value is safe. First, is attr inert? If so, is safe */
    } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
      return false;
    } else ;
    return true;
  };
  /**
   * _isBasicCustomElement
   * checks if at least one dash is included in tagName, and it's not the first char
   * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
   *
   * @param tagName name of the tag of the node to sanitize
   * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
   */
  const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
    return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
  };
  /**
   * _sanitizeAttributes
   *
   * @protect attributes
   * @protect nodeName
   * @protect removeAttribute
   * @protect setAttribute
   *
   * @param currentNode to sanitize
   */
  const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
    /* Execute a hook if present */
    _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
    const {
      attributes
    } = currentNode;
    /* Check if we have attributes; if not we might have a text node */
    if (!attributes || _isClobbered(currentNode)) {
      return;
    }
    const hookEvent = {
      attrName: '',
      attrValue: '',
      keepAttr: true,
      allowedAttributes: ALLOWED_ATTR,
      forceKeepAttr: undefined
    };
    let l = attributes.length;
    /* Go backwards over all attributes; safely remove bad ones */
    while (l--) {
      const attr = attributes[l];
      const {
        name,
        namespaceURI,
        value: attrValue
      } = attr;
      const lcName = transformCaseFunc(name);
      const initValue = attrValue;
      let value = name === 'value' ? initValue : stringTrim(initValue);
      /* Execute a hook if present */
      hookEvent.attrName = lcName;
      hookEvent.attrValue = value;
      hookEvent.keepAttr = true;
      hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
      _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
      value = hookEvent.attrValue;
      /* Full DOM Clobbering protection via namespace isolation,
       * Prefix id and name attributes with `user-content-`
       */
      if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
        // Remove the attribute with this value
        _removeAttribute(name, currentNode);
        // Prefix the value and later re-create the attribute with the sanitized value
        value = SANITIZE_NAMED_PROPS_PREFIX + value;
      }
      /* Work around a security issue with comments inside attributes */
      if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Did the hooks approve of the attribute? */
      if (hookEvent.forceKeepAttr) {
        continue;
      }
      /* Did the hooks approve of the attribute? */
      if (!hookEvent.keepAttr) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Work around a security issue in jQuery 3.0 */
      if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Sanitize attribute content to be template-safe */
      if (SAFE_FOR_TEMPLATES) {
        arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
          value = stringReplace(value, expr, ' ');
        });
      }
      /* Is `value` valid for this attribute? */
      const lcTag = transformCaseFunc(currentNode.nodeName);
      if (!_isValidAttribute(lcTag, lcName, value)) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Handle attributes that require Trusted Types */
      if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
        if (namespaceURI) ; else {
          switch (trustedTypes.getAttributeType(lcTag, lcName)) {
            case 'TrustedHTML':
              {
                value = trustedTypesPolicy.createHTML(value);
                break;
              }
            case 'TrustedScriptURL':
              {
                value = trustedTypesPolicy.createScriptURL(value);
                break;
              }
          }
        }
      }
      /* Handle invalid data-* attribute set by try-catching it */
      if (value !== initValue) {
        try {
          if (namespaceURI) {
            currentNode.setAttributeNS(namespaceURI, name, value);
          } else {
            /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
            currentNode.setAttribute(name, value);
          }
          if (_isClobbered(currentNode)) {
            _forceRemove(currentNode);
          } else {
            arrayPop(DOMPurify.removed);
          }
        } catch (_) {
          _removeAttribute(name, currentNode);
        }
      }
    }
    /* Execute a hook if present */
    _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
  };
  /**
   * _sanitizeShadowDOM
   *
   * @param fragment to iterate over recursively
   */
  const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
    let shadowNode = null;
    const shadowIterator = _createNodeIterator(fragment);
    /* Execute a hook if present */
    _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
    while (shadowNode = shadowIterator.nextNode()) {
      /* Execute a hook if present */
      _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
      /* Sanitize tags and elements */
      _sanitizeElements(shadowNode);
      /* Check attributes next */
      _sanitizeAttributes(shadowNode);
      /* Deep shadow DOM detected */
      if (shadowNode.content instanceof DocumentFragment) {
        _sanitizeShadowDOM(shadowNode.content);
      }
    }
    /* Execute a hook if present */
    _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
  };
  // eslint-disable-next-line complexity
  DOMPurify.sanitize = function (dirty) {
    let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    let body = null;
    let importedNode = null;
    let currentNode = null;
    let returnNode = null;
    /* Make sure we have a string to sanitize.
      DO NOT return early, as this will return the wrong type if
      the user has requested a DOM object rather than a string */
    IS_EMPTY_INPUT = !dirty;
    if (IS_EMPTY_INPUT) {
      dirty = '<!-->';
    }
    /* Stringify, in case dirty is an object */
    if (typeof dirty !== 'string' && !_isNode(dirty)) {
      if (typeof dirty.toString === 'function') {
        dirty = dirty.toString();
        if (typeof dirty !== 'string') {
          throw typeErrorCreate('dirty is not a string, aborting');
        }
      } else {
        throw typeErrorCreate('toString is not a function');
      }
    }
    /* Return dirty HTML if DOMPurify cannot run */
    if (!DOMPurify.isSupported) {
      return dirty;
    }
    /* Assign config vars */
    if (!SET_CONFIG) {
      _parseConfig(cfg);
    }
    /* Clean up removed elements */
    DOMPurify.removed = [];
    /* Check if dirty is correctly typed for IN_PLACE */
    if (typeof dirty === 'string') {
      IN_PLACE = false;
    }
    if (IN_PLACE) {
      /* Do some early pre-sanitization to avoid unsafe root nodes */
      if (dirty.nodeName) {
        const tagName = transformCaseFunc(dirty.nodeName);
        if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
          throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
        }
      }
    } else if (dirty instanceof Node) {
      /* If dirty is a DOM element, append to an empty document to avoid
         elements being stripped by the parser */
      body = _initDocument('<!---->');
      importedNode = body.ownerDocument.importNode(dirty, true);
      if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
        /* Node is already a body, use as is */
        body = importedNode;
      } else if (importedNode.nodeName === 'HTML') {
        body = importedNode;
      } else {
        // eslint-disable-next-line unicorn/prefer-dom-node-append
        body.appendChild(importedNode);
      }
    } else {
      /* Exit directly if we have nothing to do */
      if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
      // eslint-disable-next-line unicorn/prefer-includes
      dirty.indexOf('<') === -1) {
        return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
      }
      /* Initialize the document to work on */
      body = _initDocument(dirty);
      /* Check we have a DOM node from the data */
      if (!body) {
        return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
      }
    }
    /* Remove first element node (ours) if FORCE_BODY is set */
    if (body && FORCE_BODY) {
      _forceRemove(body.firstChild);
    }
    /* Get node iterator */
    const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
    /* Now start iterating over the created document */
    while (currentNode = nodeIterator.nextNode()) {
      /* Sanitize tags and elements */
      _sanitizeElements(currentNode);
      /* Check attributes next */
      _sanitizeAttributes(currentNode);
      /* Shadow DOM detected, sanitize it */
      if (currentNode.content instanceof DocumentFragment) {
        _sanitizeShadowDOM(currentNode.content);
      }
    }
    /* If we sanitized `dirty` in-place, return it. */
    if (IN_PLACE) {
      return dirty;
    }
    /* Return sanitized string or DOM */
    if (RETURN_DOM) {
      if (RETURN_DOM_FRAGMENT) {
        returnNode = createDocumentFragment.call(body.ownerDocument);
        while (body.firstChild) {
          // eslint-disable-next-line unicorn/prefer-dom-node-append
          returnNode.appendChild(body.firstChild);
        }
      } else {
        returnNode = body;
      }
      if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
        /*
          AdoptNode() is not used because internal state is not reset
          (e.g. the past names map of a HTMLFormElement), this is safe
          in theory but we would rather not risk another attack vector.
          The state that is cloned by importNode() is explicitly defined
          by the specs.
        */
        returnNode = importNode.call(originalDocument, returnNode, true);
      }
      return returnNode;
    }
    let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
    /* Serialize doctype if allowed */
    if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
      serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
    }
    /* Sanitize final string template-safe */
    if (SAFE_FOR_TEMPLATES) {
      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
        serializedHTML = stringReplace(serializedHTML, expr, ' ');
      });
    }
    return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
  };
  DOMPurify.setConfig = function () {
    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    _parseConfig(cfg);
    SET_CONFIG = true;
  };
  DOMPurify.clearConfig = function () {
    CONFIG = null;
    SET_CONFIG = false;
  };
  DOMPurify.isValidAttribute = function (tag, attr, value) {
    /* Initialize shared config vars if necessary. */
    if (!CONFIG) {
      _parseConfig({});
    }
    const lcTag = transformCaseFunc(tag);
    const lcName = transformCaseFunc(attr);
    return _isValidAttribute(lcTag, lcName, value);
  };
  DOMPurify.addHook = function (entryPoint, hookFunction) {
    if (typeof hookFunction !== 'function') {
      return;
    }
    arrayPush(hooks[entryPoint], hookFunction);
  };
  DOMPurify.removeHook = function (entryPoint, hookFunction) {
    if (hookFunction !== undefined) {
      const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
      return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
    }
    return arrayPop(hooks[entryPoint]);
  };
  DOMPurify.removeHooks = function (entryPoint) {
    hooks[entryPoint] = [];
  };
  DOMPurify.removeAllHooks = function () {
    hooks = _createHooksMap();
  };
  return DOMPurify;
}
var purify = createDOMPurify();


//# sourceMappingURL=purify.es.mjs.map


/***/ }),

/***/ "./node_modules/favico.js-slevomat/favico.js":
/*!***************************************************!*\
  !*** ./node_modules/favico.js-slevomat/favico.js ***!
  \***************************************************/
/***/ ((module, exports) => {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
 * @license MIT or GPL-2.0
 * @fileOverview Favico animations
 * @author Miroslav Magda, http://blog.ejci.net
 * @source: https://github.com/ejci/favico.js
 * @version 0.3.10
 */

/**
 * Create new favico instance
 * @param {Object} Options
 * @return {Object} Favico object
 * @example
 * var favico = new Favico({
 *    bgColor : '#d00',
 *    textColor : '#fff',
 *    fontFamily : 'sans-serif',
 *    fontStyle : 'bold',
 *    type : 'circle',
 *    position : 'down',
 *    animation : 'slide',
 *    elementId: false,
 *    element: null,
 *    dataUrl: function(url){},
 *    win: window
 * });
 */
(function () {

	var Favico = (function (opt) {
		'use strict';
		opt = (opt) ? opt : {};
		var _def = {
			bgColor: '#d00',
			textColor: '#fff',
			fontFamily: 'sans-serif', //Arial,Verdana,Times New Roman,serif,sans-serif,...
			fontStyle: 'bold', //normal,italic,oblique,bold,bolder,lighter,100,200,300,400,500,600,700,800,900
			type: 'circle',
			position: 'down', // down, up, left, leftup (upleft)
			animation: 'slide',
			elementId: false,
			element: null,
			dataUrl: false,
			win: window
		};
		var _opt, _orig, _h, _w, _canvas, _context, _img, _ready, _lastBadge, _running, _readyCb, _stop, _browser, _animTimeout, _drawTimeout, _doc;

		_browser = {};
		_browser.ff = typeof InstallTrigger != 'undefined';
		_browser.chrome = !!window.chrome;
		_browser.opera = !!window.opera || navigator.userAgent.indexOf('Opera') >= 0;
		_browser.ie = /*@cc_on!@*/false;
		_browser.safari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
		_browser.supported = (_browser.chrome || _browser.ff || _browser.opera);

		var _queue = [];
		_readyCb = function () {
		};
		_ready = _stop = false;
		/**
		 * Initialize favico
		 */
		var init = function () {
			//merge initial options
			_opt = merge(_def, opt);
			_opt.bgColor = hexToRgb(_opt.bgColor);
			_opt.textColor = hexToRgb(_opt.textColor);
			_opt.position = _opt.position.toLowerCase();
			_opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.animation;

			_doc = _opt.win.document;

			var isUp = _opt.position.indexOf('up') > -1;
			var isLeft = _opt.position.indexOf('left') > -1;

			//transform the animations
			if (isUp || isLeft) {
				for (var a in animation.types) {
					for (var i = 0; i < animation.types[a].length; i++) {
						var step = animation.types[a][i];

						if (isUp) {
							if (step.y < 0.6) {
								step.y = step.y - 0.4;
							} else {
								step.y = step.y - 2 * step.y + (1 - step.w);
							}
						}

						if (isLeft) {
							if (step.x < 0.6) {
								step.x = step.x - 0.4;
							} else {
								step.x = step.x - 2 * step.x + (1 - step.h);
							}
						}

						animation.types[a][i] = step;
					}
				}
			}
			_opt.type = (type['' + _opt.type]) ? _opt.type : _def.type;

			_orig = link. getIcons();
			//create temp canvas
			_canvas = document.createElement('canvas');
			//create temp image
			_img = document.createElement('img');
			var lastIcon = _orig[_orig.length - 1];
			if (lastIcon.hasAttribute('href')) {
				_img.setAttribute('crossOrigin', 'anonymous');
				//get width/height
				_img.onload = function () {
					_h = (_img.height > 0) ? _img.height : 32;
					_w = (_img.width > 0) ? _img.width : 32;
					_canvas.height = _h;
					_canvas.width = _w;
					_context = _canvas.getContext('2d');
					icon.ready();
				};
				_img.setAttribute('src', lastIcon.getAttribute('href'));
			} else {
				_h = 32;
				_w = 32;
				_img.height = _h;
				_img.width = _w;
				_canvas.height = _h;
				_canvas.width = _w;
				_context = _canvas.getContext('2d');
				icon.ready();
			}

		};
		/**
		 * Icon namespace
		 */
		var icon = {};
		/**
		 * Icon is ready (reset icon) and start animation (if ther is any)
		 */
		icon.ready = function () {
			_ready = true;
			icon.reset();
			_readyCb();
		};
		/**
		 * Reset icon to default state
		 */
		icon.reset = function () {
			//reset
			if (!_ready) {
				return;
			}
			_queue = [];
			_lastBadge = false;
			_running = false;
			_context.clearRect(0, 0, _w, _h);
			_context.drawImage(_img, 0, 0, _w, _h);
			//_stop=true;
			link.setIcon(_canvas);
			//webcam('stop');
			//video('stop');
			window.clearTimeout(_animTimeout);
			window.clearTimeout(_drawTimeout);
		};
		/**
		 * Start animation
		 */
		icon.start = function () {
			if (!_ready || _running) {
				return;
			}
			var finished = function () {
				_lastBadge = _queue[0];
				_running = false;
				if (_queue.length > 0) {
					_queue.shift();
					icon.start();
				} else {

				}
			};
			if (_queue.length > 0) {
				_running = true;
				var run = function () {
					// apply options for this animation
					['type', 'animation', 'bgColor', 'textColor', 'fontFamily', 'fontStyle'].forEach(function (a) {
						if (a in _queue[0].options) {
							_opt[a] = _queue[0].options[a];
						}
					});
					animation.run(_queue[0].options, function () {
						finished();
					}, false);
				};
				if (_lastBadge) {
					animation.run(_lastBadge.options, function () {
						run();
					}, true);
				} else {
					run();
				}
			}
		};

		/**
		 * Badge types
		 */
		var type = {};
		var options = function (opt) {
			opt.n = ((typeof opt.n) === 'number') ? Math.abs(opt.n | 0) : opt.n;
			opt.x = _w * opt.x;
			opt.y = _h * opt.y;
			opt.w = _w * opt.w;
			opt.h = _h * opt.h;
			opt.len = ("" + opt.n).length;
			return opt;
		};
		/**
		 * Generate circle
		 * @param {Object} opt Badge options
		 */
		type.circle = function (opt) {
			opt = options(opt);
			var more = false;
			if (opt.len === 2) {
				opt.x = opt.x - opt.w * 0.4;
				opt.w = opt.w * 1.4;
				more = true;
			} else if (opt.len >= 3) {
				opt.x = opt.x - opt.w * 0.65;
				opt.w = opt.w * 1.65;
				more = true;
			}
			_context.clearRect(0, 0, _w, _h);
			_context.drawImage(_img, 0, 0, _w, _h);
			_context.beginPath();
			_context.font = _opt.fontStyle + " " + Math.floor(opt.h * (opt.n > 99 ? 0.85 : 1)) + "px " + _opt.fontFamily;
			_context.textAlign = 'center';
			if (more) {
				_context.moveTo(opt.x + opt.w / 2, opt.y);
				_context.lineTo(opt.x + opt.w - opt.h / 2, opt.y);
				_context.quadraticCurveTo(opt.x + opt.w, opt.y, opt.x + opt.w, opt.y + opt.h / 2);
				_context.lineTo(opt.x + opt.w, opt.y + opt.h - opt.h / 2);
				_context.quadraticCurveTo(opt.x + opt.w, opt.y + opt.h, opt.x + opt.w - opt.h / 2, opt.y + opt.h);
				_context.lineTo(opt.x + opt.h / 2, opt.y + opt.h);
				_context.quadraticCurveTo(opt.x, opt.y + opt.h, opt.x, opt.y + opt.h - opt.h / 2);
				_context.lineTo(opt.x, opt.y + opt.h / 2);
				_context.quadraticCurveTo(opt.x, opt.y, opt.x + opt.h / 2, opt.y);
			} else {
				_context.arc(opt.x + opt.w / 2, opt.y + opt.h / 2, opt.h / 2, 0, 2 * Math.PI);
			}
			_context.fillStyle = 'rgba(' + _opt.bgColor.r + ',' + _opt.bgColor.g + ',' + _opt.bgColor.b + ',' + opt.o + ')';
			_context.fill();
			_context.closePath();
			_context.beginPath();
			_context.stroke();
			_context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')';
			//_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
			if ((typeof opt.n) === 'number' && opt.n > 999) {
				_context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000)) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2));
			} else {
				_context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
			}
			_context.closePath();
		};
		/**
		 * Generate rectangle
		 * @param {Object} opt Badge options
		 */
		type.rectangle = function (opt) {
			opt = options(opt);
			var more = false;
			if (opt.len === 2) {
				opt.x = opt.x - opt.w * 0.4;
				opt.w = opt.w * 1.4;
				more = true;
			} else if (opt.len >= 3) {
				opt.x = opt.x - opt.w * 0.65;
				opt.w = opt.w * 1.65;
				more = true;
			}
			_context.clearRect(0, 0, _w, _h);
			_context.drawImage(_img, 0, 0, _w, _h);
			_context.beginPath();
			_context.font = _opt.fontStyle + " " + Math.floor(opt.h * (opt.n > 99 ? 0.9 : 1)) + "px " + _opt.fontFamily;
			_context.textAlign = 'center';
			_context.fillStyle = 'rgba(' + _opt.bgColor.r + ',' + _opt.bgColor.g + ',' + _opt.bgColor.b + ',' + opt.o + ')';
			_context.fillRect(opt.x, opt.y, opt.w, opt.h);
			_context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')';
			//_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
			if ((typeof opt.n) === 'number' && opt.n > 999) {
				_context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000)) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2));
			} else {
				_context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
			}
			_context.closePath();
		};

		/**
		 * Set badge
		 */
		var badge = function (number, opts) {
			opts = ((typeof opts) === 'string' ? {
				animation: opts
			} : opts) || {};
			_readyCb = function () {
				try {
					if (typeof (number) === 'number' ? (number > 0) : (number !== '')) {
						var q = {
							type: 'badge',
							options: {
								n: number
							}
						};
						if ('animation' in opts && animation.types['' + opts.animation]) {
							q.options.animation = '' + opts.animation;
						}
						if ('type' in opts && type['' + opts.type]) {
							q.options.type = '' + opts.type;
						}
						['bgColor', 'textColor'].forEach(function (o) {
							if (o in opts) {
								q.options[o] = hexToRgb(opts[o]);
							}
						});
						['fontStyle', 'fontFamily'].forEach(function (o) {
							if (o in opts) {
								q.options[o] = opts[o];
							}
						});
						_queue.push(q);
						if (_queue.length > 100) {
							throw new Error('Too many badges requests in queue.');
						}
						icon.start();
					} else {
						icon.reset();
					}
				} catch (e) {
					throw new Error('Error setting badge. Message: ' + e.message);
				}
			};
			if (_ready) {
				_readyCb();
			}
		};

		var setOpt = function (key, value) {
			var opts = key;
			if (!(value == null && Object.prototype.toString.call(key) == '[object Object]')) {
				opts = {};
				opts[key] = value;
			}

			var keys = Object.keys(opts);
			for (var i = 0; i < keys.length; i++) {
				if (keys[i] == 'bgColor' || keys[i] == 'textColor') {
					_opt[keys[i]] = hexToRgb(opts[keys[i]]);
				} else {
					_opt[keys[i]] = opts[keys[i]];
				}
			}

			_queue.push(_lastBadge);
			icon.start();
		};

		var link = {};
		/**
		 * Get icons from HEAD tag or create a new <link> element
		 */
		link.getIcons = function () {
			var elms = [];
			//get link element
			var getLinks = function () {
				var icons = [];
				var links = _doc.getElementsByTagName('head')[0].getElementsByTagName('link');
				for (var i = 0; i < links.length; i++) {
					if ((/(^|\s)icon(\s|$)/i).test(links[i].getAttribute('rel'))) {
						icons.push(links[i]);
					}
				}
				return icons;
			};
			if (_opt.element) {
				elms = [_opt.element];
			} else if (_opt.elementId) {
				//if img element identified by elementId
				elms = [_doc.getElementById(_opt.elementId)];
				elms[0].setAttribute('href', elms[0].getAttribute('src'));
			} else {
				//if link element
				elms = getLinks();
				if (elms.length === 0) {
					elms = [_doc.createElement('link')];
					elms[0].setAttribute('rel', 'icon');
					_doc.getElementsByTagName('head')[0].appendChild(elms[0]);
				}
			}
			elms.forEach(function(item) {
				item.setAttribute('type', 'image/png');
			});
			return elms;
		};
		link.setIcon = function (canvas) {
			var url = canvas.toDataURL('image/png');
			link.setIconSrc(url);
		};
		link.setIconSrc = function (url) {
			if (_opt.dataUrl) {
				//if using custom exporter
				_opt.dataUrl(url);
			}
			if (_opt.element) {
				_opt.element.setAttribute('href', url);
				_opt.element.setAttribute('src', url);
			} else if (_opt.elementId) {
				//if is attached to element (image)
				var elm = _doc.getElementById(_opt.elementId);
				elm.setAttribute('href', url);
				elm.setAttribute('src', url);
			} else {
				//if is attached to fav icon
				if (_browser.ff || _browser.opera) {
					//for FF we need to "recreate" element, atach to dom and remove old <link>
					//var originalType = _orig.getAttribute('rel');
					var old = _orig[_orig.length - 1];
					var newIcon = _doc.createElement('link');
					_orig = [newIcon];
					//_orig.setAttribute('rel', originalType);
					if (_browser.opera) {
						newIcon.setAttribute('rel', 'icon');
					}
					newIcon.setAttribute('rel', 'icon');
					newIcon.setAttribute('type', 'image/png');
					_doc.getElementsByTagName('head')[0].appendChild(newIcon);
					newIcon.setAttribute('href', url);
					if (old.parentNode) {
						old.parentNode.removeChild(old);
					}
				} else {
					_orig.forEach(function(icon) {
						icon.setAttribute('href', url);
					});
				}
			}
		};

		//http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb#answer-5624139
		//HEX to RGB convertor
		function hexToRgb(hex) {
			var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
			hex = hex.replace(shorthandRegex, function (m, r, g, b) {
				return r + r + g + g + b + b;
			});
			var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
			return result ? {
				r: parseInt(result[1], 16),
				g: parseInt(result[2], 16),
				b: parseInt(result[3], 16)
			} : false;
		}

		/**
		 * Merge options
		 */
		function merge(def, opt) {
			var mergedOpt = {};
			var attrname;
			for (attrname in def) {
				mergedOpt[attrname] = def[attrname];
			}
			for (attrname in opt) {
				mergedOpt[attrname] = opt[attrname];
			}
			return mergedOpt;
		}

		/**
		 * Cross-browser page visibility shim
		 * http://stackoverflow.com/questions/12536562/detect-whether-a-window-is-visible
		 */
		function isPageHidden() {
			return _doc.hidden || _doc.msHidden || _doc.webkitHidden || _doc.mozHidden;
		}

		/**
		 * @namespace animation
		 */
		var animation = {};
		/**
		 * Animation "frame" duration
		 */
		animation.duration = 40;
		/**
		 * Animation types (none,fade,pop,slide)
		 */
		animation.types = {};
		animation.types.fade = [{
			x: 0.4,
			y: 0.4,
			w: 0.6,
			h: 0.6,
			o: 0.0
		}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.1
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.2
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.3
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.4
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.5
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.6
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.7
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.8
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 0.9
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 1.0
			}];
		animation.types.none = [{
			x: 0.4,
			y: 0.4,
			w: 0.6,
			h: 0.6,
			o: 1
		}];
		animation.types.pop = [{
			x: 1,
			y: 1,
			w: 0,
			h: 0,
			o: 1
		}, {
				x: 0.9,
				y: 0.9,
				w: 0.1,
				h: 0.1,
				o: 1
			}, {
				x: 0.8,
				y: 0.8,
				w: 0.2,
				h: 0.2,
				o: 1
			}, {
				x: 0.7,
				y: 0.7,
				w: 0.3,
				h: 0.3,
				o: 1
			}, {
				x: 0.6,
				y: 0.6,
				w: 0.4,
				h: 0.4,
				o: 1
			}, {
				x: 0.5,
				y: 0.5,
				w: 0.5,
				h: 0.5,
				o: 1
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 1
			}];
		animation.types.popFade = [{
			x: 0.75,
			y: 0.75,
			w: 0,
			h: 0,
			o: 0
		}, {
				x: 0.65,
				y: 0.65,
				w: 0.1,
				h: 0.1,
				o: 0.2
			}, {
				x: 0.6,
				y: 0.6,
				w: 0.2,
				h: 0.2,
				o: 0.4
			}, {
				x: 0.55,
				y: 0.55,
				w: 0.3,
				h: 0.3,
				o: 0.6
			}, {
				x: 0.50,
				y: 0.50,
				w: 0.4,
				h: 0.4,
				o: 0.8
			}, {
				x: 0.45,
				y: 0.45,
				w: 0.5,
				h: 0.5,
				o: 0.9
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 1
			}];
		animation.types.slide = [{
			x: 0.4,
			y: 1,
			w: 0.6,
			h: 0.6,
			o: 1
		}, {
				x: 0.4,
				y: 0.9,
				w: 0.6,
				h: 0.6,
				o: 1
			}, {
				x: 0.4,
				y: 0.9,
				w: 0.6,
				h: 0.6,
				o: 1
			}, {
				x: 0.4,
				y: 0.8,
				w: 0.6,
				h: 0.6,
				o: 1
			}, {
				x: 0.4,
				y: 0.7,
				w: 0.6,
				h: 0.6,
				o: 1
			}, {
				x: 0.4,
				y: 0.6,
				w: 0.6,
				h: 0.6,
				o: 1
			}, {
				x: 0.4,
				y: 0.5,
				w: 0.6,
				h: 0.6,
				o: 1
			}, {
				x: 0.4,
				y: 0.4,
				w: 0.6,
				h: 0.6,
				o: 1
			}];
		/**
		 * Run animation
		 * @param {Object} opt Animation options
		 * @param {Object} cb Callabak after all steps are done
		 * @param {Object} revert Reverse order? true|false
		 * @param {Object} step Optional step number (frame bumber)
		 */
		animation.run = function (opt, cb, revert, step) {
			var animationType = animation.types[isPageHidden() ? 'none' : _opt.animation];
			if (revert === true) {
				step = (typeof step !== 'undefined') ? step : animationType.length - 1;
			} else {
				step = (typeof step !== 'undefined') ? step : 0;
			}
			cb = (cb) ? cb : function () {
			};
			if ((step < animationType.length) && (step >= 0)) {
				type[_opt.type](merge(opt, animationType[step]));
				_animTimeout = setTimeout(function () {
					if (revert) {
						step = step - 1;
					} else {
						step = step + 1;
					}
					animation.run(opt, cb, revert, step);
				}, animation.duration);

				link.setIcon(_canvas);
			} else {
				cb();
				return;
			}
		};
		//auto init
		init();
		return {
			badge: badge,
			setOpt: setOpt,
			reset: icon.reset,
			browser: {
				supported: _browser.supported
			}
		};
	});

	// AMD / RequireJS
	if (true) {
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return Favico;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	}
	// CommonJS
	else // removed by dead control flow
{}

})();


/***/ }),

/***/ "./node_modules/filesize/dist/filesize.esm.js":
/*!****************************************************!*\
  !*** ./node_modules/filesize/dist/filesize.esm.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   filesize: () => (/* binding */ filesize),
/* harmony export */   partial: () => (/* binding */ partial)
/* harmony export */ });
/**
 * filesize
 *
 * @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
 * @license BSD-3-Clause
 * @version 10.1.6
 */
const ARRAY = "array";
const BIT = "bit";
const BITS = "bits";
const BYTE = "byte";
const BYTES = "bytes";
const EMPTY = "";
const EXPONENT = "exponent";
const FUNCTION = "function";
const IEC = "iec";
const INVALID_NUMBER = "Invalid number";
const INVALID_ROUND = "Invalid rounding method";
const JEDEC = "jedec";
const OBJECT = "object";
const PERIOD = ".";
const ROUND = "round";
const S = "s";
const SI = "si";
const SI_KBIT = "kbit";
const SI_KBYTE = "kB";
const SPACE = " ";
const STRING = "string";
const ZERO = "0";
const STRINGS = {
	symbol: {
		iec: {
			bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
			bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
		},
		jedec: {
			bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"],
			bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
		}
	},
	fullform: {
		iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
		jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
	}
};function filesize (arg, {
	bits = false,
	pad = false,
	base = -1,
	round = 2,
	locale = EMPTY,
	localeOptions = {},
	separator = EMPTY,
	spacer = SPACE,
	symbols = {},
	standard = EMPTY,
	output = STRING,
	fullform = false,
	fullforms = [],
	exponent = -1,
	roundingMethod = ROUND,
	precision = 0
} = {}) {
	let e = exponent,
		num = Number(arg),
		result = [],
		val = 0,
		u = EMPTY;

	// Sync base & standard
	if (standard === SI) {
		base = 10;
		standard = JEDEC;
	} else if (standard === IEC || standard === JEDEC) {
		base = 2;
	} else if (base === 2) {
		standard = IEC;
	} else {
		base = 10;
		standard = JEDEC;
	}

	const ceil = base === 10 ? 1000 : 1024,
		full = fullform === true,
		neg = num < 0,
		roundingFunc = Math[roundingMethod];

	if (typeof arg !== "bigint" && isNaN(arg)) {
		throw new TypeError(INVALID_NUMBER);
	}

	if (typeof roundingFunc !== FUNCTION) {
		throw new TypeError(INVALID_ROUND);
	}

	// Flipping a negative number to determine the size
	if (neg) {
		num = -num;
	}

	// Determining the exponent
	if (e === -1 || isNaN(e)) {
		e = Math.floor(Math.log(num) / Math.log(ceil));

		if (e < 0) {
			e = 0;
		}
	}

	// Exceeding supported length, time to reduce & multiply
	if (e > 8) {
		if (precision > 0) {
			precision += 8 - e;
		}

		e = 8;
	}

	if (output === EXPONENT) {
		return e;
	}

	// Zero is now a special case because bytes divide by 1
	if (num === 0) {
		result[0] = 0;
		u = result[1] = STRINGS.symbol[standard][bits ? BITS : BYTES][e];
	} else {
		val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e));

		if (bits) {
			val = val * 8;

			if (val >= ceil && e < 8) {
				val = val / ceil;
				e++;
			}
		}

		const p = Math.pow(10, e > 0 ? round : 0);
		result[0] = roundingFunc(val * p) / p;

		if (result[0] === ceil && e < 8 && exponent === -1) {
			result[0] = 1;
			e++;
		}

		u = result[1] = base === 10 && e === 1 ? bits ? SI_KBIT : SI_KBYTE : STRINGS.symbol[standard][bits ? BITS : BYTES][e];
	}

	// Decorating a 'diff'
	if (neg) {
		result[0] = -result[0];
	}

	// Setting optional precision
	if (precision > 0) {
		result[0] = result[0].toPrecision(precision);
	}

	// Applying custom symbol
	result[1] = symbols[result[1]] || result[1];

	if (locale === true) {
		result[0] = result[0].toLocaleString();
	} else if (locale.length > 0) {
		result[0] = result[0].toLocaleString(locale, localeOptions);
	} else if (separator.length > 0) {
		result[0] = result[0].toString().replace(PERIOD, separator);
	}

	if (pad && round > 0) {
		const i =  result[0].toString(),
			x = separator || ((i.match(/(\D)/g) || []).pop() || PERIOD),
			tmp = i.toString().split(x),
			s = tmp[1] || EMPTY,
			l = s.length,
			n = round - l;

		result[0] = `${tmp[0]}${x}${s.padEnd(l + n, ZERO)}`;
	}

	if (full) {
		result[1] = fullforms[e] ? fullforms[e] : STRINGS.fullform[standard][e] + (bits ? BIT : BYTE) + (result[0] === 1 ? EMPTY : S);
	}

	// Returning Array, Object, or String (default)
	return output === ARRAY ? result : output === OBJECT ? {
		value: result[0],
		symbol: result[1],
		exponent: e,
		unit: u
	} : result.join(spacer);
}

// Partial application for functional programming
function partial ({
	bits = false,
	pad = false,
	base = -1,
	round = 2,
	locale = EMPTY,
	localeOptions = {},
	separator = EMPTY,
	spacer = SPACE,
	symbols = {},
	standard = EMPTY,
	output = STRING,
	fullform = false,
	fullforms = [],
	exponent = -1,
	roundingMethod = ROUND,
	precision = 0
} = {}) {
	return arg => filesize(arg, {
		bits,
		pad,
		base,
		round,
		locale,
		localeOptions,
		separator,
		spacer,
		symbols,
		standard,
		output,
		fullform,
		fullforms,
		exponent,
		roundingMethod,
		precision
	});
}

/***/ }),

/***/ "./node_modules/gifuct-js/lib/deinterlace.js":
/*!***************************************************!*\
  !*** ./node_modules/gifuct-js/lib/deinterlace.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.deinterlace = void 0;

/**
 * Deinterlace function from https://github.com/shachaf/jsgif
 */
var deinterlace = function deinterlace(pixels, width) {
  var newPixels = new Array(pixels.length);
  var rows = pixels.length / width;

  var cpRow = function cpRow(toRow, fromRow) {
    var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
    newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
  }; // See appendix E.


  var offsets = [0, 4, 2, 1];
  var steps = [8, 8, 4, 2];
  var fromRow = 0;

  for (var pass = 0; pass < 4; pass++) {
    for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
      cpRow(toRow, fromRow);
      fromRow++;
    }
  }

  return newPixels;
};

exports.deinterlace = deinterlace;

/***/ }),

/***/ "./node_modules/gifuct-js/lib/index.js":
/*!*********************************************!*\
  !*** ./node_modules/gifuct-js/lib/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.decompressFrames = exports.decompressFrame = exports.parseGIF = void 0;

var _gif = _interopRequireDefault(__webpack_require__(/*! js-binary-schema-parser/lib/schemas/gif */ "./node_modules/js-binary-schema-parser/lib/schemas/gif.js"));

var _jsBinarySchemaParser = __webpack_require__(/*! js-binary-schema-parser */ "./node_modules/js-binary-schema-parser/lib/index.js");

var _uint = __webpack_require__(/*! js-binary-schema-parser/lib/parsers/uint8 */ "./node_modules/js-binary-schema-parser/lib/parsers/uint8.js");

var _deinterlace = __webpack_require__(/*! ./deinterlace */ "./node_modules/gifuct-js/lib/deinterlace.js");

var _lzw = __webpack_require__(/*! ./lzw */ "./node_modules/gifuct-js/lib/lzw.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var parseGIF = function parseGIF(arrayBuffer) {
  var byteData = new Uint8Array(arrayBuffer);
  return (0, _jsBinarySchemaParser.parse)((0, _uint.buildStream)(byteData), _gif["default"]);
};

exports.parseGIF = parseGIF;

var generatePatch = function generatePatch(image) {
  var totalPixels = image.pixels.length;
  var patchData = new Uint8ClampedArray(totalPixels * 4);

  for (var i = 0; i < totalPixels; i++) {
    var pos = i * 4;
    var colorIndex = image.pixels[i];
    var color = image.colorTable[colorIndex] || [0, 0, 0];
    patchData[pos] = color[0];
    patchData[pos + 1] = color[1];
    patchData[pos + 2] = color[2];
    patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
  }

  return patchData;
};

var decompressFrame = function decompressFrame(frame, gct, buildImagePatch) {
  if (!frame.image) {
    console.warn('gif frame does not have associated image.');
    return;
  }

  var image = frame.image; // get the number of pixels

  var totalPixels = image.descriptor.width * image.descriptor.height; // do lzw decompression

  var pixels = (0, _lzw.lzw)(image.data.minCodeSize, image.data.blocks, totalPixels); // deal with interlacing if necessary

  if (image.descriptor.lct.interlaced) {
    pixels = (0, _deinterlace.deinterlace)(pixels, image.descriptor.width);
  }

  var resultImage = {
    pixels: pixels,
    dims: {
      top: frame.image.descriptor.top,
      left: frame.image.descriptor.left,
      width: frame.image.descriptor.width,
      height: frame.image.descriptor.height
    }
  }; // color table

  if (image.descriptor.lct && image.descriptor.lct.exists) {
    resultImage.colorTable = image.lct;
  } else {
    resultImage.colorTable = gct;
  } // add per frame relevant gce information


  if (frame.gce) {
    resultImage.delay = (frame.gce.delay || 10) * 10; // convert to ms

    resultImage.disposalType = frame.gce.extras.disposal; // transparency

    if (frame.gce.extras.transparentColorGiven) {
      resultImage.transparentIndex = frame.gce.transparentColorIndex;
    }
  } // create canvas usable imagedata if desired


  if (buildImagePatch) {
    resultImage.patch = generatePatch(resultImage);
  }

  return resultImage;
};

exports.decompressFrame = decompressFrame;

var decompressFrames = function decompressFrames(parsedGif, buildImagePatches) {
  return parsedGif.frames.filter(function (f) {
    return f.image;
  }).map(function (f) {
    return decompressFrame(f, parsedGif.gct, buildImagePatches);
  });
};

exports.decompressFrames = decompressFrames;

/***/ }),

/***/ "./node_modules/gifuct-js/lib/lzw.js":
/*!*******************************************!*\
  !*** ./node_modules/gifuct-js/lib/lzw.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.lzw = void 0;

/**
 * javascript port of java LZW decompression
 * Original java author url: https://gist.github.com/devunwired/4479231
 */
var lzw = function lzw(minCodeSize, data, pixelCount) {
  var MAX_STACK_SIZE = 4096;
  var nullCode = -1;
  var npix = pixelCount;
  var available, clear, code_mask, code_size, end_of_information, in_code, old_code, bits, code, i, datum, data_size, first, top, bi, pi;
  var dstPixels = new Array(pixelCount);
  var prefix = new Array(MAX_STACK_SIZE);
  var suffix = new Array(MAX_STACK_SIZE);
  var pixelStack = new Array(MAX_STACK_SIZE + 1); // Initialize GIF data stream decoder.

  data_size = minCodeSize;
  clear = 1 << data_size;
  end_of_information = clear + 1;
  available = clear + 2;
  old_code = nullCode;
  code_size = data_size + 1;
  code_mask = (1 << code_size) - 1;

  for (code = 0; code < clear; code++) {
    prefix[code] = 0;
    suffix[code] = code;
  } // Decode GIF pixel stream.


  var datum, bits, count, first, top, pi, bi;
  datum = bits = count = first = top = pi = bi = 0;

  for (i = 0; i < npix;) {
    if (top === 0) {
      if (bits < code_size) {
        // get the next byte
        datum += data[bi] << bits;
        bits += 8;
        bi++;
        continue;
      } // Get the next code.


      code = datum & code_mask;
      datum >>= code_size;
      bits -= code_size; // Interpret the code

      if (code > available || code == end_of_information) {
        break;
      }

      if (code == clear) {
        // Reset decoder.
        code_size = data_size + 1;
        code_mask = (1 << code_size) - 1;
        available = clear + 2;
        old_code = nullCode;
        continue;
      }

      if (old_code == nullCode) {
        pixelStack[top++] = suffix[code];
        old_code = code;
        first = code;
        continue;
      }

      in_code = code;

      if (code == available) {
        pixelStack[top++] = first;
        code = old_code;
      }

      while (code > clear) {
        pixelStack[top++] = suffix[code];
        code = prefix[code];
      }

      first = suffix[code] & 0xff;
      pixelStack[top++] = first; // add a new string to the table, but only if space is available
      // if not, just continue with current table until a clear code is found
      // (deferred clear code implementation as per GIF spec)

      if (available < MAX_STACK_SIZE) {
        prefix[available] = old_code;
        suffix[available] = first;
        available++;

        if ((available & code_mask) === 0 && available < MAX_STACK_SIZE) {
          code_size++;
          code_mask += available;
        }
      }

      old_code = in_code;
    } // Pop a pixel off the pixel stack.


    top--;
    dstPixels[pi++] = pixelStack[top];
    i++;
  }

  for (i = pi; i < npix; i++) {
    dstPixels[i] = 0; // clear missing pixels
  }

  return dstPixels;
};

exports.lzw = lzw;

/***/ }),

/***/ "./node_modules/hsluv/dist/hsluv.mjs":
/*!*******************************************!*\
  !*** ./node_modules/hsluv/dist/hsluv.mjs ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Hsluv: () => (/* binding */ Hsluv)
/* harmony export */ });
class Hsluv {
    constructor() {
        // RGB
        this.hex = '#000000';
        this.rgb_r = 0;
        this.rgb_g = 0;
        this.rgb_b = 0;
        // CIE XYZ
        this.xyz_x = 0;
        this.xyz_y = 0;
        this.xyz_z = 0;
        // CIE LUV
        this.luv_l = 0;
        this.luv_u = 0;
        this.luv_v = 0;
        // CIE LUV LCh
        this.lch_l = 0;
        this.lch_c = 0;
        this.lch_h = 0;
        // HSLuv
        this.hsluv_h = 0;
        this.hsluv_s = 0;
        this.hsluv_l = 0;
        // HPLuv
        this.hpluv_h = 0;
        this.hpluv_p = 0;
        this.hpluv_l = 0;
        // 6 lines in slope-intercept format: R < 0, R > 1, G < 0, G > 1, B < 0, B > 1
        this.r0s = 0;
        this.r0i = 0;
        this.r1s = 0;
        this.r1i = 0;
        this.g0s = 0;
        this.g0i = 0;
        this.g1s = 0;
        this.g1i = 0;
        this.b0s = 0;
        this.b0i = 0;
        this.b1s = 0;
        this.b1i = 0;
    }
    static fromLinear(c) {
        if (c <= 0.0031308) {
            return 12.92 * c;
        }
        else {
            return 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
        }
    }
    static toLinear(c) {
        if (c > 0.04045) {
            return Math.pow((c + 0.055) / 1.055, 2.4);
        }
        else {
            return c / 12.92;
        }
    }
    static yToL(Y) {
        if (Y <= Hsluv.epsilon) {
            return Y / Hsluv.refY * Hsluv.kappa;
        }
        else {
            return 116 * Math.pow(Y / Hsluv.refY, 1 / 3) - 16;
        }
    }
    static lToY(L) {
        if (L <= 8) {
            return Hsluv.refY * L / Hsluv.kappa;
        }
        else {
            return Hsluv.refY * Math.pow((L + 16) / 116, 3);
        }
    }
    static rgbChannelToHex(chan) {
        const c = Math.round(chan * 255);
        const digit2 = c % 16;
        const digit1 = (c - digit2) / 16 | 0;
        return Hsluv.hexChars.charAt(digit1) + Hsluv.hexChars.charAt(digit2);
    }
    static hexToRgbChannel(hex, offset) {
        const digit1 = Hsluv.hexChars.indexOf(hex.charAt(offset));
        const digit2 = Hsluv.hexChars.indexOf(hex.charAt(offset + 1));
        const n = digit1 * 16 + digit2;
        return n / 255.0;
    }
    static distanceFromOriginAngle(slope, intercept, angle) {
        const d = intercept / (Math.sin(angle) - slope * Math.cos(angle));
        if (d < 0) {
            return Infinity;
        }
        else {
            return d;
        }
    }
    static distanceFromOrigin(slope, intercept) {
        return Math.abs(intercept) / Math.sqrt(Math.pow(slope, 2) + 1);
    }
    static min6(f1, f2, f3, f4, f5, f6) {
        return Math.min(f1, Math.min(f2, Math.min(f3, Math.min(f4, Math.min(f5, f6)))));
    }
    rgbToHex() {
        this.hex = "#";
        this.hex += Hsluv.rgbChannelToHex(this.rgb_r);
        this.hex += Hsluv.rgbChannelToHex(this.rgb_g);
        this.hex += Hsluv.rgbChannelToHex(this.rgb_b);
    }
    hexToRgb() {
        this.hex = this.hex.toLowerCase();
        this.rgb_r = Hsluv.hexToRgbChannel(this.hex, 1);
        this.rgb_g = Hsluv.hexToRgbChannel(this.hex, 3);
        this.rgb_b = Hsluv.hexToRgbChannel(this.hex, 5);
    }
    xyzToRgb() {
        this.rgb_r = Hsluv.fromLinear(Hsluv.m_r0 * this.xyz_x + Hsluv.m_r1 * this.xyz_y + Hsluv.m_r2 * this.xyz_z);
        this.rgb_g = Hsluv.fromLinear(Hsluv.m_g0 * this.xyz_x + Hsluv.m_g1 * this.xyz_y + Hsluv.m_g2 * this.xyz_z);
        this.rgb_b = Hsluv.fromLinear(Hsluv.m_b0 * this.xyz_x + Hsluv.m_b1 * this.xyz_y + Hsluv.m_b2 * this.xyz_z);
    }
    rgbToXyz() {
        const lr = Hsluv.toLinear(this.rgb_r);
        const lg = Hsluv.toLinear(this.rgb_g);
        const lb = Hsluv.toLinear(this.rgb_b);
        this.xyz_x = 0.41239079926595 * lr + 0.35758433938387 * lg + 0.18048078840183 * lb;
        this.xyz_y = 0.21263900587151 * lr + 0.71516867876775 * lg + 0.072192315360733 * lb;
        this.xyz_z = 0.019330818715591 * lr + 0.11919477979462 * lg + 0.95053215224966 * lb;
    }
    xyzToLuv() {
        const divider = this.xyz_x + 15 * this.xyz_y + 3 * this.xyz_z;
        let varU = 4 * this.xyz_x;
        let varV = 9 * this.xyz_y;
        if (divider !== 0) {
            varU /= divider;
            varV /= divider;
        }
        else {
            varU = NaN;
            varV = NaN;
        }
        this.luv_l = Hsluv.yToL(this.xyz_y);
        if (this.luv_l === 0) {
            this.luv_u = 0;
            this.luv_v = 0;
        }
        else {
            this.luv_u = 13 * this.luv_l * (varU - Hsluv.refU);
            this.luv_v = 13 * this.luv_l * (varV - Hsluv.refV);
        }
    }
    luvToXyz() {
        if (this.luv_l === 0) {
            this.xyz_x = 0;
            this.xyz_y = 0;
            this.xyz_z = 0;
            return;
        }
        const varU = this.luv_u / (13 * this.luv_l) + Hsluv.refU;
        const varV = this.luv_v / (13 * this.luv_l) + Hsluv.refV;
        this.xyz_y = Hsluv.lToY(this.luv_l);
        this.xyz_x = 0 - 9 * this.xyz_y * varU / ((varU - 4) * varV - varU * varV);
        this.xyz_z = (9 * this.xyz_y - 15 * varV * this.xyz_y - varV * this.xyz_x) / (3 * varV);
    }
    luvToLch() {
        this.lch_l = this.luv_l;
        this.lch_c = Math.sqrt(this.luv_u * this.luv_u + this.luv_v * this.luv_v);
        if (this.lch_c < 0.00000001) {
            this.lch_h = 0;
        }
        else {
            const hrad = Math.atan2(this.luv_v, this.luv_u);
            this.lch_h = hrad * 180.0 / Math.PI;
            if (this.lch_h < 0) {
                this.lch_h = 360 + this.lch_h;
            }
        }
    }
    lchToLuv() {
        const hrad = this.lch_h / 180.0 * Math.PI;
        this.luv_l = this.lch_l;
        this.luv_u = Math.cos(hrad) * this.lch_c;
        this.luv_v = Math.sin(hrad) * this.lch_c;
    }
    calculateBoundingLines(l) {
        const sub1 = Math.pow(l + 16, 3) / 1560896;
        const sub2 = sub1 > Hsluv.epsilon ? sub1 : l / Hsluv.kappa;
        const s1r = sub2 * (284517 * Hsluv.m_r0 - 94839 * Hsluv.m_r2);
        const s2r = sub2 * (838422 * Hsluv.m_r2 + 769860 * Hsluv.m_r1 + 731718 * Hsluv.m_r0);
        const s3r = sub2 * (632260 * Hsluv.m_r2 - 126452 * Hsluv.m_r1);
        const s1g = sub2 * (284517 * Hsluv.m_g0 - 94839 * Hsluv.m_g2);
        const s2g = sub2 * (838422 * Hsluv.m_g2 + 769860 * Hsluv.m_g1 + 731718 * Hsluv.m_g0);
        const s3g = sub2 * (632260 * Hsluv.m_g2 - 126452 * Hsluv.m_g1);
        const s1b = sub2 * (284517 * Hsluv.m_b0 - 94839 * Hsluv.m_b2);
        const s2b = sub2 * (838422 * Hsluv.m_b2 + 769860 * Hsluv.m_b1 + 731718 * Hsluv.m_b0);
        const s3b = sub2 * (632260 * Hsluv.m_b2 - 126452 * Hsluv.m_b1);
        this.r0s = s1r / s3r;
        this.r0i = s2r * l / s3r;
        this.r1s = s1r / (s3r + 126452);
        this.r1i = (s2r - 769860) * l / (s3r + 126452);
        this.g0s = s1g / s3g;
        this.g0i = s2g * l / s3g;
        this.g1s = s1g / (s3g + 126452);
        this.g1i = (s2g - 769860) * l / (s3g + 126452);
        this.b0s = s1b / s3b;
        this.b0i = s2b * l / s3b;
        this.b1s = s1b / (s3b + 126452);
        this.b1i = (s2b - 769860) * l / (s3b + 126452);
    }
    calcMaxChromaHpluv() {
        const r0 = Hsluv.distanceFromOrigin(this.r0s, this.r0i);
        const r1 = Hsluv.distanceFromOrigin(this.r1s, this.r1i);
        const g0 = Hsluv.distanceFromOrigin(this.g0s, this.g0i);
        const g1 = Hsluv.distanceFromOrigin(this.g1s, this.g1i);
        const b0 = Hsluv.distanceFromOrigin(this.b0s, this.b0i);
        const b1 = Hsluv.distanceFromOrigin(this.b1s, this.b1i);
        return Hsluv.min6(r0, r1, g0, g1, b0, b1);
    }
    calcMaxChromaHsluv(h) {
        const hueRad = h / 360 * Math.PI * 2;
        const r0 = Hsluv.distanceFromOriginAngle(this.r0s, this.r0i, hueRad);
        const r1 = Hsluv.distanceFromOriginAngle(this.r1s, this.r1i, hueRad);
        const g0 = Hsluv.distanceFromOriginAngle(this.g0s, this.g0i, hueRad);
        const g1 = Hsluv.distanceFromOriginAngle(this.g1s, this.g1i, hueRad);
        const b0 = Hsluv.distanceFromOriginAngle(this.b0s, this.b0i, hueRad);
        const b1 = Hsluv.distanceFromOriginAngle(this.b1s, this.b1i, hueRad);
        return Hsluv.min6(r0, r1, g0, g1, b0, b1);
    }
    hsluvToLch() {
        if (this.hsluv_l > 99.9999999) {
            this.lch_l = 100;
            this.lch_c = 0;
        }
        else if (this.hsluv_l < 0.00000001) {
            this.lch_l = 0;
            this.lch_c = 0;
        }
        else {
            this.lch_l = this.hsluv_l;
            this.calculateBoundingLines(this.hsluv_l);
            const max = this.calcMaxChromaHsluv(this.hsluv_h);
            this.lch_c = max / 100 * this.hsluv_s;
        }
        this.lch_h = this.hsluv_h;
    }
    lchToHsluv() {
        if (this.lch_l > 99.9999999) {
            this.hsluv_s = 0;
            this.hsluv_l = 100;
        }
        else if (this.lch_l < 0.00000001) {
            this.hsluv_s = 0;
            this.hsluv_l = 0;
        }
        else {
            this.calculateBoundingLines(this.lch_l);
            const max = this.calcMaxChromaHsluv(this.lch_h);
            this.hsluv_s = this.lch_c / max * 100;
            this.hsluv_l = this.lch_l;
        }
        this.hsluv_h = this.lch_h;
    }
    hpluvToLch() {
        if (this.hpluv_l > 99.9999999) {
            this.lch_l = 100;
            this.lch_c = 0;
        }
        else if (this.hpluv_l < 0.00000001) {
            this.lch_l = 0;
            this.lch_c = 0;
        }
        else {
            this.lch_l = this.hpluv_l;
            this.calculateBoundingLines(this.hpluv_l);
            const max = this.calcMaxChromaHpluv();
            this.lch_c = max / 100 * this.hpluv_p;
        }
        this.lch_h = this.hpluv_h;
    }
    lchToHpluv() {
        if (this.lch_l > 99.9999999) {
            this.hpluv_p = 0;
            this.hpluv_l = 100;
        }
        else if (this.lch_l < 0.00000001) {
            this.hpluv_p = 0;
            this.hpluv_l = 0;
        }
        else {
            this.calculateBoundingLines(this.lch_l);
            const max = this.calcMaxChromaHpluv();
            this.hpluv_p = this.lch_c / max * 100;
            this.hpluv_l = this.lch_l;
        }
        this.hpluv_h = this.lch_h;
    }
    hsluvToRgb() {
        this.hsluvToLch();
        this.lchToLuv();
        this.luvToXyz();
        this.xyzToRgb();
    }
    hpluvToRgb() {
        this.hpluvToLch();
        this.lchToLuv();
        this.luvToXyz();
        this.xyzToRgb();
    }
    hsluvToHex() {
        this.hsluvToRgb();
        this.rgbToHex();
    }
    hpluvToHex() {
        this.hpluvToRgb();
        this.rgbToHex();
    }
    rgbToHsluv() {
        this.rgbToXyz();
        this.xyzToLuv();
        this.luvToLch();
        this.lchToHpluv();
        this.lchToHsluv();
    }
    rgbToHpluv() {
        this.rgbToXyz();
        this.xyzToLuv();
        this.luvToLch();
        this.lchToHpluv();
        this.lchToHpluv();
    }
    hexToHsluv() {
        this.hexToRgb();
        this.rgbToHsluv();
    }
    hexToHpluv() {
        this.hexToRgb();
        this.rgbToHpluv();
    }
}
Hsluv.hexChars = "0123456789abcdef";
Hsluv.refY = 1.0;
Hsluv.refU = 0.19783000664283;
Hsluv.refV = 0.46831999493879;
Hsluv.kappa = 903.2962962;
Hsluv.epsilon = 0.0088564516;
Hsluv.m_r0 = 3.240969941904521;
Hsluv.m_r1 = -1.537383177570093;
Hsluv.m_r2 = -0.498610760293;
Hsluv.m_g0 = -0.96924363628087;
Hsluv.m_g1 = 1.87596750150772;
Hsluv.m_g2 = 0.041555057407175;
Hsluv.m_b0 = 0.055630079696993;
Hsluv.m_b1 = -0.20397695888897;
Hsluv.m_b2 = 1.056971514242878;


/***/ }),

/***/ "./node_modules/jed/jed.js":
/*!*********************************!*\
  !*** ./node_modules/jed/jed.js ***!
  \*********************************/
/***/ (function(module, exports) {

/**
 * @preserve jed.js https://github.com/SlexAxton/Jed
 */
/*
-----------
A gettext compatible i18n library for modern JavaScript Applications

by Alex Sexton - AlexSexton [at] gmail - @SlexAxton

MIT License

A jQuery Foundation project - requires CLA to contribute -
https://contribute.jquery.org/CLA/



Jed offers the entire applicable GNU gettext spec'd set of
functions, but also offers some nicer wrappers around them.
The api for gettext was written for a language with no function
overloading, so Jed allows a little more of that.

Many thanks to Joshua I. Miller - unrtst@cpan.org - who wrote
gettext.js back in 2008. I was able to vet a lot of my ideas
against his. I also made sure Jed passed against his tests
in order to offer easy upgrades -- jsgettext.berlios.de
*/
(function (root, undef) {

  // Set up some underscore-style functions, if you already have
  // underscore, feel free to delete this section, and use it
  // directly, however, the amount of functions used doesn't
  // warrant having underscore as a full dependency.
  // Underscore 1.3.0 was used to port and is licensed
  // under the MIT License by Jeremy Ashkenas.
  var ArrayProto    = Array.prototype,
      ObjProto      = Object.prototype,
      slice         = ArrayProto.slice,
      hasOwnProp    = ObjProto.hasOwnProperty,
      nativeForEach = ArrayProto.forEach,
      breaker       = {};

  // We're not using the OOP style _ so we don't need the
  // extra level of indirection. This still means that you
  // sub out for real `_` though.
  var _ = {
    forEach : function( obj, iterator, context ) {
      var i, l, key;
      if ( obj === null ) {
        return;
      }

      if ( nativeForEach && obj.forEach === nativeForEach ) {
        obj.forEach( iterator, context );
      }
      else if ( obj.length === +obj.length ) {
        for ( i = 0, l = obj.length; i < l; i++ ) {
          if ( i in obj && iterator.call( context, obj[i], i, obj ) === breaker ) {
            return;
          }
        }
      }
      else {
        for ( key in obj) {
          if ( hasOwnProp.call( obj, key ) ) {
            if ( iterator.call (context, obj[key], key, obj ) === breaker ) {
              return;
            }
          }
        }
      }
    },
    extend : function( obj ) {
      this.forEach( slice.call( arguments, 1 ), function ( source ) {
        for ( var prop in source ) {
          obj[prop] = source[prop];
        }
      });
      return obj;
    }
  };
  // END Miniature underscore impl

  // Jed is a constructor function
  var Jed = function ( options ) {
    // Some minimal defaults
    this.defaults = {
      "locale_data" : {
        "messages" : {
          "" : {
            "domain"       : "messages",
            "lang"         : "en",
            "plural_forms" : "nplurals=2; plural=(n != 1);"
          }
          // There are no default keys, though
        }
      },
      // The default domain if one is missing
      "domain" : "messages",
      // enable debug mode to log untranslated strings to the console
      "debug" : false
    };

    // Mix in the sent options with the default options
    this.options = _.extend( {}, this.defaults, options );
    this.textdomain( this.options.domain );

    if ( options.domain && ! this.options.locale_data[ this.options.domain ] ) {
      throw new Error('Text domain set to non-existent domain: `' + options.domain + '`');
    }
  };

  // The gettext spec sets this character as the default
  // delimiter for context lookups.
  // e.g.: context\u0004key
  // If your translation company uses something different,
  // just change this at any time and it will use that instead.
  Jed.context_delimiter = String.fromCharCode( 4 );

  function getPluralFormFunc ( plural_form_string ) {
    return Jed.PF.compile( plural_form_string || "nplurals=2; plural=(n != 1);");
  }

  function Chain( key, i18n ){
    this._key = key;
    this._i18n = i18n;
  }

  // Create a chainable api for adding args prettily
  _.extend( Chain.prototype, {
    onDomain : function ( domain ) {
      this._domain = domain;
      return this;
    },
    withContext : function ( context ) {
      this._context = context;
      return this;
    },
    ifPlural : function ( num, pkey ) {
      this._val = num;
      this._pkey = pkey;
      return this;
    },
    fetch : function ( sArr ) {
      if ( {}.toString.call( sArr ) != '[object Array]' ) {
        sArr = [].slice.call(arguments, 0);
      }
      return ( sArr && sArr.length ? Jed.sprintf : function(x){ return x; } )(
        this._i18n.dcnpgettext(this._domain, this._context, this._key, this._pkey, this._val),
        sArr
      );
    }
  });

  // Add functions to the Jed prototype.
  // These will be the functions on the object that's returned
  // from creating a `new Jed()`
  // These seem redundant, but they gzip pretty well.
  _.extend( Jed.prototype, {
    // The sexier api start point
    translate : function ( key ) {
      return new Chain( key, this );
    },

    textdomain : function ( domain ) {
      if ( ! domain ) {
        return this._textdomain;
      }
      this._textdomain = domain;
    },

    gettext : function ( key ) {
      return this.dcnpgettext.call( this, undef, undef, key );
    },

    dgettext : function ( domain, key ) {
     return this.dcnpgettext.call( this, domain, undef, key );
    },

    dcgettext : function ( domain , key /*, category */ ) {
      // Ignores the category anyways
      return this.dcnpgettext.call( this, domain, undef, key );
    },

    ngettext : function ( skey, pkey, val ) {
      return this.dcnpgettext.call( this, undef, undef, skey, pkey, val );
    },

    dngettext : function ( domain, skey, pkey, val ) {
      return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );
    },

    dcngettext : function ( domain, skey, pkey, val/*, category */) {
      return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );
    },

    pgettext : function ( context, key ) {
      return this.dcnpgettext.call( this, undef, context, key );
    },

    dpgettext : function ( domain, context, key ) {
      return this.dcnpgettext.call( this, domain, context, key );
    },

    dcpgettext : function ( domain, context, key/*, category */) {
      return this.dcnpgettext.call( this, domain, context, key );
    },

    npgettext : function ( context, skey, pkey, val ) {
      return this.dcnpgettext.call( this, undef, context, skey, pkey, val );
    },

    dnpgettext : function ( domain, context, skey, pkey, val ) {
      return this.dcnpgettext.call( this, domain, context, skey, pkey, val );
    },

    // The most fully qualified gettext function. It has every option.
    // Since it has every option, we can use it from every other method.
    // This is the bread and butter.
    // Technically there should be one more argument in this function for 'Category',
    // but since we never use it, we might as well not waste the bytes to define it.
    dcnpgettext : function ( domain, context, singular_key, plural_key, val ) {
      // Set some defaults

      plural_key = plural_key || singular_key;

      // Use the global domain default if one
      // isn't explicitly passed in
      domain = domain || this._textdomain;

      var fallback;

      // Handle special cases

      // No options found
      if ( ! this.options ) {
        // There's likely something wrong, but we'll return the correct key for english
        // We do this by instantiating a brand new Jed instance with the default set
        // for everything that could be broken.
        fallback = new Jed();
        return fallback.dcnpgettext.call( fallback, undefined, undefined, singular_key, plural_key, val );
      }

      // No translation data provided
      if ( ! this.options.locale_data ) {
        throw new Error('No locale data provided.');
      }

      if ( ! this.options.locale_data[ domain ] ) {
        throw new Error('Domain `' + domain + '` was not found.');
      }

      if ( ! this.options.locale_data[ domain ][ "" ] ) {
        throw new Error('No locale meta information provided.');
      }

      // Make sure we have a truthy key. Otherwise we might start looking
      // into the empty string key, which is the options for the locale
      // data.
      if ( ! singular_key ) {
        throw new Error('No translation key found.');
      }

      var key  = context ? context + Jed.context_delimiter + singular_key : singular_key,
          locale_data = this.options.locale_data,
          dict = locale_data[ domain ],
          defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[""],
          pluralForms = dict[""].plural_forms || dict[""]["Plural-Forms"] || dict[""]["plural-forms"] || defaultConf.plural_forms || defaultConf["Plural-Forms"] || defaultConf["plural-forms"],
          val_list,
          res;

      var val_idx;
      if (val === undefined) {
        // No value passed in; assume singular key lookup.
        val_idx = 0;

      } else {
        // Value has been passed in; use plural-forms calculations.

        // Handle invalid numbers, but try casting strings for good measure
        if ( typeof val != 'number' ) {
          val = parseInt( val, 10 );

          if ( isNaN( val ) ) {
            throw new Error('The number that was passed in is not a number.');
          }
        }

        val_idx = getPluralFormFunc(pluralForms)(val);
      }

      // Throw an error if a domain isn't found
      if ( ! dict ) {
        throw new Error('No domain named `' + domain + '` could be found.');
      }

      val_list = dict[ key ];

      // If there is no match, then revert back to
      // english style singular/plural with the keys passed in.
      if ( ! val_list || val_idx > val_list.length ) {
        if (this.options.missing_key_callback) {
          this.options.missing_key_callback(key, domain);
        }
        res = [ singular_key, plural_key ];

        // collect untranslated strings
        if (this.options.debug===true) {
          console.log(res[ getPluralFormFunc(pluralForms)( val ) ]);
        }
        return res[ getPluralFormFunc()( val ) ];
      }

      res = val_list[ val_idx ];

      // This includes empty strings on purpose
      if ( ! res  ) {
        res = [ singular_key, plural_key ];
        return res[ getPluralFormFunc()( val ) ];
      }
      return res;
    }
  });


  // We add in sprintf capabilities for post translation value interolation
  // This is not internally used, so you can remove it if you have this
  // available somewhere else, or want to use a different system.

  // We _slightly_ modify the normal sprintf behavior to more gracefully handle
  // undefined values.

  /**
   sprintf() for JavaScript 0.7-beta1
   http://www.diveintojavascript.com/projects/javascript-sprintf

   Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
       * Redistributions of source code must retain the above copyright
         notice, this list of conditions and the following disclaimer.
       * Redistributions in binary form must reproduce the above copyright
         notice, this list of conditions and the following disclaimer in the
         documentation and/or other materials provided with the distribution.
       * Neither the name of sprintf() for JavaScript nor the
         names of its contributors may be used to endorse or promote products
         derived from this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  var sprintf = (function() {
    function get_type(variable) {
      return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
    }
    function str_repeat(input, multiplier) {
      for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}
      return output.join('');
    }

    var str_format = function() {
      if (!str_format.cache.hasOwnProperty(arguments[0])) {
        str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
      }
      return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
    };

    str_format.format = function(parse_tree, argv) {
      var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
      for (i = 0; i < tree_length; i++) {
        node_type = get_type(parse_tree[i]);
        if (node_type === 'string') {
          output.push(parse_tree[i]);
        }
        else if (node_type === 'array') {
          match = parse_tree[i]; // convenience purposes only
          if (match[2]) { // keyword argument
            arg = argv[cursor];
            for (k = 0; k < match[2].length; k++) {
              if (!arg.hasOwnProperty(match[2][k])) {
                throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
              }
              arg = arg[match[2][k]];
            }
          }
          else if (match[1]) { // positional argument (explicit)
            arg = argv[match[1]];
          }
          else { // positional argument (implicit)
            arg = argv[cursor++];
          }

          if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
            throw(sprintf('[sprintf] expecting number but found %s', get_type(arg)));
          }

          // Jed EDIT
          if ( typeof arg == 'undefined' || arg === null ) {
            arg = '';
          }
          // Jed EDIT

          switch (match[8]) {
            case 'b': arg = arg.toString(2); break;
            case 'c': arg = String.fromCharCode(arg); break;
            case 'd': arg = parseInt(arg, 10); break;
            case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;
            case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;
            case 'o': arg = arg.toString(8); break;
            case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;
            case 'u': arg = Math.abs(arg); break;
            case 'x': arg = arg.toString(16); break;
            case 'X': arg = arg.toString(16).toUpperCase(); break;
          }
          arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);
          pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
          pad_length = match[6] - String(arg).length;
          pad = match[6] ? str_repeat(pad_character, pad_length) : '';
          output.push(match[5] ? arg + pad : pad + arg);
        }
      }
      return output.join('');
    };

    str_format.cache = {};

    str_format.parse = function(fmt) {
      var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
      while (_fmt) {
        if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
          parse_tree.push(match[0]);
        }
        else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
          parse_tree.push('%');
        }
        else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
          if (match[2]) {
            arg_names |= 1;
            var field_list = [], replacement_field = match[2], field_match = [];
            if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
              field_list.push(field_match[1]);
              while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
                if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
                  field_list.push(field_match[1]);
                }
                else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
                  field_list.push(field_match[1]);
                }
                else {
                  throw('[sprintf] huh?');
                }
              }
            }
            else {
              throw('[sprintf] huh?');
            }
            match[2] = field_list;
          }
          else {
            arg_names |= 2;
          }
          if (arg_names === 3) {
            throw('[sprintf] mixing positional and named placeholders is not (yet) supported');
          }
          parse_tree.push(match);
        }
        else {
          throw('[sprintf] huh?');
        }
        _fmt = _fmt.substring(match[0].length);
      }
      return parse_tree;
    };

    return str_format;
  })();

  var vsprintf = function(fmt, argv) {
    argv.unshift(fmt);
    return sprintf.apply(null, argv);
  };

  Jed.parse_plural = function ( plural_forms, n ) {
    plural_forms = plural_forms.replace(/n/g, n);
    return Jed.parse_expression(plural_forms);
  };

  Jed.sprintf = function ( fmt, args ) {
    if ( {}.toString.call( args ) == '[object Array]' ) {
      return vsprintf( fmt, [].slice.call(args) );
    }
    return sprintf.apply(this, [].slice.call(arguments) );
  };

  Jed.prototype.sprintf = function () {
    return Jed.sprintf.apply(this, arguments);
  };
  // END sprintf Implementation

  // Start the Plural forms section
  // This is a full plural form expression parser. It is used to avoid
  // running 'eval' or 'new Function' directly against the plural
  // forms.
  //
  // This can be important if you get translations done through a 3rd
  // party vendor. I encourage you to use this instead, however, I
  // also will provide a 'precompiler' that you can use at build time
  // to output valid/safe function representations of the plural form
  // expressions. This means you can build this code out for the most
  // part.
  Jed.PF = {};

  Jed.PF.parse = function ( p ) {
    var plural_str = Jed.PF.extractPluralExpr( p );
    return Jed.PF.parser.parse.call(Jed.PF.parser, plural_str);
  };

  Jed.PF.compile = function ( p ) {
    // Handle trues and falses as 0 and 1
    function imply( val ) {
      return (val === true ? 1 : val ? val : 0);
    }

    var ast = Jed.PF.parse( p );
    return function ( n ) {
      return imply( Jed.PF.interpreter( ast )( n ) );
    };
  };

  Jed.PF.interpreter = function ( ast ) {
    return function ( n ) {
      var res;
      switch ( ast.type ) {
        case 'GROUP':
          return Jed.PF.interpreter( ast.expr )( n );
        case 'TERNARY':
          if ( Jed.PF.interpreter( ast.expr )( n ) ) {
            return Jed.PF.interpreter( ast.truthy )( n );
          }
          return Jed.PF.interpreter( ast.falsey )( n );
        case 'OR':
          return Jed.PF.interpreter( ast.left )( n ) || Jed.PF.interpreter( ast.right )( n );
        case 'AND':
          return Jed.PF.interpreter( ast.left )( n ) && Jed.PF.interpreter( ast.right )( n );
        case 'LT':
          return Jed.PF.interpreter( ast.left )( n ) < Jed.PF.interpreter( ast.right )( n );
        case 'GT':
          return Jed.PF.interpreter( ast.left )( n ) > Jed.PF.interpreter( ast.right )( n );
        case 'LTE':
          return Jed.PF.interpreter( ast.left )( n ) <= Jed.PF.interpreter( ast.right )( n );
        case 'GTE':
          return Jed.PF.interpreter( ast.left )( n ) >= Jed.PF.interpreter( ast.right )( n );
        case 'EQ':
          return Jed.PF.interpreter( ast.left )( n ) == Jed.PF.interpreter( ast.right )( n );
        case 'NEQ':
          return Jed.PF.interpreter( ast.left )( n ) != Jed.PF.interpreter( ast.right )( n );
        case 'MOD':
          return Jed.PF.interpreter( ast.left )( n ) % Jed.PF.interpreter( ast.right )( n );
        case 'VAR':
          return n;
        case 'NUM':
          return ast.val;
        default:
          throw new Error("Invalid Token found.");
      }
    };
  };

  Jed.PF.extractPluralExpr = function ( p ) {
    // trim first
    p = p.replace(/^\s\s*/, '').replace(/\s\s*$/, '');

    if (! /;\s*$/.test(p)) {
      p = p.concat(';');
    }

    var nplurals_re = /nplurals\=(\d+);/,
        plural_re = /plural\=(.*);/,
        nplurals_matches = p.match( nplurals_re ),
        res = {},
        plural_matches;

    // Find the nplurals number
    if ( nplurals_matches.length > 1 ) {
      res.nplurals = nplurals_matches[1];
    }
    else {
      throw new Error('nplurals not found in plural_forms string: ' + p );
    }

    // remove that data to get to the formula
    p = p.replace( nplurals_re, "" );
    plural_matches = p.match( plural_re );

    if (!( plural_matches && plural_matches.length > 1 ) ) {
      throw new Error('`plural` expression not found: ' + p);
    }
    return plural_matches[ 1 ];
  };

  /* Jison generated parser */
  Jed.PF.parser = (function(){

var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"expressions":3,"e":4,"EOF":5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,"n":19,"NUMBER":20,"$accept":0,"$end":1},
terminals_: {2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},
productions_: [0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {

var $0 = $$.length - 1;
switch (yystate) {
case 1: return { type : 'GROUP', expr: $$[$0-1] };
// removed by dead control flow
{}
case 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };
break;
case 3:this.$ = { type: "OR", left: $$[$0-2], right: $$[$0] };
break;
case 4:this.$ = { type: "AND", left: $$[$0-2], right: $$[$0] };
break;
case 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };
break;
case 6:this.$ = { type: 'LTE', left: $$[$0-2], right: $$[$0] };
break;
case 7:this.$ = { type: 'GT', left: $$[$0-2], right: $$[$0] };
break;
case 8:this.$ = { type: 'GTE', left: $$[$0-2], right: $$[$0] };
break;
case 9:this.$ = { type: 'NEQ', left: $$[$0-2], right: $$[$0] };
break;
case 10:this.$ = { type: 'EQ', left: $$[$0-2], right: $$[$0] };
break;
case 11:this.$ = { type: 'MOD', left: $$[$0-2], right: $$[$0] };
break;
case 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };
break;
case 13:this.$ = { type: 'VAR' };
break;
case 14:this.$ = { type: 'NUM', val: Number(yytext) };
break;
}
},
table: [{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],
defaultActions: {6:[2,1]},
parseError: function parseError(str, hash) {
    throw new Error(str);
},
parse: function parse(input) {
    var self = this,
        stack = [0],
        vstack = [null], // semantic value stack
        lstack = [], // location stack
        table = this.table,
        yytext = '',
        yylineno = 0,
        yyleng = 0,
        recovering = 0,
        TERROR = 2,
        EOF = 1;

    //this.reductionCount = this.shiftCount = 0;

    this.lexer.setInput(input);
    this.lexer.yy = this.yy;
    this.yy.lexer = this.lexer;
    if (typeof this.lexer.yylloc == 'undefined')
        this.lexer.yylloc = {};
    var yyloc = this.lexer.yylloc;
    lstack.push(yyloc);

    if (typeof this.yy.parseError === 'function')
        this.parseError = this.yy.parseError;

    function popStack (n) {
        stack.length = stack.length - 2*n;
        vstack.length = vstack.length - n;
        lstack.length = lstack.length - n;
    }

    function lex() {
        var token;
        token = self.lexer.lex() || 1; // $end = 1
        // if token isn't its numeric value, convert
        if (typeof token !== 'number') {
            token = self.symbols_[token] || token;
        }
        return token;
    }

    var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;
    while (true) {
        // retreive state number from top of stack
        state = stack[stack.length-1];

        // use default actions if available
        if (this.defaultActions[state]) {
            action = this.defaultActions[state];
        } else {
            if (symbol == null)
                symbol = lex();
            // read action for current state and first input
            action = table[state] && table[state][symbol];
        }

        // handle parse error
        _handle_error:
        if (typeof action === 'undefined' || !action.length || !action[0]) {

            if (!recovering) {
                // Report error
                expected = [];
                for (p in table[state]) if (this.terminals_[p] && p > 2) {
                    expected.push("'"+this.terminals_[p]+"'");
                }
                var errStr = '';
                if (this.lexer.showPosition) {
                    errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
                } else {
                    errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
                                  (symbol == 1 /*EOF*/ ? "end of input" :
                                              ("'"+(this.terminals_[symbol] || symbol)+"'"));
                }
                this.parseError(errStr,
                    {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
            }

            // just recovered from another error
            if (recovering == 3) {
                if (symbol == EOF) {
                    throw new Error(errStr || 'Parsing halted.');
                }

                // discard current lookahead and grab another
                yyleng = this.lexer.yyleng;
                yytext = this.lexer.yytext;
                yylineno = this.lexer.yylineno;
                yyloc = this.lexer.yylloc;
                symbol = lex();
            }

            // try to recover from error
            while (1) {
                // check for error recovery rule in this state
                if ((TERROR.toString()) in table[state]) {
                    break;
                }
                if (state == 0) {
                    throw new Error(errStr || 'Parsing halted.');
                }
                popStack(1);
                state = stack[stack.length-1];
            }

            preErrorSymbol = symbol; // save the lookahead token
            symbol = TERROR;         // insert generic error symbol as new lookahead
            state = stack[stack.length-1];
            action = table[state] && table[state][TERROR];
            recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
        }

        // this shouldn't happen, unless resolve defaults are off
        if (action[0] instanceof Array && action.length > 1) {
            throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
        }

        switch (action[0]) {

            case 1: // shift
                //this.shiftCount++;

                stack.push(symbol);
                vstack.push(this.lexer.yytext);
                lstack.push(this.lexer.yylloc);
                stack.push(action[1]); // push state
                symbol = null;
                if (!preErrorSymbol) { // normal execution/no error
                    yyleng = this.lexer.yyleng;
                    yytext = this.lexer.yytext;
                    yylineno = this.lexer.yylineno;
                    yyloc = this.lexer.yylloc;
                    if (recovering > 0)
                        recovering--;
                } else { // error just occurred, resume old lookahead f/ before error
                    symbol = preErrorSymbol;
                    preErrorSymbol = null;
                }
                break;

            case 2: // reduce
                //this.reductionCount++;

                len = this.productions_[action[1]][1];

                // perform semantic action
                yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
                // default location, uses first token for firsts, last for lasts
                yyval._$ = {
                    first_line: lstack[lstack.length-(len||1)].first_line,
                    last_line: lstack[lstack.length-1].last_line,
                    first_column: lstack[lstack.length-(len||1)].first_column,
                    last_column: lstack[lstack.length-1].last_column
                };
                r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);

                if (typeof r !== 'undefined') {
                    return r;
                }

                // pop off stack
                if (len) {
                    stack = stack.slice(0,-1*len*2);
                    vstack = vstack.slice(0, -1*len);
                    lstack = lstack.slice(0, -1*len);
                }

                stack.push(this.productions_[action[1]][0]);    // push nonterminal (reduce)
                vstack.push(yyval.$);
                lstack.push(yyval._$);
                // goto new state = table[STATE][NONTERMINAL]
                newState = table[stack[stack.length-2]][stack[stack.length-1]];
                stack.push(newState);
                break;

            case 3: // accept
                return true;
        }

    }

    return true;
}};/* Jison generated lexer */
var lexer = (function(){

var lexer = ({EOF:1,
parseError:function parseError(str, hash) {
        if (this.yy.parseError) {
            this.yy.parseError(str, hash);
        } else {
            throw new Error(str);
        }
    },
setInput:function (input) {
        this._input = input;
        this._more = this._less = this.done = false;
        this.yylineno = this.yyleng = 0;
        this.yytext = this.matched = this.match = '';
        this.conditionStack = ['INITIAL'];
        this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
        return this;
    },
input:function () {
        var ch = this._input[0];
        this.yytext+=ch;
        this.yyleng++;
        this.match+=ch;
        this.matched+=ch;
        var lines = ch.match(/\n/);
        if (lines) this.yylineno++;
        this._input = this._input.slice(1);
        return ch;
    },
unput:function (ch) {
        this._input = ch + this._input;
        return this;
    },
more:function () {
        this._more = true;
        return this;
    },
pastInput:function () {
        var past = this.matched.substr(0, this.matched.length - this.match.length);
        return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
    },
upcomingInput:function () {
        var next = this.match;
        if (next.length < 20) {
            next += this._input.substr(0, 20-next.length);
        }
        return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
    },
showPosition:function () {
        var pre = this.pastInput();
        var c = new Array(pre.length + 1).join("-");
        return pre + this.upcomingInput() + "\n" + c+"^";
    },
next:function () {
        if (this.done) {
            return this.EOF;
        }
        if (!this._input) this.done = true;

        var token,
            match,
            col,
            lines;
        if (!this._more) {
            this.yytext = '';
            this.match = '';
        }
        var rules = this._currentRules();
        for (var i=0;i < rules.length; i++) {
            match = this._input.match(this.rules[rules[i]]);
            if (match) {
                lines = match[0].match(/\n.*/g);
                if (lines) this.yylineno += lines.length;
                this.yylloc = {first_line: this.yylloc.last_line,
                               last_line: this.yylineno+1,
                               first_column: this.yylloc.last_column,
                               last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
                this.yytext += match[0];
                this.match += match[0];
                this.matches = match;
                this.yyleng = this.yytext.length;
                this._more = false;
                this._input = this._input.slice(match[0].length);
                this.matched += match[0];
                token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);
                if (token) return token;
                else return;
            }
        }
        if (this._input === "") {
            return this.EOF;
        } else {
            this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
                    {text: "", token: null, line: this.yylineno});
        }
    },
lex:function lex() {
        var r = this.next();
        if (typeof r !== 'undefined') {
            return r;
        } else {
            return this.lex();
        }
    },
begin:function begin(condition) {
        this.conditionStack.push(condition);
    },
popState:function popState() {
        return this.conditionStack.pop();
    },
_currentRules:function _currentRules() {
        return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
    },
topState:function () {
        return this.conditionStack[this.conditionStack.length-2];
    },
pushState:function begin(condition) {
        this.begin(condition);
    }});
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {

var YYSTATE=YY_START;
switch($avoiding_name_collisions) {
case 0:/* skip whitespace */
break;
case 1:return 20
// removed by dead control flow
{}
case 2:return 19
// removed by dead control flow
{}
case 3:return 8
// removed by dead control flow
{}
case 4:return 9
// removed by dead control flow
{}
case 5:return 6
// removed by dead control flow
{}
case 6:return 7
// removed by dead control flow
{}
case 7:return 11
// removed by dead control flow
{}
case 8:return 13
// removed by dead control flow
{}
case 9:return 10
// removed by dead control flow
{}
case 10:return 12
// removed by dead control flow
{}
case 11:return 14
// removed by dead control flow
{}
case 12:return 15
// removed by dead control flow
{}
case 13:return 16
// removed by dead control flow
{}
case 14:return 17
// removed by dead control flow
{}
case 15:return 18
// removed by dead control flow
{}
case 16:return 5
// removed by dead control flow
{}
case 17:return 'INVALID'
// removed by dead control flow
{}
}
};
lexer.rules = [/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./];
lexer.conditions = {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"inclusive":true}};return lexer;})()
parser.lexer = lexer;
return parser;
})();
// End parser

  // Handle node, amd, and global systems
  if (true) {
    if ( true && module.exports) {
      exports = module.exports = Jed;
    }
    exports.Jed = Jed;
  }
  else // removed by dead control flow
{}

})(this);


/***/ }),

/***/ "./node_modules/js-binary-schema-parser/lib/index.js":
/*!***********************************************************!*\
  !*** ./node_modules/js-binary-schema-parser/lib/index.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.loop = exports.conditional = exports.parse = void 0;

var parse = function parse(stream, schema) {
  var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  var parent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : result;

  if (Array.isArray(schema)) {
    schema.forEach(function (partSchema) {
      return parse(stream, partSchema, result, parent);
    });
  } else if (typeof schema === 'function') {
    schema(stream, result, parent, parse);
  } else {
    var key = Object.keys(schema)[0];

    if (Array.isArray(schema[key])) {
      parent[key] = {};
      parse(stream, schema[key], result, parent[key]);
    } else {
      parent[key] = schema[key](stream, result, parent, parse);
    }
  }

  return result;
};

exports.parse = parse;

var conditional = function conditional(schema, conditionFunc) {
  return function (stream, result, parent, parse) {
    if (conditionFunc(stream, result, parent)) {
      parse(stream, schema, result, parent);
    }
  };
};

exports.conditional = conditional;

var loop = function loop(schema, continueFunc) {
  return function (stream, result, parent, parse) {
    var arr = [];
    var lastStreamPos = stream.pos;

    while (continueFunc(stream, result, parent)) {
      var newParent = {};
      parse(stream, schema, result, newParent); // cases when whole file is parsed but no termination is there and stream position is not getting updated as well
      // it falls into infinite recursion, null check to avoid the same

      if (stream.pos === lastStreamPos) {
        break;
      }

      lastStreamPos = stream.pos;
      arr.push(newParent);
    }

    return arr;
  };
};

exports.loop = loop;

/***/ }),

/***/ "./node_modules/js-binary-schema-parser/lib/parsers/uint8.js":
/*!*******************************************************************!*\
  !*** ./node_modules/js-binary-schema-parser/lib/parsers/uint8.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.readBits = exports.readArray = exports.readUnsigned = exports.readString = exports.peekBytes = exports.readBytes = exports.peekByte = exports.readByte = exports.buildStream = void 0;

// Default stream and parsers for Uint8TypedArray data type
var buildStream = function buildStream(uint8Data) {
  return {
    data: uint8Data,
    pos: 0
  };
};

exports.buildStream = buildStream;

var readByte = function readByte() {
  return function (stream) {
    return stream.data[stream.pos++];
  };
};

exports.readByte = readByte;

var peekByte = function peekByte() {
  var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  return function (stream) {
    return stream.data[stream.pos + offset];
  };
};

exports.peekByte = peekByte;

var readBytes = function readBytes(length) {
  return function (stream) {
    return stream.data.subarray(stream.pos, stream.pos += length);
  };
};

exports.readBytes = readBytes;

var peekBytes = function peekBytes(length) {
  return function (stream) {
    return stream.data.subarray(stream.pos, stream.pos + length);
  };
};

exports.peekBytes = peekBytes;

var readString = function readString(length) {
  return function (stream) {
    return Array.from(readBytes(length)(stream)).map(function (value) {
      return String.fromCharCode(value);
    }).join('');
  };
};

exports.readString = readString;

var readUnsigned = function readUnsigned(littleEndian) {
  return function (stream) {
    var bytes = readBytes(2)(stream);
    return littleEndian ? (bytes[1] << 8) + bytes[0] : (bytes[0] << 8) + bytes[1];
  };
};

exports.readUnsigned = readUnsigned;

var readArray = function readArray(byteSize, totalOrFunc) {
  return function (stream, result, parent) {
    var total = typeof totalOrFunc === 'function' ? totalOrFunc(stream, result, parent) : totalOrFunc;
    var parser = readBytes(byteSize);
    var arr = new Array(total);

    for (var i = 0; i < total; i++) {
      arr[i] = parser(stream);
    }

    return arr;
  };
};

exports.readArray = readArray;

var subBitsTotal = function subBitsTotal(bits, startIndex, length) {
  var result = 0;

  for (var i = 0; i < length; i++) {
    result += bits[startIndex + i] && Math.pow(2, length - i - 1);
  }

  return result;
};

var readBits = function readBits(schema) {
  return function (stream) {
    var _byte = readByte()(stream); // convert the byte to bit array


    var bits = new Array(8);

    for (var i = 0; i < 8; i++) {
      bits[7 - i] = !!(_byte & 1 << i);
    } // convert the bit array to values based on the schema


    return Object.keys(schema).reduce(function (res, key) {
      var def = schema[key];

      if (def.length) {
        res[key] = subBitsTotal(bits, def.index, def.length);
      } else {
        res[key] = bits[def.index];
      }

      return res;
    }, {});
  };
};

exports.readBits = readBits;

/***/ }),

/***/ "./node_modules/js-binary-schema-parser/lib/schemas/gif.js":
/*!*****************************************************************!*\
  !*** ./node_modules/js-binary-schema-parser/lib/schemas/gif.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _ = __webpack_require__(/*! ../ */ "./node_modules/js-binary-schema-parser/lib/index.js");

var _uint = __webpack_require__(/*! ../parsers/uint8 */ "./node_modules/js-binary-schema-parser/lib/parsers/uint8.js");

// a set of 0x00 terminated subblocks
var subBlocksSchema = {
  blocks: function blocks(stream) {
    var terminator = 0x00;
    var chunks = [];
    var streamSize = stream.data.length;
    var total = 0;

    for (var size = (0, _uint.readByte)()(stream); size !== terminator; size = (0, _uint.readByte)()(stream)) {
      // size becomes undefined for some case when file is corrupted and  terminator is not proper 
      // null check to avoid recursion
      if (!size) break; // catch corrupted files with no terminator

      if (stream.pos + size >= streamSize) {
        var availableSize = streamSize - stream.pos;
        chunks.push((0, _uint.readBytes)(availableSize)(stream));
        total += availableSize;
        break;
      }

      chunks.push((0, _uint.readBytes)(size)(stream));
      total += size;
    }

    var result = new Uint8Array(total);
    var offset = 0;

    for (var i = 0; i < chunks.length; i++) {
      result.set(chunks[i], offset);
      offset += chunks[i].length;
    }

    return result;
  }
}; // global control extension

var gceSchema = (0, _.conditional)({
  gce: [{
    codes: (0, _uint.readBytes)(2)
  }, {
    byteSize: (0, _uint.readByte)()
  }, {
    extras: (0, _uint.readBits)({
      future: {
        index: 0,
        length: 3
      },
      disposal: {
        index: 3,
        length: 3
      },
      userInput: {
        index: 6
      },
      transparentColorGiven: {
        index: 7
      }
    })
  }, {
    delay: (0, _uint.readUnsigned)(true)
  }, {
    transparentColorIndex: (0, _uint.readByte)()
  }, {
    terminator: (0, _uint.readByte)()
  }]
}, function (stream) {
  var codes = (0, _uint.peekBytes)(2)(stream);
  return codes[0] === 0x21 && codes[1] === 0xf9;
}); // image pipeline block

var imageSchema = (0, _.conditional)({
  image: [{
    code: (0, _uint.readByte)()
  }, {
    descriptor: [{
      left: (0, _uint.readUnsigned)(true)
    }, {
      top: (0, _uint.readUnsigned)(true)
    }, {
      width: (0, _uint.readUnsigned)(true)
    }, {
      height: (0, _uint.readUnsigned)(true)
    }, {
      lct: (0, _uint.readBits)({
        exists: {
          index: 0
        },
        interlaced: {
          index: 1
        },
        sort: {
          index: 2
        },
        future: {
          index: 3,
          length: 2
        },
        size: {
          index: 5,
          length: 3
        }
      })
    }]
  }, (0, _.conditional)({
    lct: (0, _uint.readArray)(3, function (stream, result, parent) {
      return Math.pow(2, parent.descriptor.lct.size + 1);
    })
  }, function (stream, result, parent) {
    return parent.descriptor.lct.exists;
  }), {
    data: [{
      minCodeSize: (0, _uint.readByte)()
    }, subBlocksSchema]
  }]
}, function (stream) {
  return (0, _uint.peekByte)()(stream) === 0x2c;
}); // plain text block

var textSchema = (0, _.conditional)({
  text: [{
    codes: (0, _uint.readBytes)(2)
  }, {
    blockSize: (0, _uint.readByte)()
  }, {
    preData: function preData(stream, result, parent) {
      return (0, _uint.readBytes)(parent.text.blockSize)(stream);
    }
  }, subBlocksSchema]
}, function (stream) {
  var codes = (0, _uint.peekBytes)(2)(stream);
  return codes[0] === 0x21 && codes[1] === 0x01;
}); // application block

var applicationSchema = (0, _.conditional)({
  application: [{
    codes: (0, _uint.readBytes)(2)
  }, {
    blockSize: (0, _uint.readByte)()
  }, {
    id: function id(stream, result, parent) {
      return (0, _uint.readString)(parent.blockSize)(stream);
    }
  }, subBlocksSchema]
}, function (stream) {
  var codes = (0, _uint.peekBytes)(2)(stream);
  return codes[0] === 0x21 && codes[1] === 0xff;
}); // comment block

var commentSchema = (0, _.conditional)({
  comment: [{
    codes: (0, _uint.readBytes)(2)
  }, subBlocksSchema]
}, function (stream) {
  var codes = (0, _uint.peekBytes)(2)(stream);
  return codes[0] === 0x21 && codes[1] === 0xfe;
});
var schema = [{
  header: [{
    signature: (0, _uint.readString)(3)
  }, {
    version: (0, _uint.readString)(3)
  }]
}, {
  lsd: [{
    width: (0, _uint.readUnsigned)(true)
  }, {
    height: (0, _uint.readUnsigned)(true)
  }, {
    gct: (0, _uint.readBits)({
      exists: {
        index: 0
      },
      resolution: {
        index: 1,
        length: 3
      },
      sort: {
        index: 4
      },
      size: {
        index: 5,
        length: 3
      }
    })
  }, {
    backgroundColorIndex: (0, _uint.readByte)()
  }, {
    pixelAspectRatio: (0, _uint.readByte)()
  }]
}, (0, _.conditional)({
  gct: (0, _uint.readArray)(3, function (stream, result) {
    return Math.pow(2, result.lsd.gct.size + 1);
  })
}, function (stream, result) {
  return result.lsd.gct.exists;
}), // content frames
{
  frames: (0, _.loop)([gceSchema, applicationSchema, commentSchema, imageSchema, textSchema], function (stream) {
    var nextCode = (0, _uint.peekByte)()(stream); // rather than check for a terminator, we should check for the existence
    // of an ext or image block to avoid infinite loops
    //var terminator = 0x3B;
    //return nextCode !== terminator;

    return nextCode === 0x21 || nextCode === 0x2c;
  })
}];
var _default = schema;
exports["default"] = _default;

/***/ }),

/***/ "./node_modules/lit-element/development/lit-element.js":
/*!*************************************************************!*\
  !*** ./node_modules/lit-element/development/lit-element.js ***!
  \*************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSSResult: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.CSSResult),
/* harmony export */   LitElement: () => (/* binding */ LitElement),
/* harmony export */   ReactiveElement: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.ReactiveElement),
/* harmony export */   _$LE: () => (/* binding */ _$LE),
/* harmony export */   _$LH: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__._$LH),
/* harmony export */   adoptStyles: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.adoptStyles),
/* harmony export */   css: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.css),
/* harmony export */   defaultConverter: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.defaultConverter),
/* harmony export */   getCompatibleStyle: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.getCompatibleStyle),
/* harmony export */   html: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__.html),
/* harmony export */   mathml: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__.mathml),
/* harmony export */   noChange: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__.noChange),
/* harmony export */   notEqual: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.notEqual),
/* harmony export */   nothing: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__.nothing),
/* harmony export */   render: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__.render),
/* harmony export */   supportsAdoptingStyleSheets: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.supportsAdoptingStyleSheets),
/* harmony export */   svg: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_1__.svg),
/* harmony export */   unsafeCSS: () => (/* reexport safe */ _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.unsafeCSS)
/* harmony export */ });
/* harmony import */ var _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lit/reactive-element */ "./node_modules/@lit/reactive-element/development/reactive-element.js");
/* harmony import */ var lit_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit-html */ "./node_modules/lit-html/development/lit-html.js");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**
 * The main LitElement module, which defines the {@linkcode LitElement} base
 * class and related APIs.
 *
 * LitElement components can define a template and a set of observed
 * properties. Changing an observed property triggers a re-render of the
 * element.
 *
 * Import {@linkcode LitElement} and {@linkcode html} from this module to
 * create a component:
 *
 *  ```js
 * import {LitElement, html} from 'lit-element';
 *
 * class MyElement extends LitElement {
 *
 *   // Declare observed properties
 *   static get properties() {
 *     return {
 *       adjective: {}
 *     }
 *   }
 *
 *   constructor() {
 *     this.adjective = 'awesome';
 *   }
 *
 *   // Define the element's template
 *   render() {
 *     return html`<p>your ${adjective} template here</p>`;
 *   }
 * }
 *
 * customElements.define('my-element', MyElement);
 * ```
 *
 * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html
 * templating. The `ReactiveElement` class is provided for users that want to
 * build their own custom element base classes that don't use lit-html.
 *
 * @packageDocumentation
 */




/*
 * When using Closure Compiler, JSCompiler_renameProperty(property, object) is
 * replaced at compile time by the munged name for object[property]. We cannot
 * alias this function, so we have to use a small shim that has the same
 * behavior when not compiling.
 */
/*@__INLINE__*/
const JSCompiler_renameProperty = (prop, _obj) => prop;
const DEV_MODE = true;
// Allows minifiers to rename references to globalThis
const global = globalThis;
let issueWarning;
if (DEV_MODE) {
    // Ensure warnings are issued only 1x, even if multiple versions of Lit
    // are loaded.
    global.litIssuedWarnings ??= new Set();
    /**
     * Issue a warning if we haven't already, based either on `code` or `warning`.
     * Warnings are disabled automatically only by `warning`; disabling via `code`
     * can be done by users.
     */
    issueWarning = (code, warning) => {
        warning += ` See https://lit.dev/msg/${code} for more information.`;
        if (!global.litIssuedWarnings.has(warning) &&
            !global.litIssuedWarnings.has(code)) {
            console.warn(warning);
            global.litIssuedWarnings.add(warning);
        }
    };
}
/**
 * Base element class that manages element properties and attributes, and
 * renders a lit-html template.
 *
 * To define a component, subclass `LitElement` and implement a
 * `render` method to provide the component's template. Define properties
 * using the {@linkcode LitElement.properties properties} property or the
 * {@linkcode property} decorator.
 */
class LitElement extends _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__.ReactiveElement {
    constructor() {
        super(...arguments);
        /**
         * @category rendering
         */
        this.renderOptions = { host: this };
        this.__childPart = undefined;
    }
    /**
     * @category rendering
     */
    createRenderRoot() {
        const renderRoot = super.createRenderRoot();
        // When adoptedStyleSheets are shimmed, they are inserted into the
        // shadowRoot by createRenderRoot. Adjust the renderBefore node so that
        // any styles in Lit content render before adoptedStyleSheets. This is
        // important so that adoptedStyleSheets have precedence over styles in
        // the shadowRoot.
        this.renderOptions.renderBefore ??= renderRoot.firstChild;
        return renderRoot;
    }
    /**
     * Updates the element. This method reflects property values to attributes
     * and calls `render` to render DOM via lit-html. Setting properties inside
     * this method will *not* trigger another update.
     * @param changedProperties Map of changed properties with old values
     * @category updates
     */
    update(changedProperties) {
        // Setting properties in `render` should not trigger an update. Since
        // updates are allowed after super.update, it's important to call `render`
        // before that.
        const value = this.render();
        if (!this.hasUpdated) {
            this.renderOptions.isConnected = this.isConnected;
        }
        super.update(changedProperties);
        this.__childPart = (0,lit_html__WEBPACK_IMPORTED_MODULE_1__.render)(value, this.renderRoot, this.renderOptions);
    }
    /**
     * Invoked when the component is added to the document's DOM.
     *
     * In `connectedCallback()` you should setup tasks that should only occur when
     * the element is connected to the document. The most common of these is
     * adding event listeners to nodes external to the element, like a keydown
     * event handler added to the window.
     *
     * ```ts
     * connectedCallback() {
     *   super.connectedCallback();
     *   addEventListener('keydown', this._handleKeydown);
     * }
     * ```
     *
     * Typically, anything done in `connectedCallback()` should be undone when the
     * element is disconnected, in `disconnectedCallback()`.
     *
     * @category lifecycle
     */
    connectedCallback() {
        super.connectedCallback();
        this.__childPart?.setConnected(true);
    }
    /**
     * Invoked when the component is removed from the document's DOM.
     *
     * This callback is the main signal to the element that it may no longer be
     * used. `disconnectedCallback()` should ensure that nothing is holding a
     * reference to the element (such as event listeners added to nodes external
     * to the element), so that it is free to be garbage collected.
     *
     * ```ts
     * disconnectedCallback() {
     *   super.disconnectedCallback();
     *   window.removeEventListener('keydown', this._handleKeydown);
     * }
     * ```
     *
     * An element may be re-connected after being disconnected.
     *
     * @category lifecycle
     */
    disconnectedCallback() {
        super.disconnectedCallback();
        this.__childPart?.setConnected(false);
    }
    /**
     * Invoked on each update to perform rendering tasks. This method may return
     * any value renderable by lit-html's `ChildPart` - typically a
     * `TemplateResult`. Setting properties inside this method will *not* trigger
     * the element to update.
     * @category rendering
     */
    render() {
        return lit_html__WEBPACK_IMPORTED_MODULE_1__.noChange;
    }
}
// This property needs to remain unminified.
LitElement['_$litElement$'] = true;
/**
 * Ensure this class is marked as `finalized` as an optimization ensuring
 * it will not needlessly try to `finalize`.
 *
 * Note this property name is a string to prevent breaking Closure JS Compiler
 * optimizations. See @lit/reactive-element for more information.
 */
LitElement[JSCompiler_renameProperty('finalized', LitElement)] = true;
// Install hydration if available
global.litElementHydrateSupport?.({ LitElement });
// Apply polyfills if available
const polyfillSupport = DEV_MODE
    ? global.litElementPolyfillSupportDevMode
    : global.litElementPolyfillSupport;
polyfillSupport?.({ LitElement });
/**
 * END USERS SHOULD NOT RELY ON THIS OBJECT.
 *
 * Private exports for use by other Lit packages, not intended for use by
 * external users.
 *
 * We currently do not make a mangled rollup build of the lit-ssr code. In order
 * to keep a number of (otherwise private) top-level exports  mangled in the
 * client side code, we export a _$LE object containing those members (or
 * helper methods for accessing private fields of those members), and then
 * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
 * client-side code is being used in `dev` mode or `prod` mode.
 *
 * This has a unique name, to disambiguate it from private exports in
 * lit-html, since this module re-exports all of lit-html.
 *
 * @private
 */
const _$LE = {
    _$attributeToProperty: (el, name, value) => {
        // eslint-disable-next-line
        el._$attributeToProperty(name, value);
    },
    // eslint-disable-next-line
    _$changedProperties: (el) => el._$changedProperties,
};
// IMPORTANT: do not change the property name or the assignment expression.
// This line will be used in regexes to search for LitElement usage.
(global.litElementVersions ??= []).push('4.2.0');
if (DEV_MODE && global.litElementVersions.length > 1) {
    queueMicrotask(() => {
        issueWarning('multiple-versions', `Multiple versions of Lit loaded. Loading multiple versions ` +
            `is not recommended.`);
    });
}
//# sourceMappingURL=lit-element.js.map

/***/ }),

/***/ "./node_modules/lit-html/development/async-directive.js":
/*!**************************************************************!*\
  !*** ./node_modules/lit-html/development/async-directive.js ***!
  \**************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AsyncDirective: () => (/* binding */ AsyncDirective),
/* harmony export */   Directive: () => (/* reexport safe */ _directive_js__WEBPACK_IMPORTED_MODULE_1__.Directive),
/* harmony export */   PartType: () => (/* reexport safe */ _directive_js__WEBPACK_IMPORTED_MODULE_1__.PartType),
/* harmony export */   directive: () => (/* reexport safe */ _directive_js__WEBPACK_IMPORTED_MODULE_1__.directive)
/* harmony export */ });
/* harmony import */ var _directive_helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./directive-helpers.js */ "./node_modules/lit-html/development/directive-helpers.js");
/* harmony import */ var _directive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./directive.js */ "./node_modules/lit-html/development/directive.js");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ 


const DEV_MODE = true;
/**
 * Recursively walks down the tree of Parts/TemplateInstances/Directives to set
 * the connected state of directives and run `disconnected`/ `reconnected`
 * callbacks.
 *
 * @return True if there were children to disconnect; false otherwise
 */ const notifyChildrenConnectedChanged = (parent, isConnected)=>{
    const children = parent._$disconnectableChildren;
    if (children === undefined) {
        return false;
    }
    for (const obj of children){
        var // The existence of `_$notifyDirectiveConnectionChanged` is used as a "brand" to
        // disambiguate AsyncDirectives from other DisconnectableChildren
        // (as opposed to using an instanceof check to know when to call it); the
        // redundancy of "Directive" in the API name is to avoid conflicting with
        // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in
        // this list
        // Disconnect Directive (and any nested directives contained within)
        // This property needs to remain unminified.
        _obj__$notifyDirectiveConnectionChanged;
        (_obj__$notifyDirectiveConnectionChanged = obj['_$notifyDirectiveConnectionChanged']) === null || _obj__$notifyDirectiveConnectionChanged === void 0 ? void 0 : _obj__$notifyDirectiveConnectionChanged.call(obj, isConnected, false);
        // Disconnect Part/TemplateInstance
        notifyChildrenConnectedChanged(obj, isConnected);
    }
    return true;
};
/**
 * Removes the given child from its parent list of disconnectable children, and
 * if the parent list becomes empty as a result, removes the parent from its
 * parent, and so forth up the tree when that causes subsequent parent lists to
 * become empty.
 */ const removeDisconnectableFromParent = (obj)=>{
    let parent, children;
    do {
        if ((parent = obj._$parent) === undefined) {
            break;
        }
        children = parent._$disconnectableChildren;
        children.delete(obj);
        obj = parent;
    }while ((children === null || children === void 0 ? void 0 : children.size) === 0)
};
const addDisconnectableToParent = (obj)=>{
    // Climb the parent tree, creating a sparse tree of children needing
    // disconnection
    for(let parent; parent = obj._$parent; obj = parent){
        let children = parent._$disconnectableChildren;
        if (children === undefined) {
            parent._$disconnectableChildren = children = new Set();
        } else if (children.has(obj)) {
            break;
        }
        children.add(obj);
        installDisconnectAPI(parent);
    }
};
/**
 * Changes the parent reference of the ChildPart, and updates the sparse tree of
 * Disconnectable children accordingly.
 *
 * Note, this method will be patched onto ChildPart instances and called from
 * the core code when parts are moved between different parents.
 */ function reparentDisconnectables(newParent) {
    if (this._$disconnectableChildren !== undefined) {
        removeDisconnectableFromParent(this);
        this._$parent = newParent;
        addDisconnectableToParent(this);
    } else {
        this._$parent = newParent;
    }
}
/**
 * Sets the connected state on any directives contained within the committed
 * value of this part (i.e. within a TemplateInstance or iterable of
 * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within
 * any directives stored on the ChildPart (when `valueOnly` is false).
 *
 * `isClearingValue` should be passed as `true` on a top-level part that is
 * clearing itself, and not as a result of recursively disconnecting directives
 * as part of a `clear` operation higher up the tree. This both ensures that any
 * directive on this ChildPart that produced a value that caused the clear
 * operation is not disconnected, and also serves as a performance optimization
 * to avoid needless bookkeeping when a subtree is going away; when clearing a
 * subtree, only the top-most part need to remove itself from the parent.
 *
 * `fromPartIndex` is passed only in the case of a partial `_clear` running as a
 * result of truncating an iterable.
 *
 * Note, this method will be patched onto ChildPart instances and called from the
 * core code when parts are cleared or the connection state is changed by the
 * user.
 */ function notifyChildPartConnectedChanged(isConnected, isClearingValue = false, fromPartIndex = 0) {
    const value = this._$committedValue;
    const children = this._$disconnectableChildren;
    if (children === undefined || children.size === 0) {
        return;
    }
    if (isClearingValue) {
        if (Array.isArray(value)) {
            // Iterable case: Any ChildParts created by the iterable should be
            // disconnected and removed from this ChildPart's disconnectable
            // children (starting at `fromPartIndex` in the case of truncation)
            for(let i = fromPartIndex; i < value.length; i++){
                notifyChildrenConnectedChanged(value[i], false);
                removeDisconnectableFromParent(value[i]);
            }
        } else if (value != null) {
            // TemplateInstance case: If the value has disconnectable children (will
            // only be in the case that it is a TemplateInstance), we disconnect it
            // and remove it from this ChildPart's disconnectable children
            notifyChildrenConnectedChanged(value, false);
            removeDisconnectableFromParent(value);
        }
    } else {
        notifyChildrenConnectedChanged(this, isConnected);
    }
}
/**
 * Patches disconnection API onto ChildParts.
 */ const installDisconnectAPI = (obj)=>{
    if (obj.type == _directive_js__WEBPACK_IMPORTED_MODULE_1__.PartType.CHILD) {
        var _obj, _obj1;
        var __$notifyConnectionChanged;
        (__$notifyConnectionChanged = (_obj = obj)._$notifyConnectionChanged) !== null && __$notifyConnectionChanged !== void 0 ? __$notifyConnectionChanged : _obj._$notifyConnectionChanged = notifyChildPartConnectedChanged;
        var __$reparentDisconnectables;
        (__$reparentDisconnectables = (_obj1 = obj)._$reparentDisconnectables) !== null && __$reparentDisconnectables !== void 0 ? __$reparentDisconnectables : _obj1._$reparentDisconnectables = reparentDisconnectables;
    }
};
/**
 * An abstract `Directive` base class whose `disconnected` method will be
 * called when the part containing the directive is cleared as a result of
 * re-rendering, or when the user calls `part.setConnected(false)` on
 * a part that was previously rendered containing the directive (as happens
 * when e.g. a LitElement disconnects from the DOM).
 *
 * If `part.setConnected(true)` is subsequently called on a
 * containing part, the directive's `reconnected` method will be called prior
 * to its next `update`/`render` callbacks. When implementing `disconnected`,
 * `reconnected` should also be implemented to be compatible with reconnection.
 *
 * Note that updates may occur while the directive is disconnected. As such,
 * directives should generally check the `this.isConnected` flag during
 * render/update to determine whether it is safe to subscribe to resources
 * that may prevent garbage collection.
 */ class AsyncDirective extends _directive_js__WEBPACK_IMPORTED_MODULE_1__.Directive {
    /**
     * Initialize the part with internal fields
     * @param part
     * @param parent
     * @param attributeIndex
     */ _$initialize(part, parent, attributeIndex) {
        super._$initialize(part, parent, attributeIndex);
        addDisconnectableToParent(this);
        this.isConnected = part._$isConnected;
    }
    // This property needs to remain unminified.
    /**
     * Called from the core code when a directive is going away from a part (in
     * which case `shouldRemoveFromParent` should be true), and from the
     * `setChildrenConnected` helper function when recursively changing the
     * connection state of a tree (in which case `shouldRemoveFromParent` should
     * be false).
     *
     * @param isConnected
     * @param isClearingDirective - True when the directive itself is being
     *     removed; false when the tree is being disconnected
     * @internal
     */ ['_$notifyDirectiveConnectionChanged'](isConnected, isClearingDirective = true) {
        if (isConnected !== this.isConnected) {
            this.isConnected = isConnected;
            if (isConnected) {
                var _this_reconnected, _this;
                (_this_reconnected = (_this = this).reconnected) === null || _this_reconnected === void 0 ? void 0 : _this_reconnected.call(_this);
            } else {
                var _this_disconnected, _this1;
                (_this_disconnected = (_this1 = this).disconnected) === null || _this_disconnected === void 0 ? void 0 : _this_disconnected.call(_this1);
            }
        }
        if (isClearingDirective) {
            notifyChildrenConnectedChanged(this, isConnected);
            removeDisconnectableFromParent(this);
        }
    }
    /**
     * Sets the value of the directive's Part outside the normal `update`/`render`
     * lifecycle of a directive.
     *
     * This method should not be called synchronously from a directive's `update`
     * or `render`.
     *
     * @param directive The directive to update
     * @param value The value to set
     */ setValue(value) {
        if ((0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isSingleExpression)(this.__part)) {
            this.__part._$setValue(value, this);
        } else {
            // this.__attributeIndex will be defined in this case, but
            // assert it in dev mode
            if (DEV_MODE && this.__attributeIndex === undefined) {
                throw new Error(`Expected this.__attributeIndex to be a number`);
            }
            const newValues = [
                ...this.__part._$committedValue
            ];
            newValues[this.__attributeIndex] = value;
            this.__part._$setValue(newValues, this, 0);
        }
    }
    /**
     * User callbacks for implementing logic to release any resources/subscriptions
     * that may have been retained by this directive. Since directives may also be
     * re-connected, `reconnected` should also be implemented to restore the
     * working state of the directive prior to the next render.
     */ disconnected() {}
    reconnected() {}
    constructor(){
        super(...arguments);
        // @internal
        this._$disconnectableChildren = undefined;
    }
} //# sourceMappingURL=async-directive.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/directive-helpers.js":
/*!****************************************************************!*\
  !*** ./node_modules/lit-html/development/directive-helpers.js ***!
  \****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   TemplateResultType: () => (/* binding */ TemplateResultType),
/* harmony export */   clearPart: () => (/* binding */ clearPart),
/* harmony export */   getCommittedValue: () => (/* binding */ getCommittedValue),
/* harmony export */   getDirectiveClass: () => (/* binding */ getDirectiveClass),
/* harmony export */   insertPart: () => (/* binding */ insertPart),
/* harmony export */   isCompiledTemplateResult: () => (/* binding */ isCompiledTemplateResult),
/* harmony export */   isDirectiveResult: () => (/* binding */ isDirectiveResult),
/* harmony export */   isPrimitive: () => (/* binding */ isPrimitive),
/* harmony export */   isSingleExpression: () => (/* binding */ isSingleExpression),
/* harmony export */   isTemplateResult: () => (/* binding */ isTemplateResult),
/* harmony export */   removePart: () => (/* binding */ removePart),
/* harmony export */   setChildPartValue: () => (/* binding */ setChildPartValue),
/* harmony export */   setCommittedValue: () => (/* binding */ setCommittedValue)
/* harmony export */ });
/* harmony import */ var _lit_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lit-html.js */ "./node_modules/lit-html/development/lit-html.js");
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ var _window_ShadyDOM, _window_ShadyDOM1;

const { _ChildPart: ChildPart } = _lit_html_js__WEBPACK_IMPORTED_MODULE_0__._$LH;
const ENABLE_SHADYDOM_NOPATCH = true;
const wrap = ENABLE_SHADYDOM_NOPATCH && ((_window_ShadyDOM = window.ShadyDOM) === null || _window_ShadyDOM === void 0 ? void 0 : _window_ShadyDOM.inUse) && ((_window_ShadyDOM1 = window.ShadyDOM) === null || _window_ShadyDOM1 === void 0 ? void 0 : _window_ShadyDOM1.noPatch) === true ? window.ShadyDOM.wrap : (node)=>node;
/**
 * Tests if a value is a primitive value.
 *
 * See https://tc39.github.io/ecma262/#sec-typeof-operator
 */ const isPrimitive = (value)=>value === null || typeof value != 'object' && typeof value != 'function';
const TemplateResultType = {
    HTML: 1,
    SVG: 2,
    MATHML: 3
};
/**
 * Tests if a value is a TemplateResult or a CompiledTemplateResult.
 */ const isTemplateResult = (value, type)=>type === undefined ? (value === null || value === void 0 ? void 0 : value['_$litType$']) !== undefined : (value === null || value === void 0 ? void 0 : value['_$litType$']) === type;
/**
 * Tests if a value is a CompiledTemplateResult.
 */ const isCompiledTemplateResult = (value)=>{
    var _value__$litType$;
    return (value === null || value === void 0 ? void 0 : (_value__$litType$ = value['_$litType$']) === null || _value__$litType$ === void 0 ? void 0 : _value__$litType$.h) != null;
};
/**
 * Tests if a value is a DirectiveResult.
 */ const isDirectiveResult = (value)=>// This property needs to remain unminified.
    (value === null || value === void 0 ? void 0 : value['_$litDirective$']) !== undefined;
/**
 * Retrieves the Directive class for a DirectiveResult
 */ const getDirectiveClass = (value)=>// This property needs to remain unminified.
    value === null || value === void 0 ? void 0 : value['_$litDirective$'];
/**
 * Tests whether a part has only a single-expression with no strings to
 * interpolate between.
 *
 * Only AttributePart and PropertyPart can have multiple expressions.
 * Multi-expression parts have a `strings` property and single-expression
 * parts do not.
 */ const isSingleExpression = (part)=>part.strings === undefined;
const createMarker = ()=>document.createComment('');
/**
 * Inserts a ChildPart into the given container ChildPart's DOM, either at the
 * end of the container ChildPart, or before the optional `refPart`.
 *
 * This does not add the part to the containerPart's committed value. That must
 * be done by callers.
 *
 * @param containerPart Part within which to add the new ChildPart
 * @param refPart Part before which to add the new ChildPart; when omitted the
 *     part added to the end of the `containerPart`
 * @param part Part to insert, or undefined to create a new part
 */ const insertPart = (containerPart, refPart, part)=>{
    const container = wrap(containerPart._$startNode).parentNode;
    const refNode = refPart === undefined ? containerPart._$endNode : refPart._$startNode;
    if (part === undefined) {
        const startNode = wrap(container).insertBefore(createMarker(), refNode);
        const endNode = wrap(container).insertBefore(createMarker(), refNode);
        part = new ChildPart(startNode, endNode, containerPart, containerPart.options);
    } else {
        const endNode = wrap(part._$endNode).nextSibling;
        const oldParent = part._$parent;
        const parentChanged = oldParent !== containerPart;
        if (parentChanged) {
            var _part__$reparentDisconnectables;
            (_part__$reparentDisconnectables = part._$reparentDisconnectables) === null || _part__$reparentDisconnectables === void 0 ? void 0 : _part__$reparentDisconnectables.call(part, containerPart);
            // Note that although `_$reparentDisconnectables` updates the part's
            // `_$parent` reference after unlinking from its current parent, that
            // method only exists if Disconnectables are present, so we need to
            // unconditionally set it here
            part._$parent = containerPart;
            // Since the _$isConnected getter is somewhat costly, only
            // read it once we know the subtree has directives that need
            // to be notified
            let newConnectionState;
            if (part._$notifyConnectionChanged !== undefined && (newConnectionState = containerPart._$isConnected) !== oldParent._$isConnected) {
                part._$notifyConnectionChanged(newConnectionState);
            }
        }
        if (endNode !== refNode || parentChanged) {
            let start = part._$startNode;
            while(start !== endNode){
                const n = wrap(start).nextSibling;
                wrap(container).insertBefore(start, refNode);
                start = n;
            }
        }
    }
    return part;
};
/**
 * Sets the value of a Part.
 *
 * Note that this should only be used to set/update the value of user-created
 * parts (i.e. those created using `insertPart`); it should not be used
 * by directives to set the value of the directive's container part. Directives
 * should return a value from `update`/`render` to update their part state.
 *
 * For directives that require setting their part value asynchronously, they
 * should extend `AsyncDirective` and call `this.setValue()`.
 *
 * @param part Part to set
 * @param value Value to set
 * @param index For `AttributePart`s, the index to set
 * @param directiveParent Used internally; should not be set by user
 */ const setChildPartValue = (part, value, directiveParent = part)=>{
    part._$setValue(value, directiveParent);
    return part;
};
// A sentinel value that can never appear as a part value except when set by
// live(). Used to force a dirty-check to fail and cause a re-render.
const RESET_VALUE = {};
/**
 * Sets the committed value of a ChildPart directly without triggering the
 * commit stage of the part.
 *
 * This is useful in cases where a directive needs to update the part such
 * that the next update detects a value change or not. When value is omitted,
 * the next update will be guaranteed to be detected as a change.
 *
 * @param part
 * @param value
 */ const setCommittedValue = (part, value = RESET_VALUE)=>part._$committedValue = value;
/**
 * Returns the committed value of a ChildPart.
 *
 * The committed value is used for change detection and efficient updates of
 * the part. It can differ from the value set by the template or directive in
 * cases where the template value is transformed before being committed.
 *
 * - `TemplateResult`s are committed as a `TemplateInstance`
 * - Iterables are committed as `Array<ChildPart>`
 * - All other types are committed as the template value or value returned or
 *   set by a directive.
 *
 * @param part
 */ const getCommittedValue = (part)=>part._$committedValue;
/**
 * Removes a ChildPart from the DOM, including any of its content.
 *
 * @param part The Part to remove
 */ const removePart = (part)=>{
    var _part__$notifyConnectionChanged;
    (_part__$notifyConnectionChanged = part._$notifyConnectionChanged) === null || _part__$notifyConnectionChanged === void 0 ? void 0 : _part__$notifyConnectionChanged.call(part, false, true);
    let start = part._$startNode;
    const end = wrap(part._$endNode).nextSibling;
    while(start !== end){
        const n = wrap(start).nextSibling;
        wrap(start).remove();
        start = n;
    }
};
const clearPart = (part)=>{
    part._$clear();
}; //# sourceMappingURL=directive-helpers.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/directive.js":
/*!********************************************************!*\
  !*** ./node_modules/lit-html/development/directive.js ***!
  \********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Directive: () => (/* binding */ Directive),
/* harmony export */   PartType: () => (/* binding */ PartType),
/* harmony export */   directive: () => (/* binding */ directive)
/* harmony export */ });
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ const PartType = {
    ATTRIBUTE: 1,
    CHILD: 2,
    PROPERTY: 3,
    BOOLEAN_ATTRIBUTE: 4,
    EVENT: 5,
    ELEMENT: 6
};
/**
 * Creates a user-facing directive function from a Directive class. This
 * function has the same parameters as the directive's render() method.
 */ const directive = (c)=>(...values)=>({
            // This property needs to remain unminified.
            ['_$litDirective$']: c,
            values
        });
/**
 * Base class for creating custom directives. Users should extend this class,
 * implement `render` and/or `update`, and then pass their subclass to
 * `directive`.
 */ class Directive {
    // See comment in Disconnectable interface for why this is a getter
    get _$isConnected() {
        return this._$parent._$isConnected;
    }
    /** @internal */ _$initialize(part, parent, attributeIndex) {
        this.__part = part;
        this._$parent = parent;
        this.__attributeIndex = attributeIndex;
    }
    /** @internal */ _$resolve(part, props) {
        return this.update(part, props);
    }
    update(_part, props) {
        return this.render(...props);
    }
    constructor(_partInfo){}
} //# sourceMappingURL=directive.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/directives/private-async-helpers.js":
/*!*******************************************************************************!*\
  !*** ./node_modules/lit-html/development/directives/private-async-helpers.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Pauser: () => (/* binding */ Pauser),
/* harmony export */   PseudoWeakRef: () => (/* binding */ PseudoWeakRef),
/* harmony export */   forAwaitOf: () => (/* binding */ forAwaitOf)
/* harmony export */ });
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ // Note, this module is not included in package exports so that it's private to
// our first-party directives. If it ends up being useful, we can open it up and
// export it.
/**
 * Helper to iterate an AsyncIterable in its own closure.
 * @param iterable The iterable to iterate
 * @param callback The callback to call for each value. If the callback returns
 * `false`, the loop will be broken.
 */ function _async_iterator(iterable) {
    var method, async, sync, retry = 2;
    for("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;){
        if (async && null != (method = iterable[async])) return method.call(iterable);
        if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
        async = "@@asyncIterator", sync = "@@iterator";
    }
    throw new TypeError("Object is not async iterable");
}
function AsyncFromSyncIterator(s) {
    function AsyncFromSyncIteratorContinuation(r) {
        if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
        var done = r.done;
        return Promise.resolve(r.value).then(function(value) {
            return {
                value: value,
                done: done
            };
        });
    }
    return AsyncFromSyncIterator = function(s) {
        this.s = s, this.n = s.next;
    }, AsyncFromSyncIterator.prototype = {
        s: null,
        n: null,
        next: function() {
            return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
        },
        return: function(value) {
            var ret = this.s.return;
            return void 0 === ret ? Promise.resolve({
                value: value,
                done: !0
            }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
        },
        throw: function(value) {
            var thr = this.s.return;
            return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
        }
    }, new AsyncFromSyncIterator(s);
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
const forAwaitOf = (iterable, callback)=>_async_to_generator(function*() {
        {
            var _iteratorAbruptCompletion = false, _didIteratorError = false, _iteratorError;
            try {
                for(var _iterator = _async_iterator(iterable), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false){
                    let _value = _step.value;
                    const v = _value;
                    if ((yield callback(v)) === false) {
                        return;
                    }
                }
            } catch (err) {
                _didIteratorError = true;
                _iteratorError = err;
            } finally{
                try {
                    if (_iteratorAbruptCompletion && _iterator.return != null) {
                        yield _iterator.return();
                    }
                } finally{
                    if (_didIteratorError) {
                        throw _iteratorError;
                    }
                }
            }
        }
    })();
/**
 * Holds a reference to an instance that can be disconnected and reconnected,
 * so that a closure over the ref (e.g. in a then function to a promise) does
 * not strongly hold a ref to the instance. Approximates a WeakRef but must
 * be manually connected & disconnected to the backing instance.
 */ class PseudoWeakRef {
    /**
     * Disassociates the ref with the backing instance.
     */ disconnect() {
        this._ref = undefined;
    }
    /**
     * Reassociates the ref with the backing instance.
     */ reconnect(ref) {
        this._ref = ref;
    }
    /**
     * Retrieves the backing instance (will be undefined when disconnected)
     */ deref() {
        return this._ref;
    }
    constructor(ref){
        this._ref = ref;
    }
}
/**
 * A helper to pause and resume waiting on a condition in an async function
 */ class Pauser {
    /**
     * When paused, returns a promise to be awaited; when unpaused, returns
     * undefined. Note that in the microtask between the pauser being resumed
     * an await of this promise resolving, the pauser could be paused again,
     * hence callers should check the promise in a loop when awaiting.
     * @returns A promise to be awaited when paused or undefined
     */ get() {
        return this._promise;
    }
    /**
     * Creates a promise to be awaited
     */ pause() {
        var _this__promise;
        (_this__promise = this._promise) !== null && _this__promise !== void 0 ? _this__promise : this._promise = new Promise((resolve)=>this._resolve = resolve);
    }
    /**
     * Resolves the promise which may be awaited
     */ resume() {
        var _this__resolve, _this;
        (_this__resolve = (_this = this)._resolve) === null || _this__resolve === void 0 ? void 0 : _this__resolve.call(_this);
        this._promise = this._resolve = undefined;
    }
    constructor(){
        this._promise = undefined;
        this._resolve = undefined;
    }
} //# sourceMappingURL=private-async-helpers.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/directives/repeat.js":
/*!****************************************************************!*\
  !*** ./node_modules/lit-html/development/directives/repeat.js ***!
  \****************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   repeat: () => (/* binding */ repeat)
/* harmony export */ });
/* harmony import */ var _lit_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lit-html.js */ "./node_modules/lit-html/development/lit-html.js");
/* harmony import */ var _directive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../directive.js */ "./node_modules/lit-html/development/directive.js");
/* harmony import */ var _directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../directive-helpers.js */ "./node_modules/lit-html/development/directive-helpers.js");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ 


// Helper for generating a map of array item to its index over a subset
// of an array (used to lazily generate `newKeyToIndexMap` and
// `oldKeyToIndexMap`)
const generateMap = (list, start, end)=>{
    const map = new Map();
    for(let i = start; i <= end; i++){
        map.set(list[i], i);
    }
    return map;
};
class RepeatDirective extends _directive_js__WEBPACK_IMPORTED_MODULE_1__.Directive {
    _getValuesAndKeys(items, keyFnOrTemplate, template) {
        let keyFn;
        if (template === undefined) {
            template = keyFnOrTemplate;
        } else if (keyFnOrTemplate !== undefined) {
            keyFn = keyFnOrTemplate;
        }
        const keys = [];
        const values = [];
        let index = 0;
        for (const item of items){
            keys[index] = keyFn ? keyFn(item, index) : index;
            values[index] = template(item, index);
            index++;
        }
        return {
            values,
            keys
        };
    }
    render(items, keyFnOrTemplate, template) {
        return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;
    }
    update(containerPart, [items, keyFnOrTemplate, template]) {
        // Old part & key lists are retrieved from the last update (which may
        // be primed by hydration)
        const oldParts = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.getCommittedValue)(containerPart);
        const { values: newValues, keys: newKeys } = this._getValuesAndKeys(items, keyFnOrTemplate, template);
        // We check that oldParts, the committed value, is an Array as an
        // indicator that the previous value came from a repeat() call. If
        // oldParts is not an Array then this is the first render and we return
        // an array for lit-html's array handling to render, and remember the
        // keys.
        if (!Array.isArray(oldParts)) {
            this._itemKeys = newKeys;
            return newValues;
        }
        var _this__itemKeys;
        // In SSR hydration it's possible for oldParts to be an array but for us
        // to not have item keys because the update() hasn't run yet. We set the
        // keys to an empty array. This will cause all oldKey/newKey comparisons
        // to fail and execution to fall to the last nested brach below which
        // reuses the oldPart.
        const oldKeys = (_this__itemKeys = this._itemKeys) !== null && _this__itemKeys !== void 0 ? _this__itemKeys : this._itemKeys = [];
        // New part list will be built up as we go (either reused from
        // old parts or created for new keys in this update). This is
        // saved in the above cache at the end of the update.
        const newParts = [];
        // Maps from key to index for current and previous update; these
        // are generated lazily only when needed as a performance
        // optimization, since they are only required for multiple
        // non-contiguous changes in the list, which are less common.
        let newKeyToIndexMap;
        let oldKeyToIndexMap;
        // Head and tail pointers to old parts and new values
        let oldHead = 0;
        let oldTail = oldParts.length - 1;
        let newHead = 0;
        let newTail = newValues.length - 1;
        // Overview of O(n) reconciliation algorithm (general approach
        // based on ideas found in ivi, vue, snabbdom, etc.):
        //
        // * We start with the list of old parts and new values (and
        //   arrays of their respective keys), head/tail pointers into
        //   each, and we build up the new list of parts by updating
        //   (and when needed, moving) old parts or creating new ones.
        //   The initial scenario might look like this (for brevity of
        //   the diagrams, the numbers in the array reflect keys
        //   associated with the old parts or new values, although keys
        //   and parts/values are actually stored in parallel arrays
        //   indexed using the same head/tail pointers):
        //
        //      oldHead v                 v oldTail
        //   oldKeys:  [0, 1, 2, 3, 4, 5, 6]
        //   newParts: [ ,  ,  ,  ,  ,  ,  ]
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new
        //                                      item order
        //      newHead ^                 ^ newTail
        //
        // * Iterate old & new lists from both sides, updating,
        //   swapping, or removing parts at the head/tail locations
        //   until neither head nor tail can move.
        //
        // * Example below: keys at head pointers match, so update old
        //   part 0 in-place (no need to move it) and record part 0 in
        //   the `newParts` list. The last thing we do is advance the
        //   `oldHead` and `newHead` pointers (will be reflected in the
        //   next diagram).
        //
        //      oldHead v                 v oldTail
        //   oldKeys:  [0, 1, 2, 3, 4, 5, 6]
        //   newParts: [0,  ,  ,  ,  ,  ,  ] <- heads matched: update 0
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]    and advance both oldHead
        //                                      & newHead
        //      newHead ^                 ^ newTail
        //
        // * Example below: head pointers don't match, but tail
        //   pointers do, so update part 6 in place (no need to move
        //   it), and record part 6 in the `newParts` list. Last,
        //   advance the `oldTail` and `oldHead` pointers.
        //
        //         oldHead v              v oldTail
        //   oldKeys:  [0, 1, 2, 3, 4, 5, 6]
        //   newParts: [0,  ,  ,  ,  ,  , 6] <- tails matched: update 6
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]    and advance both oldTail
        //                                      & newTail
        //         newHead ^              ^ newTail
        //
        // * If neither head nor tail match; next check if one of the
        //   old head/tail items was removed. We first need to generate
        //   the reverse map of new keys to index (`newKeyToIndexMap`),
        //   which is done once lazily as a performance optimization,
        //   since we only hit this case if multiple non-contiguous
        //   changes were made. Note that for contiguous removal
        //   anywhere in the list, the head and tails would advance
        //   from either end and pass each other before we get to this
        //   case and removals would be handled in the final while loop
        //   without needing to generate the map.
        //
        // * Example below: The key at `oldTail` was removed (no longer
        //   in the `newKeyToIndexMap`), so remove that part from the
        //   DOM and advance just the `oldTail` pointer.
        //
        //         oldHead v           v oldTail
        //   oldKeys:  [0, 1, 2, 3, 4, 5, 6]
        //   newParts: [0,  ,  ,  ,  ,  , 6] <- 5 not in new map: remove
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]    5 and advance oldTail
        //         newHead ^           ^ newTail
        //
        // * Once head and tail cannot move, any mismatches are due to
        //   either new or moved items; if a new key is in the previous
        //   "old key to old index" map, move the old part to the new
        //   location, otherwise create and insert a new part. Note
        //   that when moving an old part we null its position in the
        //   oldParts array if it lies between the head and tail so we
        //   know to skip it when the pointers get there.
        //
        // * Example below: neither head nor tail match, and neither
        //   were removed; so find the `newHead` key in the
        //   `oldKeyToIndexMap`, and move that old part's DOM into the
        //   next head position (before `oldParts[oldHead]`). Last,
        //   null the part in the `oldPart` array since it was
        //   somewhere in the remaining oldParts still to be scanned
        //   (between the head and tail pointers) so that we know to
        //   skip that old part on future iterations.
        //
        //         oldHead v        v oldTail
        //   oldKeys:  [0, 1, -, 3, 4, 5, 6]
        //   newParts: [0, 2,  ,  ,  ,  , 6] <- stuck: update & move 2
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]    into place and advance
        //                                      newHead
        //         newHead ^           ^ newTail
        //
        // * Note that for moves/insertions like the one above, a part
        //   inserted at the head pointer is inserted before the
        //   current `oldParts[oldHead]`, and a part inserted at the
        //   tail pointer is inserted before `newParts[newTail+1]`. The
        //   seeming asymmetry lies in the fact that new parts are
        //   moved into place outside in, so to the right of the head
        //   pointer are old parts, and to the right of the tail
        //   pointer are new parts.
        //
        // * We always restart back from the top of the algorithm,
        //   allowing matching and simple updates in place to
        //   continue...
        //
        // * Example below: the head pointers once again match, so
        //   simply update part 1 and record it in the `newParts`
        //   array.  Last, advance both head pointers.
        //
        //         oldHead v        v oldTail
        //   oldKeys:  [0, 1, -, 3, 4, 5, 6]
        //   newParts: [0, 2, 1,  ,  ,  , 6] <- heads matched: update 1
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]    and advance both oldHead
        //                                      & newHead
        //            newHead ^        ^ newTail
        //
        // * As mentioned above, items that were moved as a result of
        //   being stuck (the final else clause in the code below) are
        //   marked with null, so we always advance old pointers over
        //   these so we're comparing the next actual old value on
        //   either end.
        //
        // * Example below: `oldHead` is null (already placed in
        //   newParts), so advance `oldHead`.
        //
        //            oldHead v     v oldTail
        //   oldKeys:  [0, 1, -, 3, 4, 5, 6] <- old head already used:
        //   newParts: [0, 2, 1,  ,  ,  , 6]    advance oldHead
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]
        //               newHead ^     ^ newTail
        //
        // * Note it's not critical to mark old parts as null when they
        //   are moved from head to tail or tail to head, since they
        //   will be outside the pointer range and never visited again.
        //
        // * Example below: Here the old tail key matches the new head
        //   key, so the part at the `oldTail` position and move its
        //   DOM to the new head position (before `oldParts[oldHead]`).
        //   Last, advance `oldTail` and `newHead` pointers.
        //
        //               oldHead v  v oldTail
        //   oldKeys:  [0, 1, -, 3, 4, 5, 6]
        //   newParts: [0, 2, 1, 4,  ,  , 6] <- old tail matches new
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]   head: update & move 4,
        //                                     advance oldTail & newHead
        //               newHead ^     ^ newTail
        //
        // * Example below: Old and new head keys match, so update the
        //   old head part in place, and advance the `oldHead` and
        //   `newHead` pointers.
        //
        //               oldHead v oldTail
        //   oldKeys:  [0, 1, -, 3, 4, 5, 6]
        //   newParts: [0, 2, 1, 4, 3,   ,6] <- heads match: update 3
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]    and advance oldHead &
        //                                      newHead
        //                  newHead ^  ^ newTail
        //
        // * Once the new or old pointers move past each other then all
        //   we have left is additions (if old list exhausted) or
        //   removals (if new list exhausted). Those are handled in the
        //   final while loops at the end.
        //
        // * Example below: `oldHead` exceeded `oldTail`, so we're done
        //   with the main loop.  Create the remaining part and insert
        //   it at the new head position, and the update is complete.
        //
        //                   (oldHead > oldTail)
        //   oldKeys:  [0, 1, -, 3, 4, 5, 6]
        //   newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7
        //   newKeys:  [0, 2, 1, 4, 3, 7, 6]
        //                     newHead ^ newTail
        //
        // * Note that the order of the if/else clauses is not
        //   important to the algorithm, as long as the null checks
        //   come first (to ensure we're always working on valid old
        //   parts) and that the final else clause comes last (since
        //   that's where the expensive moves occur). The order of
        //   remaining clauses is just a simple guess at which cases
        //   will be most common.
        //
        // * Note, we could calculate the longest
        //   increasing subsequence (LIS) of old items in new position,
        //   and only move those not in the LIS set. However that costs
        //   O(nlogn) time and adds a bit more code, and only helps
        //   make rare types of mutations require fewer moves. The
        //   above handles removes, adds, reversal, swaps, and single
        //   moves of contiguous items in linear time, in the minimum
        //   number of moves. As the number of multiple moves where LIS
        //   might help approaches a random shuffle, the LIS
        //   optimization becomes less helpful, so it seems not worth
        //   the code at this point. Could reconsider if a compelling
        //   case arises.
        while(oldHead <= oldTail && newHead <= newTail){
            if (oldParts[oldHead] === null) {
                // `null` means old part at head has already been used
                // below; skip
                oldHead++;
            } else if (oldParts[oldTail] === null) {
                // `null` means old part at tail has already been used
                // below; skip
                oldTail--;
            } else if (oldKeys[oldHead] === newKeys[newHead]) {
                // Old head matches new head; update in place
                newParts[newHead] = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(oldParts[oldHead], newValues[newHead]);
                oldHead++;
                newHead++;
            } else if (oldKeys[oldTail] === newKeys[newTail]) {
                // Old tail matches new tail; update in place
                newParts[newTail] = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(oldParts[oldTail], newValues[newTail]);
                oldTail--;
                newTail--;
            } else if (oldKeys[oldHead] === newKeys[newTail]) {
                // Old head matches new tail; update and move to new tail
                newParts[newTail] = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(oldParts[oldHead], newValues[newTail]);
                (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.insertPart)(containerPart, newParts[newTail + 1], oldParts[oldHead]);
                oldHead++;
                newTail--;
            } else if (oldKeys[oldTail] === newKeys[newHead]) {
                // Old tail matches new head; update and move to new head
                newParts[newHead] = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(oldParts[oldTail], newValues[newHead]);
                (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.insertPart)(containerPart, oldParts[oldHead], oldParts[oldTail]);
                oldTail--;
                newHead++;
            } else {
                if (newKeyToIndexMap === undefined) {
                    // Lazily generate key-to-index maps, used for removals &
                    // moves below
                    newKeyToIndexMap = generateMap(newKeys, newHead, newTail);
                    oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);
                }
                if (!newKeyToIndexMap.has(oldKeys[oldHead])) {
                    // Old head is no longer in new list; remove
                    (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.removePart)(oldParts[oldHead]);
                    oldHead++;
                } else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {
                    // Old tail is no longer in new list; remove
                    (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.removePart)(oldParts[oldTail]);
                    oldTail--;
                } else {
                    // Any mismatches at this point are due to additions or
                    // moves; see if we have an old part we can reuse and move
                    // into place
                    const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);
                    const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;
                    if (oldPart === null) {
                        // No old part for this value; create a new one and
                        // insert it
                        const newPart = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.insertPart)(containerPart, oldParts[oldHead]);
                        (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(newPart, newValues[newHead]);
                        newParts[newHead] = newPart;
                    } else {
                        // Reuse old part
                        newParts[newHead] = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(oldPart, newValues[newHead]);
                        (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.insertPart)(containerPart, oldParts[oldHead], oldPart);
                        // This marks the old part as having been used, so that
                        // it will be skipped in the first two checks above
                        oldParts[oldIndex] = null;
                    }
                    newHead++;
                }
            }
        }
        // Add parts for any remaining new values
        while(newHead <= newTail){
            // For all remaining additions, we insert before last new
            // tail, since old pointers are no longer valid
            const newPart = (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.insertPart)(containerPart, newParts[newTail + 1]);
            (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setChildPartValue)(newPart, newValues[newHead]);
            newParts[newHead++] = newPart;
        }
        // Remove any remaining unused old parts
        while(oldHead <= oldTail){
            const oldPart = oldParts[oldHead++];
            if (oldPart !== null) {
                (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.removePart)(oldPart);
            }
        }
        // Save order of new parts for next round
        this._itemKeys = newKeys;
        // Directly set part value, bypassing it's dirty-checking
        (0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_2__.setCommittedValue)(containerPart, newParts);
        return _lit_html_js__WEBPACK_IMPORTED_MODULE_0__.noChange;
    }
    constructor(partInfo){
        super(partInfo);
        if (partInfo.type !== _directive_js__WEBPACK_IMPORTED_MODULE_1__.PartType.CHILD) {
            throw new Error('repeat() can only be used in text expressions');
        }
    }
}
/**
 * A directive that repeats a series of values (usually `TemplateResults`)
 * generated from an iterable, and updates those items efficiently when the
 * iterable changes based on user-provided `keys` associated with each item.
 *
 * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,
 * meaning previous DOM for a given key is moved into the new position if
 * needed, and DOM will never be reused with values for different keys (new DOM
 * will always be created for new keys). This is generally the most efficient
 * way to use `repeat` since it performs minimum unnecessary work for insertions
 * and removals.
 *
 * The `keyFn` takes two parameters, the item and its index, and returns a unique key value.
 *
 * ```js
 * html`
 *   <ol>
 *     ${repeat(this.items, (item) => item.id, (item, index) => {
 *       return html`<li>${index}: ${item.name}</li>`;
 *     })}
 *   </ol>
 * `
 * ```
 *
 * **Important**: If providing a `keyFn`, keys *must* be unique for all items in a
 * given call to `repeat`. The behavior when two or more items have the same key
 * is undefined.
 *
 * If no `keyFn` is provided, this directive will perform similar to mapping
 * items to values, and DOM will be reused against potentially different items.
 */ const repeat = (0,_directive_js__WEBPACK_IMPORTED_MODULE_1__.directive)(RepeatDirective); //# sourceMappingURL=repeat.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/directives/unsafe-html.js":
/*!*********************************************************************!*\
  !*** ./node_modules/lit-html/development/directives/unsafe-html.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   UnsafeHTMLDirective: () => (/* binding */ UnsafeHTMLDirective),
/* harmony export */   unsafeHTML: () => (/* binding */ unsafeHTML)
/* harmony export */ });
/* harmony import */ var _lit_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lit-html.js */ "./node_modules/lit-html/development/lit-html.js");
/* harmony import */ var _directive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../directive.js */ "./node_modules/lit-html/development/directive.js");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ 

const HTML_RESULT = 1;
class UnsafeHTMLDirective extends _directive_js__WEBPACK_IMPORTED_MODULE_1__.Directive {
    render(value) {
        if (value === _lit_html_js__WEBPACK_IMPORTED_MODULE_0__.nothing || value == null) {
            this._templateResult = undefined;
            return this._value = value;
        }
        if (value === _lit_html_js__WEBPACK_IMPORTED_MODULE_0__.noChange) {
            return value;
        }
        if (typeof value != 'string') {
            throw new Error(`${this.constructor.directiveName}() called with a non-string value`);
        }
        if (value === this._value) {
            return this._templateResult;
        }
        this._value = value;
        const strings = [
            value
        ];
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        strings.raw = strings;
        // WARNING: impersonating a TemplateResult like this is extremely
        // dangerous. Third-party directives should not do this.
        return this._templateResult = {
            // Cast to a known set of integers that satisfy ResultType so that we
            // don't have to export ResultType and possibly encourage this pattern.
            // This property needs to remain unminified.
            ['_$litType$']: this.constructor.resultType,
            strings,
            values: []
        };
    }
    constructor(partInfo){
        super(partInfo);
        this._value = _lit_html_js__WEBPACK_IMPORTED_MODULE_0__.nothing;
        if (partInfo.type !== _directive_js__WEBPACK_IMPORTED_MODULE_1__.PartType.CHILD) {
            throw new Error(`${this.constructor.directiveName}() can only be used in child bindings`);
        }
    }
}
UnsafeHTMLDirective.directiveName = 'unsafeHTML';
UnsafeHTMLDirective.resultType = HTML_RESULT;
/**
 * Renders the result as HTML, rather than text.
 *
 * The values `undefined`, `null`, and `nothing`, will all result in no content
 * (empty string) being rendered.
 *
 * Note, this is unsafe to use with any user-provided input that hasn't been
 * sanitized or escaped, as it may lead to cross-site-scripting
 * vulnerabilities.
 */ const unsafeHTML = (0,_directive_js__WEBPACK_IMPORTED_MODULE_1__.directive)(UnsafeHTMLDirective); //# sourceMappingURL=unsafe-html.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/directives/until.js":
/*!***************************************************************!*\
  !*** ./node_modules/lit-html/development/directives/until.js ***!
  \***************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   UntilDirective: () => (/* binding */ UntilDirective),
/* harmony export */   until: () => (/* binding */ until)
/* harmony export */ });
/* harmony import */ var _lit_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lit-html.js */ "./node_modules/lit-html/development/lit-html.js");
/* harmony import */ var _directive_helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../directive-helpers.js */ "./node_modules/lit-html/development/directive-helpers.js");
/* harmony import */ var _async_directive_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../async-directive.js */ "./node_modules/lit-html/development/async-directive.js");
/* harmony import */ var _private_async_helpers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./private-async-helpers.js */ "./node_modules/lit-html/development/directives/private-async-helpers.js");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




const isPromise = (x)=>{
    return !(0,_directive_helpers_js__WEBPACK_IMPORTED_MODULE_1__.isPrimitive)(x) && typeof x.then === 'function';
};
// Effectively infinity, but a SMI.
const _infinity = 0x3fffffff;
class UntilDirective extends _async_directive_js__WEBPACK_IMPORTED_MODULE_2__.AsyncDirective {
    render(...args) {
        var _args_find;
        return (_args_find = args.find((x)=>!isPromise(x))) !== null && _args_find !== void 0 ? _args_find : _lit_html_js__WEBPACK_IMPORTED_MODULE_0__.noChange;
    }
    update(_part, args) {
        const previousValues = this.__values;
        let previousLength = previousValues.length;
        this.__values = args;
        const weakThis = this.__weakThis;
        const pauser = this.__pauser;
        // If our initial render occurs while disconnected, ensure that the pauser
        // and weakThis are in the disconnected state
        if (!this.isConnected) {
            this.disconnected();
        }
        for(let i = 0; i < args.length; i++){
            // If we've rendered a higher-priority value already, stop.
            if (i > this.__lastRenderedIndex) {
                break;
            }
            const value = args[i];
            // Render non-Promise values immediately
            if (!isPromise(value)) {
                this.__lastRenderedIndex = i;
                // Since a lower-priority value will never overwrite a higher-priority
                // synchronous value, we can stop processing now.
                return value;
            }
            // If this is a Promise we've already handled, skip it.
            if (i < previousLength && value === previousValues[i]) {
                continue;
            }
            // We have a Promise that we haven't seen before, so priorities may have
            // changed. Forget what we rendered before.
            this.__lastRenderedIndex = _infinity;
            previousLength = 0;
            // Note, the callback avoids closing over `this` so that the directive
            // can be gc'ed before the promise resolves; instead `this` is retrieved
            // from `weakThis`, which can break the hard reference in the closure when
            // the directive disconnects
            Promise.resolve(value).then((result)=>_async_to_generator(function*() {
                    // If we're disconnected, wait until we're (maybe) reconnected
                    // The while loop here handles the case that the connection state
                    // thrashes, causing the pauser to resume and then get re-paused
                    while(pauser.get()){
                        yield pauser.get();
                    }
                    // If the callback gets here and there is no `this`, it means that the
                    // directive has been disconnected and garbage collected and we don't
                    // need to do anything else
                    const _this = weakThis.deref();
                    if (_this !== undefined) {
                        const index = _this.__values.indexOf(value);
                        // If state.values doesn't contain the value, we've re-rendered without
                        // the value, so don't render it. Then, only render if the value is
                        // higher-priority than what's already been rendered.
                        if (index > -1 && index < _this.__lastRenderedIndex) {
                            _this.__lastRenderedIndex = index;
                            _this.setValue(result);
                        }
                    }
                })());
        }
        return _lit_html_js__WEBPACK_IMPORTED_MODULE_0__.noChange;
    }
    disconnected() {
        this.__weakThis.disconnect();
        this.__pauser.pause();
    }
    reconnected() {
        this.__weakThis.reconnect(this);
        this.__pauser.resume();
    }
    constructor(){
        super(...arguments);
        this.__lastRenderedIndex = _infinity;
        this.__values = [];
        this.__weakThis = new _private_async_helpers_js__WEBPACK_IMPORTED_MODULE_3__.PseudoWeakRef(this);
        this.__pauser = new _private_async_helpers_js__WEBPACK_IMPORTED_MODULE_3__.Pauser();
    }
}
/**
 * Renders one of a series of values, including Promises, to a Part.
 *
 * Values are rendered in priority order, with the first argument having the
 * highest priority and the last argument having the lowest priority. If a
 * value is a Promise, low-priority values will be rendered until it resolves.
 *
 * The priority of values can be used to create placeholder content for async
 * data. For example, a Promise with pending content can be the first,
 * highest-priority, argument, and a non_promise loading indicator template can
 * be used as the second, lower-priority, argument. The loading indicator will
 * render immediately, and the primary content will render when the Promise
 * resolves.
 *
 * Example:
 *
 * ```js
 * const content = fetch('./content.txt').then(r => r.text());
 * html`${until(content, html`<span>Loading...</span>`)}`
 * ```
 */ const until = (0,_async_directive_js__WEBPACK_IMPORTED_MODULE_2__.directive)(UntilDirective); /**
 * The type of the class that powers this directive. Necessary for naming the
 * directive's return type.
 */  // export type {UntilDirective};
 //# sourceMappingURL=until.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/is-server.js":
/*!********************************************************!*\
  !*** ./node_modules/lit-html/development/is-server.js ***!
  \********************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isServer: () => (/* binding */ isServer)
/* harmony export */ });
/**
 * @license
 * Copyright 2022 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ /**
 * @fileoverview
 *
 * This file exports a boolean const whose value will depend on what environment
 * the module is being imported from.
 */ const NODE_MODE = false;
/**
 * A boolean that will be `true` in server environments like Node, and `false`
 * in browser environments. Note that your server environment or toolchain must
 * support the `"node"` export condition for this to be `true`.
 *
 * This can be used when authoring components to change behavior based on
 * whether or not the component is executing in an SSR context.
 */ const isServer = NODE_MODE; //# sourceMappingURL=is-server.js.map


/***/ }),

/***/ "./node_modules/lit-html/development/lit-html.js":
/*!*******************************************************!*\
  !*** ./node_modules/lit-html/development/lit-html.js ***!
  \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _$LH: () => (/* binding */ _$LH),
/* harmony export */   html: () => (/* binding */ html),
/* harmony export */   mathml: () => (/* binding */ mathml),
/* harmony export */   noChange: () => (/* binding */ noChange),
/* harmony export */   nothing: () => (/* binding */ nothing),
/* harmony export */   render: () => (/* binding */ render),
/* harmony export */   svg: () => (/* binding */ svg)
/* harmony export */ });
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */ var _global_ShadyDOM, _global_ShadyDOM1;
var // IMPORTANT: do not change the property name or the assignment expression.
// This line will be used in regexes to search for lit-html usage.
_global;
const DEV_MODE = true;
const ENABLE_EXTRA_SECURITY_HOOKS = true;
const ENABLE_SHADYDOM_NOPATCH = true;
const NODE_MODE = false;
// Allows minifiers to rename references to globalThis
const global = globalThis;
/**
 * Useful for visualizing and logging insights into what the Lit template system is doing.
 *
 * Compiled out of prod mode builds.
 */ const debugLogEvent = DEV_MODE ? (event)=>{
    const shouldEmit = global.emitLitDebugLogEvents;
    if (!shouldEmit) {
        return;
    }
    global.dispatchEvent(new CustomEvent('lit-debug', {
        detail: event
    }));
} : undefined;
// Used for connecting beginRender and endRender events when there are nested
// renders when errors are thrown preventing an endRender event from being
// called.
let debugLogRenderId = 0;
let issueWarning;
if (DEV_MODE) {
    var _global1;
    var _litIssuedWarnings;
    (_litIssuedWarnings = (_global1 = global).litIssuedWarnings) !== null && _litIssuedWarnings !== void 0 ? _litIssuedWarnings : _global1.litIssuedWarnings = new Set();
    /**
     * Issue a warning if we haven't already, based either on `code` or `warning`.
     * Warnings are disabled automatically only by `warning`; disabling via `code`
     * can be done by users.
     */ issueWarning = (code, warning)=>{
        warning += code ? ` See https://lit.dev/msg/${code} for more information.` : '';
        if (!global.litIssuedWarnings.has(warning) && !global.litIssuedWarnings.has(code)) {
            console.warn(warning);
            global.litIssuedWarnings.add(warning);
        }
    };
    queueMicrotask(()=>{
        issueWarning('dev-mode', `Lit is in dev mode. Not recommended for production!`);
    });
}
const wrap = ENABLE_SHADYDOM_NOPATCH && ((_global_ShadyDOM = global.ShadyDOM) === null || _global_ShadyDOM === void 0 ? void 0 : _global_ShadyDOM.inUse) && ((_global_ShadyDOM1 = global.ShadyDOM) === null || _global_ShadyDOM1 === void 0 ? void 0 : _global_ShadyDOM1.noPatch) === true ? global.ShadyDOM.wrap : (node)=>node;
const trustedTypes = global.trustedTypes;
/**
 * Our TrustedTypePolicy for HTML which is declared using the html template
 * tag function.
 *
 * That HTML is a developer-authored constant, and is parsed with innerHTML
 * before any untrusted expressions have been mixed in. Therefor it is
 * considered safe by construction.
 */ const policy = trustedTypes ? trustedTypes.createPolicy('lit-html', {
    createHTML: (s)=>s
}) : undefined;
const identityFunction = (value)=>value;
const noopSanitizer = (_node, _name, _type)=>identityFunction;
/** Sets the global sanitizer factory. */ const setSanitizer = (newSanitizer)=>{
    if (!ENABLE_EXTRA_SECURITY_HOOKS) {
        return;
    }
    if (sanitizerFactoryInternal !== noopSanitizer) {
        throw new Error(`Attempted to overwrite existing lit-html security policy.` + ` setSanitizeDOMValueFactory should be called at most once.`);
    }
    sanitizerFactoryInternal = newSanitizer;
};
/**
 * Only used in internal tests, not a part of the public API.
 */ const _testOnlyClearSanitizerFactoryDoNotCallOrElse = ()=>{
    sanitizerFactoryInternal = noopSanitizer;
};
const createSanitizer = (node, name, type)=>{
    return sanitizerFactoryInternal(node, name, type);
};
// Added to an attribute name to mark the attribute as bound so we can find
// it easily.
const boundAttributeSuffix = '$lit$';
// This marker is used in many syntactic positions in HTML, so it must be
// a valid element name and attribute name. We don't support dynamic names (yet)
// but this at least ensures that the parse tree is closer to the template
// intention.
const marker = `lit$${Math.random().toFixed(9).slice(2)}$`;
// String used to tell if a comment is a marker comment
const markerMatch = '?' + marker;
// Text used to insert a comment marker node. We use processing instruction
// syntax because it's slightly smaller, but parses as a comment node.
const nodeMarker = `<${markerMatch}>`;
const d = NODE_MODE && global.document === undefined ? {
    createTreeWalker () {
        return {};
    }
} : document;
// Creates a dynamic marker. We never have to search for these in the DOM.
const createMarker = ()=>d.createComment('');
const isPrimitive = (value)=>value === null || typeof value != 'object' && typeof value != 'function';
const isArray = Array.isArray;
const isIterable = (value)=>isArray(value) || // eslint-disable-next-line @typescript-eslint/no-explicit-any
    typeof (value === null || value === void 0 ? void 0 : value[Symbol.iterator]) === 'function';
const SPACE_CHAR = `[ \t\n\f\r]`;
const ATTR_VALUE_CHAR = `[^ \t\n\f\r"'\`<>=]`;
const NAME_CHAR = `[^\\s"'>=/]`;
// These regexes represent the five parsing states that we care about in the
// Template's HTML scanner. They match the *end* of the state they're named
// after.
// Depending on the match, we transition to a new state. If there's no match,
// we stay in the same state.
// Note that the regexes are stateful. We utilize lastIndex and sync it
// across the multiple regexes used. In addition to the five regexes below
// we also dynamically create a regex to find the matching end tags for raw
// text elements.
/**
 * End of text is: `<` followed by:
 *   (comment start) or (tag) or (dynamic tag binding)
 */ const textEndRegex = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
const COMMENT_START = 1;
const TAG_NAME = 2;
const DYNAMIC_TAG_NAME = 3;
const commentEndRegex = /-->/g;
/**
 * Comments not started with <!--, like </{, can be ended by a single `>`
 */ const comment2EndRegex = />/g;
/**
 * The tagEnd regex matches the end of the "inside an opening" tag syntax
 * position. It either matches a `>`, an attribute-like sequence, or the end
 * of the string after a space (attribute-name position ending).
 *
 * See attributes in the HTML spec:
 * https://www.w3.org/TR/html5/syntax.html#elements-attributes
 *
 * " \t\n\f\r" are HTML space characters:
 * https://infra.spec.whatwg.org/#ascii-whitespace
 *
 * So an attribute is:
 *  * The name: any character except a whitespace character, ("), ('), ">",
 *    "=", or "/". Note: this is different from the HTML spec which also excludes control characters.
 *  * Followed by zero or more space characters
 *  * Followed by "="
 *  * Followed by zero or more space characters
 *  * Followed by:
 *    * Any character except space, ('), ("), "<", ">", "=", (`), or
 *    * (") then any non-("), or
 *    * (') then any non-(')
 */ const tagEndRegex = new RegExp(`>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|("|')|))|$)`, 'g');
const ENTIRE_MATCH = 0;
const ATTRIBUTE_NAME = 1;
const SPACES_AND_EQUALS = 2;
const QUOTE_CHAR = 3;
const singleQuoteAttrEndRegex = /'/g;
const doubleQuoteAttrEndRegex = /"/g;
/**
 * Matches the raw text elements.
 *
 * Comments are not parsed within raw text elements, so we need to search their
 * text content for marker strings.
 */ const rawTextElement = /^(?:script|style|textarea|title)$/i;
/** TemplateResult types */ const HTML_RESULT = 1;
const SVG_RESULT = 2;
const MATHML_RESULT = 3;
// TemplatePart types
// IMPORTANT: these must match the values in PartType
const ATTRIBUTE_PART = 1;
const CHILD_PART = 2;
const PROPERTY_PART = 3;
const BOOLEAN_ATTRIBUTE_PART = 4;
const EVENT_PART = 5;
const ELEMENT_PART = 6;
const COMMENT_PART = 7;
/**
 * Generates a template literal tag function that returns a TemplateResult with
 * the given result type.
 */ const tag = (type)=>(strings, ...values)=>{
        // Warn against templates octal escape sequences
        // We do this here rather than in render so that the warning is closer to the
        // template definition.
        if (DEV_MODE && strings.some((s)=>s === undefined)) {
            console.warn('Some template strings are undefined.\n' + 'This is probably caused by illegal octal escape sequences.');
        }
        if (DEV_MODE) {
            // Import static-html.js results in a circular dependency which g3 doesn't
            // handle. Instead we know that static values must have the field
            // `_$litStatic$`.
            if (values.some((val)=>val === null || val === void 0 ? void 0 : val['_$litStatic$'])) {
                issueWarning('', `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\n` + `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`);
            }
        }
        return {
            // This property needs to remain unminified.
            ['_$litType$']: type,
            strings,
            values
        };
    };
/**
 * Interprets a template literal as an HTML template that can efficiently
 * render to and update a container.
 *
 * ```ts
 * const header = (title: string) => html`<h1>${title}</h1>`;
 * ```
 *
 * The `html` tag returns a description of the DOM to render as a value. It is
 * lazy, meaning no work is done until the template is rendered. When rendering,
 * if a template comes from the same expression as a previously rendered result,
 * it's efficiently updated instead of replaced.
 */ const html = tag(HTML_RESULT);
/**
 * Interprets a template literal as an SVG fragment that can efficiently render
 * to and update a container.
 *
 * ```ts
 * const rect = svg`<rect width="10" height="10"></rect>`;
 *
 * const myImage = html`
 *   <svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
 *     ${rect}
 *   </svg>`;
 * ```
 *
 * The `svg` *tag function* should only be used for SVG fragments, or elements
 * that would be contained **inside** an `<svg>` HTML element. A common error is
 * placing an `<svg>` *element* in a template tagged with the `svg` tag
 * function. The `<svg>` element is an HTML element and should be used within a
 * template tagged with the {@linkcode html} tag function.
 *
 * In LitElement usage, it's invalid to return an SVG fragment from the
 * `render()` method, as the SVG fragment will be contained within the element's
 * shadow root and thus not be properly contained within an `<svg>` HTML
 * element.
 */ const svg = tag(SVG_RESULT);
/**
 * Interprets a template literal as MathML fragment that can efficiently render
 * to and update a container.
 *
 * ```ts
 * const num = mathml`<mn>1</mn>`;
 *
 * const eq = html`
 *   <math>
 *     ${num}
 *   </math>`;
 * ```
 *
 * The `mathml` *tag function* should only be used for MathML fragments, or
 * elements that would be contained **inside** a `<math>` HTML element. A common
 * error is placing a `<math>` *element* in a template tagged with the `mathml`
 * tag function. The `<math>` element is an HTML element and should be used
 * within a template tagged with the {@linkcode html} tag function.
 *
 * In LitElement usage, it's invalid to return an MathML fragment from the
 * `render()` method, as the MathML fragment will be contained within the
 * element's shadow root and thus not be properly contained within a `<math>`
 * HTML element.
 */ const mathml = tag(MATHML_RESULT);
/**
 * A sentinel value that signals that a value was handled by a directive and
 * should not be written to the DOM.
 */ const noChange = Symbol.for('lit-noChange');
/**
 * A sentinel value that signals a ChildPart to fully clear its content.
 *
 * ```ts
 * const button = html`${
 *  user.isAdmin
 *    ? html`<button>DELETE</button>`
 *    : nothing
 * }`;
 * ```
 *
 * Prefer using `nothing` over other falsy values as it provides a consistent
 * behavior between various expression binding contexts.
 *
 * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the
 * same and render no nodes. In attribute expressions, `nothing` _removes_ the
 * attribute, while `undefined` and `null` will render an empty string. In
 * property expressions `nothing` becomes `undefined`.
 */ const nothing = Symbol.for('lit-nothing');
/**
 * The cache of prepared templates, keyed by the tagged TemplateStringsArray
 * and _not_ accounting for the specific template tag used. This means that
 * template tags cannot be dynamic - they must statically be one of html, svg,
 * or attr. This restriction simplifies the cache lookup, which is on the hot
 * path for rendering.
 */ const templateCache = new WeakMap();
const walker = d.createTreeWalker(d, 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */ );
let sanitizerFactoryInternal = noopSanitizer;
function trustFromTemplateString(tsa, stringFromTSA) {
    // A security check to prevent spoofing of Lit template results.
    // In the future, we may be able to replace this with Array.isTemplateObject,
    // though we might need to make that check inside of the html and svg
    // functions, because precompiled templates don't come in as
    // TemplateStringArray objects.
    if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {
        let message = 'invalid template strings array';
        if (DEV_MODE) {
            message = `
          Internal Error: expected template strings to be an array
          with a 'raw' field. Faking a template strings array by
          calling html or svg like an ordinary function is effectively
          the same as calling unsafeHtml and can lead to major security
          issues, e.g. opening your code up to XSS attacks.
          If you're using the html or svg tagged template functions normally
          and still seeing this error, please file a bug at
          https://github.com/lit/lit/issues/new?template=bug_report.md
          and include information about your build tooling, if any.
        `.trim().replace(/\n */g, '\n');
        }
        throw new Error(message);
    }
    return policy !== undefined ? policy.createHTML(stringFromTSA) : stringFromTSA;
}
/**
 * Returns an HTML string for the given TemplateStringsArray and result type
 * (HTML or SVG), along with the case-sensitive bound attribute names in
 * template order. The HTML contains comment markers denoting the `ChildPart`s
 * and suffixes on bound attributes denoting the `AttributeParts`.
 *
 * @param strings template strings array
 * @param type HTML or SVG
 * @return Array containing `[html, attrNames]` (array returned for terseness,
 *     to avoid object fields since this code is shared with non-minified SSR
 *     code)
 */ const getTemplateHtml = (strings, type)=>{
    // Insert makers into the template HTML to represent the position of
    // bindings. The following code scans the template strings to determine the
    // syntactic position of the bindings. They can be in text position, where
    // we insert an HTML comment, attribute value position, where we insert a
    // sentinel string and re-write the attribute name, or inside a tag where
    // we insert the sentinel string.
    const l = strings.length - 1;
    // Stores the case-sensitive bound attribute names in the order of their
    // parts. ElementParts are also reflected in this array as undefined
    // rather than a string, to disambiguate from attribute bindings.
    const attrNames = [];
    let html = type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';
    // When we're inside a raw text tag (not it's text content), the regex
    // will still be tagRegex so we can find attributes, but will switch to
    // this regex when the tag ends.
    let rawTextEndRegex;
    // The current parsing state, represented as a reference to one of the
    // regexes
    let regex = textEndRegex;
    for(let i = 0; i < l; i++){
        const s = strings[i];
        // The index of the end of the last attribute name. When this is
        // positive at end of a string, it means we're in an attribute value
        // position and need to rewrite the attribute name.
        // We also use a special value of -2 to indicate that we encountered
        // the end of a string in attribute name position.
        let attrNameEndIndex = -1;
        let attrName;
        let lastIndex = 0;
        let match;
        // The conditions in this loop handle the current parse state, and the
        // assignments to the `regex` variable are the state transitions.
        while(lastIndex < s.length){
            // Make sure we start searching from where we previously left off
            regex.lastIndex = lastIndex;
            match = regex.exec(s);
            if (match === null) {
                break;
            }
            lastIndex = regex.lastIndex;
            if (regex === textEndRegex) {
                if (match[COMMENT_START] === '!--') {
                    regex = commentEndRegex;
                } else if (match[COMMENT_START] !== undefined) {
                    // We started a weird comment, like </{
                    regex = comment2EndRegex;
                } else if (match[TAG_NAME] !== undefined) {
                    if (rawTextElement.test(match[TAG_NAME])) {
                        // Record if we encounter a raw-text element. We'll switch to
                        // this regex at the end of the tag.
                        rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');
                    }
                    regex = tagEndRegex;
                } else if (match[DYNAMIC_TAG_NAME] !== undefined) {
                    if (DEV_MODE) {
                        throw new Error('Bindings in tag names are not supported. Please use static templates instead. ' + 'See https://lit.dev/docs/templates/expressions/#static-expressions');
                    }
                    regex = tagEndRegex;
                }
            } else if (regex === tagEndRegex) {
                if (match[ENTIRE_MATCH] === '>') {
                    // End of a tag. If we had started a raw-text element, use that
                    // regex
                    regex = rawTextEndRegex !== null && rawTextEndRegex !== void 0 ? rawTextEndRegex : textEndRegex;
                    // We may be ending an unquoted attribute value, so make sure we
                    // clear any pending attrNameEndIndex
                    attrNameEndIndex = -1;
                } else if (match[ATTRIBUTE_NAME] === undefined) {
                    // Attribute name position
                    attrNameEndIndex = -2;
                } else {
                    attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;
                    attrName = match[ATTRIBUTE_NAME];
                    regex = match[QUOTE_CHAR] === undefined ? tagEndRegex : match[QUOTE_CHAR] === '"' ? doubleQuoteAttrEndRegex : singleQuoteAttrEndRegex;
                }
            } else if (regex === doubleQuoteAttrEndRegex || regex === singleQuoteAttrEndRegex) {
                regex = tagEndRegex;
            } else if (regex === commentEndRegex || regex === comment2EndRegex) {
                regex = textEndRegex;
            } else {
                // Not one of the five state regexes, so it must be the dynamically
                // created raw text regex and we're at the close of that element.
                regex = tagEndRegex;
                rawTextEndRegex = undefined;
            }
        }
        if (DEV_MODE) {
            // If we have a attrNameEndIndex, which indicates that we should
            // rewrite the attribute name, assert that we're in a valid attribute
            // position - either in a tag, or a quoted attribute value.
            console.assert(attrNameEndIndex === -1 || regex === tagEndRegex || regex === singleQuoteAttrEndRegex || regex === doubleQuoteAttrEndRegex, 'unexpected parse state B');
        }
        // We have four cases:
        //  1. We're in text position, and not in a raw text element
        //     (regex === textEndRegex): insert a comment marker.
        //  2. We have a non-negative attrNameEndIndex which means we need to
        //     rewrite the attribute name to add a bound attribute suffix.
        //  3. We're at the non-first binding in a multi-binding attribute, use a
        //     plain marker.
        //  4. We're somewhere else inside the tag. If we're in attribute name
        //     position (attrNameEndIndex === -2), add a sequential suffix to
        //     generate a unique attribute name.
        // Detect a binding next to self-closing tag end and insert a space to
        // separate the marker from the tag end:
        const end = regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';
        html += regex === textEndRegex ? s + nodeMarker : attrNameEndIndex >= 0 ? (attrNames.push(attrName), s.slice(0, attrNameEndIndex) + boundAttributeSuffix + s.slice(attrNameEndIndex)) + marker + end : s + marker + (attrNameEndIndex === -2 ? i : end);
    }
    const htmlResult = html + (strings[l] || '<?>') + (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');
    // Returned as an array for terseness
    return [
        trustFromTemplateString(strings, htmlResult),
        attrNames
    ];
};
class Template {
    // Overridden via `litHtmlPolyfillSupport` to provide platform support.
    /** @nocollapse */ static createElement(html, _options) {
        const el = d.createElement('template');
        el.innerHTML = html;
        return el;
    }
    constructor(// This property needs to remain unminified.
    { strings, ['_$litType$']: type }, options){
        this.parts = [];
        let node;
        let nodeIndex = 0;
        let attrNameIndex = 0;
        const partCount = strings.length - 1;
        const parts = this.parts;
        // Create template element
        const [html, attrNames] = getTemplateHtml(strings, type);
        this.el = Template.createElement(html, options);
        walker.currentNode = this.el.content;
        // Re-parent SVG or MathML nodes into template root
        if (type === SVG_RESULT || type === MATHML_RESULT) {
            const wrapper = this.el.content.firstChild;
            wrapper.replaceWith(...wrapper.childNodes);
        }
        // Walk the template to find binding markers and create TemplateParts
        while((node = walker.nextNode()) !== null && parts.length < partCount){
            if (node.nodeType === 1) {
                if (DEV_MODE) {
                    const tag = node.localName;
                    // Warn if `textarea` includes an expression and throw if `template`
                    // does since these are not supported. We do this by checking
                    // innerHTML for anything that looks like a marker. This catches
                    // cases like bindings in textarea there markers turn into text nodes.
                    if (/^(?:textarea|template)$/i.test(tag) && node.innerHTML.includes(marker)) {
                        const m = `Expressions are not supported inside \`${tag}\` ` + `elements. See https://lit.dev/msg/expression-in-${tag} for more ` + `information.`;
                        if (tag === 'template') {
                            throw new Error(m);
                        } else issueWarning('', m);
                    }
                }
                // TODO (justinfagnani): for attempted dynamic tag names, we don't
                // increment the bindingIndex, and it'll be off by 1 in the element
                // and off by two after it.
                if (node.hasAttributes()) {
                    for (const name of node.getAttributeNames()){
                        if (name.endsWith(boundAttributeSuffix)) {
                            const realName = attrNames[attrNameIndex++];
                            const value = node.getAttribute(name);
                            const statics = value.split(marker);
                            const m = /([.?@])?(.*)/.exec(realName);
                            parts.push({
                                type: ATTRIBUTE_PART,
                                index: nodeIndex,
                                name: m[2],
                                strings: statics,
                                ctor: m[1] === '.' ? PropertyPart : m[1] === '?' ? BooleanAttributePart : m[1] === '@' ? EventPart : AttributePart
                            });
                            node.removeAttribute(name);
                        } else if (name.startsWith(marker)) {
                            parts.push({
                                type: ELEMENT_PART,
                                index: nodeIndex
                            });
                            node.removeAttribute(name);
                        }
                    }
                }
                // TODO (justinfagnani): benchmark the regex against testing for each
                // of the 3 raw text element names.
                if (rawTextElement.test(node.tagName)) {
                    // For raw text elements we need to split the text content on
                    // markers, create a Text node for each segment, and create
                    // a TemplatePart for each marker.
                    const strings = node.textContent.split(marker);
                    const lastIndex = strings.length - 1;
                    if (lastIndex > 0) {
                        node.textContent = trustedTypes ? trustedTypes.emptyScript : '';
                        // Generate a new text node for each literal section
                        // These nodes are also used as the markers for child parts
                        for(let i = 0; i < lastIndex; i++){
                            node.append(strings[i], createMarker());
                            // Walk past the marker node we just added
                            walker.nextNode();
                            parts.push({
                                type: CHILD_PART,
                                index: ++nodeIndex
                            });
                        }
                        // Note because this marker is added after the walker's current
                        // node, it will be walked to in the outer loop (and ignored), so
                        // we don't need to adjust nodeIndex here
                        node.append(strings[lastIndex], createMarker());
                    }
                }
            } else if (node.nodeType === 8) {
                const data = node.data;
                if (data === markerMatch) {
                    parts.push({
                        type: CHILD_PART,
                        index: nodeIndex
                    });
                } else {
                    let i = -1;
                    while((i = node.data.indexOf(marker, i + 1)) !== -1){
                        // Comment node has a binding marker inside, make an inactive part
                        // The binding won't work, but subsequent bindings will
                        parts.push({
                            type: COMMENT_PART,
                            index: nodeIndex
                        });
                        // Move to the end of the match
                        i += marker.length - 1;
                    }
                }
            }
            nodeIndex++;
        }
        if (DEV_MODE) {
            // If there was a duplicate attribute on a tag, then when the tag is
            // parsed into an element the attribute gets de-duplicated. We can detect
            // this mismatch if we haven't precisely consumed every attribute name
            // when preparing the template. This works because `attrNames` is built
            // from the template string and `attrNameIndex` comes from processing the
            // resulting DOM.
            if (attrNames.length !== attrNameIndex) {
                throw new Error(`Detected duplicate attribute bindings. This occurs if your template ` + `has duplicate attributes on an element tag. For example ` + `"<input ?disabled=\${true} ?disabled=\${false}>" contains a ` + `duplicate "disabled" attribute. The error was detected in ` + `the following template: \n` + '`' + strings.join('${...}') + '`');
            }
        }
        // We could set walker.currentNode to another node here to prevent a memory
        // leak, but every time we prepare a template, we immediately render it
        // and re-use the walker in new TemplateInstance._clone().
        debugLogEvent && debugLogEvent({
            kind: 'template prep',
            template: this,
            clonableTemplate: this.el,
            parts: this.parts,
            strings
        });
    }
}
function resolveDirective(part, value, parent = part, attributeIndex) {
    var _parent___directives;
    // Bail early if the value is explicitly noChange. Note, this means any
    // nested directive is still attached and is not run.
    if (value === noChange) {
        return value;
    }
    let currentDirective = attributeIndex !== undefined ? (_parent___directives = parent.__directives) === null || _parent___directives === void 0 ? void 0 : _parent___directives[attributeIndex] : parent.__directive;
    const nextDirectiveConstructor = isPrimitive(value) ? undefined : value['_$litDirective$'];
    if ((currentDirective === null || currentDirective === void 0 ? void 0 : currentDirective.constructor) !== nextDirectiveConstructor) {
        var // This property needs to remain unminified.
        _currentDirective__$notifyDirectiveConnectionChanged;
        currentDirective === null || currentDirective === void 0 ? void 0 : (_currentDirective__$notifyDirectiveConnectionChanged = currentDirective['_$notifyDirectiveConnectionChanged']) === null || _currentDirective__$notifyDirectiveConnectionChanged === void 0 ? void 0 : _currentDirective__$notifyDirectiveConnectionChanged.call(currentDirective, false);
        if (nextDirectiveConstructor === undefined) {
            currentDirective = undefined;
        } else {
            currentDirective = new nextDirectiveConstructor(part);
            currentDirective._$initialize(part, parent, attributeIndex);
        }
        if (attributeIndex !== undefined) {
            var _parent;
            var ___directives;
            ((___directives = (_parent = parent).__directives) !== null && ___directives !== void 0 ? ___directives : _parent.__directives = [])[attributeIndex] = currentDirective;
        } else {
            parent.__directive = currentDirective;
        }
    }
    if (currentDirective !== undefined) {
        value = resolveDirective(part, currentDirective._$resolve(part, value.values), currentDirective, attributeIndex);
    }
    return value;
}
/**
 * An updateable instance of a Template. Holds references to the Parts used to
 * update the template instance.
 */ class TemplateInstance {
    // Called by ChildPart parentNode getter
    get parentNode() {
        return this._$parent.parentNode;
    }
    // See comment in Disconnectable interface for why this is a getter
    get _$isConnected() {
        return this._$parent._$isConnected;
    }
    // This method is separate from the constructor because we need to return a
    // DocumentFragment and we don't want to hold onto it with an instance field.
    _clone(options) {
        const { el: { content }, parts: parts } = this._$template;
        var _options_creationScope;
        const fragment = ((_options_creationScope = options === null || options === void 0 ? void 0 : options.creationScope) !== null && _options_creationScope !== void 0 ? _options_creationScope : d).importNode(content, true);
        walker.currentNode = fragment;
        let node = walker.nextNode();
        let nodeIndex = 0;
        let partIndex = 0;
        let templatePart = parts[0];
        while(templatePart !== undefined){
            if (nodeIndex === templatePart.index) {
                let part;
                if (templatePart.type === CHILD_PART) {
                    part = new ChildPart(node, node.nextSibling, this, options);
                } else if (templatePart.type === ATTRIBUTE_PART) {
                    part = new templatePart.ctor(node, templatePart.name, templatePart.strings, this, options);
                } else if (templatePart.type === ELEMENT_PART) {
                    part = new ElementPart(node, this, options);
                }
                this._$parts.push(part);
                templatePart = parts[++partIndex];
            }
            if (nodeIndex !== (templatePart === null || templatePart === void 0 ? void 0 : templatePart.index)) {
                node = walker.nextNode();
                nodeIndex++;
            }
        }
        // We need to set the currentNode away from the cloned tree so that we
        // don't hold onto the tree even if the tree is detached and should be
        // freed.
        walker.currentNode = d;
        return fragment;
    }
    _update(values) {
        let i = 0;
        for (const part of this._$parts){
            if (part !== undefined) {
                debugLogEvent && debugLogEvent({
                    kind: 'set part',
                    part,
                    value: values[i],
                    valueIndex: i,
                    values,
                    templateInstance: this
                });
                if (part.strings !== undefined) {
                    part._$setValue(values, part, i);
                    // The number of values the part consumes is part.strings.length - 1
                    // since values are in between template spans. We increment i by 1
                    // later in the loop, so increment it by part.strings.length - 2 here
                    i += part.strings.length - 2;
                } else {
                    part._$setValue(values[i]);
                }
            }
            i++;
        }
    }
    constructor(template, parent){
        this._$parts = [];
        /** @internal */ this._$disconnectableChildren = undefined;
        this._$template = template;
        this._$parent = parent;
    }
}
class ChildPart {
    // See comment in Disconnectable interface for why this is a getter
    get _$isConnected() {
        var _this__$parent;
        var _this__$parent__$isConnected;
        // ChildParts that are not at the root should always be created with a
        // parent; only RootChildNode's won't, so they return the local isConnected
        // state
        return (_this__$parent__$isConnected = (_this__$parent = this._$parent) === null || _this__$parent === void 0 ? void 0 : _this__$parent._$isConnected) !== null && _this__$parent__$isConnected !== void 0 ? _this__$parent__$isConnected : this.__isConnected;
    }
    /**
     * The parent node into which the part renders its content.
     *
     * A ChildPart's content consists of a range of adjacent child nodes of
     * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
     * `.endNode`).
     *
     * - If both `.startNode` and `.endNode` are non-null, then the part's content
     * consists of all siblings between `.startNode` and `.endNode`, exclusively.
     *
     * - If `.startNode` is non-null but `.endNode` is null, then the part's
     * content consists of all siblings following `.startNode`, up to and
     * including the last child of `.parentNode`. If `.endNode` is non-null, then
     * `.startNode` will always be non-null.
     *
     * - If both `.endNode` and `.startNode` are null, then the part's content
     * consists of all child nodes of `.parentNode`.
     */ get parentNode() {
        let parentNode = wrap(this._$startNode).parentNode;
        const parent = this._$parent;
        if (parent !== undefined && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeType) === 11 /* Node.DOCUMENT_FRAGMENT */ ) {
            // If the parentNode is a DocumentFragment, it may be because the DOM is
            // still in the cloned fragment during initial render; if so, get the real
            // parentNode the part will be committed into by asking the parent.
            parentNode = parent.parentNode;
        }
        return parentNode;
    }
    /**
     * The part's leading marker node, if any. See `.parentNode` for more
     * information.
     */ get startNode() {
        return this._$startNode;
    }
    /**
     * The part's trailing marker node, if any. See `.parentNode` for more
     * information.
     */ get endNode() {
        return this._$endNode;
    }
    _$setValue(value, directiveParent = this) {
        if (DEV_MODE && this.parentNode === null) {
            throw new Error(`This \`ChildPart\` has no \`parentNode\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \`innerHTML\` or \`textContent\` can do this.`);
        }
        value = resolveDirective(this, value, directiveParent);
        if (isPrimitive(value)) {
            // Non-rendering child values. It's important that these do not render
            // empty text nodes to avoid issues with preventing default <slot>
            // fallback content.
            if (value === nothing || value == null || value === '') {
                if (this._$committedValue !== nothing) {
                    debugLogEvent && debugLogEvent({
                        kind: 'commit nothing to child',
                        start: this._$startNode,
                        end: this._$endNode,
                        parent: this._$parent,
                        options: this.options
                    });
                    this._$clear();
                }
                this._$committedValue = nothing;
            } else if (value !== this._$committedValue && value !== noChange) {
                this._commitText(value);
            }
        // This property needs to remain unminified.
        } else if (value['_$litType$'] !== undefined) {
            this._commitTemplateResult(value);
        } else if (value.nodeType !== undefined) {
            var _this_options;
            if (DEV_MODE && ((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.host) === value) {
                this._commitText(`[probable mistake: rendered a template's host in itself ` + `(commonly caused by writing \${this} in a template]`);
                console.warn(`Attempted to render the template host`, value, `inside itself. This is almost always a mistake, and in dev mode `, `we render some warning text. In production however, we'll `, `render it, which will usually result in an error, and sometimes `, `in the element disappearing from the DOM.`);
                return;
            }
            this._commitNode(value);
        } else if (isIterable(value)) {
            this._commitIterable(value);
        } else {
            // Fallback, will render the string representation
            this._commitText(value);
        }
    }
    _insert(node) {
        return wrap(wrap(this._$startNode).parentNode).insertBefore(node, this._$endNode);
    }
    _commitNode(value) {
        if (this._$committedValue !== value) {
            this._$clear();
            if (ENABLE_EXTRA_SECURITY_HOOKS && sanitizerFactoryInternal !== noopSanitizer) {
                var _this__$startNode_parentNode;
                const parentNodeName = (_this__$startNode_parentNode = this._$startNode.parentNode) === null || _this__$startNode_parentNode === void 0 ? void 0 : _this__$startNode_parentNode.nodeName;
                if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {
                    let message = 'Forbidden';
                    if (DEV_MODE) {
                        if (parentNodeName === 'STYLE') {
                            message = `Lit does not support binding inside style nodes. ` + `This is a security risk, as style injection attacks can ` + `exfiltrate data and spoof UIs. ` + `Consider instead using css\`...\` literals ` + `to compose styles, and do dynamic styling with ` + `css custom properties, ::parts, <slot>s, ` + `and by mutating the DOM rather than stylesheets.`;
                        } else {
                            message = `Lit does not support binding inside script nodes. ` + `This is a security risk, as it could allow arbitrary ` + `code execution.`;
                        }
                    }
                    throw new Error(message);
                }
            }
            debugLogEvent && debugLogEvent({
                kind: 'commit node',
                start: this._$startNode,
                parent: this._$parent,
                value: value,
                options: this.options
            });
            this._$committedValue = this._insert(value);
        }
    }
    _commitText(value) {
        // If the committed value is a primitive it means we called _commitText on
        // the previous render, and we know that this._$startNode.nextSibling is a
        // Text node. We can now just replace the text content (.data) of the node.
        if (this._$committedValue !== nothing && isPrimitive(this._$committedValue)) {
            const node = wrap(this._$startNode).nextSibling;
            if (ENABLE_EXTRA_SECURITY_HOOKS) {
                if (this._textSanitizer === undefined) {
                    this._textSanitizer = createSanitizer(node, 'data', 'property');
                }
                value = this._textSanitizer(value);
            }
            debugLogEvent && debugLogEvent({
                kind: 'commit text',
                node,
                value,
                options: this.options
            });
            node.data = value;
        } else {
            if (ENABLE_EXTRA_SECURITY_HOOKS) {
                const textNode = d.createTextNode('');
                this._commitNode(textNode);
                // When setting text content, for security purposes it matters a lot
                // what the parent is. For example, <style> and <script> need to be
                // handled with care, while <span> does not. So first we need to put a
                // text node into the document, then we can sanitize its content.
                if (this._textSanitizer === undefined) {
                    this._textSanitizer = createSanitizer(textNode, 'data', 'property');
                }
                value = this._textSanitizer(value);
                debugLogEvent && debugLogEvent({
                    kind: 'commit text',
                    node: textNode,
                    value,
                    options: this.options
                });
                textNode.data = value;
            } else {
                this._commitNode(d.createTextNode(value));
                debugLogEvent && debugLogEvent({
                    kind: 'commit text',
                    node: wrap(this._$startNode).nextSibling,
                    value,
                    options: this.options
                });
            }
        }
        this._$committedValue = value;
    }
    _commitTemplateResult(result) {
        var _this__$committedValue;
        // This property needs to remain unminified.
        const { values, ['_$litType$']: type } = result;
        // If $litType$ is a number, result is a plain TemplateResult and we get
        // the template from the template cache. If not, result is a
        // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need
        // to create the <template> element the first time we see it.
        const template = typeof type === 'number' ? this._$getTemplate(result) : (type.el === undefined && (type.el = Template.createElement(trustFromTemplateString(type.h, type.h[0]), this.options)), type);
        if (((_this__$committedValue = this._$committedValue) === null || _this__$committedValue === void 0 ? void 0 : _this__$committedValue._$template) === template) {
            debugLogEvent && debugLogEvent({
                kind: 'template updating',
                template,
                instance: this._$committedValue,
                parts: this._$committedValue._$parts,
                options: this.options,
                values
            });
            this._$committedValue._update(values);
        } else {
            const instance = new TemplateInstance(template, this);
            const fragment = instance._clone(this.options);
            debugLogEvent && debugLogEvent({
                kind: 'template instantiated',
                template,
                instance,
                parts: instance._$parts,
                options: this.options,
                fragment,
                values
            });
            instance._update(values);
            debugLogEvent && debugLogEvent({
                kind: 'template instantiated and updated',
                template,
                instance,
                parts: instance._$parts,
                options: this.options,
                fragment,
                values
            });
            this._commitNode(fragment);
            this._$committedValue = instance;
        }
    }
    // Overridden via `litHtmlPolyfillSupport` to provide platform support.
    /** @internal */ _$getTemplate(result) {
        let template = templateCache.get(result.strings);
        if (template === undefined) {
            templateCache.set(result.strings, template = new Template(result));
        }
        return template;
    }
    _commitIterable(value) {
        // For an Iterable, we create a new InstancePart per item, then set its
        // value to the item. This is a little bit of overhead for every item in
        // an Iterable, but it lets us recurse easily and efficiently update Arrays
        // of TemplateResults that will be commonly returned from expressions like:
        // array.map((i) => html`${i}`), by reusing existing TemplateInstances.
        // If value is an array, then the previous render was of an
        // iterable and value will contain the ChildParts from the previous
        // render. If value is not an array, clear this part and make a new
        // array for ChildParts.
        if (!isArray(this._$committedValue)) {
            this._$committedValue = [];
            this._$clear();
        }
        // Lets us keep track of how many items we stamped so we can clear leftover
        // items from a previous render
        const itemParts = this._$committedValue;
        let partIndex = 0;
        let itemPart;
        for (const item of value){
            if (partIndex === itemParts.length) {
                // If no existing part, create a new one
                // TODO (justinfagnani): test perf impact of always creating two parts
                // instead of sharing parts between nodes
                // https://github.com/lit/lit/issues/1266
                itemParts.push(itemPart = new ChildPart(this._insert(createMarker()), this._insert(createMarker()), this, this.options));
            } else {
                // Reuse an existing part
                itemPart = itemParts[partIndex];
            }
            itemPart._$setValue(item);
            partIndex++;
        }
        if (partIndex < itemParts.length) {
            // itemParts always have end nodes
            this._$clear(itemPart && wrap(itemPart._$endNode).nextSibling, partIndex);
            // Truncate the parts array so _value reflects the current state
            itemParts.length = partIndex;
        }
    }
    /**
     * Removes the nodes contained within this Part from the DOM.
     *
     * @param start Start node to clear from, for clearing a subset of the part's
     *     DOM (used when truncating iterables)
     * @param from  When `start` is specified, the index within the iterable from
     *     which ChildParts are being removed, used for disconnecting directives in
     *     those Parts.
     *
     * @internal
     */ _$clear(start = wrap(this._$startNode).nextSibling, from) {
        var _this__$notifyConnectionChanged, _this;
        (_this__$notifyConnectionChanged = (_this = this)._$notifyConnectionChanged) === null || _this__$notifyConnectionChanged === void 0 ? void 0 : _this__$notifyConnectionChanged.call(_this, false, true, from);
        while(start && start !== this._$endNode){
            const n = wrap(start).nextSibling;
            wrap(start).remove();
            start = n;
        }
    }
    /**
     * Implementation of RootPart's `isConnected`. Note that this method
     * should only be called on `RootPart`s (the `ChildPart` returned from a
     * top-level `render()` call). It has no effect on non-root ChildParts.
     * @param isConnected Whether to set
     * @internal
     */ setConnected(isConnected) {
        if (this._$parent === undefined) {
            var _this__$notifyConnectionChanged, _this;
            this.__isConnected = isConnected;
            (_this__$notifyConnectionChanged = (_this = this)._$notifyConnectionChanged) === null || _this__$notifyConnectionChanged === void 0 ? void 0 : _this__$notifyConnectionChanged.call(_this, isConnected);
        } else if (DEV_MODE) {
            throw new Error('part.setConnected() may only be called on a ' + 'RootPart returned from render().');
        }
    }
    constructor(startNode, endNode, parent, options){
        this.type = CHILD_PART;
        this._$committedValue = nothing;
        // The following fields will be patched onto ChildParts when required by
        // AsyncDirective
        /** @internal */ this._$disconnectableChildren = undefined;
        this._$startNode = startNode;
        this._$endNode = endNode;
        this._$parent = parent;
        this.options = options;
        var _options_isConnected;
        // Note __isConnected is only ever accessed on RootParts (i.e. when there is
        // no _$parent); the value on a non-root-part is "don't care", but checking
        // for parent would be more code
        this.__isConnected = (_options_isConnected = options === null || options === void 0 ? void 0 : options.isConnected) !== null && _options_isConnected !== void 0 ? _options_isConnected : true;
        if (ENABLE_EXTRA_SECURITY_HOOKS) {
            // Explicitly initialize for consistent class shape.
            this._textSanitizer = undefined;
        }
    }
}
class AttributePart {
    get tagName() {
        return this.element.tagName;
    }
    // See comment in Disconnectable interface for why this is a getter
    get _$isConnected() {
        return this._$parent._$isConnected;
    }
    /**
     * Sets the value of this part by resolving the value from possibly multiple
     * values and static strings and committing it to the DOM.
     * If this part is single-valued, `this._strings` will be undefined, and the
     * method will be called with a single value argument. If this part is
     * multi-value, `this._strings` will be defined, and the method is called
     * with the value array of the part's owning TemplateInstance, and an offset
     * into the value array from which the values should be read.
     * This method is overloaded this way to eliminate short-lived array slices
     * of the template instance values, and allow a fast-path for single-valued
     * parts.
     *
     * @param value The part value, or an array of values for multi-valued parts
     * @param valueIndex the index to start reading values from. `undefined` for
     *   single-valued parts
     * @param noCommit causes the part to not commit its value to the DOM. Used
     *   in hydration to prime attribute parts with their first-rendered value,
     *   but not set the attribute, and in SSR to no-op the DOM operation and
     *   capture the value for serialization.
     *
     * @internal
     */ _$setValue(value, directiveParent = this, valueIndex, noCommit) {
        const strings = this.strings;
        // Whether any of the values has changed, for dirty-checking
        let change = false;
        if (strings === undefined) {
            // Single-value binding case
            value = resolveDirective(this, value, directiveParent, 0);
            change = !isPrimitive(value) || value !== this._$committedValue && value !== noChange;
            if (change) {
                this._$committedValue = value;
            }
        } else {
            // Interpolation case
            const values = value;
            value = strings[0];
            let i, v;
            for(i = 0; i < strings.length - 1; i++){
                v = resolveDirective(this, values[valueIndex + i], directiveParent, i);
                if (v === noChange) {
                    // If the user-provided value is `noChange`, use the previous value
                    v = this._$committedValue[i];
                }
                change || (change = !isPrimitive(v) || v !== this._$committedValue[i]);
                if (v === nothing) {
                    value = nothing;
                } else if (value !== nothing) {
                    value += (v !== null && v !== void 0 ? v : '') + strings[i + 1];
                }
                // We always record each value, even if one is `nothing`, for future
                // change detection.
                this._$committedValue[i] = v;
            }
        }
        if (change && !noCommit) {
            this._commitValue(value);
        }
    }
    /** @internal */ _commitValue(value) {
        if (value === nothing) {
            wrap(this.element).removeAttribute(this.name);
        } else {
            if (ENABLE_EXTRA_SECURITY_HOOKS) {
                if (this._sanitizer === undefined) {
                    this._sanitizer = sanitizerFactoryInternal(this.element, this.name, 'attribute');
                }
                value = this._sanitizer(value !== null && value !== void 0 ? value : '');
            }
            debugLogEvent && debugLogEvent({
                kind: 'commit attribute',
                element: this.element,
                name: this.name,
                value,
                options: this.options
            });
            wrap(this.element).setAttribute(this.name, value !== null && value !== void 0 ? value : '');
        }
    }
    constructor(element, name, strings, parent, options){
        this.type = ATTRIBUTE_PART;
        /** @internal */ this._$committedValue = nothing;
        /** @internal */ this._$disconnectableChildren = undefined;
        this.element = element;
        this.name = name;
        this._$parent = parent;
        this.options = options;
        if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {
            this._$committedValue = new Array(strings.length - 1).fill(new String());
            this.strings = strings;
        } else {
            this._$committedValue = nothing;
        }
        if (ENABLE_EXTRA_SECURITY_HOOKS) {
            this._sanitizer = undefined;
        }
    }
}
class PropertyPart extends AttributePart {
    /** @internal */ _commitValue(value) {
        if (ENABLE_EXTRA_SECURITY_HOOKS) {
            if (this._sanitizer === undefined) {
                this._sanitizer = sanitizerFactoryInternal(this.element, this.name, 'property');
            }
            value = this._sanitizer(value);
        }
        debugLogEvent && debugLogEvent({
            kind: 'commit property',
            element: this.element,
            name: this.name,
            value,
            options: this.options
        });
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        this.element[this.name] = value === nothing ? undefined : value;
    }
    constructor(){
        super(...arguments);
        this.type = PROPERTY_PART;
    }
}
class BooleanAttributePart extends AttributePart {
    /** @internal */ _commitValue(value) {
        debugLogEvent && debugLogEvent({
            kind: 'commit boolean attribute',
            element: this.element,
            name: this.name,
            value: !!(value && value !== nothing),
            options: this.options
        });
        wrap(this.element).toggleAttribute(this.name, !!value && value !== nothing);
    }
    constructor(){
        super(...arguments);
        this.type = BOOLEAN_ATTRIBUTE_PART;
    }
}
class EventPart extends AttributePart {
    // EventPart does not use the base _$setValue/_resolveValue implementation
    // since the dirty checking is more complex
    /** @internal */ _$setValue(newListener, directiveParent = this) {
        var _resolveDirective;
        newListener = (_resolveDirective = resolveDirective(this, newListener, directiveParent, 0)) !== null && _resolveDirective !== void 0 ? _resolveDirective : nothing;
        if (newListener === noChange) {
            return;
        }
        const oldListener = this._$committedValue;
        // If the new value is nothing or any options change we have to remove the
        // part as a listener.
        const shouldRemoveListener = newListener === nothing && oldListener !== nothing || newListener.capture !== oldListener.capture || newListener.once !== oldListener.once || newListener.passive !== oldListener.passive;
        // If the new value is not nothing and we removed the listener, we have
        // to add the part as a listener.
        const shouldAddListener = newListener !== nothing && (oldListener === nothing || shouldRemoveListener);
        debugLogEvent && debugLogEvent({
            kind: 'commit event listener',
            element: this.element,
            name: this.name,
            value: newListener,
            options: this.options,
            removeListener: shouldRemoveListener,
            addListener: shouldAddListener,
            oldListener
        });
        if (shouldRemoveListener) {
            this.element.removeEventListener(this.name, this, oldListener);
        }
        if (shouldAddListener) {
            this.element.addEventListener(this.name, this, newListener);
        }
        this._$committedValue = newListener;
    }
    handleEvent(event) {
        if (typeof this._$committedValue === 'function') {
            var _this_options;
            var _this_options_host;
            this._$committedValue.call((_this_options_host = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.host) !== null && _this_options_host !== void 0 ? _this_options_host : this.element, event);
        } else {
            this._$committedValue.handleEvent(event);
        }
    }
    constructor(element, name, strings, parent, options){
        super(element, name, strings, parent, options);
        this.type = EVENT_PART;
        if (DEV_MODE && this.strings !== undefined) {
            throw new Error(`A \`<${element.localName}>\` has a \`@${name}=...\` listener with ` + 'invalid content. Event listeners in templates must have exactly ' + 'one expression and no surrounding text.');
        }
    }
}
class ElementPart {
    // See comment in Disconnectable interface for why this is a getter
    get _$isConnected() {
        return this._$parent._$isConnected;
    }
    _$setValue(value) {
        debugLogEvent && debugLogEvent({
            kind: 'commit to element binding',
            element: this.element,
            value,
            options: this.options
        });
        resolveDirective(this, value);
    }
    constructor(element, parent, options){
        this.element = element;
        this.type = ELEMENT_PART;
        /** @internal */ this._$disconnectableChildren = undefined;
        this._$parent = parent;
        this.options = options;
    }
}
/**
 * END USERS SHOULD NOT RELY ON THIS OBJECT.
 *
 * Private exports for use by other Lit packages, not intended for use by
 * external users.
 *
 * We currently do not make a mangled rollup build of the lit-ssr code. In order
 * to keep a number of (otherwise private) top-level exports mangled in the
 * client side code, we export a _$LH object containing those members (or
 * helper methods for accessing private fields of those members), and then
 * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
 * client-side code is being used in `dev` mode or `prod` mode.
 *
 * This has a unique name, to disambiguate it from private exports in
 * lit-element, which re-exports all of lit-html.
 *
 * @private
 */ const _$LH = {
    // Used in lit-ssr
    _boundAttributeSuffix: boundAttributeSuffix,
    _marker: marker,
    _markerMatch: markerMatch,
    _HTML_RESULT: HTML_RESULT,
    _getTemplateHtml: getTemplateHtml,
    // Used in tests and private-ssr-support
    _TemplateInstance: TemplateInstance,
    _isIterable: isIterable,
    _resolveDirective: resolveDirective,
    _ChildPart: ChildPart,
    _AttributePart: AttributePart,
    _BooleanAttributePart: BooleanAttributePart,
    _EventPart: EventPart,
    _PropertyPart: PropertyPart,
    _ElementPart: ElementPart
};
// Apply polyfills if available
const polyfillSupport = DEV_MODE ? global.litHtmlPolyfillSupportDevMode : global.litHtmlPolyfillSupport;
polyfillSupport === null || polyfillSupport === void 0 ? void 0 : polyfillSupport(Template, ChildPart);
var _litHtmlVersions;
((_litHtmlVersions = (_global = global).litHtmlVersions) !== null && _litHtmlVersions !== void 0 ? _litHtmlVersions : _global.litHtmlVersions = []).push('3.3.0');
if (DEV_MODE && global.litHtmlVersions.length > 1) {
    queueMicrotask(()=>{
        issueWarning('multiple-versions', `Multiple versions of Lit loaded. ` + `Loading multiple versions is not recommended.`);
    });
}
/**
 * Renders a value, usually a lit-html TemplateResult, to the container.
 *
 * This example renders the text "Hello, Zoe!" inside a paragraph tag, appending
 * it to the container `document.body`.
 *
 * ```js
 * import {html, render} from 'lit';
 *
 * const name = "Zoe";
 * render(html`<p>Hello, ${name}!</p>`, document.body);
 * ```
 *
 * @param value Any [renderable
 *   value](https://lit.dev/docs/templates/expressions/#child-expressions),
 *   typically a {@linkcode TemplateResult} created by evaluating a template tag
 *   like {@linkcode html} or {@linkcode svg}.
 * @param container A DOM container to render to. The first render will append
 *   the rendered value to the container, and subsequent renders will
 *   efficiently update the rendered value if the same result type was
 *   previously rendered there.
 * @param options See {@linkcode RenderOptions} for options documentation.
 * @see
 * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}
 */ const render = (value, container, options)=>{
    if (DEV_MODE && container == null) {
        // Give a clearer error message than
        //     Uncaught TypeError: Cannot read properties of null (reading
        //     '_$litPart$')
        // which reads like an internal Lit error.
        throw new TypeError(`The container to render into may not be ${container}`);
    }
    const renderId = DEV_MODE ? debugLogRenderId++ : 0;
    var _options_renderBefore;
    const partOwnerNode = (_options_renderBefore = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _options_renderBefore !== void 0 ? _options_renderBefore : container;
    // This property needs to remain unminified.
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    let part = partOwnerNode['_$litPart$'];
    debugLogEvent && debugLogEvent({
        kind: 'begin render',
        id: renderId,
        value,
        container,
        options,
        part
    });
    if (part === undefined) {
        var _options_renderBefore1;
        const endNode = (_options_renderBefore1 = options === null || options === void 0 ? void 0 : options.renderBefore) !== null && _options_renderBefore1 !== void 0 ? _options_renderBefore1 : null;
        // This property needs to remain unminified.
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        partOwnerNode['_$litPart$'] = part = new ChildPart(container.insertBefore(createMarker(), endNode), endNode, undefined, options !== null && options !== void 0 ? options : {});
    }
    part._$setValue(value);
    debugLogEvent && debugLogEvent({
        kind: 'end render',
        id: renderId,
        value,
        container,
        options,
        part
    });
    return part;
};
if (ENABLE_EXTRA_SECURITY_HOOKS) {
    render.setSanitizer = setSanitizer;
    render.createSanitizer = createSanitizer;
    if (DEV_MODE) {
        render._testOnlyClearSanitizerFactoryDoNotCallOrElse = _testOnlyClearSanitizerFactoryDoNotCallOrElse;
    }
} //# sourceMappingURL=lit-html.js.map


/***/ }),

/***/ "./node_modules/lit/async-directive.js":
/*!*********************************************!*\
  !*** ./node_modules/lit/async-directive.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AsyncDirective: () => (/* reexport safe */ lit_html_async_directive_js__WEBPACK_IMPORTED_MODULE_0__.AsyncDirective),
/* harmony export */   Directive: () => (/* reexport safe */ lit_html_async_directive_js__WEBPACK_IMPORTED_MODULE_0__.Directive),
/* harmony export */   PartType: () => (/* reexport safe */ lit_html_async_directive_js__WEBPACK_IMPORTED_MODULE_0__.PartType),
/* harmony export */   directive: () => (/* reexport safe */ lit_html_async_directive_js__WEBPACK_IMPORTED_MODULE_0__.directive)
/* harmony export */ });
/* harmony import */ var lit_html_async_directive_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit-html/async-directive.js */ "./node_modules/lit-html/development/async-directive.js");

//# sourceMappingURL=async-directive.js.map


/***/ }),

/***/ "./node_modules/lit/directive.js":
/*!***************************************!*\
  !*** ./node_modules/lit/directive.js ***!
  \***************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Directive: () => (/* reexport safe */ lit_html_directive_js__WEBPACK_IMPORTED_MODULE_0__.Directive),
/* harmony export */   PartType: () => (/* reexport safe */ lit_html_directive_js__WEBPACK_IMPORTED_MODULE_0__.PartType),
/* harmony export */   directive: () => (/* reexport safe */ lit_html_directive_js__WEBPACK_IMPORTED_MODULE_0__.directive)
/* harmony export */ });
/* harmony import */ var lit_html_directive_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit-html/directive.js */ "./node_modules/lit-html/development/directive.js");

//# sourceMappingURL=directive.js.map


/***/ }),

/***/ "./node_modules/lit/directives/repeat.js":
/*!***********************************************!*\
  !*** ./node_modules/lit/directives/repeat.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   repeat: () => (/* reexport safe */ lit_html_directives_repeat_js__WEBPACK_IMPORTED_MODULE_0__.repeat)
/* harmony export */ });
/* harmony import */ var lit_html_directives_repeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit-html/directives/repeat.js */ "./node_modules/lit-html/development/directives/repeat.js");

//# sourceMappingURL=repeat.js.map


/***/ }),

/***/ "./node_modules/lit/directives/unsafe-html.js":
/*!****************************************************!*\
  !*** ./node_modules/lit/directives/unsafe-html.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   UnsafeHTMLDirective: () => (/* reexport safe */ lit_html_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_0__.UnsafeHTMLDirective),
/* harmony export */   unsafeHTML: () => (/* reexport safe */ lit_html_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_0__.unsafeHTML)
/* harmony export */ });
/* harmony import */ var lit_html_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit-html/directives/unsafe-html.js */ "./node_modules/lit-html/development/directives/unsafe-html.js");

//# sourceMappingURL=unsafe-html.js.map


/***/ }),

/***/ "./node_modules/lit/directives/until.js":
/*!**********************************************!*\
  !*** ./node_modules/lit/directives/until.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   UntilDirective: () => (/* reexport safe */ lit_html_directives_until_js__WEBPACK_IMPORTED_MODULE_0__.UntilDirective),
/* harmony export */   until: () => (/* reexport safe */ lit_html_directives_until_js__WEBPACK_IMPORTED_MODULE_0__.until)
/* harmony export */ });
/* harmony import */ var lit_html_directives_until_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit-html/directives/until.js */ "./node_modules/lit-html/development/directives/until.js");

//# sourceMappingURL=until.js.map


/***/ }),

/***/ "./node_modules/lit/html.js":
/*!**********************************!*\
  !*** ./node_modules/lit/html.js ***!
  \**********************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _$LH: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__._$LH),
/* harmony export */   html: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__.html),
/* harmony export */   mathml: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__.mathml),
/* harmony export */   noChange: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__.noChange),
/* harmony export */   nothing: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__.nothing),
/* harmony export */   render: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__.render),
/* harmony export */   svg: () => (/* reexport safe */ lit_html__WEBPACK_IMPORTED_MODULE_0__.svg)
/* harmony export */ });
/* harmony import */ var lit_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit-html */ "./node_modules/lit-html/development/lit-html.js");

//# sourceMappingURL=html.js.map


/***/ }),

/***/ "./node_modules/lit/index.js":
/*!***********************************!*\
  !*** ./node_modules/lit/index.js ***!
  \***********************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CSSResult: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.CSSResult),
/* harmony export */   LitElement: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.LitElement),
/* harmony export */   ReactiveElement: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.ReactiveElement),
/* harmony export */   _$LE: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__._$LE),
/* harmony export */   _$LH: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__._$LH),
/* harmony export */   adoptStyles: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.adoptStyles),
/* harmony export */   css: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.css),
/* harmony export */   defaultConverter: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.defaultConverter),
/* harmony export */   getCompatibleStyle: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.getCompatibleStyle),
/* harmony export */   html: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.html),
/* harmony export */   isServer: () => (/* reexport safe */ lit_html_is_server_js__WEBPACK_IMPORTED_MODULE_3__.isServer),
/* harmony export */   mathml: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.mathml),
/* harmony export */   noChange: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.noChange),
/* harmony export */   notEqual: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.notEqual),
/* harmony export */   nothing: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.nothing),
/* harmony export */   render: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.render),
/* harmony export */   supportsAdoptingStyleSheets: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.supportsAdoptingStyleSheets),
/* harmony export */   svg: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.svg),
/* harmony export */   unsafeCSS: () => (/* reexport safe */ lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__.unsafeCSS)
/* harmony export */ });
/* harmony import */ var _lit_reactive_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lit/reactive-element */ "./node_modules/@lit/reactive-element/development/reactive-element.js");
/* harmony import */ var lit_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit-html */ "./node_modules/lit-html/development/lit-html.js");
/* harmony import */ var lit_element_lit_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit-element/lit-element.js */ "./node_modules/lit-element/development/lit-element.js");
/* harmony import */ var lit_html_is_server_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit-html/is-server.js */ "./node_modules/lit-html/development/is-server.js");

//# sourceMappingURL=index.js.map


/***/ }),

/***/ "./node_modules/localforage-driver-memory/_bundle/umd.js":
/*!***************************************************************!*\
  !*** ./node_modules/localforage-driver-memory/_bundle/umd.js ***!
  \***************************************************************/
/***/ (function(__unused_webpack_module, exports) {

/*!
MIT License

Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/


(function (global, factory) {
     true ? factory(exports) :
    0;
}(typeof self !== 'undefined' ? self : this, function (exports) { 'use strict';

    var _driver = 'localforage-driver-memory';

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */

    function __values(o) {
        var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
        if (m) return m.call(o);
        return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
    }

    /*!
    MIT License

    Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

    */

    /**
     * Abstracts constructing a Blob object, so it also works in older
     * browsers that don't support the native Blob constructor. (i.e.
     * old QtWebKit versions, at least).
     * Abstracts constructing a Blob object, so it also works in older
     * browsers that don't support the native Blob constructor. (i.e.
     * old QtWebKit versions, at least).
     *
     * @param parts
     * @param properties
     */
    function createBlob(parts, properties) {
        /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
        parts = parts || [];
        properties = properties || {};
        try {
            return new Blob(parts, properties);
        }
        catch (e) {
            if (e.name !== 'TypeError') {
                throw e;
            }
            //tslint:disable-next-line:variable-name
            var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder
                : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder
                    : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder
                        : WebKitBlobBuilder;
            var builder = new Builder();
            for (var i = 0; i < parts.length; i += 1) {
                builder.append(parts[i]);
            }
            return builder.getBlob(properties.type);
        }
    }

    var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
    var SERIALIZED_MARKER_LENGTH = "__lfsc__:" /* SERIALIZED_MARKER */.length;
    var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + "arbf" /* TYPE_ARRAYBUFFER */.length;
    //tslint:disable:no-magic-numbers no-bitwise prefer-switch no-unbound-method
    var toString = Object.prototype.toString;
    function stringToBuffer(serializedString) {
        // Fill the string into a ArrayBuffer.
        var bufferLength = serializedString.length * 0.75;
        var len = serializedString.length;
        if (serializedString[serializedString.length - 1] === '=') {
            bufferLength--;
            if (serializedString[serializedString.length - 2] === '=') {
                bufferLength--;
            }
        }
        var buffer = new ArrayBuffer(bufferLength);
        var bytes = new Uint8Array(buffer);
        for (var i = 0, p = 0; i < len; i += 4) {
            var encoded1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */.indexOf(serializedString[i]);
            var encoded2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */.indexOf(serializedString[i + 1]);
            var encoded3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */.indexOf(serializedString[i + 2]);
            var encoded4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */.indexOf(serializedString[i + 3]);
            bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
            bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
            bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
        }
        return buffer;
    }
    /**
     * Converts a buffer to a string to store, serialized, in the backend
     * storage library.
     */
    function bufferToString(buffer) {
        // base64-arraybuffer
        var bytes = new Uint8Array(buffer);
        var base64String = '';
        for (var i = 0; i < bytes.length; i += 3) {
            /*jslint bitwise: true */
            base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */[bytes[i] >> 2];
            base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
            base64String +=
                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
            base64String += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" /* BASE_CHARS */[bytes[i + 2] & 63];
        }
        if (bytes.length % 3 === 2) {
            base64String = base64String.substring(0, base64String.length - 1) + '=';
        }
        else if (bytes.length % 3 === 1) {
            base64String = base64String.substring(0, base64String.length - 2) + '==';
        }
        return base64String;
    }
    /**
     * Serialize a value, afterwards executing a callback (which usually
     * instructs the `setItem()` callback/promise to be executed). This is how
     * we store binary data with localStorage.
     * @param value
     * @param callback
     */
    function serialize(value, callback) {
        var valueType = '';
        if (value) {
            valueType = toString.call(value);
        }
        // Cannot use `value instanceof ArrayBuffer` or such here, as these
        // checks fail when running the tests using casper.js...
        if (value && (valueType === '[object ArrayBuffer]' ||
            (value.buffer && toString.call(value.buffer) === '[object ArrayBuffer]'))) {
            // Convert binary arrays to a string and prefix the string with
            // a special marker.
            var buffer = void 0;
            var marker = "__lfsc__:" /* SERIALIZED_MARKER */;
            if (value instanceof ArrayBuffer) {
                buffer = value;
                marker += "arbf" /* TYPE_ARRAYBUFFER */;
            }
            else {
                buffer = value.buffer;
                if (valueType === '[object Int8Array]') {
                    marker += "si08" /* TYPE_INT8ARRAY */;
                }
                else if (valueType === '[object Uint8Array]') {
                    marker += "ui08" /* TYPE_UINT8ARRAY */;
                }
                else if (valueType === '[object Uint8ClampedArray]') {
                    marker += "uic8" /* TYPE_UINT8CLAMPEDARRAY */;
                }
                else if (valueType === '[object Int16Array]') {
                    marker += "si16" /* TYPE_INT16ARRAY */;
                }
                else if (valueType === '[object Uint16Array]') {
                    marker += "ur16" /* TYPE_UINT16ARRAY */;
                }
                else if (valueType === '[object Int32Array]') {
                    marker += "si32" /* TYPE_INT32ARRAY */;
                }
                else if (valueType === '[object Uint32Array]') {
                    marker += "ui32" /* TYPE_UINT32ARRAY */;
                }
                else if (valueType === '[object Float32Array]') {
                    marker += "fl32" /* TYPE_FLOAT32ARRAY */;
                }
                else if (valueType === '[object Float64Array]') {
                    marker += "fl64" /* TYPE_FLOAT64ARRAY */;
                }
                else {
                    callback(new Error('Failed to get type for BinaryArray'));
                }
            }
            callback(marker + bufferToString(buffer));
        }
        else if (valueType === '[object Blob]') {
            // Convert the blob to a binaryArray and then to a string.
            var fileReader = new FileReader();
            fileReader.onload = function () {
                // Backwards-compatible prefix for the blob type.
                //tslint:disable-next-line:restrict-plus-operands
                var str = "~~local_forage_type~" /* BLOB_TYPE_PREFIX */ + value.type + "~" + bufferToString(this.result);
                callback("__lfsc__:" /* SERIALIZED_MARKER */ + "blob" /* TYPE_BLOB */ + str);
            };
            fileReader.readAsArrayBuffer(value);
        }
        else {
            try {
                callback(JSON.stringify(value));
            }
            catch (e) {
                console.error('Couldn\'t convert value into a JSON string: ', value);
                callback(null, e);
            }
        }
    }
    /**
     * Deserialize data we've inserted into a value column/field. We place
     * special markers into our strings to mark them as encoded; this isn't
     * as nice as a meta field, but it's the only sane thing we can do whilst
     * keeping localStorage support intact.
     *
     * Oftentimes this will just deserialize JSON content, but if we have a
     * special marker (SERIALIZED_MARKER, defined above), we will extract
     * some kind of arraybuffer/binary data/typed array out of the string.
     * @param value
     */
    function deserialize(value) {
        // If we haven't marked this string as being specially serialized (i.e.
        // something other than serialized JSON), we can just return it and be
        // done with it.
        if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== "__lfsc__:" /* SERIALIZED_MARKER */) {
            return JSON.parse(value);
        }
        // The following code deals with deserializing some kind of Blob or
        // TypedArray. First we separate out the type of data we're dealing
        // with from the data itself.
        var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
        var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);
        var blobType;
        // Backwards-compatible blob type serialization strategy.
        // DBs created with older versions of localForage will simply not have the blob type.
        if (type === "blob" /* TYPE_BLOB */ && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
            var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
            blobType = matcher[1];
            serializedString = serializedString.substring(matcher[0].length);
        }
        var buffer = stringToBuffer(serializedString);
        // Return the right type based on the code/type set during
        // serialization.
        switch (type) {
            case "arbf" /* TYPE_ARRAYBUFFER */:
                return buffer;
            case "blob" /* TYPE_BLOB */:
                return createBlob([buffer], { type: blobType });
            case "si08" /* TYPE_INT8ARRAY */:
                return new Int8Array(buffer);
            case "ui08" /* TYPE_UINT8ARRAY */:
                return new Uint8Array(buffer);
            case "uic8" /* TYPE_UINT8CLAMPEDARRAY */:
                return new Uint8ClampedArray(buffer);
            case "si16" /* TYPE_INT16ARRAY */:
                return new Int16Array(buffer);
            case "ur16" /* TYPE_UINT16ARRAY */:
                return new Uint16Array(buffer);
            case "si32" /* TYPE_INT32ARRAY */:
                return new Int32Array(buffer);
            case "ui32" /* TYPE_UINT32ARRAY */:
                return new Uint32Array(buffer);
            case "fl32" /* TYPE_FLOAT32ARRAY */:
                return new Float32Array(buffer);
            case "fl64" /* TYPE_FLOAT64ARRAY */:
                return new Float64Array(buffer);
            default:
                throw new Error('Unkown type: ' + type);
        }
    }

    function clone(obj) {
        var e_1, _a;
        if (obj === null || typeof (obj) !== 'object' || 'isActiveClone' in obj) {
            return obj;
        }
        var temp = obj instanceof Date ? new Date(obj) : (obj.constructor());
        try {
            for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var key = _c.value;
                if (Object.prototype.hasOwnProperty.call(obj, key)) {
                    obj['isActiveClone'] = null;
                    temp[key] = clone(obj[key]);
                    delete obj['isActiveClone'];
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
        return temp;
    }

    function getKeyPrefix(options, defaultConfig) {
        return (options.name || defaultConfig.name) + "/" + (options.storeName || defaultConfig.storeName) + "/";
    }

    function executeCallback(promise, callback) {
        if (callback) {
            promise.then(function (result) {
                callback(null, result);
            }, function (error) {
                callback(error);
            });
        }
    }

    function getCallback() {
        var _args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            _args[_i] = arguments[_i];
        }
        if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
            return arguments[arguments.length - 1];
        }
    }

    //tslint:disable-next-line:no-ignored-initial-value
    function dropInstanceCommon(options, callback) {
        var _this = this;
        callback = getCallback.apply(this, arguments);
        options = (typeof options !== 'function' && options) || {};
        if (!options.name) {
            var currentConfig = this.config();
            options.name = options.name || currentConfig.name;
            options.storeName = options.storeName || currentConfig.storeName;
        }
        var promise;
        if (!options.name) {
            promise = Promise.reject('Invalid arguments');
        }
        else {
            promise = new Promise(function (resolve) {
                if (!options.storeName) {
                    resolve(options.name + "/");
                }
                else {
                    resolve(getKeyPrefix(options, _this._defaultConfig));
                }
            });
        }
        return { promise: promise, callback: callback };
    }

    function normaliseKey(key) {
        // Cast the key to a string, as that's all we can set as a key.
        if (typeof key !== 'string') {
            console.warn(key + " used as a key, but it is not a string.");
            key = String(key);
        }
        return key;
    }

    var serialiser = {
        bufferToString: bufferToString,
        deserialize: deserialize,
        serialize: serialize,
        stringToBuffer: stringToBuffer
    };

    var stores = {};
    /** @internal */
    var Store = /** @class */ (function () {
        function Store(kp) {
            this.kp = kp;
            this.data = {};
        }
        Store.resolve = function (kp) {
            if (!stores[kp]) {
                stores[kp] = new Store(kp);
            }
            return stores[kp];
        };
        Store.prototype.clear = function () {
            this.data = {};
        };
        Store.prototype.drop = function () {
            this.clear();
            delete stores[this.kp];
        };
        Store.prototype.get = function (key) {
            return this.data[key];
        };
        Store.prototype.key = function (idx) {
            return this.keys()[idx];
        };
        Store.prototype.keys = function () {
            return Object.keys(this.data);
        };
        Store.prototype.rm = function (k) {
            delete this.data[k];
        };
        Store.prototype.set = function (k, v) {
            this.data[k] = v;
        };
        return Store;
    }());

    function _initStorage(options) {
        var opts = options ? clone(options) : {};
        var kp = getKeyPrefix(opts, this._defaultConfig);
        var store = Store.resolve(kp);
        this._dbInfo = opts;
        this._dbInfo.serializer = serialiser;
        this._dbInfo.keyPrefix = kp;
        this._dbInfo.mStore = store;
        return Promise.resolve();
    }

    function clear(callback) {
        var _this = this;
        var promise = this.ready().then(function () {
            _this._dbInfo.mStore.clear();
        });
        executeCallback(promise, callback);
        return promise;
    }

    function dropInstance(_options, _cb) {
        var _a = dropInstanceCommon.apply(this, arguments), promise = _a.promise, callback = _a.callback;
        var outPromise = promise.then(function (keyPrefix) {
            Store.resolve(keyPrefix).drop();
        });
        executeCallback(outPromise, callback);
        return promise;
    }

    function getItem(key$, callback) {
        var _this = this;
        key$ = normaliseKey(key$);
        var promise = this.ready().then(function () {
            var result = _this._dbInfo.mStore.get(key$);
            // Deserialise if the result is not null or undefined
            return result == null ? null : _this._dbInfo.serializer.deserialize(result); //tslint:disable-line:triple-equals
        });
        executeCallback(promise, callback);
        return promise;
    }

    function iterate(iterator, callback) {
        var _this = this;
        var promise = this.ready().then(function () {
            var store = _this._dbInfo.mStore;
            var keys = store.keys();
            for (var i = 0; i < keys.length; i++) {
                var value = store.get(keys[i]);
                // If a result was found, parse it from the serialized
                // string into a JS object. If result isn't truthy, the
                // key is likely undefined and we'll pass it straight
                // to the iterator.
                if (value) {
                    value = _this._dbInfo.serializer.deserialize(value);
                }
                value = iterator(value, keys[i], i + 1);
                if (value !== undefined) {
                    return value;
                }
            }
        });
        executeCallback(promise, callback);
        return promise;
    }

    function key(idx, callback) {
        var _this = this;
        var promise = this.ready().then(function () {
            var result;
            try {
                result = _this._dbInfo.mStore.key(idx);
                if (result === undefined) {
                    result = null;
                }
            }
            catch (_a) {
                result = null;
            }
            return result;
        });
        executeCallback(promise, callback);
        return promise;
    }

    function keys(callback) {
        var _this = this;
        var promise = this.ready().then(function () {
            return _this._dbInfo.mStore.keys();
        });
        executeCallback(promise, callback);
        return promise;
    }

    function length(callback) {
        var promise = this.keys().then(function (keys$) { return keys$.length; });
        executeCallback(promise, callback);
        return promise;
    }

    function removeItem(key$, callback) {
        var _this = this;
        key$ = normaliseKey(key$);
        var promise = this.ready().then(function () {
            _this._dbInfo.mStore.rm(key$);
        });
        executeCallback(promise, callback);
        return promise;
    }

    function setItem(key$, value, callback) {
        var _this = this;
        key$ = normaliseKey(key$);
        var promise = this.ready().then(function () {
            if (value === undefined) {
                value = null;
            }
            // Save the original value to pass to the callback.
            var originalValue = value;
            return new Promise(function (resolve, reject) {
                _this._dbInfo.serializer.serialize(value, function (value$, error) {
                    if (error) {
                        reject(error);
                    }
                    else {
                        try {
                            _this._dbInfo.mStore.set(key$, value$);
                            resolve(originalValue);
                        }
                        catch (e) {
                            reject(e);
                        }
                    }
                });
            });
        });
        executeCallback(promise, callback);
        return promise;
    }

    var _support = true;

    exports._support = _support;
    exports._driver = _driver;
    exports._initStorage = _initStorage;
    exports.clear = clear;
    exports.dropInstance = dropInstance;
    exports.getItem = getItem;
    exports.iterate = iterate;
    exports.key = key;
    exports.keys = keys;
    exports.length = length;
    exports.removeItem = removeItem;
    exports.setItem = setItem;

    Object.defineProperty(exports, '__esModule', { value: true });

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


/***/ }),

/***/ "./node_modules/localforage-setitems/dist/localforage-setitems.js":
/*!************************************************************************!*\
  !*** ./node_modules/localforage-setitems/dist/localforage-setitems.js ***!
  \************************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

(function (global, factory) {
     true ? factory(exports, __webpack_require__(/*! localforage */ "./node_modules/localforage/dist/localforage.js")) :
    0;
}(this, (function (exports,localforage) { 'use strict';

localforage = 'default' in localforage ? localforage['default'] : localforage;

function getSerializerPromise(localForageInstance) {
    if (getSerializerPromise.result) {
        return getSerializerPromise.result;
    }
    if (!localForageInstance || typeof localForageInstance.getSerializer !== 'function') {
        return Promise.reject(new Error('localforage.getSerializer() was not available! ' + 'localforage v1.4+ is required!'));
    }
    getSerializerPromise.result = localForageInstance.getSerializer();
    return getSerializerPromise.result;
}



function executeCallback(promise, callback) {
    if (callback) {
        promise.then(function (result) {
            callback(null, result);
        }, function (error) {
            callback(error);
        });
    }
}

function forEachItem(items, keyFn, valueFn, loopFn) {
    function ensurePropGetterMethod(propFn, defaultPropName) {
        var propName = propFn || defaultPropName;

        if ((!propFn || typeof propFn !== 'function') && typeof propName === 'string') {
            propFn = function propFn(item) {
                return item[propName];
            };
        }
        return propFn;
    }

    var result = [];
    // http://stackoverflow.com/questions/4775722/check-if-object-is-array
    if (Object.prototype.toString.call(items) === '[object Array]') {
        keyFn = ensurePropGetterMethod(keyFn, 'key');
        valueFn = ensurePropGetterMethod(valueFn, 'value');

        for (var i = 0, len = items.length; i < len; i++) {
            var item = items[i];
            result.push(loopFn(keyFn(item), valueFn(item)));
        }
    } else {
        for (var prop in items) {
            if (items.hasOwnProperty(prop)) {
                result.push(loopFn(prop, items[prop]));
            }
        }
    }
    return result;
}

function setItemsIndexedDB(items, keyFn, valueFn, callback) {
    var localforageInstance = this;

    var promise = localforageInstance.ready().then(function () {
        return new Promise(function (resolve, reject) {
            // Inspired from @lu4 PR mozilla/localForage#318
            var dbInfo = localforageInstance._dbInfo;
            var transaction = dbInfo.db.transaction(dbInfo.storeName, 'readwrite');
            var store = transaction.objectStore(dbInfo.storeName);
            var lastError;

            transaction.oncomplete = function () {
                resolve(items);
            };
            transaction.onabort = transaction.onerror = function (event) {
                reject(lastError || event.target);
            };

            function requestOnError(evt) {
                var request = evt.target || this;
                lastError = request.error || request.transaction.error;
                reject(lastError);
            }

            forEachItem(items, keyFn, valueFn, function (key, value) {
                // The reason we don't _save_ null is because IE 10 does
                // not support saving the `null` type in IndexedDB. How
                // ironic, given the bug below!
                // See: https://github.com/mozilla/localForage/issues/161
                if (value === null) {
                    value = undefined;
                }
                var request = store.put(value, key);
                request.onerror = requestOnError;
            });
        });
    });
    executeCallback(promise, callback);
    return promise;
}

function setItemsWebsql(items, keyFn, valueFn, callback) {
    var localforageInstance = this;
    var promise = new Promise(function (resolve, reject) {
        localforageInstance.ready().then(function () {
            return getSerializerPromise(localforageInstance);
        }).then(function (serializer) {
            // Inspired from @lu4 PR mozilla/localForage#318
            var dbInfo = localforageInstance._dbInfo;
            dbInfo.db.transaction(function (t) {

                var query = 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' (key, value) VALUES (?, ?)';

                var itemPromises = forEachItem(items, keyFn, valueFn, function (key, value) {
                    return new Promise(function (resolve, reject) {
                        serializer.serialize(value, function (value, error) {
                            if (error) {
                                reject(error);
                            } else {
                                t.executeSql(query, [key, value], function () {
                                    resolve();
                                }, function (t, error) {
                                    reject(error);
                                });
                            }
                        });
                    });
                });

                Promise.all(itemPromises).then(function () {
                    resolve(items);
                }, reject);
            }, function (sqlError) {
                reject(sqlError);
            } /*, function() {
                 if (resolving) {
                     resolve(items);
                 }
              }*/);
        }).catch(reject);
    });
    executeCallback(promise, callback);
    return promise;
}

function setItemsGeneric(items, keyFn, valueFn, callback) {
    var localforageInstance = this;

    var itemPromises = forEachItem(items, keyFn, valueFn, function (key, value) {
        return localforageInstance.setItem(key, value);
    });
    var promise = Promise.all(itemPromises);

    executeCallback(promise, callback);
    return promise;
}

function localforageSetItems(items, keyFn, valueFn, callback) {
    var localforageInstance = this;
    var currentDriver = localforageInstance.driver();

    if (currentDriver === localforageInstance.INDEXEDDB) {
        return setItemsIndexedDB.call(localforageInstance, items, keyFn, valueFn, callback);
    } else if (currentDriver === localforageInstance.WEBSQL) {
        return setItemsWebsql.call(localforageInstance, items, keyFn, valueFn, callback);
    } else {
        return setItemsGeneric.call(localforageInstance, items, keyFn, valueFn, callback);
    }
}

function extendPrototype(localforage$$1) {
    var localforagePrototype = Object.getPrototypeOf(localforage$$1);
    if (localforagePrototype) {
        localforagePrototype.setItems = localforageSetItems;
        localforagePrototype.setItems.indexedDB = function () {
            return setItemsIndexedDB.apply(this, arguments);
        };
        localforagePrototype.setItems.websql = function () {
            return setItemsWebsql.apply(this, arguments);
        };
        localforagePrototype.setItems.generic = function () {
            return setItemsGeneric.apply(this, arguments);
        };
    }
}

var extendPrototypeResult = extendPrototype(localforage);

exports.setItemsGeneric = setItemsGeneric;
exports.localforageSetItems = localforageSetItems;
exports.extendPrototype = extendPrototype;
exports.extendPrototypeResult = extendPrototypeResult;

Object.defineProperty(exports, '__esModule', { value: true });

})));


/***/ }),

/***/ "./node_modules/localforage-webextensionstorage-driver/driver.js":
/*!***********************************************************************!*\
  !*** ./node_modules/localforage-webextensionstorage-driver/driver.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = createDriver;

var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));

var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));

var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));

var _utils = __webpack_require__(/*! ./utils */ "./node_modules/localforage-webextensionstorage-driver/utils.js");

function createDriver(name, property) {
  var storage = (0, _utils.getStorage)();
  var support = !!(storage && storage[property]);
  var driver = support ? storage[property] : {
    clear: function clear() {},
    get: function get() {},
    remove: function remove() {},
    set: function set() {}
  };

  var _clear = driver.clear.bind(driver);

  var get = driver.get.bind(driver);
  var remove = driver.remove.bind(driver);
  var set = driver.set.bind(driver);
  return {
    _driver: name,
    _support: support,
    // eslint-disable-next-line no-underscore-dangle
    _initStorage: function _initStorage() {
      return Promise.resolve();
    },
    clear: function clear(callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
        return _regenerator["default"].wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _clear();

                if (callback) callback();

              case 2:
              case "end":
                return _context.stop();
            }
          }
        }, _callee);
      }))();
    },
    iterate: function iterate(iterator, callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
        var items, keys;
        return _regenerator["default"].wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.next = 2;
                return (0, _utils.usePromise)(get, null);

              case 2:
                items = _context2.sent;
                keys = Object.keys(items);
                keys.forEach(function (key, i) {
                  return iterator(items[key], key, i);
                });
                if (callback) callback();

              case 6:
              case "end":
                return _context2.stop();
            }
          }
        }, _callee2);
      }))();
    },
    getItem: function getItem(key, callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
        var result;
        return _regenerator["default"].wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                _context3.prev = 0;
                _context3.next = 3;
                return (0, _utils.usePromise)(get, key);

              case 3:
                result = _context3.sent;
                result = typeof key === 'string' ? result[key] : result;
                result = result === undefined ? null : result;
                if (callback) callback(null, result);
                return _context3.abrupt("return", result);

              case 10:
                _context3.prev = 10;
                _context3.t0 = _context3["catch"](0);
                if (callback) callback(_context3.t0);
                throw _context3.t0;

              case 14:
              case "end":
                return _context3.stop();
            }
          }
        }, _callee3, null, [[0, 10]]);
      }))();
    },
    key: function key(n, callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
        var results, key;
        return _regenerator["default"].wrap(function _callee4$(_context4) {
          while (1) {
            switch (_context4.prev = _context4.next) {
              case 0:
                _context4.next = 2;
                return (0, _utils.usePromise)(get, null);

              case 2:
                results = _context4.sent;
                key = Object.keys(results)[n];
                if (callback) callback(key);
                return _context4.abrupt("return", key);

              case 6:
              case "end":
                return _context4.stop();
            }
          }
        }, _callee4);
      }))();
    },
    keys: function keys(callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
        var results, keys;
        return _regenerator["default"].wrap(function _callee5$(_context5) {
          while (1) {
            switch (_context5.prev = _context5.next) {
              case 0:
                _context5.next = 2;
                return (0, _utils.usePromise)(get, null);

              case 2:
                results = _context5.sent;
                keys = Object.keys(results);
                if (callback) callback(keys);
                return _context5.abrupt("return", keys);

              case 6:
              case "end":
                return _context5.stop();
            }
          }
        }, _callee5);
      }))();
    },
    length: function length(callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
        var results, _Object$keys, length;

        return _regenerator["default"].wrap(function _callee6$(_context6) {
          while (1) {
            switch (_context6.prev = _context6.next) {
              case 0:
                _context6.next = 2;
                return (0, _utils.usePromise)(get, null);

              case 2:
                results = _context6.sent;
                _Object$keys = Object.keys(results), length = _Object$keys.length;
                if (callback) callback(length);
                return _context6.abrupt("return", length);

              case 6:
              case "end":
                return _context6.stop();
            }
          }
        }, _callee6);
      }))();
    },
    removeItem: function removeItem(key, callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
        return _regenerator["default"].wrap(function _callee7$(_context7) {
          while (1) {
            switch (_context7.prev = _context7.next) {
              case 0:
                _context7.next = 2;
                return (0, _utils.usePromise)(remove, key);

              case 2:
                if (callback) callback();

              case 3:
              case "end":
                return _context7.stop();
            }
          }
        }, _callee7);
      }))();
    },
    setItem: function setItem(key, value, callback) {
      return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
        return _regenerator["default"].wrap(function _callee8$(_context8) {
          while (1) {
            switch (_context8.prev = _context8.next) {
              case 0:
                _context8.next = 2;
                return (0, _utils.usePromise)(set, (0, _defineProperty2["default"])({}, key, value));

              case 2:
                if (callback) callback();

              case 3:
              case "end":
                return _context8.stop();
            }
          }
        }, _callee8);
      }))();
    }
  };
}

/***/ }),

/***/ "./node_modules/localforage-webextensionstorage-driver/local.js":
/*!**********************************************************************!*\
  !*** ./node_modules/localforage-webextensionstorage-driver/local.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _driver = _interopRequireDefault(__webpack_require__(/*! ./driver */ "./node_modules/localforage-webextensionstorage-driver/driver.js"));

var _default = (0, _driver["default"])('webExtensionLocalStorage', 'local');

exports["default"] = _default;

/***/ }),

/***/ "./node_modules/localforage-webextensionstorage-driver/sync.js":
/*!*********************************************************************!*\
  !*** ./node_modules/localforage-webextensionstorage-driver/sync.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _driver = _interopRequireDefault(__webpack_require__(/*! ./driver */ "./node_modules/localforage-webextensionstorage-driver/driver.js"));

var _default = (0, _driver["default"])('webExtensionSyncStorage', 'sync');

exports["default"] = _default;

/***/ }),

/***/ "./node_modules/localforage-webextensionstorage-driver/utils.js":
/*!**********************************************************************!*\
  !*** ./node_modules/localforage-webextensionstorage-driver/utils.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, exports) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.getStorage = getStorage;
exports.usePromise = usePromise;

/**
 * Need to invoke a function at runtime instead of import-time to make tests
 * pass with mocked browser and chrome objects
 */
function getStorage() {
  return typeof browser !== 'undefined' && browser.storage || typeof chrome !== 'undefined' && chrome.storage;
}
/**
 * Need to invoke a function at runtime instead of import-time to make tests
 * pass with mocked browser and chrome objects
 */


function usesPromises() {
  var storage = getStorage();

  try {
    return storage && storage.local.get && storage.local.get() && typeof storage.local.get().then === 'function';
  } catch (e) {
    return false;
  }
}
/**
 * Converts a callback-based API to a promise based API.
 * For now we assume that there is only one arg in addition to the callback
 */


function usePromise(fn, arg) {
  if (usesPromises()) {
    return fn(arg);
  }

  return new Promise(function (resolve) {
    fn(arg, function () {
      resolve.apply(void 0, arguments);
    });
  });
}

/***/ }),

/***/ "./node_modules/localforage/dist/localforage.js":
/*!******************************************************!*\
  !*** ./node_modules/localforage/dist/localforage.js ***!
  \******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

/*!
    localForage -- Offline Storage, Improved
    Version 1.10.0
    https://localforage.github.io/localForage
    (c) 2013-2017 Mozilla, Apache License 2.0
*/
(function(f){if(true){module.exports=f()}else // removed by dead control flow
{ var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=undefined;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw (f.code="MODULE_NOT_FOUND", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=undefined;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
(function (global){
'use strict';
var Mutation = global.MutationObserver || global.WebKitMutationObserver;

var scheduleDrain;

{
  if (Mutation) {
    var called = 0;
    var observer = new Mutation(nextTick);
    var element = global.document.createTextNode('');
    observer.observe(element, {
      characterData: true
    });
    scheduleDrain = function () {
      element.data = (called = ++called % 2);
    };
  } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {
    var channel = new global.MessageChannel();
    channel.port1.onmessage = nextTick;
    scheduleDrain = function () {
      channel.port2.postMessage(0);
    };
  } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {
    scheduleDrain = function () {

      // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
      // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
      var scriptEl = global.document.createElement('script');
      scriptEl.onreadystatechange = function () {
        nextTick();

        scriptEl.onreadystatechange = null;
        scriptEl.parentNode.removeChild(scriptEl);
        scriptEl = null;
      };
      global.document.documentElement.appendChild(scriptEl);
    };
  } else {
    scheduleDrain = function () {
      setTimeout(nextTick, 0);
    };
  }
}

var draining;
var queue = [];
//named nextTick for less confusing stack traces
function nextTick() {
  draining = true;
  var i, oldQueue;
  var len = queue.length;
  while (len) {
    oldQueue = queue;
    queue = [];
    i = -1;
    while (++i < len) {
      oldQueue[i]();
    }
    len = queue.length;
  }
  draining = false;
}

module.exports = immediate;
function immediate(task) {
  if (queue.push(task) === 1 && !draining) {
    scheduleDrain();
  }
}

}).call(this,typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],2:[function(_dereq_,module,exports){
'use strict';
var immediate = _dereq_(1);

/* istanbul ignore next */
function INTERNAL() {}

var handlers = {};

var REJECTED = ['REJECTED'];
var FULFILLED = ['FULFILLED'];
var PENDING = ['PENDING'];

module.exports = Promise;

function Promise(resolver) {
  if (typeof resolver !== 'function') {
    throw new TypeError('resolver must be a function');
  }
  this.state = PENDING;
  this.queue = [];
  this.outcome = void 0;
  if (resolver !== INTERNAL) {
    safelyResolveThenable(this, resolver);
  }
}

Promise.prototype["catch"] = function (onRejected) {
  return this.then(null, onRejected);
};
Promise.prototype.then = function (onFulfilled, onRejected) {
  if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||
    typeof onRejected !== 'function' && this.state === REJECTED) {
    return this;
  }
  var promise = new this.constructor(INTERNAL);
  if (this.state !== PENDING) {
    var resolver = this.state === FULFILLED ? onFulfilled : onRejected;
    unwrap(promise, resolver, this.outcome);
  } else {
    this.queue.push(new QueueItem(promise, onFulfilled, onRejected));
  }

  return promise;
};
function QueueItem(promise, onFulfilled, onRejected) {
  this.promise = promise;
  if (typeof onFulfilled === 'function') {
    this.onFulfilled = onFulfilled;
    this.callFulfilled = this.otherCallFulfilled;
  }
  if (typeof onRejected === 'function') {
    this.onRejected = onRejected;
    this.callRejected = this.otherCallRejected;
  }
}
QueueItem.prototype.callFulfilled = function (value) {
  handlers.resolve(this.promise, value);
};
QueueItem.prototype.otherCallFulfilled = function (value) {
  unwrap(this.promise, this.onFulfilled, value);
};
QueueItem.prototype.callRejected = function (value) {
  handlers.reject(this.promise, value);
};
QueueItem.prototype.otherCallRejected = function (value) {
  unwrap(this.promise, this.onRejected, value);
};

function unwrap(promise, func, value) {
  immediate(function () {
    var returnValue;
    try {
      returnValue = func(value);
    } catch (e) {
      return handlers.reject(promise, e);
    }
    if (returnValue === promise) {
      handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));
    } else {
      handlers.resolve(promise, returnValue);
    }
  });
}

handlers.resolve = function (self, value) {
  var result = tryCatch(getThen, value);
  if (result.status === 'error') {
    return handlers.reject(self, result.value);
  }
  var thenable = result.value;

  if (thenable) {
    safelyResolveThenable(self, thenable);
  } else {
    self.state = FULFILLED;
    self.outcome = value;
    var i = -1;
    var len = self.queue.length;
    while (++i < len) {
      self.queue[i].callFulfilled(value);
    }
  }
  return self;
};
handlers.reject = function (self, error) {
  self.state = REJECTED;
  self.outcome = error;
  var i = -1;
  var len = self.queue.length;
  while (++i < len) {
    self.queue[i].callRejected(error);
  }
  return self;
};

function getThen(obj) {
  // Make sure we only access the accessor once as required by the spec
  var then = obj && obj.then;
  if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {
    return function appyThen() {
      then.apply(obj, arguments);
    };
  }
}

function safelyResolveThenable(self, thenable) {
  // Either fulfill, reject or reject with error
  var called = false;
  function onError(value) {
    if (called) {
      return;
    }
    called = true;
    handlers.reject(self, value);
  }

  function onSuccess(value) {
    if (called) {
      return;
    }
    called = true;
    handlers.resolve(self, value);
  }

  function tryToUnwrap() {
    thenable(onSuccess, onError);
  }

  var result = tryCatch(tryToUnwrap);
  if (result.status === 'error') {
    onError(result.value);
  }
}

function tryCatch(func, value) {
  var out = {};
  try {
    out.value = func(value);
    out.status = 'success';
  } catch (e) {
    out.status = 'error';
    out.value = e;
  }
  return out;
}

Promise.resolve = resolve;
function resolve(value) {
  if (value instanceof this) {
    return value;
  }
  return handlers.resolve(new this(INTERNAL), value);
}

Promise.reject = reject;
function reject(reason) {
  var promise = new this(INTERNAL);
  return handlers.reject(promise, reason);
}

Promise.all = all;
function all(iterable) {
  var self = this;
  if (Object.prototype.toString.call(iterable) !== '[object Array]') {
    return this.reject(new TypeError('must be an array'));
  }

  var len = iterable.length;
  var called = false;
  if (!len) {
    return this.resolve([]);
  }

  var values = new Array(len);
  var resolved = 0;
  var i = -1;
  var promise = new this(INTERNAL);

  while (++i < len) {
    allResolver(iterable[i], i);
  }
  return promise;
  function allResolver(value, i) {
    self.resolve(value).then(resolveFromAll, function (error) {
      if (!called) {
        called = true;
        handlers.reject(promise, error);
      }
    });
    function resolveFromAll(outValue) {
      values[i] = outValue;
      if (++resolved === len && !called) {
        called = true;
        handlers.resolve(promise, values);
      }
    }
  }
}

Promise.race = race;
function race(iterable) {
  var self = this;
  if (Object.prototype.toString.call(iterable) !== '[object Array]') {
    return this.reject(new TypeError('must be an array'));
  }

  var len = iterable.length;
  var called = false;
  if (!len) {
    return this.resolve([]);
  }

  var i = -1;
  var promise = new this(INTERNAL);

  while (++i < len) {
    resolver(iterable[i]);
  }
  return promise;
  function resolver(value) {
    self.resolve(value).then(function (response) {
      if (!called) {
        called = true;
        handlers.resolve(promise, response);
      }
    }, function (error) {
      if (!called) {
        called = true;
        handlers.reject(promise, error);
      }
    });
  }
}

},{"1":1}],3:[function(_dereq_,module,exports){
(function (global){
'use strict';
if (typeof global.Promise !== 'function') {
  global.Promise = _dereq_(2);
}

}).call(this,typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"2":2}],4:[function(_dereq_,module,exports){
'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function getIDB() {
    /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */
    try {
        if (typeof indexedDB !== 'undefined') {
            return indexedDB;
        }
        if (typeof webkitIndexedDB !== 'undefined') {
            return webkitIndexedDB;
        }
        if (typeof mozIndexedDB !== 'undefined') {
            return mozIndexedDB;
        }
        if (typeof OIndexedDB !== 'undefined') {
            return OIndexedDB;
        }
        if (typeof msIndexedDB !== 'undefined') {
            return msIndexedDB;
        }
    } catch (e) {
        return;
    }
}

var idb = getIDB();

function isIndexedDBValid() {
    try {
        // Initialize IndexedDB; fall back to vendor-prefixed versions
        // if needed.
        if (!idb || !idb.open) {
            return false;
        }
        // We mimic PouchDB here;
        //
        // We test for openDatabase because IE Mobile identifies itself
        // as Safari. Oh the lulz...
        var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);

        var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;

        // Safari <10.1 does not meet our requirements for IDB support
        // (see: https://github.com/pouchdb/pouchdb/issues/5572).
        // Safari 10.1 shipped with fetch, we can use that to detect it.
        // Note: this creates issues with `window.fetch` polyfills and
        // overrides; see:
        // https://github.com/localForage/localForage/issues/856
        return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&
        // some outdated implementations of IDB that appear on Samsung
        // and HTC Android devices <4.4 are missing IDBKeyRange
        // See: https://github.com/mozilla/localForage/issues/128
        // See: https://github.com/mozilla/localForage/issues/272
        typeof IDBKeyRange !== 'undefined';
    } catch (e) {
        return false;
    }
}

// Abstracts constructing a Blob object, so it also works in older
// browsers that don't support the native Blob constructor. (i.e.
// old QtWebKit versions, at least).
// Abstracts constructing a Blob object, so it also works in older
// browsers that don't support the native Blob constructor. (i.e.
// old QtWebKit versions, at least).
function createBlob(parts, properties) {
    /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
    parts = parts || [];
    properties = properties || {};
    try {
        return new Blob(parts, properties);
    } catch (e) {
        if (e.name !== 'TypeError') {
            throw e;
        }
        var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;
        var builder = new Builder();
        for (var i = 0; i < parts.length; i += 1) {
            builder.append(parts[i]);
        }
        return builder.getBlob(properties.type);
    }
}

// This is CommonJS because lie is an external dependency, so Rollup
// can just ignore it.
if (typeof Promise === 'undefined') {
    // In the "nopromises" build this will just throw if you don't have
    // a global promise object, but it would throw anyway later.
    _dereq_(3);
}
var Promise$1 = Promise;

function executeCallback(promise, callback) {
    if (callback) {
        promise.then(function (result) {
            callback(null, result);
        }, function (error) {
            callback(error);
        });
    }
}

function executeTwoCallbacks(promise, callback, errorCallback) {
    if (typeof callback === 'function') {
        promise.then(callback);
    }

    if (typeof errorCallback === 'function') {
        promise["catch"](errorCallback);
    }
}

function normalizeKey(key) {
    // Cast the key to a string, as that's all we can set as a key.
    if (typeof key !== 'string') {
        console.warn(key + ' used as a key, but it is not a string.');
        key = String(key);
    }

    return key;
}

function getCallback() {
    if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
        return arguments[arguments.length - 1];
    }
}

// Some code originally from async_storage.js in
// [Gaia](https://github.com/mozilla-b2g/gaia).

var DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';
var supportsBlobs = void 0;
var dbContexts = {};
var toString = Object.prototype.toString;

// Transaction Modes
var READ_ONLY = 'readonly';
var READ_WRITE = 'readwrite';

// Transform a binary string to an array buffer, because otherwise
// weird stuff happens when you try to work with the binary string directly.
// It is known.
// From http://stackoverflow.com/questions/14967647/ (continues on next line)
// encode-decode-image-with-base64-breaks-image (2013-04-21)
function _binStringToArrayBuffer(bin) {
    var length = bin.length;
    var buf = new ArrayBuffer(length);
    var arr = new Uint8Array(buf);
    for (var i = 0; i < length; i++) {
        arr[i] = bin.charCodeAt(i);
    }
    return buf;
}

//
// Blobs are not supported in all versions of IndexedDB, notably
// Chrome <37 and Android <5. In those versions, storing a blob will throw.
//
// Various other blob bugs exist in Chrome v37-42 (inclusive).
// Detecting them is expensive and confusing to users, and Chrome 37-42
// is at very low usage worldwide, so we do a hacky userAgent check instead.
//
// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120
// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916
// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836
//
// Code borrowed from PouchDB. See:
// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js
//
function _checkBlobSupportWithoutCaching(idb) {
    return new Promise$1(function (resolve) {
        var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);
        var blob = createBlob(['']);
        txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');

        txn.onabort = function (e) {
            // If the transaction aborts now its due to not being able to
            // write to the database, likely due to the disk being full
            e.preventDefault();
            e.stopPropagation();
            resolve(false);
        };

        txn.oncomplete = function () {
            var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/);
            var matchedEdge = navigator.userAgent.match(/Edge\//);
            // MS Edge pretends to be Chrome 42:
            // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx
            resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);
        };
    })["catch"](function () {
        return false; // error, so assume unsupported
    });
}

function _checkBlobSupport(idb) {
    if (typeof supportsBlobs === 'boolean') {
        return Promise$1.resolve(supportsBlobs);
    }
    return _checkBlobSupportWithoutCaching(idb).then(function (value) {
        supportsBlobs = value;
        return supportsBlobs;
    });
}

function _deferReadiness(dbInfo) {
    var dbContext = dbContexts[dbInfo.name];

    // Create a deferred object representing the current database operation.
    var deferredOperation = {};

    deferredOperation.promise = new Promise$1(function (resolve, reject) {
        deferredOperation.resolve = resolve;
        deferredOperation.reject = reject;
    });

    // Enqueue the deferred operation.
    dbContext.deferredOperations.push(deferredOperation);

    // Chain its promise to the database readiness.
    if (!dbContext.dbReady) {
        dbContext.dbReady = deferredOperation.promise;
    } else {
        dbContext.dbReady = dbContext.dbReady.then(function () {
            return deferredOperation.promise;
        });
    }
}

function _advanceReadiness(dbInfo) {
    var dbContext = dbContexts[dbInfo.name];

    // Dequeue a deferred operation.
    var deferredOperation = dbContext.deferredOperations.pop();

    // Resolve its promise (which is part of the database readiness
    // chain of promises).
    if (deferredOperation) {
        deferredOperation.resolve();
        return deferredOperation.promise;
    }
}

function _rejectReadiness(dbInfo, err) {
    var dbContext = dbContexts[dbInfo.name];

    // Dequeue a deferred operation.
    var deferredOperation = dbContext.deferredOperations.pop();

    // Reject its promise (which is part of the database readiness
    // chain of promises).
    if (deferredOperation) {
        deferredOperation.reject(err);
        return deferredOperation.promise;
    }
}

function _getConnection(dbInfo, upgradeNeeded) {
    return new Promise$1(function (resolve, reject) {
        dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();

        if (dbInfo.db) {
            if (upgradeNeeded) {
                _deferReadiness(dbInfo);
                dbInfo.db.close();
            } else {
                return resolve(dbInfo.db);
            }
        }

        var dbArgs = [dbInfo.name];

        if (upgradeNeeded) {
            dbArgs.push(dbInfo.version);
        }

        var openreq = idb.open.apply(idb, dbArgs);

        if (upgradeNeeded) {
            openreq.onupgradeneeded = function (e) {
                var db = openreq.result;
                try {
                    db.createObjectStore(dbInfo.storeName);
                    if (e.oldVersion <= 1) {
                        // Added when support for blob shims was added
                        db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);
                    }
                } catch (ex) {
                    if (ex.name === 'ConstraintError') {
                        console.warn('The database "' + dbInfo.name + '"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage "' + dbInfo.storeName + '" already exists.');
                    } else {
                        throw ex;
                    }
                }
            };
        }

        openreq.onerror = function (e) {
            e.preventDefault();
            reject(openreq.error);
        };

        openreq.onsuccess = function () {
            var db = openreq.result;
            db.onversionchange = function (e) {
                // Triggered when the database is modified (e.g. adding an objectStore) or
                // deleted (even when initiated by other sessions in different tabs).
                // Closing the connection here prevents those operations from being blocked.
                // If the database is accessed again later by this instance, the connection
                // will be reopened or the database recreated as needed.
                e.target.close();
            };
            resolve(db);
            _advanceReadiness(dbInfo);
        };
    });
}

function _getOriginalConnection(dbInfo) {
    return _getConnection(dbInfo, false);
}

function _getUpgradedConnection(dbInfo) {
    return _getConnection(dbInfo, true);
}

function _isUpgradeNeeded(dbInfo, defaultVersion) {
    if (!dbInfo.db) {
        return true;
    }

    var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);
    var isDowngrade = dbInfo.version < dbInfo.db.version;
    var isUpgrade = dbInfo.version > dbInfo.db.version;

    if (isDowngrade) {
        // If the version is not the default one
        // then warn for impossible downgrade.
        if (dbInfo.version !== defaultVersion) {
            console.warn('The database "' + dbInfo.name + '"' + " can't be downgraded from version " + dbInfo.db.version + ' to version ' + dbInfo.version + '.');
        }
        // Align the versions to prevent errors.
        dbInfo.version = dbInfo.db.version;
    }

    if (isUpgrade || isNewStore) {
        // If the store is new then increment the version (if needed).
        // This will trigger an "upgradeneeded" event which is required
        // for creating a store.
        if (isNewStore) {
            var incVersion = dbInfo.db.version + 1;
            if (incVersion > dbInfo.version) {
                dbInfo.version = incVersion;
            }
        }

        return true;
    }

    return false;
}

// encode a blob for indexeddb engines that don't support blobs
function _encodeBlob(blob) {
    return new Promise$1(function (resolve, reject) {
        var reader = new FileReader();
        reader.onerror = reject;
        reader.onloadend = function (e) {
            var base64 = btoa(e.target.result || '');
            resolve({
                __local_forage_encoded_blob: true,
                data: base64,
                type: blob.type
            });
        };
        reader.readAsBinaryString(blob);
    });
}

// decode an encoded blob
function _decodeBlob(encodedBlob) {
    var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));
    return createBlob([arrayBuff], { type: encodedBlob.type });
}

// is this one of our fancy encoded blobs?
function _isEncodedBlob(value) {
    return value && value.__local_forage_encoded_blob;
}

// Specialize the default `ready()` function by making it dependent
// on the current database operations. Thus, the driver will be actually
// ready when it's been initialized (default) *and* there are no pending
// operations on the database (initiated by some other instances).
function _fullyReady(callback) {
    var self = this;

    var promise = self._initReady().then(function () {
        var dbContext = dbContexts[self._dbInfo.name];

        if (dbContext && dbContext.dbReady) {
            return dbContext.dbReady;
        }
    });

    executeTwoCallbacks(promise, callback, callback);
    return promise;
}

// Try to establish a new db connection to replace the
// current one which is broken (i.e. experiencing
// InvalidStateError while creating a transaction).
function _tryReconnect(dbInfo) {
    _deferReadiness(dbInfo);

    var dbContext = dbContexts[dbInfo.name];
    var forages = dbContext.forages;

    for (var i = 0; i < forages.length; i++) {
        var forage = forages[i];
        if (forage._dbInfo.db) {
            forage._dbInfo.db.close();
            forage._dbInfo.db = null;
        }
    }
    dbInfo.db = null;

    return _getOriginalConnection(dbInfo).then(function (db) {
        dbInfo.db = db;
        if (_isUpgradeNeeded(dbInfo)) {
            // Reopen the database for upgrading.
            return _getUpgradedConnection(dbInfo);
        }
        return db;
    }).then(function (db) {
        // store the latest db reference
        // in case the db was upgraded
        dbInfo.db = dbContext.db = db;
        for (var i = 0; i < forages.length; i++) {
            forages[i]._dbInfo.db = db;
        }
    })["catch"](function (err) {
        _rejectReadiness(dbInfo, err);
        throw err;
    });
}

// FF doesn't like Promises (micro-tasks) and IDDB store operations,
// so we have to do it with callbacks
function createTransaction(dbInfo, mode, callback, retries) {
    if (retries === undefined) {
        retries = 1;
    }

    try {
        var tx = dbInfo.db.transaction(dbInfo.storeName, mode);
        callback(null, tx);
    } catch (err) {
        if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {
            return Promise$1.resolve().then(function () {
                if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {
                    // increase the db version, to create the new ObjectStore
                    if (dbInfo.db) {
                        dbInfo.version = dbInfo.db.version + 1;
                    }
                    // Reopen the database for upgrading.
                    return _getUpgradedConnection(dbInfo);
                }
            }).then(function () {
                return _tryReconnect(dbInfo).then(function () {
                    createTransaction(dbInfo, mode, callback, retries - 1);
                });
            })["catch"](callback);
        }

        callback(err);
    }
}

function createDbContext() {
    return {
        // Running localForages sharing a database.
        forages: [],
        // Shared database.
        db: null,
        // Database readiness (promise).
        dbReady: null,
        // Deferred operations on the database.
        deferredOperations: []
    };
}

// Open the IndexedDB database (automatically creates one if one didn't
// previously exist), using any options set in the config.
function _initStorage(options) {
    var self = this;
    var dbInfo = {
        db: null
    };

    if (options) {
        for (var i in options) {
            dbInfo[i] = options[i];
        }
    }

    // Get the current context of the database;
    var dbContext = dbContexts[dbInfo.name];

    // ...or create a new context.
    if (!dbContext) {
        dbContext = createDbContext();
        // Register the new context in the global container.
        dbContexts[dbInfo.name] = dbContext;
    }

    // Register itself as a running localForage in the current context.
    dbContext.forages.push(self);

    // Replace the default `ready()` function with the specialized one.
    if (!self._initReady) {
        self._initReady = self.ready;
        self.ready = _fullyReady;
    }

    // Create an array of initialization states of the related localForages.
    var initPromises = [];

    function ignoreErrors() {
        // Don't handle errors here,
        // just makes sure related localForages aren't pending.
        return Promise$1.resolve();
    }

    for (var j = 0; j < dbContext.forages.length; j++) {
        var forage = dbContext.forages[j];
        if (forage !== self) {
            // Don't wait for itself...
            initPromises.push(forage._initReady()["catch"](ignoreErrors));
        }
    }

    // Take a snapshot of the related localForages.
    var forages = dbContext.forages.slice(0);

    // Initialize the connection process only when
    // all the related localForages aren't pending.
    return Promise$1.all(initPromises).then(function () {
        dbInfo.db = dbContext.db;
        // Get the connection or open a new one without upgrade.
        return _getOriginalConnection(dbInfo);
    }).then(function (db) {
        dbInfo.db = db;
        if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {
            // Reopen the database for upgrading.
            return _getUpgradedConnection(dbInfo);
        }
        return db;
    }).then(function (db) {
        dbInfo.db = dbContext.db = db;
        self._dbInfo = dbInfo;
        // Share the final connection amongst related localForages.
        for (var k = 0; k < forages.length; k++) {
            var forage = forages[k];
            if (forage !== self) {
                // Self is already up-to-date.
                forage._dbInfo.db = dbInfo.db;
                forage._dbInfo.version = dbInfo.version;
            }
        }
    });
}

function getItem(key, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    var req = store.get(key);

                    req.onsuccess = function () {
                        var value = req.result;
                        if (value === undefined) {
                            value = null;
                        }
                        if (_isEncodedBlob(value)) {
                            value = _decodeBlob(value);
                        }
                        resolve(value);
                    };

                    req.onerror = function () {
                        reject(req.error);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

// Iterate over all items stored in database.
function iterate(iterator, callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    var req = store.openCursor();
                    var iterationNumber = 1;

                    req.onsuccess = function () {
                        var cursor = req.result;

                        if (cursor) {
                            var value = cursor.value;
                            if (_isEncodedBlob(value)) {
                                value = _decodeBlob(value);
                            }
                            var result = iterator(value, cursor.key, iterationNumber++);

                            // when the iterator callback returns any
                            // (non-`undefined`) value, then we stop
                            // the iteration immediately
                            if (result !== void 0) {
                                resolve(result);
                            } else {
                                cursor["continue"]();
                            }
                        } else {
                            resolve();
                        }
                    };

                    req.onerror = function () {
                        reject(req.error);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);

    return promise;
}

function setItem(key, value, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = new Promise$1(function (resolve, reject) {
        var dbInfo;
        self.ready().then(function () {
            dbInfo = self._dbInfo;
            if (toString.call(value) === '[object Blob]') {
                return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {
                    if (blobSupport) {
                        return value;
                    }
                    return _encodeBlob(value);
                });
            }
            return value;
        }).then(function (value) {
            createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);

                    // The reason we don't _save_ null is because IE 10 does
                    // not support saving the `null` type in IndexedDB. How
                    // ironic, given the bug below!
                    // See: https://github.com/mozilla/localForage/issues/161
                    if (value === null) {
                        value = undefined;
                    }

                    var req = store.put(value, key);

                    transaction.oncomplete = function () {
                        // Cast to undefined so the value passed to
                        // callback/promise is the same as what one would get out
                        // of `getItem()` later. This leads to some weirdness
                        // (setItem('foo', undefined) will return `null`), but
                        // it's not my fault localStorage is our baseline and that
                        // it's weird.
                        if (value === undefined) {
                            value = null;
                        }

                        resolve(value);
                    };
                    transaction.onabort = transaction.onerror = function () {
                        var err = req.error ? req.error : req.transaction.error;
                        reject(err);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function removeItem(key, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    // We use a Grunt task to make this safe for IE and some
                    // versions of Android (including those used by Cordova).
                    // Normally IE won't like `.delete()` and will insist on
                    // using `['delete']()`, but we have a build step that
                    // fixes this for us now.
                    var req = store["delete"](key);
                    transaction.oncomplete = function () {
                        resolve();
                    };

                    transaction.onerror = function () {
                        reject(req.error);
                    };

                    // The request will be also be aborted if we've exceeded our storage
                    // space.
                    transaction.onabort = function () {
                        var err = req.error ? req.error : req.transaction.error;
                        reject(err);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function clear(callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    var req = store.clear();

                    transaction.oncomplete = function () {
                        resolve();
                    };

                    transaction.onabort = transaction.onerror = function () {
                        var err = req.error ? req.error : req.transaction.error;
                        reject(err);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function length(callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    var req = store.count();

                    req.onsuccess = function () {
                        resolve(req.result);
                    };

                    req.onerror = function () {
                        reject(req.error);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function key(n, callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        if (n < 0) {
            resolve(null);

            return;
        }

        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    var advanced = false;
                    var req = store.openKeyCursor();

                    req.onsuccess = function () {
                        var cursor = req.result;
                        if (!cursor) {
                            // this means there weren't enough keys
                            resolve(null);

                            return;
                        }

                        if (n === 0) {
                            // We have the first key, return it if that's what they
                            // wanted.
                            resolve(cursor.key);
                        } else {
                            if (!advanced) {
                                // Otherwise, ask the cursor to skip ahead n
                                // records.
                                advanced = true;
                                cursor.advance(n);
                            } else {
                                // When we get here, we've got the nth key.
                                resolve(cursor.key);
                            }
                        }
                    };

                    req.onerror = function () {
                        reject(req.error);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function keys(callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {
                if (err) {
                    return reject(err);
                }

                try {
                    var store = transaction.objectStore(self._dbInfo.storeName);
                    var req = store.openKeyCursor();
                    var keys = [];

                    req.onsuccess = function () {
                        var cursor = req.result;

                        if (!cursor) {
                            resolve(keys);
                            return;
                        }

                        keys.push(cursor.key);
                        cursor["continue"]();
                    };

                    req.onerror = function () {
                        reject(req.error);
                    };
                } catch (e) {
                    reject(e);
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function dropInstance(options, callback) {
    callback = getCallback.apply(this, arguments);

    var currentConfig = this.config();
    options = typeof options !== 'function' && options || {};
    if (!options.name) {
        options.name = options.name || currentConfig.name;
        options.storeName = options.storeName || currentConfig.storeName;
    }

    var self = this;
    var promise;
    if (!options.name) {
        promise = Promise$1.reject('Invalid arguments');
    } else {
        var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;

        var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {
            var dbContext = dbContexts[options.name];
            var forages = dbContext.forages;
            dbContext.db = db;
            for (var i = 0; i < forages.length; i++) {
                forages[i]._dbInfo.db = db;
            }
            return db;
        });

        if (!options.storeName) {
            promise = dbPromise.then(function (db) {
                _deferReadiness(options);

                var dbContext = dbContexts[options.name];
                var forages = dbContext.forages;

                db.close();
                for (var i = 0; i < forages.length; i++) {
                    var forage = forages[i];
                    forage._dbInfo.db = null;
                }

                var dropDBPromise = new Promise$1(function (resolve, reject) {
                    var req = idb.deleteDatabase(options.name);

                    req.onerror = function () {
                        var db = req.result;
                        if (db) {
                            db.close();
                        }
                        reject(req.error);
                    };

                    req.onblocked = function () {
                        // Closing all open connections in onversionchange handler should prevent this situation, but if
                        // we do get here, it just means the request remains pending - eventually it will succeed or error
                        console.warn('dropInstance blocked for database "' + options.name + '" until all open connections are closed');
                    };

                    req.onsuccess = function () {
                        var db = req.result;
                        if (db) {
                            db.close();
                        }
                        resolve(db);
                    };
                });

                return dropDBPromise.then(function (db) {
                    dbContext.db = db;
                    for (var i = 0; i < forages.length; i++) {
                        var _forage = forages[i];
                        _advanceReadiness(_forage._dbInfo);
                    }
                })["catch"](function (err) {
                    (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function () {});
                    throw err;
                });
            });
        } else {
            promise = dbPromise.then(function (db) {
                if (!db.objectStoreNames.contains(options.storeName)) {
                    return;
                }

                var newVersion = db.version + 1;

                _deferReadiness(options);

                var dbContext = dbContexts[options.name];
                var forages = dbContext.forages;

                db.close();
                for (var i = 0; i < forages.length; i++) {
                    var forage = forages[i];
                    forage._dbInfo.db = null;
                    forage._dbInfo.version = newVersion;
                }

                var dropObjectPromise = new Promise$1(function (resolve, reject) {
                    var req = idb.open(options.name, newVersion);

                    req.onerror = function (err) {
                        var db = req.result;
                        db.close();
                        reject(err);
                    };

                    req.onupgradeneeded = function () {
                        var db = req.result;
                        db.deleteObjectStore(options.storeName);
                    };

                    req.onsuccess = function () {
                        var db = req.result;
                        db.close();
                        resolve(db);
                    };
                });

                return dropObjectPromise.then(function (db) {
                    dbContext.db = db;
                    for (var j = 0; j < forages.length; j++) {
                        var _forage2 = forages[j];
                        _forage2._dbInfo.db = db;
                        _advanceReadiness(_forage2._dbInfo);
                    }
                })["catch"](function (err) {
                    (_rejectReadiness(options, err) || Promise$1.resolve())["catch"](function () {});
                    throw err;
                });
            });
        }
    }

    executeCallback(promise, callback);
    return promise;
}

var asyncStorage = {
    _driver: 'asyncStorage',
    _initStorage: _initStorage,
    _support: isIndexedDBValid(),
    iterate: iterate,
    getItem: getItem,
    setItem: setItem,
    removeItem: removeItem,
    clear: clear,
    length: length,
    key: key,
    keys: keys,
    dropInstance: dropInstance
};

function isWebSQLValid() {
    return typeof openDatabase === 'function';
}

// Sadly, the best way to save binary data in WebSQL/localStorage is serializing
// it to Base64, so this is how we store it to prevent very strange errors with less
// verbose ways of binary <-> string data storage.
var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

var BLOB_TYPE_PREFIX = '~~local_forage_type~';
var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;

var SERIALIZED_MARKER = '__lfsc__:';
var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;

// OMG the serializations!
var TYPE_ARRAYBUFFER = 'arbf';
var TYPE_BLOB = 'blob';
var TYPE_INT8ARRAY = 'si08';
var TYPE_UINT8ARRAY = 'ui08';
var TYPE_UINT8CLAMPEDARRAY = 'uic8';
var TYPE_INT16ARRAY = 'si16';
var TYPE_INT32ARRAY = 'si32';
var TYPE_UINT16ARRAY = 'ur16';
var TYPE_UINT32ARRAY = 'ui32';
var TYPE_FLOAT32ARRAY = 'fl32';
var TYPE_FLOAT64ARRAY = 'fl64';
var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;

var toString$1 = Object.prototype.toString;

function stringToBuffer(serializedString) {
    // Fill the string into a ArrayBuffer.
    var bufferLength = serializedString.length * 0.75;
    var len = serializedString.length;
    var i;
    var p = 0;
    var encoded1, encoded2, encoded3, encoded4;

    if (serializedString[serializedString.length - 1] === '=') {
        bufferLength--;
        if (serializedString[serializedString.length - 2] === '=') {
            bufferLength--;
        }
    }

    var buffer = new ArrayBuffer(bufferLength);
    var bytes = new Uint8Array(buffer);

    for (i = 0; i < len; i += 4) {
        encoded1 = BASE_CHARS.indexOf(serializedString[i]);
        encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);
        encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);
        encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);

        /*jslint bitwise: true */
        bytes[p++] = encoded1 << 2 | encoded2 >> 4;
        bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
        bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
    }
    return buffer;
}

// Converts a buffer to a string to store, serialized, in the backend
// storage library.
function bufferToString(buffer) {
    // base64-arraybuffer
    var bytes = new Uint8Array(buffer);
    var base64String = '';
    var i;

    for (i = 0; i < bytes.length; i += 3) {
        /*jslint bitwise: true */
        base64String += BASE_CHARS[bytes[i] >> 2];
        base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
        base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
        base64String += BASE_CHARS[bytes[i + 2] & 63];
    }

    if (bytes.length % 3 === 2) {
        base64String = base64String.substring(0, base64String.length - 1) + '=';
    } else if (bytes.length % 3 === 1) {
        base64String = base64String.substring(0, base64String.length - 2) + '==';
    }

    return base64String;
}

// Serialize a value, afterwards executing a callback (which usually
// instructs the `setItem()` callback/promise to be executed). This is how
// we store binary data with localStorage.
function serialize(value, callback) {
    var valueType = '';
    if (value) {
        valueType = toString$1.call(value);
    }

    // Cannot use `value instanceof ArrayBuffer` or such here, as these
    // checks fail when running the tests using casper.js...
    //
    // TODO: See why those tests fail and use a better solution.
    if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {
        // Convert binary arrays to a string and prefix the string with
        // a special marker.
        var buffer;
        var marker = SERIALIZED_MARKER;

        if (value instanceof ArrayBuffer) {
            buffer = value;
            marker += TYPE_ARRAYBUFFER;
        } else {
            buffer = value.buffer;

            if (valueType === '[object Int8Array]') {
                marker += TYPE_INT8ARRAY;
            } else if (valueType === '[object Uint8Array]') {
                marker += TYPE_UINT8ARRAY;
            } else if (valueType === '[object Uint8ClampedArray]') {
                marker += TYPE_UINT8CLAMPEDARRAY;
            } else if (valueType === '[object Int16Array]') {
                marker += TYPE_INT16ARRAY;
            } else if (valueType === '[object Uint16Array]') {
                marker += TYPE_UINT16ARRAY;
            } else if (valueType === '[object Int32Array]') {
                marker += TYPE_INT32ARRAY;
            } else if (valueType === '[object Uint32Array]') {
                marker += TYPE_UINT32ARRAY;
            } else if (valueType === '[object Float32Array]') {
                marker += TYPE_FLOAT32ARRAY;
            } else if (valueType === '[object Float64Array]') {
                marker += TYPE_FLOAT64ARRAY;
            } else {
                callback(new Error('Failed to get type for BinaryArray'));
            }
        }

        callback(marker + bufferToString(buffer));
    } else if (valueType === '[object Blob]') {
        // Conver the blob to a binaryArray and then to a string.
        var fileReader = new FileReader();

        fileReader.onload = function () {
            // Backwards-compatible prefix for the blob type.
            var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);

            callback(SERIALIZED_MARKER + TYPE_BLOB + str);
        };

        fileReader.readAsArrayBuffer(value);
    } else {
        try {
            callback(JSON.stringify(value));
        } catch (e) {
            console.error("Couldn't convert value into a JSON string: ", value);

            callback(null, e);
        }
    }
}

// Deserialize data we've inserted into a value column/field. We place
// special markers into our strings to mark them as encoded; this isn't
// as nice as a meta field, but it's the only sane thing we can do whilst
// keeping localStorage support intact.
//
// Oftentimes this will just deserialize JSON content, but if we have a
// special marker (SERIALIZED_MARKER, defined above), we will extract
// some kind of arraybuffer/binary data/typed array out of the string.
function deserialize(value) {
    // If we haven't marked this string as being specially serialized (i.e.
    // something other than serialized JSON), we can just return it and be
    // done with it.
    if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
        return JSON.parse(value);
    }

    // The following code deals with deserializing some kind of Blob or
    // TypedArray. First we separate out the type of data we're dealing
    // with from the data itself.
    var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
    var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);

    var blobType;
    // Backwards-compatible blob type serialization strategy.
    // DBs created with older versions of localForage will simply not have the blob type.
    if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
        var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
        blobType = matcher[1];
        serializedString = serializedString.substring(matcher[0].length);
    }
    var buffer = stringToBuffer(serializedString);

    // Return the right type based on the code/type set during
    // serialization.
    switch (type) {
        case TYPE_ARRAYBUFFER:
            return buffer;
        case TYPE_BLOB:
            return createBlob([buffer], { type: blobType });
        case TYPE_INT8ARRAY:
            return new Int8Array(buffer);
        case TYPE_UINT8ARRAY:
            return new Uint8Array(buffer);
        case TYPE_UINT8CLAMPEDARRAY:
            return new Uint8ClampedArray(buffer);
        case TYPE_INT16ARRAY:
            return new Int16Array(buffer);
        case TYPE_UINT16ARRAY:
            return new Uint16Array(buffer);
        case TYPE_INT32ARRAY:
            return new Int32Array(buffer);
        case TYPE_UINT32ARRAY:
            return new Uint32Array(buffer);
        case TYPE_FLOAT32ARRAY:
            return new Float32Array(buffer);
        case TYPE_FLOAT64ARRAY:
            return new Float64Array(buffer);
        default:
            throw new Error('Unkown type: ' + type);
    }
}

var localforageSerializer = {
    serialize: serialize,
    deserialize: deserialize,
    stringToBuffer: stringToBuffer,
    bufferToString: bufferToString
};

/*
 * Includes code from:
 *
 * base64-arraybuffer
 * https://github.com/niklasvh/base64-arraybuffer
 *
 * Copyright (c) 2012 Niklas von Hertzen
 * Licensed under the MIT license.
 */

function createDbTable(t, dbInfo, callback, errorCallback) {
    t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);
}

// Open the WebSQL database (automatically creates one if one didn't
// previously exist), using any options set in the config.
function _initStorage$1(options) {
    var self = this;
    var dbInfo = {
        db: null
    };

    if (options) {
        for (var i in options) {
            dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];
        }
    }

    var dbInfoPromise = new Promise$1(function (resolve, reject) {
        // Open the database; the openDatabase API will automatically
        // create it for us if it doesn't exist.
        try {
            dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);
        } catch (e) {
            return reject(e);
        }

        // Create our key/value table if it doesn't exist.
        dbInfo.db.transaction(function (t) {
            createDbTable(t, dbInfo, function () {
                self._dbInfo = dbInfo;
                resolve();
            }, function (t, error) {
                reject(error);
            });
        }, reject);
    });

    dbInfo.serializer = localforageSerializer;
    return dbInfoPromise;
}

function tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {
    t.executeSql(sqlStatement, args, callback, function (t, error) {
        if (error.code === error.SYNTAX_ERR) {
            t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name = ?", [dbInfo.storeName], function (t, results) {
                if (!results.rows.length) {
                    // if the table is missing (was deleted)
                    // re-create it table and retry
                    createDbTable(t, dbInfo, function () {
                        t.executeSql(sqlStatement, args, callback, errorCallback);
                    }, errorCallback);
                } else {
                    errorCallback(t, error);
                }
            }, errorCallback);
        } else {
            errorCallback(t, error);
        }
    }, errorCallback);
}

function getItem$1(key, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;
            dbInfo.db.transaction(function (t) {
                tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {
                    var result = results.rows.length ? results.rows.item(0).value : null;

                    // Check to see if this is serialized content we need to
                    // unpack.
                    if (result) {
                        result = dbInfo.serializer.deserialize(result);
                    }

                    resolve(result);
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function iterate$1(iterator, callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;

            dbInfo.db.transaction(function (t) {
                tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {
                    var rows = results.rows;
                    var length = rows.length;

                    for (var i = 0; i < length; i++) {
                        var item = rows.item(i);
                        var result = item.value;

                        // Check to see if this is serialized content
                        // we need to unpack.
                        if (result) {
                            result = dbInfo.serializer.deserialize(result);
                        }

                        result = iterator(result, item.key, i + 1);

                        // void(0) prevents problems with redefinition
                        // of `undefined`.
                        if (result !== void 0) {
                            resolve(result);
                            return;
                        }
                    }

                    resolve();
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function _setItem(key, value, callback, retriesLeft) {
    var self = this;

    key = normalizeKey(key);

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            // The localStorage API doesn't return undefined values in an
            // "expected" way, so undefined is always cast to null in all
            // drivers. See: https://github.com/mozilla/localForage/pull/42
            if (value === undefined) {
                value = null;
            }

            // Save the original value to pass to the callback.
            var originalValue = value;

            var dbInfo = self._dbInfo;
            dbInfo.serializer.serialize(value, function (value, error) {
                if (error) {
                    reject(error);
                } else {
                    dbInfo.db.transaction(function (t) {
                        tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {
                            resolve(originalValue);
                        }, function (t, error) {
                            reject(error);
                        });
                    }, function (sqlError) {
                        // The transaction failed; check
                        // to see if it's a quota error.
                        if (sqlError.code === sqlError.QUOTA_ERR) {
                            // We reject the callback outright for now, but
                            // it's worth trying to re-run the transaction.
                            // Even if the user accepts the prompt to use
                            // more storage on Safari, this error will
                            // be called.
                            //
                            // Try to re-run the transaction.
                            if (retriesLeft > 0) {
                                resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));
                                return;
                            }
                            reject(sqlError);
                        }
                    });
                }
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function setItem$1(key, value, callback) {
    return _setItem.apply(this, [key, value, callback, 1]);
}

function removeItem$1(key, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;
            dbInfo.db.transaction(function (t) {
                tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {
                    resolve();
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

// Deletes every item in the table.
// TODO: Find out if this resets the AUTO_INCREMENT number.
function clear$1(callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;
            dbInfo.db.transaction(function (t) {
                tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {
                    resolve();
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

// Does a simple `COUNT(key)` to get the number of items stored in
// localForage.
function length$1(callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;
            dbInfo.db.transaction(function (t) {
                // Ahhh, SQL makes this one soooooo easy.
                tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {
                    var result = results.rows.item(0).c;
                    resolve(result);
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

// Return the key located at key index X; essentially gets the key from a
// `WHERE id = ?`. This is the most efficient way I can think to implement
// this rarely-used (in my experience) part of the API, but it can seem
// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so
// the ID of each key will change every time it's updated. Perhaps a stored
// procedure for the `setItem()` SQL would solve this problem?
// TODO: Don't change ID on `setItem()`.
function key$1(n, callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;
            dbInfo.db.transaction(function (t) {
                tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {
                    var result = results.rows.length ? results.rows.item(0).key : null;
                    resolve(result);
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

function keys$1(callback) {
    var self = this;

    var promise = new Promise$1(function (resolve, reject) {
        self.ready().then(function () {
            var dbInfo = self._dbInfo;
            dbInfo.db.transaction(function (t) {
                tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {
                    var keys = [];

                    for (var i = 0; i < results.rows.length; i++) {
                        keys.push(results.rows.item(i).key);
                    }

                    resolve(keys);
                }, function (t, error) {
                    reject(error);
                });
            });
        })["catch"](reject);
    });

    executeCallback(promise, callback);
    return promise;
}

// https://www.w3.org/TR/webdatabase/#databases
// > There is no way to enumerate or delete the databases available for an origin from this API.
function getAllStoreNames(db) {
    return new Promise$1(function (resolve, reject) {
        db.transaction(function (t) {
            t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function (t, results) {
                var storeNames = [];

                for (var i = 0; i < results.rows.length; i++) {
                    storeNames.push(results.rows.item(i).name);
                }

                resolve({
                    db: db,
                    storeNames: storeNames
                });
            }, function (t, error) {
                reject(error);
            });
        }, function (sqlError) {
            reject(sqlError);
        });
    });
}

function dropInstance$1(options, callback) {
    callback = getCallback.apply(this, arguments);

    var currentConfig = this.config();
    options = typeof options !== 'function' && options || {};
    if (!options.name) {
        options.name = options.name || currentConfig.name;
        options.storeName = options.storeName || currentConfig.storeName;
    }

    var self = this;
    var promise;
    if (!options.name) {
        promise = Promise$1.reject('Invalid arguments');
    } else {
        promise = new Promise$1(function (resolve) {
            var db;
            if (options.name === currentConfig.name) {
                // use the db reference of the current instance
                db = self._dbInfo.db;
            } else {
                db = openDatabase(options.name, '', '', 0);
            }

            if (!options.storeName) {
                // drop all database tables
                resolve(getAllStoreNames(db));
            } else {
                resolve({
                    db: db,
                    storeNames: [options.storeName]
                });
            }
        }).then(function (operationInfo) {
            return new Promise$1(function (resolve, reject) {
                operationInfo.db.transaction(function (t) {
                    function dropTable(storeName) {
                        return new Promise$1(function (resolve, reject) {
                            t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {
                                resolve();
                            }, function (t, error) {
                                reject(error);
                            });
                        });
                    }

                    var operations = [];
                    for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {
                        operations.push(dropTable(operationInfo.storeNames[i]));
                    }

                    Promise$1.all(operations).then(function () {
                        resolve();
                    })["catch"](function (e) {
                        reject(e);
                    });
                }, function (sqlError) {
                    reject(sqlError);
                });
            });
        });
    }

    executeCallback(promise, callback);
    return promise;
}

var webSQLStorage = {
    _driver: 'webSQLStorage',
    _initStorage: _initStorage$1,
    _support: isWebSQLValid(),
    iterate: iterate$1,
    getItem: getItem$1,
    setItem: setItem$1,
    removeItem: removeItem$1,
    clear: clear$1,
    length: length$1,
    key: key$1,
    keys: keys$1,
    dropInstance: dropInstance$1
};

function isLocalStorageValid() {
    try {
        return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&
        // in IE8 typeof localStorage.setItem === 'object'
        !!localStorage.setItem;
    } catch (e) {
        return false;
    }
}

function _getKeyPrefix(options, defaultConfig) {
    var keyPrefix = options.name + '/';

    if (options.storeName !== defaultConfig.storeName) {
        keyPrefix += options.storeName + '/';
    }
    return keyPrefix;
}

// Check if localStorage throws when saving an item
function checkIfLocalStorageThrows() {
    var localStorageTestKey = '_localforage_support_test';

    try {
        localStorage.setItem(localStorageTestKey, true);
        localStorage.removeItem(localStorageTestKey);

        return false;
    } catch (e) {
        return true;
    }
}

// Check if localStorage is usable and allows to save an item
// This method checks if localStorage is usable in Safari Private Browsing
// mode, or in any other case where the available quota for localStorage
// is 0 and there wasn't any saved items yet.
function _isLocalStorageUsable() {
    return !checkIfLocalStorageThrows() || localStorage.length > 0;
}

// Config the localStorage backend, using options set in the config.
function _initStorage$2(options) {
    var self = this;
    var dbInfo = {};
    if (options) {
        for (var i in options) {
            dbInfo[i] = options[i];
        }
    }

    dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);

    if (!_isLocalStorageUsable()) {
        return Promise$1.reject();
    }

    self._dbInfo = dbInfo;
    dbInfo.serializer = localforageSerializer;

    return Promise$1.resolve();
}

// Remove all keys from the datastore, effectively destroying all data in
// the app's key/value store!
function clear$2(callback) {
    var self = this;
    var promise = self.ready().then(function () {
        var keyPrefix = self._dbInfo.keyPrefix;

        for (var i = localStorage.length - 1; i >= 0; i--) {
            var key = localStorage.key(i);

            if (key.indexOf(keyPrefix) === 0) {
                localStorage.removeItem(key);
            }
        }
    });

    executeCallback(promise, callback);
    return promise;
}

// Retrieve an item from the store. Unlike the original async_storage
// library in Gaia, we don't modify return values at all. If a key's value
// is `undefined`, we pass that value to the callback function.
function getItem$2(key, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = self.ready().then(function () {
        var dbInfo = self._dbInfo;
        var result = localStorage.getItem(dbInfo.keyPrefix + key);

        // If a result was found, parse it from the serialized
        // string into a JS object. If result isn't truthy, the key
        // is likely undefined and we'll pass it straight to the
        // callback.
        if (result) {
            result = dbInfo.serializer.deserialize(result);
        }

        return result;
    });

    executeCallback(promise, callback);
    return promise;
}

// Iterate over all items in the store.
function iterate$2(iterator, callback) {
    var self = this;

    var promise = self.ready().then(function () {
        var dbInfo = self._dbInfo;
        var keyPrefix = dbInfo.keyPrefix;
        var keyPrefixLength = keyPrefix.length;
        var length = localStorage.length;

        // We use a dedicated iterator instead of the `i` variable below
        // so other keys we fetch in localStorage aren't counted in
        // the `iterationNumber` argument passed to the `iterate()`
        // callback.
        //
        // See: github.com/mozilla/localForage/pull/435#discussion_r38061530
        var iterationNumber = 1;

        for (var i = 0; i < length; i++) {
            var key = localStorage.key(i);
            if (key.indexOf(keyPrefix) !== 0) {
                continue;
            }
            var value = localStorage.getItem(key);

            // If a result was found, parse it from the serialized
            // string into a JS object. If result isn't truthy, the
            // key is likely undefined and we'll pass it straight
            // to the iterator.
            if (value) {
                value = dbInfo.serializer.deserialize(value);
            }

            value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);

            if (value !== void 0) {
                return value;
            }
        }
    });

    executeCallback(promise, callback);
    return promise;
}

// Same as localStorage's key() method, except takes a callback.
function key$2(n, callback) {
    var self = this;
    var promise = self.ready().then(function () {
        var dbInfo = self._dbInfo;
        var result;
        try {
            result = localStorage.key(n);
        } catch (error) {
            result = null;
        }

        // Remove the prefix from the key, if a key is found.
        if (result) {
            result = result.substring(dbInfo.keyPrefix.length);
        }

        return result;
    });

    executeCallback(promise, callback);
    return promise;
}

function keys$2(callback) {
    var self = this;
    var promise = self.ready().then(function () {
        var dbInfo = self._dbInfo;
        var length = localStorage.length;
        var keys = [];

        for (var i = 0; i < length; i++) {
            var itemKey = localStorage.key(i);
            if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {
                keys.push(itemKey.substring(dbInfo.keyPrefix.length));
            }
        }

        return keys;
    });

    executeCallback(promise, callback);
    return promise;
}

// Supply the number of keys in the datastore to the callback function.
function length$2(callback) {
    var self = this;
    var promise = self.keys().then(function (keys) {
        return keys.length;
    });

    executeCallback(promise, callback);
    return promise;
}

// Remove an item from the store, nice and simple.
function removeItem$2(key, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = self.ready().then(function () {
        var dbInfo = self._dbInfo;
        localStorage.removeItem(dbInfo.keyPrefix + key);
    });

    executeCallback(promise, callback);
    return promise;
}

// Set a key's value and run an optional callback once the value is set.
// Unlike Gaia's implementation, the callback function is passed the value,
// in case you want to operate on that value only after you're sure it
// saved, or something like that.
function setItem$2(key, value, callback) {
    var self = this;

    key = normalizeKey(key);

    var promise = self.ready().then(function () {
        // Convert undefined values to null.
        // https://github.com/mozilla/localForage/pull/42
        if (value === undefined) {
            value = null;
        }

        // Save the original value to pass to the callback.
        var originalValue = value;

        return new Promise$1(function (resolve, reject) {
            var dbInfo = self._dbInfo;
            dbInfo.serializer.serialize(value, function (value, error) {
                if (error) {
                    reject(error);
                } else {
                    try {
                        localStorage.setItem(dbInfo.keyPrefix + key, value);
                        resolve(originalValue);
                    } catch (e) {
                        // localStorage capacity exceeded.
                        // TODO: Make this a specific error/event.
                        if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
                            reject(e);
                        }
                        reject(e);
                    }
                }
            });
        });
    });

    executeCallback(promise, callback);
    return promise;
}

function dropInstance$2(options, callback) {
    callback = getCallback.apply(this, arguments);

    options = typeof options !== 'function' && options || {};
    if (!options.name) {
        var currentConfig = this.config();
        options.name = options.name || currentConfig.name;
        options.storeName = options.storeName || currentConfig.storeName;
    }

    var self = this;
    var promise;
    if (!options.name) {
        promise = Promise$1.reject('Invalid arguments');
    } else {
        promise = new Promise$1(function (resolve) {
            if (!options.storeName) {
                resolve(options.name + '/');
            } else {
                resolve(_getKeyPrefix(options, self._defaultConfig));
            }
        }).then(function (keyPrefix) {
            for (var i = localStorage.length - 1; i >= 0; i--) {
                var key = localStorage.key(i);

                if (key.indexOf(keyPrefix) === 0) {
                    localStorage.removeItem(key);
                }
            }
        });
    }

    executeCallback(promise, callback);
    return promise;
}

var localStorageWrapper = {
    _driver: 'localStorageWrapper',
    _initStorage: _initStorage$2,
    _support: isLocalStorageValid(),
    iterate: iterate$2,
    getItem: getItem$2,
    setItem: setItem$2,
    removeItem: removeItem$2,
    clear: clear$2,
    length: length$2,
    key: key$2,
    keys: keys$2,
    dropInstance: dropInstance$2
};

var sameValue = function sameValue(x, y) {
    return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);
};

var includes = function includes(array, searchElement) {
    var len = array.length;
    var i = 0;
    while (i < len) {
        if (sameValue(array[i], searchElement)) {
            return true;
        }
        i++;
    }

    return false;
};

var isArray = Array.isArray || function (arg) {
    return Object.prototype.toString.call(arg) === '[object Array]';
};

// Drivers are stored here when `defineDriver()` is called.
// They are shared across all instances of localForage.
var DefinedDrivers = {};

var DriverSupport = {};

var DefaultDrivers = {
    INDEXEDDB: asyncStorage,
    WEBSQL: webSQLStorage,
    LOCALSTORAGE: localStorageWrapper
};

var DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];

var OptionalDriverMethods = ['dropInstance'];

var LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);

var DefaultConfig = {
    description: '',
    driver: DefaultDriverOrder.slice(),
    name: 'localforage',
    // Default DB size is _JUST UNDER_ 5MB, as it's the highest size
    // we can use without a prompt.
    size: 4980736,
    storeName: 'keyvaluepairs',
    version: 1.0
};

function callWhenReady(localForageInstance, libraryMethod) {
    localForageInstance[libraryMethod] = function () {
        var _args = arguments;
        return localForageInstance.ready().then(function () {
            return localForageInstance[libraryMethod].apply(localForageInstance, _args);
        });
    };
}

function extend() {
    for (var i = 1; i < arguments.length; i++) {
        var arg = arguments[i];

        if (arg) {
            for (var _key in arg) {
                if (arg.hasOwnProperty(_key)) {
                    if (isArray(arg[_key])) {
                        arguments[0][_key] = arg[_key].slice();
                    } else {
                        arguments[0][_key] = arg[_key];
                    }
                }
            }
        }
    }

    return arguments[0];
}

var LocalForage = function () {
    function LocalForage(options) {
        _classCallCheck(this, LocalForage);

        for (var driverTypeKey in DefaultDrivers) {
            if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {
                var driver = DefaultDrivers[driverTypeKey];
                var driverName = driver._driver;
                this[driverTypeKey] = driverName;

                if (!DefinedDrivers[driverName]) {
                    // we don't need to wait for the promise,
                    // since the default drivers can be defined
                    // in a blocking manner
                    this.defineDriver(driver);
                }
            }
        }

        this._defaultConfig = extend({}, DefaultConfig);
        this._config = extend({}, this._defaultConfig, options);
        this._driverSet = null;
        this._initDriver = null;
        this._ready = false;
        this._dbInfo = null;

        this._wrapLibraryMethodsWithReady();
        this.setDriver(this._config.driver)["catch"](function () {});
    }

    // Set any config values for localForage; can be called anytime before
    // the first API call (e.g. `getItem`, `setItem`).
    // We loop through options so we don't overwrite existing config
    // values.


    LocalForage.prototype.config = function config(options) {
        // If the options argument is an object, we use it to set values.
        // Otherwise, we return either a specified config value or all
        // config values.
        if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
            // If localforage is ready and fully initialized, we can't set
            // any new configuration values. Instead, we return an error.
            if (this._ready) {
                return new Error("Can't call config() after localforage " + 'has been used.');
            }

            for (var i in options) {
                if (i === 'storeName') {
                    options[i] = options[i].replace(/\W/g, '_');
                }

                if (i === 'version' && typeof options[i] !== 'number') {
                    return new Error('Database version must be a number.');
                }

                this._config[i] = options[i];
            }

            // after all config options are set and
            // the driver option is used, try setting it
            if ('driver' in options && options.driver) {
                return this.setDriver(this._config.driver);
            }

            return true;
        } else if (typeof options === 'string') {
            return this._config[options];
        } else {
            return this._config;
        }
    };

    // Used to define a custom driver, shared across all instances of
    // localForage.


    LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {
        var promise = new Promise$1(function (resolve, reject) {
            try {
                var driverName = driverObject._driver;
                var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');

                // A driver name should be defined and not overlap with the
                // library-defined, default drivers.
                if (!driverObject._driver) {
                    reject(complianceError);
                    return;
                }

                var driverMethods = LibraryMethods.concat('_initStorage');
                for (var i = 0, len = driverMethods.length; i < len; i++) {
                    var driverMethodName = driverMethods[i];

                    // when the property is there,
                    // it should be a method even when optional
                    var isRequired = !includes(OptionalDriverMethods, driverMethodName);
                    if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {
                        reject(complianceError);
                        return;
                    }
                }

                var configureMissingMethods = function configureMissingMethods() {
                    var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {
                        return function () {
                            var error = new Error('Method ' + methodName + ' is not implemented by the current driver');
                            var promise = Promise$1.reject(error);
                            executeCallback(promise, arguments[arguments.length - 1]);
                            return promise;
                        };
                    };

                    for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {
                        var optionalDriverMethod = OptionalDriverMethods[_i];
                        if (!driverObject[optionalDriverMethod]) {
                            driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);
                        }
                    }
                };

                configureMissingMethods();

                var setDriverSupport = function setDriverSupport(support) {
                    if (DefinedDrivers[driverName]) {
                        console.info('Redefining LocalForage driver: ' + driverName);
                    }
                    DefinedDrivers[driverName] = driverObject;
                    DriverSupport[driverName] = support;
                    // don't use a then, so that we can define
                    // drivers that have simple _support methods
                    // in a blocking manner
                    resolve();
                };

                if ('_support' in driverObject) {
                    if (driverObject._support && typeof driverObject._support === 'function') {
                        driverObject._support().then(setDriverSupport, reject);
                    } else {
                        setDriverSupport(!!driverObject._support);
                    }
                } else {
                    setDriverSupport(true);
                }
            } catch (e) {
                reject(e);
            }
        });

        executeTwoCallbacks(promise, callback, errorCallback);
        return promise;
    };

    LocalForage.prototype.driver = function driver() {
        return this._driver || null;
    };

    LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {
        var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));

        executeTwoCallbacks(getDriverPromise, callback, errorCallback);
        return getDriverPromise;
    };

    LocalForage.prototype.getSerializer = function getSerializer(callback) {
        var serializerPromise = Promise$1.resolve(localforageSerializer);
        executeTwoCallbacks(serializerPromise, callback);
        return serializerPromise;
    };

    LocalForage.prototype.ready = function ready(callback) {
        var self = this;

        var promise = self._driverSet.then(function () {
            if (self._ready === null) {
                self._ready = self._initDriver();
            }

            return self._ready;
        });

        executeTwoCallbacks(promise, callback, callback);
        return promise;
    };

    LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {
        var self = this;

        if (!isArray(drivers)) {
            drivers = [drivers];
        }

        var supportedDrivers = this._getSupportedDrivers(drivers);

        function setDriverToConfig() {
            self._config.driver = self.driver();
        }

        function extendSelfWithDriver(driver) {
            self._extend(driver);
            setDriverToConfig();

            self._ready = self._initStorage(self._config);
            return self._ready;
        }

        function initDriver(supportedDrivers) {
            return function () {
                var currentDriverIndex = 0;

                function driverPromiseLoop() {
                    while (currentDriverIndex < supportedDrivers.length) {
                        var driverName = supportedDrivers[currentDriverIndex];
                        currentDriverIndex++;

                        self._dbInfo = null;
                        self._ready = null;

                        return self.getDriver(driverName).then(extendSelfWithDriver)["catch"](driverPromiseLoop);
                    }

                    setDriverToConfig();
                    var error = new Error('No available storage method found.');
                    self._driverSet = Promise$1.reject(error);
                    return self._driverSet;
                }

                return driverPromiseLoop();
            };
        }

        // There might be a driver initialization in progress
        // so wait for it to finish in order to avoid a possible
        // race condition to set _dbInfo
        var oldDriverSetDone = this._driverSet !== null ? this._driverSet["catch"](function () {
            return Promise$1.resolve();
        }) : Promise$1.resolve();

        this._driverSet = oldDriverSetDone.then(function () {
            var driverName = supportedDrivers[0];
            self._dbInfo = null;
            self._ready = null;

            return self.getDriver(driverName).then(function (driver) {
                self._driver = driver._driver;
                setDriverToConfig();
                self._wrapLibraryMethodsWithReady();
                self._initDriver = initDriver(supportedDrivers);
            });
        })["catch"](function () {
            setDriverToConfig();
            var error = new Error('No available storage method found.');
            self._driverSet = Promise$1.reject(error);
            return self._driverSet;
        });

        executeTwoCallbacks(this._driverSet, callback, errorCallback);
        return this._driverSet;
    };

    LocalForage.prototype.supports = function supports(driverName) {
        return !!DriverSupport[driverName];
    };

    LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {
        extend(this, libraryMethodsAndProperties);
    };

    LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {
        var supportedDrivers = [];
        for (var i = 0, len = drivers.length; i < len; i++) {
            var driverName = drivers[i];
            if (this.supports(driverName)) {
                supportedDrivers.push(driverName);
            }
        }
        return supportedDrivers;
    };

    LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {
        // Add a stub for each driver API method that delays the call to the
        // corresponding driver method until localForage is ready. These stubs
        // will be replaced by the driver methods as soon as the driver is
        // loaded, so there is no performance impact.
        for (var i = 0, len = LibraryMethods.length; i < len; i++) {
            callWhenReady(this, LibraryMethods[i]);
        }
    };

    LocalForage.prototype.createInstance = function createInstance(options) {
        return new LocalForage(options);
    };

    return LocalForage;
}();

// The actual localForage object that we expose as a module or via a
// global. It's extended by pulling in one of our other libraries.


var localforage_js = new LocalForage();

module.exports = localforage_js;

},{"3":3}]},{},[4])(4)
});


/***/ }),

/***/ "./node_modules/localforage/src/utils/createBlob.js":
/*!**********************************************************!*\
  !*** ./node_modules/localforage/src/utils/createBlob.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// Abstracts constructing a Blob object, so it also works in older
// browsers that don't support the native Blob constructor. (i.e.
// old QtWebKit versions, at least).
// Abstracts constructing a Blob object, so it also works in older
// browsers that don't support the native Blob constructor. (i.e.
// old QtWebKit versions, at least).
function createBlob(parts, properties) {
    /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || [];
    properties = properties || {};
    try {
        return new Blob(parts, properties);
    } catch (e) {
        if (e.name !== 'TypeError') {
            throw e;
        }
        var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;
        var builder = new Builder();
        for(var i = 0; i < parts.length; i += 1){
            builder.append(parts[i]);
        }
        return builder.getBlob(properties.type);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createBlob);


/***/ }),

/***/ "./node_modules/localforage/src/utils/executeCallback.js":
/*!***************************************************************!*\
  !*** ./node_modules/localforage/src/utils/executeCallback.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
function executeCallback(promise, callback) {
    if (callback) {
        promise.then(function(result) {
            callback(null, result);
        }, function(error) {
            callback(error);
        });
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (executeCallback);


/***/ }),

/***/ "./node_modules/localforage/src/utils/getCallback.js":
/*!***********************************************************!*\
  !*** ./node_modules/localforage/src/utils/getCallback.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ getCallback)
/* harmony export */ });
function getCallback() {
    if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {
        return arguments[arguments.length - 1];
    }
}


/***/ }),

/***/ "./node_modules/localforage/src/utils/normalizeKey.js":
/*!************************************************************!*\
  !*** ./node_modules/localforage/src/utils/normalizeKey.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ normalizeKey)
/* harmony export */ });
function normalizeKey(key) {
    // Cast the key to a string, as that's all we can set as a key.
    if (typeof key !== 'string') {
        console.warn(`${key} used as a key, but it is not a string.`);
        key = String(key);
    }
    return key;
}


/***/ }),

/***/ "./node_modules/localforage/src/utils/serializer.js":
/*!**********************************************************!*\
  !*** ./node_modules/localforage/src/utils/serializer.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _createBlob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createBlob */ "./node_modules/localforage/src/utils/createBlob.js");
/* eslint-disable no-bitwise */ 
// Sadly, the best way to save binary data in WebSQL/localStorage is serializing
// it to Base64, so this is how we store it to prevent very strange errors with less
// verbose ways of binary <-> string data storage.
var BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var BLOB_TYPE_PREFIX = '~~local_forage_type~';
var BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;
var SERIALIZED_MARKER = '__lfsc__:';
var SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;
// OMG the serializations!
var TYPE_ARRAYBUFFER = 'arbf';
var TYPE_BLOB = 'blob';
var TYPE_INT8ARRAY = 'si08';
var TYPE_UINT8ARRAY = 'ui08';
var TYPE_UINT8CLAMPEDARRAY = 'uic8';
var TYPE_INT16ARRAY = 'si16';
var TYPE_INT32ARRAY = 'si32';
var TYPE_UINT16ARRAY = 'ur16';
var TYPE_UINT32ARRAY = 'ui32';
var TYPE_FLOAT32ARRAY = 'fl32';
var TYPE_FLOAT64ARRAY = 'fl64';
var TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;
var toString = Object.prototype.toString;
function stringToBuffer(serializedString) {
    // Fill the string into a ArrayBuffer.
    var bufferLength = serializedString.length * 0.75;
    var len = serializedString.length;
    var i;
    var p = 0;
    var encoded1, encoded2, encoded3, encoded4;
    if (serializedString[serializedString.length - 1] === '=') {
        bufferLength--;
        if (serializedString[serializedString.length - 2] === '=') {
            bufferLength--;
        }
    }
    var buffer = new ArrayBuffer(bufferLength);
    var bytes = new Uint8Array(buffer);
    for(i = 0; i < len; i += 4){
        encoded1 = BASE_CHARS.indexOf(serializedString[i]);
        encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);
        encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);
        encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);
        /*jslint bitwise: true */ bytes[p++] = encoded1 << 2 | encoded2 >> 4;
        bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
        bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
    }
    return buffer;
}
// Converts a buffer to a string to store, serialized, in the backend
// storage library.
function bufferToString(buffer) {
    // base64-arraybuffer
    var bytes = new Uint8Array(buffer);
    var base64String = '';
    var i;
    for(i = 0; i < bytes.length; i += 3){
        /*jslint bitwise: true */ base64String += BASE_CHARS[bytes[i] >> 2];
        base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
        base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
        base64String += BASE_CHARS[bytes[i + 2] & 63];
    }
    if (bytes.length % 3 === 2) {
        base64String = base64String.substring(0, base64String.length - 1) + '=';
    } else if (bytes.length % 3 === 1) {
        base64String = base64String.substring(0, base64String.length - 2) + '==';
    }
    return base64String;
}
// Serialize a value, afterwards executing a callback (which usually
// instructs the `setItem()` callback/promise to be executed). This is how
// we store binary data with localStorage.
function serialize(value, callback) {
    var valueType = '';
    if (value) {
        valueType = toString.call(value);
    }
    // Cannot use `value instanceof ArrayBuffer` or such here, as these
    // checks fail when running the tests using casper.js...
    //
    // TODO: See why those tests fail and use a better solution.
    if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString.call(value.buffer) === '[object ArrayBuffer]')) {
        // Convert binary arrays to a string and prefix the string with
        // a special marker.
        var buffer;
        var marker = SERIALIZED_MARKER;
        if (value instanceof ArrayBuffer) {
            buffer = value;
            marker += TYPE_ARRAYBUFFER;
        } else {
            buffer = value.buffer;
            if (valueType === '[object Int8Array]') {
                marker += TYPE_INT8ARRAY;
            } else if (valueType === '[object Uint8Array]') {
                marker += TYPE_UINT8ARRAY;
            } else if (valueType === '[object Uint8ClampedArray]') {
                marker += TYPE_UINT8CLAMPEDARRAY;
            } else if (valueType === '[object Int16Array]') {
                marker += TYPE_INT16ARRAY;
            } else if (valueType === '[object Uint16Array]') {
                marker += TYPE_UINT16ARRAY;
            } else if (valueType === '[object Int32Array]') {
                marker += TYPE_INT32ARRAY;
            } else if (valueType === '[object Uint32Array]') {
                marker += TYPE_UINT32ARRAY;
            } else if (valueType === '[object Float32Array]') {
                marker += TYPE_FLOAT32ARRAY;
            } else if (valueType === '[object Float64Array]') {
                marker += TYPE_FLOAT64ARRAY;
            } else {
                callback(new Error('Failed to get type for BinaryArray'));
            }
        }
        callback(marker + bufferToString(buffer));
    } else if (valueType === '[object Blob]') {
        // Conver the blob to a binaryArray and then to a string.
        var fileReader = new FileReader();
        fileReader.onload = function() {
            // Backwards-compatible prefix for the blob type.
            var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);
            callback(SERIALIZED_MARKER + TYPE_BLOB + str);
        };
        fileReader.readAsArrayBuffer(value);
    } else {
        try {
            callback(JSON.stringify(value));
        } catch (e) {
            console.error("Couldn't convert value into a JSON string: ", value);
            callback(null, e);
        }
    }
}
// Deserialize data we've inserted into a value column/field. We place
// special markers into our strings to mark them as encoded; this isn't
// as nice as a meta field, but it's the only sane thing we can do whilst
// keeping localStorage support intact.
//
// Oftentimes this will just deserialize JSON content, but if we have a
// special marker (SERIALIZED_MARKER, defined above), we will extract
// some kind of arraybuffer/binary data/typed array out of the string.
function deserialize(value) {
    // If we haven't marked this string as being specially serialized (i.e.
    // something other than serialized JSON), we can just return it and be
    // done with it.
    if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {
        return JSON.parse(value);
    }
    // The following code deals with deserializing some kind of Blob or
    // TypedArray. First we separate out the type of data we're dealing
    // with from the data itself.
    var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);
    var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);
    var blobType;
    // Backwards-compatible blob type serialization strategy.
    // DBs created with older versions of localForage will simply not have the blob type.
    if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {
        var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);
        blobType = matcher[1];
        serializedString = serializedString.substring(matcher[0].length);
    }
    var buffer = stringToBuffer(serializedString);
    // Return the right type based on the code/type set during
    // serialization.
    switch(type){
        case TYPE_ARRAYBUFFER:
            return buffer;
        case TYPE_BLOB:
            return (0,_createBlob__WEBPACK_IMPORTED_MODULE_0__["default"])([
                buffer
            ], {
                type: blobType
            });
        case TYPE_INT8ARRAY:
            return new Int8Array(buffer);
        case TYPE_UINT8ARRAY:
            return new Uint8Array(buffer);
        case TYPE_UINT8CLAMPEDARRAY:
            return new Uint8ClampedArray(buffer);
        case TYPE_INT16ARRAY:
            return new Int16Array(buffer);
        case TYPE_UINT16ARRAY:
            return new Uint16Array(buffer);
        case TYPE_INT32ARRAY:
            return new Int32Array(buffer);
        case TYPE_UINT32ARRAY:
            return new Uint32Array(buffer);
        case TYPE_FLOAT32ARRAY:
            return new Float32Array(buffer);
        case TYPE_FLOAT64ARRAY:
            return new Float64Array(buffer);
        default:
            throw new Error('Unkown type: ' + type);
    }
}
var localforageSerializer = {
    serialize: serialize,
    deserialize: deserialize,
    stringToBuffer: stringToBuffer,
    bufferToString: bufferToString
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (localforageSerializer);


/***/ }),

/***/ "./node_modules/lodash-es/_DataView.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_DataView.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");



/* Built-in method references that are verified to be native. */
var DataView = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'DataView');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DataView);


/***/ }),

/***/ "./node_modules/lodash-es/_Hash.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash-es/_Hash.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _hashClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hashClear.js */ "./node_modules/lodash-es/_hashClear.js");
/* harmony import */ var _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hashDelete.js */ "./node_modules/lodash-es/_hashDelete.js");
/* harmony import */ var _hashGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hashGet.js */ "./node_modules/lodash-es/_hashGet.js");
/* harmony import */ var _hashHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hashHas.js */ "./node_modules/lodash-es/_hashHas.js");
/* harmony import */ var _hashSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_hashSet.js */ "./node_modules/lodash-es/_hashSet.js");






/**
 * Creates a hash object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Hash(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `Hash`.
Hash.prototype.clear = _hashClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
Hash.prototype['delete'] = _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
Hash.prototype.get = _hashGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
Hash.prototype.has = _hashHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
Hash.prototype.set = _hashSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Hash);


/***/ }),

/***/ "./node_modules/lodash-es/_ListCache.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_ListCache.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_listCacheClear.js */ "./node_modules/lodash-es/_listCacheClear.js");
/* harmony import */ var _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_listCacheDelete.js */ "./node_modules/lodash-es/_listCacheDelete.js");
/* harmony import */ var _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_listCacheGet.js */ "./node_modules/lodash-es/_listCacheGet.js");
/* harmony import */ var _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_listCacheHas.js */ "./node_modules/lodash-es/_listCacheHas.js");
/* harmony import */ var _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_listCacheSet.js */ "./node_modules/lodash-es/_listCacheSet.js");






/**
 * Creates an list cache object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function ListCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `ListCache`.
ListCache.prototype.clear = _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
ListCache.prototype['delete'] = _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
ListCache.prototype.get = _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
ListCache.prototype.has = _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
ListCache.prototype.set = _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ListCache);


/***/ }),

/***/ "./node_modules/lodash-es/_Map.js":
/*!****************************************!*\
  !*** ./node_modules/lodash-es/_Map.js ***!
  \****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");



/* Built-in method references that are verified to be native. */
var Map = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Map');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Map);


/***/ }),

/***/ "./node_modules/lodash-es/_MapCache.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_MapCache.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_mapCacheClear.js */ "./node_modules/lodash-es/_mapCacheClear.js");
/* harmony import */ var _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_mapCacheDelete.js */ "./node_modules/lodash-es/_mapCacheDelete.js");
/* harmony import */ var _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapCacheGet.js */ "./node_modules/lodash-es/_mapCacheGet.js");
/* harmony import */ var _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_mapCacheHas.js */ "./node_modules/lodash-es/_mapCacheHas.js");
/* harmony import */ var _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapCacheSet.js */ "./node_modules/lodash-es/_mapCacheSet.js");






/**
 * Creates a map cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function MapCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `MapCache`.
MapCache.prototype.clear = _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
MapCache.prototype['delete'] = _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
MapCache.prototype.get = _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
MapCache.prototype.has = _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
MapCache.prototype.set = _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MapCache);


/***/ }),

/***/ "./node_modules/lodash-es/_Promise.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_Promise.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");



/* Built-in method references that are verified to be native. */
var Promise = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Promise');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Promise);


/***/ }),

/***/ "./node_modules/lodash-es/_Set.js":
/*!****************************************!*\
  !*** ./node_modules/lodash-es/_Set.js ***!
  \****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");



/* Built-in method references that are verified to be native. */
var Set = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Set');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Set);


/***/ }),

/***/ "./node_modules/lodash-es/_SetCache.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_SetCache.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
/* harmony import */ var _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setCacheAdd.js */ "./node_modules/lodash-es/_setCacheAdd.js");
/* harmony import */ var _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setCacheHas.js */ "./node_modules/lodash-es/_setCacheHas.js");




/**
 *
 * Creates an array cache object to store unique values.
 *
 * @private
 * @constructor
 * @param {Array} [values] The values to cache.
 */
function SetCache(values) {
  var index = -1,
      length = values == null ? 0 : values.length;

  this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  while (++index < length) {
    this.add(values[index]);
  }
}

// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__["default"];
SetCache.prototype.has = _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SetCache);


/***/ }),

/***/ "./node_modules/lodash-es/_Stack.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/_Stack.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
/* harmony import */ var _stackClear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stackClear.js */ "./node_modules/lodash-es/_stackClear.js");
/* harmony import */ var _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stackDelete.js */ "./node_modules/lodash-es/_stackDelete.js");
/* harmony import */ var _stackGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stackGet.js */ "./node_modules/lodash-es/_stackGet.js");
/* harmony import */ var _stackHas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stackHas.js */ "./node_modules/lodash-es/_stackHas.js");
/* harmony import */ var _stackSet_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stackSet.js */ "./node_modules/lodash-es/_stackSet.js");







/**
 * Creates a stack cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Stack(entries) {
  var data = this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](entries);
  this.size = data.size;
}

// Add methods to `Stack`.
Stack.prototype.clear = _stackClear_js__WEBPACK_IMPORTED_MODULE_1__["default"];
Stack.prototype['delete'] = _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__["default"];
Stack.prototype.get = _stackGet_js__WEBPACK_IMPORTED_MODULE_3__["default"];
Stack.prototype.has = _stackHas_js__WEBPACK_IMPORTED_MODULE_4__["default"];
Stack.prototype.set = _stackSet_js__WEBPACK_IMPORTED_MODULE_5__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Stack);


/***/ }),

/***/ "./node_modules/lodash-es/_Symbol.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash-es/_Symbol.js ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");


/** Built-in value references. */
var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Symbol);


/***/ }),

/***/ "./node_modules/lodash-es/_Uint8Array.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_Uint8Array.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");


/** Built-in value references. */
var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Uint8Array;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Uint8Array);


/***/ }),

/***/ "./node_modules/lodash-es/_WeakMap.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_WeakMap.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");



/* Built-in method references that are verified to be native. */
var WeakMap = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'WeakMap');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WeakMap);


/***/ }),

/***/ "./node_modules/lodash-es/_apply.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/_apply.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A faster alternative to `Function#apply`, this function invokes `func`
 * with the `this` binding of `thisArg` and the arguments of `args`.
 *
 * @private
 * @param {Function} func The function to invoke.
 * @param {*} thisArg The `this` binding of `func`.
 * @param {Array} args The arguments to invoke `func` with.
 * @returns {*} Returns the result of `func`.
 */
function apply(func, thisArg, args) {
  switch (args.length) {
    case 0: return func.call(thisArg);
    case 1: return func.call(thisArg, args[0]);
    case 2: return func.call(thisArg, args[0], args[1]);
    case 3: return func.call(thisArg, args[0], args[1], args[2]);
  }
  return func.apply(thisArg, args);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (apply);


/***/ }),

/***/ "./node_modules/lodash-es/_arrayEach.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_arrayEach.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.forEach` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns `array`.
 */
function arrayEach(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (iteratee(array[index], index, array) === false) {
      break;
    }
  }
  return array;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayEach);


/***/ }),

/***/ "./node_modules/lodash-es/_arrayFilter.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_arrayFilter.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.filter` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {Array} Returns the new filtered array.
 */
function arrayFilter(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length,
      resIndex = 0,
      result = [];

  while (++index < length) {
    var value = array[index];
    if (predicate(value, index, array)) {
      result[resIndex++] = value;
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayFilter);


/***/ }),

/***/ "./node_modules/lodash-es/_arrayLikeKeys.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_arrayLikeKeys.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
/* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
/* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");







/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Creates an array of the enumerable property names of the array-like `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @param {boolean} inherited Specify returning inherited property names.
 * @returns {Array} Returns the array of property names.
 */
function arrayLikeKeys(value, inherited) {
  var isArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
      isArg = !isArr && (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value),
      isBuff = !isArr && !isArg && (0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
      isType = !isArr && !isArg && !isBuff && (0,_isTypedArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value),
      skipIndexes = isArr || isArg || isBuff || isType,
      result = skipIndexes ? (0,_baseTimes_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value.length, String) : [],
      length = result.length;

  for (var key in value) {
    if ((inherited || hasOwnProperty.call(value, key)) &&
        !(skipIndexes && (
           // Safari 9 has enumerable `arguments.length` in strict mode.
           key == 'length' ||
           // Node.js 0.10 has enumerable non-index properties on buffers.
           (isBuff && (key == 'offset' || key == 'parent')) ||
           // PhantomJS 2 has enumerable non-index properties on typed arrays.
           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
           // Skip index properties.
           (0,_isIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(key, length)
        ))) {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayLikeKeys);


/***/ }),

/***/ "./node_modules/lodash-es/_arrayMap.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_arrayMap.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.map` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the new mapped array.
 */
function arrayMap(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length,
      result = Array(length);

  while (++index < length) {
    result[index] = iteratee(array[index], index, array);
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayMap);


/***/ }),

/***/ "./node_modules/lodash-es/_arrayPush.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_arrayPush.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Appends the elements of `values` to `array`.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {Array} values The values to append.
 * @returns {Array} Returns `array`.
 */
function arrayPush(array, values) {
  var index = -1,
      length = values.length,
      offset = array.length;

  while (++index < length) {
    array[offset + index] = values[index];
  }
  return array;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arrayPush);


/***/ }),

/***/ "./node_modules/lodash-es/_arraySome.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_arraySome.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * A specialized version of `_.some` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 */
function arraySome(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (predicate(array[index], index, array)) {
      return true;
    }
  }
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (arraySome);


/***/ }),

/***/ "./node_modules/lodash-es/_assignMergeValue.js":
/*!*****************************************************!*\
  !*** ./node_modules/lodash-es/_assignMergeValue.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");



/**
 * This function is like `assignValue` except that it doesn't assign
 * `undefined` values.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function assignMergeValue(object, key, value) {
  if ((value !== undefined && !(0,_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object[key], value)) ||
      (value === undefined && !(key in object))) {
    (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, value);
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assignMergeValue);


/***/ }),

/***/ "./node_modules/lodash-es/_assignValue.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_assignValue.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Assigns `value` to `key` of `object` if the existing value is not equivalent
 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * for equality comparisons.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function assignValue(object, key, value) {
  var objValue = object[key];
  if (!(hasOwnProperty.call(object, key) && (0,_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, value)) ||
      (value === undefined && !(key in object))) {
    (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, value);
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assignValue);


/***/ }),

/***/ "./node_modules/lodash-es/_assocIndexOf.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_assocIndexOf.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");


/**
 * Gets the index at which the `key` is found in `array` of key-value pairs.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {*} key The key to search for.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function assocIndexOf(array, key) {
  var length = array.length;
  while (length--) {
    if ((0,_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array[length][0], key)) {
      return length;
    }
  }
  return -1;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assocIndexOf);


/***/ }),

/***/ "./node_modules/lodash-es/_baseAssign.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_baseAssign.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");



/**
 * The base implementation of `_.assign` without support for multiple sources
 * or `customizer` functions.
 *
 * @private
 * @param {Object} object The destination object.
 * @param {Object} source The source object.
 * @returns {Object} Returns `object`.
 */
function baseAssign(object, source) {
  return object && (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, (0,_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssign);


/***/ }),

/***/ "./node_modules/lodash-es/_baseAssignIn.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_baseAssignIn.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");



/**
 * The base implementation of `_.assignIn` without support for multiple sources
 * or `customizer` functions.
 *
 * @private
 * @param {Object} object The destination object.
 * @param {Object} source The source object.
 * @returns {Object} Returns `object`.
 */
function baseAssignIn(object, source) {
  return object && (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, (0,_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssignIn);


/***/ }),

/***/ "./node_modules/lodash-es/_baseAssignValue.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_baseAssignValue.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");


/**
 * The base implementation of `assignValue` and `assignMergeValue` without
 * value checks.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function baseAssignValue(object, key, value) {
  if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
    (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, {
      'configurable': true,
      'enumerable': true,
      'value': value,
      'writable': true
    });
  } else {
    object[key] = value;
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseAssignValue);


/***/ }),

/***/ "./node_modules/lodash-es/_baseClone.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseClone.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
/* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
/* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
/* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
/* harmony import */ var _baseAssignIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_baseAssignIn.js */ "./node_modules/lodash-es/_baseAssignIn.js");
/* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
/* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
/* harmony import */ var _copySymbols_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./_copySymbols.js */ "./node_modules/lodash-es/_copySymbols.js");
/* harmony import */ var _copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_copySymbolsIn.js */ "./node_modules/lodash-es/_copySymbolsIn.js");
/* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
/* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
/* harmony import */ var _initCloneArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_initCloneArray.js */ "./node_modules/lodash-es/_initCloneArray.js");
/* harmony import */ var _initCloneByTag_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_initCloneByTag.js */ "./node_modules/lodash-es/_initCloneByTag.js");
/* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
/* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");























/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
    CLONE_FLAT_FLAG = 2,
    CLONE_SYMBOLS_FLAG = 4;

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    objectTag = '[object Object]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false;

/**
 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
 * traversed objects.
 *
 * @private
 * @param {*} value The value to clone.
 * @param {boolean} bitmask The bitmask flags.
 *  1 - Deep clone
 *  2 - Flatten inherited properties
 *  4 - Clone symbols
 * @param {Function} [customizer] The function to customize cloning.
 * @param {string} [key] The key of `value`.
 * @param {Object} [object] The parent object of `value`.
 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
 * @returns {*} Returns the cloned value.
 */
function baseClone(value, bitmask, customizer, key, object, stack) {
  var result,
      isDeep = bitmask & CLONE_DEEP_FLAG,
      isFlat = bitmask & CLONE_FLAT_FLAG,
      isFull = bitmask & CLONE_SYMBOLS_FLAG;

  if (customizer) {
    result = object ? customizer(value, key, object, stack) : customizer(value);
  }
  if (result !== undefined) {
    return result;
  }
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
    return value;
  }
  var isArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  if (isArr) {
    result = (0,_initCloneArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
    if (!isDeep) {
      return (0,_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value, result);
    }
  } else {
    var tag = (0,_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value),
        isFunc = tag == funcTag || tag == genTag;

    if ((0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value)) {
      return (0,_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value, isDeep);
    }
    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
      result = (isFlat || isFunc) ? {} : (0,_initCloneObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value);
      if (!isDeep) {
        return isFlat
          ? (0,_copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value, (0,_baseAssignIn_js__WEBPACK_IMPORTED_MODULE_9__["default"])(result, value))
          : (0,_copySymbols_js__WEBPACK_IMPORTED_MODULE_10__["default"])(value, (0,_baseAssign_js__WEBPACK_IMPORTED_MODULE_11__["default"])(result, value));
      }
    } else {
      if (!cloneableTags[tag]) {
        return object ? value : {};
      }
      result = (0,_initCloneByTag_js__WEBPACK_IMPORTED_MODULE_12__["default"])(value, tag, isDeep);
    }
  }
  // Check for circular references and return its corresponding clone.
  stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_13__["default"]);
  var stacked = stack.get(value);
  if (stacked) {
    return stacked;
  }
  stack.set(value, result);

  if ((0,_isSet_js__WEBPACK_IMPORTED_MODULE_14__["default"])(value)) {
    value.forEach(function(subValue) {
      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
    });
  } else if ((0,_isMap_js__WEBPACK_IMPORTED_MODULE_15__["default"])(value)) {
    value.forEach(function(subValue, key) {
      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
    });
  }

  var keysFunc = isFull
    ? (isFlat ? _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_16__["default"] : _getAllKeys_js__WEBPACK_IMPORTED_MODULE_17__["default"])
    : (isFlat ? _keysIn_js__WEBPACK_IMPORTED_MODULE_18__["default"] : _keys_js__WEBPACK_IMPORTED_MODULE_19__["default"]);

  var props = isArr ? undefined : keysFunc(value);
  (0,_arrayEach_js__WEBPACK_IMPORTED_MODULE_20__["default"])(props || value, function(subValue, key) {
    if (props) {
      key = subValue;
      subValue = value[key];
    }
    // Recursively populate clone (susceptible to call stack limits).
    (0,_assignValue_js__WEBPACK_IMPORTED_MODULE_21__["default"])(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  });
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseClone);


/***/ }),

/***/ "./node_modules/lodash-es/_baseCreate.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_baseCreate.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");


/** Built-in value references. */
var objectCreate = Object.create;

/**
 * The base implementation of `_.create` without support for assigning
 * properties to the created object.
 *
 * @private
 * @param {Object} proto The object to inherit from.
 * @returns {Object} Returns the new object.
 */
var baseCreate = (function() {
  function object() {}
  return function(proto) {
    if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(proto)) {
      return {};
    }
    if (objectCreate) {
      return objectCreate(proto);
    }
    object.prototype = proto;
    var result = new object;
    object.prototype = undefined;
    return result;
  };
}());

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseCreate);


/***/ }),

/***/ "./node_modules/lodash-es/_baseFlatten.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_baseFlatten.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
/* harmony import */ var _isFlattenable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isFlattenable.js */ "./node_modules/lodash-es/_isFlattenable.js");



/**
 * The base implementation of `_.flatten` with support for restricting flattening.
 *
 * @private
 * @param {Array} array The array to flatten.
 * @param {number} depth The maximum recursion depth.
 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
 * @param {Array} [result=[]] The initial result value.
 * @returns {Array} Returns the new flattened array.
 */
function baseFlatten(array, depth, predicate, isStrict, result) {
  var index = -1,
      length = array.length;

  predicate || (predicate = _isFlattenable_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  result || (result = []);

  while (++index < length) {
    var value = array[index];
    if (depth > 0 && predicate(value)) {
      if (depth > 1) {
        // Recursively flatten arrays (susceptible to call stack limits).
        baseFlatten(value, depth - 1, predicate, isStrict, result);
      } else {
        (0,_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, value);
      }
    } else if (!isStrict) {
      result[result.length] = value;
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseFlatten);


/***/ }),

/***/ "./node_modules/lodash-es/_baseFor.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_baseFor.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");


/**
 * The base implementation of `baseForOwn` which iterates over `object`
 * properties returned by `keysFunc` and invokes `iteratee` for each property.
 * Iteratee functions may exit iteration early by explicitly returning `false`.
 *
 * @private
 * @param {Object} object The object to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @returns {Object} Returns `object`.
 */
var baseFor = (0,_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])();

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseFor);


/***/ }),

/***/ "./node_modules/lodash-es/_baseGet.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_baseGet.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
/* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");



/**
 * The base implementation of `_.get` without support for default values.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to get.
 * @returns {*} Returns the resolved value.
 */
function baseGet(object, path) {
  path = (0,_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);

  var index = 0,
      length = path.length;

  while (object != null && index < length) {
    object = object[(0,_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index++])];
  }
  return (index && index == length) ? object : undefined;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseGet);


/***/ }),

/***/ "./node_modules/lodash-es/_baseGetAllKeys.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_baseGetAllKeys.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");



/**
 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
 * symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @param {Function} symbolsFunc The function to get the symbols of `object`.
 * @returns {Array} Returns the array of property names and symbols.
 */
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  var result = keysFunc(object);
  return (0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object) ? result : (0,_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, symbolsFunc(object));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseGetAllKeys);


/***/ }),

/***/ "./node_modules/lodash-es/_baseGetTag.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_baseGetTag.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
/* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getRawTag.js */ "./node_modules/lodash-es/_getRawTag.js");
/* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_objectToString.js */ "./node_modules/lodash-es/_objectToString.js");




/** `Object#toString` result references. */
var nullTag = '[object Null]',
    undefinedTag = '[object Undefined]';

/** Built-in value references. */
var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;

/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return (symToStringTag && symToStringTag in Object(value))
    ? (0,_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)
    : (0,_objectToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseGetTag);


/***/ }),

/***/ "./node_modules/lodash-es/_baseHas.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_baseHas.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.has` without support for deep paths.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {Array|string} key The key to check.
 * @returns {boolean} Returns `true` if `key` exists, else `false`.
 */
function baseHas(object, key) {
  return object != null && hasOwnProperty.call(object, key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseHas);


/***/ }),

/***/ "./node_modules/lodash-es/_baseHasIn.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseHasIn.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.hasIn` without support for deep paths.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {Array|string} key The key to check.
 * @returns {boolean} Returns `true` if `key` exists, else `false`.
 */
function baseHasIn(object, key) {
  return object != null && key in Object(object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseHasIn);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsArguments.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_baseIsArguments.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/** `Object#toString` result references. */
var argsTag = '[object Arguments]';

/**
 * The base implementation of `_.isArguments`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 */
function baseIsArguments(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) == argsTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsArguments);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsEqual.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_baseIsEqual.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsEqualDeep.js */ "./node_modules/lodash-es/_baseIsEqualDeep.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/**
 * The base implementation of `_.isEqual` which supports partial comparisons
 * and tracks traversed objects.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @param {boolean} bitmask The bitmask flags.
 *  1 - Unordered comparison
 *  2 - Partial comparison
 * @param {Function} [customizer] The function to customize comparisons.
 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 */
function baseIsEqual(value, other, bitmask, customizer, stack) {
  if (value === other) {
    return true;
  }
  if (value == null || other == null || (!(0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && !(0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other))) {
    return value !== value && other !== other;
  }
  return (0,_baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, other, bitmask, customizer, baseIsEqual, stack);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsEqual);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsEqualDeep.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_baseIsEqualDeep.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
/* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
/* harmony import */ var _equalByTag_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_equalByTag.js */ "./node_modules/lodash-es/_equalByTag.js");
/* harmony import */ var _equalObjects_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_equalObjects.js */ "./node_modules/lodash-es/_equalObjects.js");
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
/* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");









/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    objectTag = '[object Object]';

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * A specialized version of `baseIsEqual` for arrays and objects which performs
 * deep comparisons and tracks traversed objects enabling objects with circular
 * references to be compared.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  var objIsArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object),
      othIsArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other),
      objTag = objIsArr ? arrayTag : (0,_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
      othTag = othIsArr ? arrayTag : (0,_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);

  objTag = objTag == argsTag ? objectTag : objTag;
  othTag = othTag == argsTag ? objectTag : othTag;

  var objIsObj = objTag == objectTag,
      othIsObj = othTag == objectTag,
      isSameTag = objTag == othTag;

  if (isSameTag && (0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object)) {
    if (!(0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(other)) {
      return false;
    }
    objIsArr = true;
    objIsObj = false;
  }
  if (isSameTag && !objIsObj) {
    stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
    return (objIsArr || (0,_isTypedArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object))
      ? (0,_equalArrays_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object, other, bitmask, customizer, equalFunc, stack)
      : (0,_equalByTag_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, other, objTag, bitmask, customizer, equalFunc, stack);
  }
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');

    if (objIsWrapped || othIsWrapped) {
      var objUnwrapped = objIsWrapped ? object.value() : object,
          othUnwrapped = othIsWrapped ? other.value() : other;

      stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
    }
  }
  if (!isSameTag) {
    return false;
  }
  stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  return (0,_equalObjects_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object, other, bitmask, customizer, equalFunc, stack);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsEqualDeep);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsMap.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseIsMap.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/** `Object#toString` result references. */
var mapTag = '[object Map]';

/**
 * The base implementation of `_.isMap` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
 */
function baseIsMap(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && (0,_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) == mapTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsMap);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsNative.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_baseIsNative.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
/* harmony import */ var _isMasked_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMasked.js */ "./node_modules/lodash-es/_isMasked.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");





/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);

/**
 * The base implementation of `_.isNative` without bad shim checks.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a native function,
 *  else `false`.
 */
function baseIsNative(value) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) || (0,_isMasked_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
    return false;
  }
  var pattern = (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) ? reIsNative : reIsHostCtor;
  return pattern.test((0,_toSource_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsNative);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsSet.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseIsSet.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/** `Object#toString` result references. */
var setTag = '[object Set]';

/**
 * The base implementation of `_.isSet` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
 */
function baseIsSet(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && (0,_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) == setTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsSet);


/***/ }),

/***/ "./node_modules/lodash-es/_baseIsTypedArray.js":
/*!*****************************************************!*\
  !*** ./node_modules/lodash-es/_baseIsTypedArray.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");




/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    objectTag = '[object Object]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;

/**
 * The base implementation of `_.isTypedArray` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 */
function baseIsTypedArray(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) &&
    (0,_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !!typedArrayTags[(0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseIsTypedArray);


/***/ }),

/***/ "./node_modules/lodash-es/_baseKeys.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_baseKeys.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
/* harmony import */ var _nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_nativeKeys.js */ "./node_modules/lodash-es/_nativeKeys.js");



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeys(object) {
  if (!(0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
    return (0,_nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  }
  var result = [];
  for (var key in Object(object)) {
    if (hasOwnProperty.call(object, key) && key != 'constructor') {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseKeys);


/***/ }),

/***/ "./node_modules/lodash-es/_baseKeysIn.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_baseKeysIn.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
/* harmony import */ var _nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_nativeKeysIn.js */ "./node_modules/lodash-es/_nativeKeysIn.js");




/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeysIn(object) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
    return (0,_nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  }
  var isProto = (0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object),
      result = [];

  for (var key in object) {
    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseKeysIn);


/***/ }),

/***/ "./node_modules/lodash-es/_baseMerge.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseMerge.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
/* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
/* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
/* harmony import */ var _baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMergeDeep.js */ "./node_modules/lodash-es/_baseMergeDeep.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
/* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");








/**
 * The base implementation of `_.merge` without support for multiple sources.
 *
 * @private
 * @param {Object} object The destination object.
 * @param {Object} source The source object.
 * @param {number} srcIndex The index of `source`.
 * @param {Function} [customizer] The function to customize merged values.
 * @param {Object} [stack] Tracks traversed source values and their merged
 *  counterparts.
 */
function baseMerge(object, source, srcIndex, customizer, stack) {
  if (object === source) {
    return;
  }
  (0,_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, function(srcValue, key) {
    stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
    if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(srcValue)) {
      (0,_baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, source, key, srcIndex, baseMerge, customizer, stack);
    }
    else {
      var newValue = customizer
        ? customizer((0,_safeGet_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, key), srcValue, (key + ''), object, source, stack)
        : undefined;

      if (newValue === undefined) {
        newValue = srcValue;
      }
      (0,_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object, key, newValue);
    }
  }, _keysIn_js__WEBPACK_IMPORTED_MODULE_6__["default"]);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseMerge);


/***/ }),

/***/ "./node_modules/lodash-es/_baseMergeDeep.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_baseMergeDeep.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
/* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
/* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
/* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
/* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
/* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
/* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
/* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
/* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
















/**
 * A specialized version of `baseMerge` for arrays and objects which performs
 * deep merges and tracks traversed objects enabling objects with circular
 * references to be merged.
 *
 * @private
 * @param {Object} object The destination object.
 * @param {Object} source The source object.
 * @param {string} key The key of the value to merge.
 * @param {number} srcIndex The index of `source`.
 * @param {Function} mergeFunc The function to merge values.
 * @param {Function} [customizer] The function to customize assigned values.
 * @param {Object} [stack] Tracks traversed source values and their merged
 *  counterparts.
 */
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  var objValue = (0,_safeGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key),
      srcValue = (0,_safeGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, key),
      stacked = stack.get(srcValue);

  if (stacked) {
    (0,_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, stacked);
    return;
  }
  var newValue = customizer
    ? customizer(objValue, srcValue, (key + ''), object, source, stack)
    : undefined;

  var isCommon = newValue === undefined;

  if (isCommon) {
    var isArr = (0,_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(srcValue),
        isBuff = !isArr && (0,_isBuffer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(srcValue),
        isTyped = !isArr && !isBuff && (0,_isTypedArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue);

    newValue = srcValue;
    if (isArr || isBuff || isTyped) {
      if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(objValue)) {
        newValue = objValue;
      }
      else if ((0,_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_5__["default"])(objValue)) {
        newValue = (0,_copyArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(objValue);
      }
      else if (isBuff) {
        isCommon = false;
        newValue = (0,_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_7__["default"])(srcValue, true);
      }
      else if (isTyped) {
        isCommon = false;
        newValue = (0,_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(srcValue, true);
      }
      else {
        newValue = [];
      }
    }
    else if ((0,_isPlainObject_js__WEBPACK_IMPORTED_MODULE_9__["default"])(srcValue) || (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_10__["default"])(srcValue)) {
      newValue = objValue;
      if ((0,_isArguments_js__WEBPACK_IMPORTED_MODULE_10__["default"])(objValue)) {
        newValue = (0,_toPlainObject_js__WEBPACK_IMPORTED_MODULE_11__["default"])(objValue);
      }
      else if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_12__["default"])(objValue) || (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_13__["default"])(objValue)) {
        newValue = (0,_initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(srcValue);
      }
    }
    else {
      isCommon = false;
    }
  }
  if (isCommon) {
    // Recursively merge objects and arrays (susceptible to call stack limits).
    stack.set(srcValue, newValue);
    mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
    stack['delete'](srcValue);
  }
  (0,_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseMergeDeep);


/***/ }),

/***/ "./node_modules/lodash-es/_basePick.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_basePick.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
/* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");



/**
 * The base implementation of `_.pick` without support for individual
 * property identifiers.
 *
 * @private
 * @param {Object} object The source object.
 * @param {string[]} paths The property paths to pick.
 * @returns {Object} Returns the new object.
 */
function basePick(object, paths) {
  return (0,_basePickBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths, function(value, path) {
    return (0,_hasIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  });
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (basePick);


/***/ }),

/***/ "./node_modules/lodash-es/_basePickBy.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_basePickBy.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
/* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
/* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");




/**
 * The base implementation of  `_.pickBy` without support for iteratee shorthands.
 *
 * @private
 * @param {Object} object The source object.
 * @param {string[]} paths The property paths to pick.
 * @param {Function} predicate The function invoked per property.
 * @returns {Object} Returns the new object.
 */
function basePickBy(object, paths, predicate) {
  var index = -1,
      length = paths.length,
      result = {};

  while (++index < length) {
    var path = paths[index],
        value = (0,_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);

    if (predicate(value, path)) {
      (0,_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, (0,_castPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path, object), value);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (basePickBy);


/***/ }),

/***/ "./node_modules/lodash-es/_baseRest.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_baseRest.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
/* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
/* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");




/**
 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @returns {Function} Returns the new function.
 */
function baseRest(func, start) {
  return (0,_setToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, start, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"]), func + '');
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseRest);


/***/ }),

/***/ "./node_modules/lodash-es/_baseSet.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_baseSet.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
/* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
/* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");






/**
 * The base implementation of `_.set`.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {Array|string} path The path of the property to set.
 * @param {*} value The value to set.
 * @param {Function} [customizer] The function to customize path creation.
 * @returns {Object} Returns `object`.
 */
function baseSet(object, path, value, customizer) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
    return object;
  }
  path = (0,_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);

  var index = -1,
      length = path.length,
      lastIndex = length - 1,
      nested = object;

  while (nested != null && ++index < length) {
    var key = (0,_toKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index]),
        newValue = value;

    if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
      return object;
    }

    if (index != lastIndex) {
      var objValue = nested[key];
      newValue = customizer ? customizer(objValue, key, nested) : undefined;
      if (newValue === undefined) {
        newValue = (0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue)
          ? objValue
          : ((0,_isIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path[index + 1]) ? [] : {});
      }
    }
    (0,_assignValue_js__WEBPACK_IMPORTED_MODULE_4__["default"])(nested, key, newValue);
    nested = nested[key];
  }
  return object;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseSet);


/***/ }),

/***/ "./node_modules/lodash-es/_baseSetToString.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_baseSetToString.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
/* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");




/**
 * The base implementation of `setToString` without support for hot loop shorting.
 *
 * @private
 * @param {Function} func The function to modify.
 * @param {Function} string The `toString` result.
 * @returns {Function} Returns `func`.
 */
var baseSetToString = !_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(func, string) {
  return (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 'toString', {
    'configurable': true,
    'enumerable': false,
    'value': (0,_constant_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string),
    'writable': true
  });
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseSetToString);


/***/ }),

/***/ "./node_modules/lodash-es/_baseTimes.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseTimes.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.times` without support for iteratee shorthands
 * or max array length checks.
 *
 * @private
 * @param {number} n The number of times to invoke `iteratee`.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the array of results.
 */
function baseTimes(n, iteratee) {
  var index = -1,
      result = Array(n);

  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseTimes);


/***/ }),

/***/ "./node_modules/lodash-es/_baseToString.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_baseToString.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
/* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");





/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
    symbolToString = symbolProto ? symbolProto.toString : undefined;

/**
 * The base implementation of `_.toString` which doesn't convert nullish
 * values to empty strings.
 *
 * @private
 * @param {*} value The value to process.
 * @returns {string} Returns the string.
 */
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value == 'string') {
    return value;
  }
  if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
    // Recursively convert values (susceptible to call stack limits).
    return (0,_arrayMap_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value, baseToString) + '';
  }
  if ((0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseToString);


/***/ }),

/***/ "./node_modules/lodash-es/_baseTrim.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_baseTrim.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");


/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;

/**
 * The base implementation of `_.trim`.
 *
 * @private
 * @param {string} string The string to trim.
 * @returns {string} Returns the trimmed string.
 */
function baseTrim(string) {
  return string
    ? string.slice(0, (0,_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string) + 1).replace(reTrimStart, '')
    : string;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseTrim);


/***/ }),

/***/ "./node_modules/lodash-es/_baseUnary.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_baseUnary.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * The base implementation of `_.unary` without support for storing metadata.
 *
 * @private
 * @param {Function} func The function to cap arguments for.
 * @returns {Function} Returns the new capped function.
 */
function baseUnary(func) {
  return function(value) {
    return func(value);
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseUnary);


/***/ }),

/***/ "./node_modules/lodash-es/_cacheHas.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_cacheHas.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if a `cache` value for `key` exists.
 *
 * @private
 * @param {Object} cache The cache to query.
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function cacheHas(cache, key) {
  return cache.has(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cacheHas);


/***/ }),

/***/ "./node_modules/lodash-es/_castPath.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_castPath.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
/* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
/* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");





/**
 * Casts `value` to a path array if it's not one.
 *
 * @private
 * @param {*} value The value to inspect.
 * @param {Object} [object] The object to query keys on.
 * @returns {Array} Returns the cast property path array.
 */
function castPath(value, object) {
  if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
    return value;
  }
  return (0,_isKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, object) ? [value] : (0,_stringToPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (castPath);


/***/ }),

/***/ "./node_modules/lodash-es/_cloneArrayBuffer.js":
/*!*****************************************************!*\
  !*** ./node_modules/lodash-es/_cloneArrayBuffer.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");


/**
 * Creates a clone of `arrayBuffer`.
 *
 * @private
 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
 * @returns {ArrayBuffer} Returns the cloned array buffer.
 */
function cloneArrayBuffer(arrayBuffer) {
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](arrayBuffer));
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneArrayBuffer);


/***/ }),

/***/ "./node_modules/lodash-es/_cloneBuffer.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_cloneBuffer.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");


/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined,
    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;

/**
 * Creates a clone of  `buffer`.
 *
 * @private
 * @param {Buffer} buffer The buffer to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Buffer} Returns the cloned buffer.
 */
function cloneBuffer(buffer, isDeep) {
  if (isDeep) {
    return buffer.slice();
  }
  var length = buffer.length,
      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);

  buffer.copy(result);
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneBuffer);


/***/ }),

/***/ "./node_modules/lodash-es/_cloneDataView.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_cloneDataView.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");


/**
 * Creates a clone of `dataView`.
 *
 * @private
 * @param {Object} dataView The data view to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Object} Returns the cloned data view.
 */
function cloneDataView(dataView, isDeep) {
  var buffer = isDeep ? (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dataView.buffer) : dataView.buffer;
  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneDataView);


/***/ }),

/***/ "./node_modules/lodash-es/_cloneRegExp.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_cloneRegExp.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;

/**
 * Creates a clone of `regexp`.
 *
 * @private
 * @param {Object} regexp The regexp to clone.
 * @returns {Object} Returns the cloned regexp.
 */
function cloneRegExp(regexp) {
  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  result.lastIndex = regexp.lastIndex;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneRegExp);


/***/ }),

/***/ "./node_modules/lodash-es/_cloneSymbol.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_cloneSymbol.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");


/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;

/**
 * Creates a clone of the `symbol` object.
 *
 * @private
 * @param {Object} symbol The symbol object to clone.
 * @returns {Object} Returns the cloned symbol object.
 */
function cloneSymbol(symbol) {
  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneSymbol);


/***/ }),

/***/ "./node_modules/lodash-es/_cloneTypedArray.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_cloneTypedArray.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");


/**
 * Creates a clone of `typedArray`.
 *
 * @private
 * @param {Object} typedArray The typed array to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Object} Returns the cloned typed array.
 */
function cloneTypedArray(typedArray, isDeep) {
  var buffer = isDeep ? (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typedArray.buffer) : typedArray.buffer;
  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneTypedArray);


/***/ }),

/***/ "./node_modules/lodash-es/_copyArray.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_copyArray.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Copies the values of `source` to `array`.
 *
 * @private
 * @param {Array} source The array to copy values from.
 * @param {Array} [array=[]] The array to copy values to.
 * @returns {Array} Returns `array`.
 */
function copyArray(source, array) {
  var index = -1,
      length = source.length;

  array || (array = Array(length));
  while (++index < length) {
    array[index] = source[index];
  }
  return array;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyArray);


/***/ }),

/***/ "./node_modules/lodash-es/_copyObject.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_copyObject.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
/* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");



/**
 * Copies properties of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy properties from.
 * @param {Array} props The property identifiers to copy.
 * @param {Object} [object={}] The object to copy properties to.
 * @param {Function} [customizer] The function to customize copied values.
 * @returns {Object} Returns `object`.
 */
function copyObject(source, props, object, customizer) {
  var isNew = !object;
  object || (object = {});

  var index = -1,
      length = props.length;

  while (++index < length) {
    var key = props[index];

    var newValue = customizer
      ? customizer(object[key], source[key], key, object, source)
      : undefined;

    if (newValue === undefined) {
      newValue = source[key];
    }
    if (isNew) {
      (0,_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
    } else {
      (0,_assignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
    }
  }
  return object;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyObject);


/***/ }),

/***/ "./node_modules/lodash-es/_copySymbols.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_copySymbols.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
/* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");



/**
 * Copies own symbols of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy symbols from.
 * @param {Object} [object={}] The object to copy symbols to.
 * @returns {Object} Returns `object`.
 */
function copySymbols(source, object) {
  return (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, (0,_getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copySymbols);


/***/ }),

/***/ "./node_modules/lodash-es/_copySymbolsIn.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_copySymbolsIn.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
/* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");



/**
 * Copies own and inherited symbols of `source` to `object`.
 *
 * @private
 * @param {Object} source The object to copy symbols from.
 * @param {Object} [object={}] The object to copy symbols to.
 * @returns {Object} Returns `object`.
 */
function copySymbolsIn(source, object) {
  return (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, (0,_getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copySymbolsIn);


/***/ }),

/***/ "./node_modules/lodash-es/_coreJsData.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_coreJsData.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");


/** Used to detect overreaching core-js shims. */
var coreJsData = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"]['__core-js_shared__'];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (coreJsData);


/***/ }),

/***/ "./node_modules/lodash-es/_createAssigner.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_createAssigner.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
/* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");



/**
 * Creates a function like `_.assign`.
 *
 * @private
 * @param {Function} assigner The function to assign values.
 * @returns {Function} Returns the new assigner function.
 */
function createAssigner(assigner) {
  return (0,_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
    var index = -1,
        length = sources.length,
        customizer = length > 1 ? sources[length - 1] : undefined,
        guard = length > 2 ? sources[2] : undefined;

    customizer = (assigner.length > 3 && typeof customizer == 'function')
      ? (length--, customizer)
      : undefined;

    if (guard && (0,_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(sources[0], sources[1], guard)) {
      customizer = length < 3 ? undefined : customizer;
      length = 1;
    }
    object = Object(object);
    while (++index < length) {
      var source = sources[index];
      if (source) {
        assigner(object, source, index, customizer);
      }
    }
    return object;
  });
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createAssigner);


/***/ }),

/***/ "./node_modules/lodash-es/_createBaseFor.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_createBaseFor.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
 *
 * @private
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Function} Returns the new base function.
 */
function createBaseFor(fromRight) {
  return function(object, iteratee, keysFunc) {
    var index = -1,
        iterable = Object(object),
        props = keysFunc(object),
        length = props.length;

    while (length--) {
      var key = props[fromRight ? length : ++index];
      if (iteratee(iterable[key], key, iterable) === false) {
        break;
      }
    }
    return object;
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createBaseFor);


/***/ }),

/***/ "./node_modules/lodash-es/_defineProperty.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_defineProperty.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");


var defineProperty = (function() {
  try {
    var func = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'defineProperty');
    func({}, '', {});
    return func;
  } catch (e) {}
}());

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defineProperty);


/***/ }),

/***/ "./node_modules/lodash-es/_equalArrays.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_equalArrays.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
/* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
/* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");




/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/**
 * A specialized version of `baseIsEqualDeep` for arrays with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Array} array The array to compare.
 * @param {Array} other The other array to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `array` and `other` objects.
 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
 */
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      arrLength = array.length,
      othLength = other.length;

  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
    return false;
  }
  // Check that cyclic values are equal.
  var arrStacked = stack.get(array);
  var othStacked = stack.get(other);
  if (arrStacked && othStacked) {
    return arrStacked == other && othStacked == array;
  }
  var index = -1,
      result = true,
      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"] : undefined;

  stack.set(array, other);
  stack.set(other, array);

  // Ignore non-index properties.
  while (++index < arrLength) {
    var arrValue = array[index],
        othValue = other[index];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, arrValue, index, other, array, stack)
        : customizer(arrValue, othValue, index, array, other, stack);
    }
    if (compared !== undefined) {
      if (compared) {
        continue;
      }
      result = false;
      break;
    }
    // Recursively compare arrays (susceptible to call stack limits).
    if (seen) {
      if (!(0,_arraySome_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other, function(othValue, othIndex) {
            if (!(0,_cacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"])(seen, othIndex) &&
                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
              return seen.push(othIndex);
            }
          })) {
        result = false;
        break;
      }
    } else if (!(
          arrValue === othValue ||
            equalFunc(arrValue, othValue, bitmask, customizer, stack)
        )) {
      result = false;
      break;
    }
  }
  stack['delete'](array);
  stack['delete'](other);
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (equalArrays);


/***/ }),

/***/ "./node_modules/lodash-es/_equalByTag.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_equalByTag.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
/* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
/* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
/* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
/* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");







/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]';

/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;

/**
 * A specialized version of `baseIsEqualDeep` for comparing objects of
 * the same `toStringTag`.
 *
 * **Note:** This function only supports comparing values with tags of
 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {string} tag The `toStringTag` of the objects to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  switch (tag) {
    case dataViewTag:
      if ((object.byteLength != other.byteLength) ||
          (object.byteOffset != other.byteOffset)) {
        return false;
      }
      object = object.buffer;
      other = other.buffer;

    case arrayBufferTag:
      if ((object.byteLength != other.byteLength) ||
          !equalFunc(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](object), new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](other))) {
        return false;
      }
      return true;

    case boolTag:
    case dateTag:
    case numberTag:
      // Coerce booleans to `1` or `0` and dates to milliseconds.
      // Invalid dates are coerced to `NaN`.
      return (0,_eq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+object, +other);

    case errorTag:
      return object.name == other.name && object.message == other.message;

    case regexpTag:
    case stringTag:
      // Coerce regexes to strings and treat strings, primitives and objects,
      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
      // for more details.
      return object == (other + '');

    case mapTag:
      var convert = _mapToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"];

    case setTag:
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
      convert || (convert = _setToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"]);

      if (object.size != other.size && !isPartial) {
        return false;
      }
      // Assume cyclic values are equal.
      var stacked = stack.get(object);
      if (stacked) {
        return stacked == other;
      }
      bitmask |= COMPARE_UNORDERED_FLAG;

      // Recursively compare objects (susceptible to call stack limits).
      stack.set(object, other);
      var result = (0,_equalArrays_js__WEBPACK_IMPORTED_MODULE_5__["default"])(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
      stack['delete'](object);
      return result;

    case symbolTag:
      if (symbolValueOf) {
        return symbolValueOf.call(object) == symbolValueOf.call(other);
      }
  }
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (equalByTag);


/***/ }),

/***/ "./node_modules/lodash-es/_equalObjects.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_equalObjects.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");


/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * A specialized version of `baseIsEqualDeep` for objects with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      objProps = (0,_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object),
      objLength = objProps.length,
      othProps = (0,_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other),
      othLength = othProps.length;

  if (objLength != othLength && !isPartial) {
    return false;
  }
  var index = objLength;
  while (index--) {
    var key = objProps[index];
    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
      return false;
    }
  }
  // Check that cyclic values are equal.
  var objStacked = stack.get(object);
  var othStacked = stack.get(other);
  if (objStacked && othStacked) {
    return objStacked == other && othStacked == object;
  }
  var result = true;
  stack.set(object, other);
  stack.set(other, object);

  var skipCtor = isPartial;
  while (++index < objLength) {
    key = objProps[index];
    var objValue = object[key],
        othValue = other[key];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, objValue, key, other, object, stack)
        : customizer(objValue, othValue, key, object, other, stack);
    }
    // Recursively compare objects (susceptible to call stack limits).
    if (!(compared === undefined
          ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
          : compared
        )) {
      result = false;
      break;
    }
    skipCtor || (skipCtor = key == 'constructor');
  }
  if (result && !skipCtor) {
    var objCtor = object.constructor,
        othCtor = other.constructor;

    // Non `Object` object instances with different constructors are not equal.
    if (objCtor != othCtor &&
        ('constructor' in object && 'constructor' in other) &&
        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
          typeof othCtor == 'function' && othCtor instanceof othCtor)) {
      result = false;
    }
  }
  stack['delete'](object);
  stack['delete'](other);
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (equalObjects);


/***/ }),

/***/ "./node_modules/lodash-es/_flatRest.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_flatRest.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
/* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
/* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");




/**
 * A specialized version of `baseRest` which flattens the rest array.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @returns {Function} Returns the new function.
 */
function flatRest(func) {
  return (0,_setToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, undefined, _flatten_js__WEBPACK_IMPORTED_MODULE_2__["default"]), func + '');
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (flatRest);


/***/ }),

/***/ "./node_modules/lodash-es/_freeGlobal.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_freeGlobal.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (freeGlobal);


/***/ }),

/***/ "./node_modules/lodash-es/_getAllKeys.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_getAllKeys.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
/* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");




/**
 * Creates an array of own enumerable property names and symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names and symbols.
 */
function getAllKeys(object) {
  return (0,_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"], _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getAllKeys);


/***/ }),

/***/ "./node_modules/lodash-es/_getAllKeysIn.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_getAllKeysIn.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
/* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");




/**
 * Creates an array of own and inherited enumerable property names and
 * symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names and symbols.
 */
function getAllKeysIn(object) {
  return (0,_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"], _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getAllKeysIn);


/***/ }),

/***/ "./node_modules/lodash-es/_getMapData.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_getMapData.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isKeyable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isKeyable.js */ "./node_modules/lodash-es/_isKeyable.js");


/**
 * Gets the data for `map`.
 *
 * @private
 * @param {Object} map The map to query.
 * @param {string} key The reference key.
 * @returns {*} Returns the map data.
 */
function getMapData(map, key) {
  var data = map.__data__;
  return (0,_isKeyable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key)
    ? data[typeof key == 'string' ? 'string' : 'hash']
    : data.map;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getMapData);


/***/ }),

/***/ "./node_modules/lodash-es/_getNative.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_getNative.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
/* harmony import */ var _getValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getValue.js */ "./node_modules/lodash-es/_getValue.js");



/**
 * Gets the native function at `key` of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {string} key The key of the method to get.
 * @returns {*} Returns the function if it's native, else `undefined`.
 */
function getNative(object, key) {
  var value = (0,_getValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key);
  return (0,_baseIsNative_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ? value : undefined;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getNative);


/***/ }),

/***/ "./node_modules/lodash-es/_getPrototype.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_getPrototype.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");


/** Built-in value references. */
var getPrototype = (0,_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.getPrototypeOf, Object);

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getPrototype);


/***/ }),

/***/ "./node_modules/lodash-es/_getRawTag.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_getRawTag.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");


/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/** Built-in value references. */
var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;

/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
      tag = value[symToStringTag];

  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}

  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getRawTag);


/***/ }),

/***/ "./node_modules/lodash-es/_getSymbols.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_getSymbols.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
/* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;

/**
 * Creates an array of the own enumerable symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of symbols.
 */
var getSymbols = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(object) {
  if (object == null) {
    return [];
  }
  object = Object(object);
  return (0,_arrayFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nativeGetSymbols(object), function(symbol) {
    return propertyIsEnumerable.call(object, symbol);
  });
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSymbols);


/***/ }),

/***/ "./node_modules/lodash-es/_getSymbolsIn.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_getSymbolsIn.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
/* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
/* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
/* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");





/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;

/**
 * Creates an array of the own and inherited enumerable symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of symbols.
 */
var getSymbolsIn = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(object) {
  var result = [];
  while (object) {
    (0,_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, (0,_getSymbols_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object));
    object = (0,_getPrototype_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  }
  return result;
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSymbolsIn);


/***/ }),

/***/ "./node_modules/lodash-es/_getTag.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash-es/_getTag.js ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _DataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_DataView.js */ "./node_modules/lodash-es/_DataView.js");
/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
/* harmony import */ var _Promise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_Promise.js */ "./node_modules/lodash-es/_Promise.js");
/* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
/* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");








/** `Object#toString` result references. */
var mapTag = '[object Map]',
    objectTag = '[object Object]',
    promiseTag = '[object Promise]',
    setTag = '[object Set]',
    weakMapTag = '[object WeakMap]';

var dataViewTag = '[object DataView]';

/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_DataView_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
    mapCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_Map_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
    promiseCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_Promise_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
    setCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_Set_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
    weakMapCtorString = (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_WeakMap_js__WEBPACK_IMPORTED_MODULE_5__["default"]);

/**
 * Gets the `toStringTag` of `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
var getTag = _baseGetTag_js__WEBPACK_IMPORTED_MODULE_6__["default"];

// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((_DataView_js__WEBPACK_IMPORTED_MODULE_1__["default"] && getTag(new _DataView_js__WEBPACK_IMPORTED_MODULE_1__["default"](new ArrayBuffer(1))) != dataViewTag) ||
    (_Map_js__WEBPACK_IMPORTED_MODULE_2__["default"] && getTag(new _Map_js__WEBPACK_IMPORTED_MODULE_2__["default"]) != mapTag) ||
    (_Promise_js__WEBPACK_IMPORTED_MODULE_3__["default"] && getTag(_Promise_js__WEBPACK_IMPORTED_MODULE_3__["default"].resolve()) != promiseTag) ||
    (_Set_js__WEBPACK_IMPORTED_MODULE_4__["default"] && getTag(new _Set_js__WEBPACK_IMPORTED_MODULE_4__["default"]) != setTag) ||
    (_WeakMap_js__WEBPACK_IMPORTED_MODULE_5__["default"] && getTag(new _WeakMap_js__WEBPACK_IMPORTED_MODULE_5__["default"]) != weakMapTag)) {
  getTag = function(value) {
    var result = (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value),
        Ctor = result == objectTag ? value.constructor : undefined,
        ctorString = Ctor ? (0,_toSource_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Ctor) : '';

    if (ctorString) {
      switch (ctorString) {
        case dataViewCtorString: return dataViewTag;
        case mapCtorString: return mapTag;
        case promiseCtorString: return promiseTag;
        case setCtorString: return setTag;
        case weakMapCtorString: return weakMapTag;
      }
    }
    return result;
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getTag);


/***/ }),

/***/ "./node_modules/lodash-es/_getValue.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_getValue.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Gets the value at `key` of `object`.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {string} key The key of the property to get.
 * @returns {*} Returns the property value.
 */
function getValue(object, key) {
  return object == null ? undefined : object[key];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getValue);


/***/ }),

/***/ "./node_modules/lodash-es/_hasPath.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_hasPath.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
/* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
/* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");







/**
 * Checks if `path` exists on `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @param {Function} hasFunc The function to check properties.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 */
function hasPath(object, path, hasFunc) {
  path = (0,_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);

  var index = -1,
      length = path.length,
      result = false;

  while (++index < length) {
    var key = (0,_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index]);
    if (!(result = object != null && hasFunc(object, key))) {
      break;
    }
    object = object[key];
  }
  if (result || ++index != length) {
    return result;
  }
  length = object == null ? 0 : object.length;
  return !!length && (0,_isLength_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length) && (0,_isIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key, length) &&
    ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object) || (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hasPath);


/***/ }),

/***/ "./node_modules/lodash-es/_hashClear.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_hashClear.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");


/**
 * Removes all key-value entries from the hash.
 *
 * @private
 * @name clear
 * @memberOf Hash
 */
function hashClear() {
  this.__data__ = _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? (0,_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(null) : {};
  this.size = 0;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashClear);


/***/ }),

/***/ "./node_modules/lodash-es/_hashDelete.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_hashDelete.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Removes `key` and its value from the hash.
 *
 * @private
 * @name delete
 * @memberOf Hash
 * @param {Object} hash The hash to modify.
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function hashDelete(key) {
  var result = this.has(key) && delete this.__data__[key];
  this.size -= result ? 1 : 0;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashDelete);


/***/ }),

/***/ "./node_modules/lodash-es/_hashGet.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_hashGet.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");


/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Gets the hash value for `key`.
 *
 * @private
 * @name get
 * @memberOf Hash
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function hashGet(key) {
  var data = this.__data__;
  if (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
    var result = data[key];
    return result === HASH_UNDEFINED ? undefined : result;
  }
  return hasOwnProperty.call(data, key) ? data[key] : undefined;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashGet);


/***/ }),

/***/ "./node_modules/lodash-es/_hashHas.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_hashHas.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");


/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Checks if a hash value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Hash
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function hashHas(key) {
  var data = this.__data__;
  return _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashHas);


/***/ }),

/***/ "./node_modules/lodash-es/_hashSet.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_hashSet.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");


/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/**
 * Sets the hash `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Hash
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the hash instance.
 */
function hashSet(key, value) {
  var data = this.__data__;
  this.size += this.has(key) ? 0 : 1;
  data[key] = (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] && value === undefined) ? HASH_UNDEFINED : value;
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hashSet);


/***/ }),

/***/ "./node_modules/lodash-es/_initCloneArray.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_initCloneArray.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Initializes an array clone.
 *
 * @private
 * @param {Array} array The array to clone.
 * @returns {Array} Returns the initialized clone.
 */
function initCloneArray(array) {
  var length = array.length,
      result = new array.constructor(length);

  // Add properties assigned by `RegExp#exec`.
  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
    result.index = array.index;
    result.input = array.input;
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initCloneArray);


/***/ }),

/***/ "./node_modules/lodash-es/_initCloneByTag.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_initCloneByTag.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
/* harmony import */ var _cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneDataView.js */ "./node_modules/lodash-es/_cloneDataView.js");
/* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cloneRegExp.js */ "./node_modules/lodash-es/_cloneRegExp.js");
/* harmony import */ var _cloneSymbol_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_cloneSymbol.js */ "./node_modules/lodash-es/_cloneSymbol.js");
/* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");






/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/**
 * Initializes an object clone based on its `toStringTag`.
 *
 * **Note:** This function only supports cloning values with tags of
 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
 *
 * @private
 * @param {Object} object The object to clone.
 * @param {string} tag The `toStringTag` of the object to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Object} Returns the initialized clone.
 */
function initCloneByTag(object, tag, isDeep) {
  var Ctor = object.constructor;
  switch (tag) {
    case arrayBufferTag:
      return (0,_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object);

    case boolTag:
    case dateTag:
      return new Ctor(+object);

    case dataViewTag:
      return (0,_cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, isDeep);

    case float32Tag: case float64Tag:
    case int8Tag: case int16Tag: case int32Tag:
    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
      return (0,_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, isDeep);

    case mapTag:
      return new Ctor;

    case numberTag:
    case stringTag:
      return new Ctor(object);

    case regexpTag:
      return (0,_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);

    case setTag:
      return new Ctor;

    case symbolTag:
      return (0,_cloneSymbol_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object);
  }
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initCloneByTag);


/***/ }),

/***/ "./node_modules/lodash-es/_initCloneObject.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_initCloneObject.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
/* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
/* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");




/**
 * Initializes an object clone.
 *
 * @private
 * @param {Object} object The object to clone.
 * @returns {Object} Returns the initialized clone.
 */
function initCloneObject(object) {
  return (typeof object.constructor == 'function' && !(0,_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object))
    ? (0,_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_getPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object))
    : {};
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (initCloneObject);


/***/ }),

/***/ "./node_modules/lodash-es/_isFlattenable.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_isFlattenable.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
/* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");




/** Built-in value references. */
var spreadableSymbol = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].isConcatSpreadable : undefined;

/**
 * Checks if `value` is a flattenable `arguments` object or array.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
 */
function isFlattenable(value) {
  return (0,_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) || (0,_isArguments_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) ||
    !!(spreadableSymbol && value && value[spreadableSymbol]);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isFlattenable);


/***/ }),

/***/ "./node_modules/lodash-es/_isIndex.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_isIndex.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;

/**
 * Checks if `value` is a valid array-like index.
 *
 * @private
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 */
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER : length;

  return !!length &&
    (type == 'number' ||
      (type != 'symbol' && reIsUint.test(value))) &&
        (value > -1 && value % 1 == 0 && value < length);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isIndex);


/***/ }),

/***/ "./node_modules/lodash-es/_isIterateeCall.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_isIterateeCall.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
/* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");





/**
 * Checks if the given arguments are from an iteratee call.
 *
 * @private
 * @param {*} value The potential iteratee value argument.
 * @param {*} index The potential iteratee index or key argument.
 * @param {*} object The potential iteratee object argument.
 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
 *  else `false`.
 */
function isIterateeCall(value, index, object) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
    return false;
  }
  var type = typeof index;
  if (type == 'number'
        ? ((0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && (0,_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index, object.length))
        : (type == 'string' && index in object)
      ) {
    return (0,_eq_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object[index], value);
  }
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isIterateeCall);


/***/ }),

/***/ "./node_modules/lodash-es/_isKey.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/_isKey.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");



/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
    reIsPlainProp = /^\w*$/;

/**
 * Checks if `value` is a property name and not a property path.
 *
 * @private
 * @param {*} value The value to check.
 * @param {Object} [object] The object to query keys on.
 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
 */
function isKey(value, object) {
  if ((0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
    return false;
  }
  var type = typeof value;
  if (type == 'number' || type == 'symbol' || type == 'boolean' ||
      value == null || (0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
    return true;
  }
  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
    (object != null && value in Object(object));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isKey);


/***/ }),

/***/ "./node_modules/lodash-es/_isKeyable.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/_isKeyable.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is suitable for use as unique object key.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
 */
function isKeyable(value) {
  var type = typeof value;
  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
    ? (value !== '__proto__')
    : (value === null);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isKeyable);


/***/ }),

/***/ "./node_modules/lodash-es/_isMasked.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_isMasked.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");


/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
  var uid = /[^.]+$/.exec(_coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys.IE_PROTO || '');
  return uid ? ('Symbol(src)_1.' + uid) : '';
}());

/**
 * Checks if `func` has its source masked.
 *
 * @private
 * @param {Function} func The function to check.
 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
 */
function isMasked(func) {
  return !!maskSrcKey && (maskSrcKey in func);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isMasked);


/***/ }),

/***/ "./node_modules/lodash-es/_isPrototype.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_isPrototype.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Checks if `value` is likely a prototype object.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
 */
function isPrototype(value) {
  var Ctor = value && value.constructor,
      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

  return value === proto;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPrototype);


/***/ }),

/***/ "./node_modules/lodash-es/_listCacheClear.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_listCacheClear.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Removes all key-value entries from the list cache.
 *
 * @private
 * @name clear
 * @memberOf ListCache
 */
function listCacheClear() {
  this.__data__ = [];
  this.size = 0;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheClear);


/***/ }),

/***/ "./node_modules/lodash-es/_listCacheDelete.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_listCacheDelete.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");


/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * Removes `key` and its value from the list cache.
 *
 * @private
 * @name delete
 * @memberOf ListCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function listCacheDelete(key) {
  var data = this.__data__,
      index = (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);

  if (index < 0) {
    return false;
  }
  var lastIndex = data.length - 1;
  if (index == lastIndex) {
    data.pop();
  } else {
    splice.call(data, index, 1);
  }
  --this.size;
  return true;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheDelete);


/***/ }),

/***/ "./node_modules/lodash-es/_listCacheGet.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_listCacheGet.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");


/**
 * Gets the list cache value for `key`.
 *
 * @private
 * @name get
 * @memberOf ListCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function listCacheGet(key) {
  var data = this.__data__,
      index = (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);

  return index < 0 ? undefined : data[index][1];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheGet);


/***/ }),

/***/ "./node_modules/lodash-es/_listCacheHas.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_listCacheHas.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");


/**
 * Checks if a list cache value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf ListCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function listCacheHas(key) {
  return (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__data__, key) > -1;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheHas);


/***/ }),

/***/ "./node_modules/lodash-es/_listCacheSet.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_listCacheSet.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");


/**
 * Sets the list cache `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf ListCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the list cache instance.
 */
function listCacheSet(key, value) {
  var data = this.__data__,
      index = (0,_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);

  if (index < 0) {
    ++this.size;
    data.push([key, value]);
  } else {
    data[index][1] = value;
  }
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (listCacheSet);


/***/ }),

/***/ "./node_modules/lodash-es/_mapCacheClear.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_mapCacheClear.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Hash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Hash.js */ "./node_modules/lodash-es/_Hash.js");
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");




/**
 * Removes all key-value entries from the map.
 *
 * @private
 * @name clear
 * @memberOf MapCache
 */
function mapCacheClear() {
  this.size = 0;
  this.__data__ = {
    'hash': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"],
    'map': new (_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] || _ListCache_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
    'string': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheClear);


/***/ }),

/***/ "./node_modules/lodash-es/_mapCacheDelete.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_mapCacheDelete.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");


/**
 * Removes `key` and its value from the map.
 *
 * @private
 * @name delete
 * @memberOf MapCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function mapCacheDelete(key) {
  var result = (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key)['delete'](key);
  this.size -= result ? 1 : 0;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheDelete);


/***/ }),

/***/ "./node_modules/lodash-es/_mapCacheGet.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_mapCacheGet.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");


/**
 * Gets the map value for `key`.
 *
 * @private
 * @name get
 * @memberOf MapCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function mapCacheGet(key) {
  return (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).get(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheGet);


/***/ }),

/***/ "./node_modules/lodash-es/_mapCacheHas.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_mapCacheHas.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");


/**
 * Checks if a map value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf MapCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function mapCacheHas(key) {
  return (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).has(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheHas);


/***/ }),

/***/ "./node_modules/lodash-es/_mapCacheSet.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_mapCacheSet.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");


/**
 * Sets the map `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf MapCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the map cache instance.
 */
function mapCacheSet(key, value) {
  var data = (0,_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key),
      size = data.size;

  data.set(key, value);
  this.size += data.size == size ? 0 : 1;
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapCacheSet);


/***/ }),

/***/ "./node_modules/lodash-es/_mapToArray.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_mapToArray.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Converts `map` to its key-value pairs.
 *
 * @private
 * @param {Object} map The map to convert.
 * @returns {Array} Returns the key-value pairs.
 */
function mapToArray(map) {
  var index = -1,
      result = Array(map.size);

  map.forEach(function(value, key) {
    result[++index] = [key, value];
  });
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapToArray);


/***/ }),

/***/ "./node_modules/lodash-es/_memoizeCapped.js":
/*!**************************************************!*\
  !*** ./node_modules/lodash-es/_memoizeCapped.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");


/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;

/**
 * A specialized version of `_.memoize` which clears the memoized function's
 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
 *
 * @private
 * @param {Function} func The function to have its output memoized.
 * @returns {Function} Returns the new memoized function.
 */
function memoizeCapped(func) {
  var result = (0,_memoize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, function(key) {
    if (cache.size === MAX_MEMOIZE_SIZE) {
      cache.clear();
    }
    return key;
  });

  var cache = result.cache;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoizeCapped);


/***/ }),

/***/ "./node_modules/lodash-es/_nativeCreate.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_nativeCreate.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");


/* Built-in method references that are verified to be native. */
var nativeCreate = (0,_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'create');

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nativeCreate);


/***/ }),

/***/ "./node_modules/lodash-es/_nativeKeys.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_nativeKeys.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");


/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = (0,_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.keys, Object);

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nativeKeys);


/***/ }),

/***/ "./node_modules/lodash-es/_nativeKeysIn.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_nativeKeysIn.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This function is like
 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * except that it includes inherited enumerable properties.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function nativeKeysIn(object) {
  var result = [];
  if (object != null) {
    for (var key in Object(object)) {
      result.push(key);
    }
  }
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nativeKeysIn);


/***/ }),

/***/ "./node_modules/lodash-es/_nodeUtil.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_nodeUtil.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");


/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"].process;

/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
  try {
    // Use `util.types` for Node.js 10+.
    var types = freeModule && freeModule.require && freeModule.require('util').types;

    if (types) {
      return types;
    }

    // Legacy `process.binding('util')` for Node.js < 10.
    return freeProcess && freeProcess.binding && freeProcess.binding('util');
  } catch (e) {}
}());

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (nodeUtil);


/***/ }),

/***/ "./node_modules/lodash-es/_objectToString.js":
/*!***************************************************!*\
  !*** ./node_modules/lodash-es/_objectToString.js ***!
  \***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */
function objectToString(value) {
  return nativeObjectToString.call(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (objectToString);


/***/ }),

/***/ "./node_modules/lodash-es/_overArg.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_overArg.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Creates a unary function that invokes `func` with its argument transformed.
 *
 * @private
 * @param {Function} func The function to wrap.
 * @param {Function} transform The argument transform.
 * @returns {Function} Returns the new function.
 */
function overArg(func, transform) {
  return function(arg) {
    return func(transform(arg));
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (overArg);


/***/ }),

/***/ "./node_modules/lodash-es/_overRest.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_overRest.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");


/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;

/**
 * A specialized version of `baseRest` which transforms the rest array.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @param {Function} transform The rest array transform.
 * @returns {Function} Returns the new function.
 */
function overRest(func, start, transform) {
  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  return function() {
    var args = arguments,
        index = -1,
        length = nativeMax(args.length - start, 0),
        array = Array(length);

    while (++index < length) {
      array[index] = args[start + index];
    }
    index = -1;
    var otherArgs = Array(start + 1);
    while (++index < start) {
      otherArgs[index] = args[index];
    }
    otherArgs[start] = transform(array);
    return (0,_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (overRest);


/***/ }),

/***/ "./node_modules/lodash-es/_root.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash-es/_root.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");


/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"] || freeSelf || Function('return this')();

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (root);


/***/ }),

/***/ "./node_modules/lodash-es/_safeGet.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/_safeGet.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
 *
 * @private
 * @param {Object} object The object to query.
 * @param {string} key The key of the property to get.
 * @returns {*} Returns the property value.
 */
function safeGet(object, key) {
  if (key === 'constructor' && typeof object[key] === 'function') {
    return;
  }

  if (key == '__proto__') {
    return;
  }

  return object[key];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (safeGet);


/***/ }),

/***/ "./node_modules/lodash-es/_setCacheAdd.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_setCacheAdd.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/**
 * Adds `value` to the array cache.
 *
 * @private
 * @name add
 * @memberOf SetCache
 * @alias push
 * @param {*} value The value to cache.
 * @returns {Object} Returns the cache instance.
 */
function setCacheAdd(value) {
  this.__data__.set(value, HASH_UNDEFINED);
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setCacheAdd);


/***/ }),

/***/ "./node_modules/lodash-es/_setCacheHas.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_setCacheHas.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is in the array cache.
 *
 * @private
 * @name has
 * @memberOf SetCache
 * @param {*} value The value to search for.
 * @returns {number} Returns `true` if `value` is found, else `false`.
 */
function setCacheHas(value) {
  return this.__data__.has(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setCacheHas);


/***/ }),

/***/ "./node_modules/lodash-es/_setToArray.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_setToArray.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Converts `set` to an array of its values.
 *
 * @private
 * @param {Object} set The set to convert.
 * @returns {Array} Returns the values.
 */
function setToArray(set) {
  var index = -1,
      result = Array(set.size);

  set.forEach(function(value) {
    result[++index] = value;
  });
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setToArray);


/***/ }),

/***/ "./node_modules/lodash-es/_setToString.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_setToString.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseSetToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSetToString.js */ "./node_modules/lodash-es/_baseSetToString.js");
/* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");



/**
 * Sets the `toString` method of `func` to return `string`.
 *
 * @private
 * @param {Function} func The function to modify.
 * @param {Function} string The `toString` result.
 * @returns {Function} Returns `func`.
 */
var setToString = (0,_shortOut_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseSetToString_js__WEBPACK_IMPORTED_MODULE_1__["default"]);

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setToString);


/***/ }),

/***/ "./node_modules/lodash-es/_shortOut.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_shortOut.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
    HOT_SPAN = 16;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;

/**
 * Creates a function that'll short out and invoke `identity` instead
 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
 * milliseconds.
 *
 * @private
 * @param {Function} func The function to restrict.
 * @returns {Function} Returns the new shortable function.
 */
function shortOut(func) {
  var count = 0,
      lastCalled = 0;

  return function() {
    var stamp = nativeNow(),
        remaining = HOT_SPAN - (stamp - lastCalled);

    lastCalled = stamp;
    if (remaining > 0) {
      if (++count >= HOT_COUNT) {
        return arguments[0];
      }
    } else {
      count = 0;
    }
    return func.apply(undefined, arguments);
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (shortOut);


/***/ }),

/***/ "./node_modules/lodash-es/_stackClear.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/_stackClear.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");


/**
 * Removes all key-value entries from the stack.
 *
 * @private
 * @name clear
 * @memberOf Stack
 */
function stackClear() {
  this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  this.size = 0;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackClear);


/***/ }),

/***/ "./node_modules/lodash-es/_stackDelete.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/_stackDelete.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Removes `key` and its value from the stack.
 *
 * @private
 * @name delete
 * @memberOf Stack
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function stackDelete(key) {
  var data = this.__data__,
      result = data['delete'](key);

  this.size = data.size;
  return result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackDelete);


/***/ }),

/***/ "./node_modules/lodash-es/_stackGet.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_stackGet.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Gets the stack value for `key`.
 *
 * @private
 * @name get
 * @memberOf Stack
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function stackGet(key) {
  return this.__data__.get(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackGet);


/***/ }),

/***/ "./node_modules/lodash-es/_stackHas.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_stackHas.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if a stack value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Stack
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function stackHas(key) {
  return this.__data__.has(key);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackHas);


/***/ }),

/***/ "./node_modules/lodash-es/_stackSet.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_stackSet.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
/* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");




/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/**
 * Sets the stack `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Stack
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the stack cache instance.
 */
function stackSet(key, value) {
  var data = this.__data__;
  if (data instanceof _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
    var pairs = data.__data__;
    if (!_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
      pairs.push([key, value]);
      this.size = ++data.size;
      return this;
    }
    data = this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_2__["default"](pairs);
  }
  data.set(key, value);
  this.size = data.size;
  return this;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stackSet);


/***/ }),

/***/ "./node_modules/lodash-es/_stringToPath.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/_stringToPath.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_memoizeCapped.js */ "./node_modules/lodash-es/_memoizeCapped.js");


/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;

/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;

/**
 * Converts `string` to a property path array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the property path array.
 */
var stringToPath = (0,_memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(string) {
  var result = [];
  if (string.charCodeAt(0) === 46 /* . */) {
    result.push('');
  }
  string.replace(rePropName, function(match, number, quote, subString) {
    result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  });
  return result;
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringToPath);


/***/ }),

/***/ "./node_modules/lodash-es/_toKey.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/_toKey.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");


/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/**
 * Converts `value` to a string key if it's not a string or symbol.
 *
 * @private
 * @param {*} value The value to inspect.
 * @returns {string|symbol} Returns the key.
 */
function toKey(value) {
  if (typeof value == 'string' || (0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
    return value;
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toKey);


/***/ }),

/***/ "./node_modules/lodash-es/_toSource.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/_toSource.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used for built-in method references. */
var funcProto = Function.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/**
 * Converts `func` to its source code.
 *
 * @private
 * @param {Function} func The function to convert.
 * @returns {string} Returns the source code.
 */
function toSource(func) {
  if (func != null) {
    try {
      return funcToString.call(func);
    } catch (e) {}
    try {
      return (func + '');
    } catch (e) {}
  }
  return '';
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toSource);


/***/ }),

/***/ "./node_modules/lodash-es/_trimmedEndIndex.js":
/*!****************************************************!*\
  !*** ./node_modules/lodash-es/_trimmedEndIndex.js ***!
  \****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used to match a single whitespace character. */
var reWhitespace = /\s/;

/**
 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
 * character of `string`.
 *
 * @private
 * @param {string} string The string to inspect.
 * @returns {number} Returns the index of the last non-whitespace character.
 */
function trimmedEndIndex(string) {
  var index = string.length;

  while (index-- && reWhitespace.test(string.charAt(index))) {}
  return index;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (trimmedEndIndex);


/***/ }),

/***/ "./node_modules/lodash-es/assignIn.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/assignIn.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
/* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");




/**
 * This method is like `_.assign` except that it iterates over own and
 * inherited source properties.
 *
 * **Note:** This method mutates `object`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @alias extend
 * @category Object
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @returns {Object} Returns `object`.
 * @see _.assign
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 * }
 *
 * function Bar() {
 *   this.c = 3;
 * }
 *
 * Foo.prototype.b = 2;
 * Bar.prototype.d = 4;
 *
 * _.assignIn({ 'a': 0 }, new Foo, new Bar);
 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
 */
var assignIn = (0,_createAssigner_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, source) {
  (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, (0,_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object);
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (assignIn);


/***/ }),

/***/ "./node_modules/lodash-es/cloneDeep.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/cloneDeep.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");


/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
    CLONE_SYMBOLS_FLAG = 4;

/**
 * This method is like `_.clone` except that it recursively clones `value`.
 *
 * @static
 * @memberOf _
 * @since 1.0.0
 * @category Lang
 * @param {*} value The value to recursively clone.
 * @returns {*} Returns the deep cloned value.
 * @see _.clone
 * @example
 *
 * var objects = [{ 'a': 1 }, { 'b': 2 }];
 *
 * var deep = _.cloneDeep(objects);
 * console.log(deep[0] === objects[0]);
 * // => false
 */
function cloneDeep(value) {
  return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneDeep);


/***/ }),

/***/ "./node_modules/lodash-es/constant.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/constant.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Creates a function that returns `value`.
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Util
 * @param {*} value The value to return from the new function.
 * @returns {Function} Returns the new constant function.
 * @example
 *
 * var objects = _.times(2, _.constant({ 'a': 1 }));
 *
 * console.log(objects);
 * // => [{ 'a': 1 }, { 'a': 1 }]
 *
 * console.log(objects[0] === objects[1]);
 * // => true
 */
function constant(value) {
  return function() {
    return value;
  };
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (constant);


/***/ }),

/***/ "./node_modules/lodash-es/create.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/create.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
/* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");



/**
 * Creates an object that inherits from the `prototype` object. If a
 * `properties` object is given, its own enumerable string keyed properties
 * are assigned to the created object.
 *
 * @static
 * @memberOf _
 * @since 2.3.0
 * @category Object
 * @param {Object} prototype The object to inherit from.
 * @param {Object} [properties] The properties to assign to the object.
 * @returns {Object} Returns the new object.
 * @example
 *
 * function Shape() {
 *   this.x = 0;
 *   this.y = 0;
 * }
 *
 * function Circle() {
 *   Shape.call(this);
 * }
 *
 * Circle.prototype = _.create(Shape.prototype, {
 *   'constructor': Circle
 * });
 *
 * var circle = new Circle;
 * circle instanceof Circle;
 * // => true
 *
 * circle instanceof Shape;
 * // => true
 */
function create(prototype, properties) {
  var result = (0,_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prototype);
  return properties == null ? result : (0,_baseAssign_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, properties);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (create);


/***/ }),

/***/ "./node_modules/lodash-es/debounce.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/debounce.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
/* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");




/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
    nativeMin = Math.min;

/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */
function debounce(func, wait, options) {
  var lastArgs,
      lastThis,
      maxWait,
      result,
      timerId,
      lastCallTime,
      lastInvokeTime = 0,
      leading = false,
      maxing = false,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  wait = (0,_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wait) || 0;
  if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) {
    leading = !!options.leading;
    maxing = 'maxWait' in options;
    maxWait = maxing ? nativeMax((0,_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.maxWait) || 0, wait) : maxWait;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }

  function invokeFunc(time) {
    var args = lastArgs,
        thisArg = lastThis;

    lastArgs = lastThis = undefined;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }

  function leadingEdge(time) {
    // Reset any `maxWait` timer.
    lastInvokeTime = time;
    // Start the timer for the trailing edge.
    timerId = setTimeout(timerExpired, wait);
    // Invoke the leading edge.
    return leading ? invokeFunc(time) : result;
  }

  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime,
        timeWaiting = wait - timeSinceLastCall;

    return maxing
      ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
      : timeWaiting;
  }

  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime;

    // Either this is the first call, activity has stopped and we're at the
    // trailing edge, the system time has gone backwards and we're treating
    // it as the trailing edge, or we've hit the `maxWait` limit.
    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  }

  function timerExpired() {
    var time = (0,_now_js__WEBPACK_IMPORTED_MODULE_2__["default"])();
    if (shouldInvoke(time)) {
      return trailingEdge(time);
    }
    // Restart the timer.
    timerId = setTimeout(timerExpired, remainingWait(time));
  }

  function trailingEdge(time) {
    timerId = undefined;

    // Only invoke if we have `lastArgs` which means `func` has been
    // debounced at least once.
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    lastArgs = lastThis = undefined;
    return result;
  }

  function cancel() {
    if (timerId !== undefined) {
      clearTimeout(timerId);
    }
    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = undefined;
  }

  function flush() {
    return timerId === undefined ? result : trailingEdge((0,_now_js__WEBPACK_IMPORTED_MODULE_2__["default"])());
  }

  function debounced() {
    var time = (0,_now_js__WEBPACK_IMPORTED_MODULE_2__["default"])(),
        isInvoking = shouldInvoke(time);

    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;

    if (isInvoking) {
      if (timerId === undefined) {
        return leadingEdge(lastCallTime);
      }
      if (maxing) {
        // Handle invocations in a tight loop.
        clearTimeout(timerId);
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }
    if (timerId === undefined) {
      timerId = setTimeout(timerExpired, wait);
    }
    return result;
  }
  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (debounce);


/***/ }),

/***/ "./node_modules/lodash-es/eq.js":
/*!**************************************!*\
  !*** ./node_modules/lodash-es/eq.js ***!
  \**************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Performs a
 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * comparison between two values to determine if they are equivalent.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.eq(object, object);
 * // => true
 *
 * _.eq(object, other);
 * // => false
 *
 * _.eq('a', 'a');
 * // => true
 *
 * _.eq('a', Object('a'));
 * // => false
 *
 * _.eq(NaN, NaN);
 * // => true
 */
function eq(value, other) {
  return value === other || (value !== value && other !== other);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (eq);


/***/ }),

/***/ "./node_modules/lodash-es/flatten.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash-es/flatten.js ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");


/**
 * Flattens `array` a single level deep.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Array
 * @param {Array} array The array to flatten.
 * @returns {Array} Returns the new flattened array.
 * @example
 *
 * _.flatten([1, [2, [3, [4]], 5]]);
 * // => [1, 2, [3, [4]], 5]
 */
function flatten(array) {
  var length = array == null ? 0 : array.length;
  return length ? (0,_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1) : [];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (flatten);


/***/ }),

/***/ "./node_modules/lodash-es/has.js":
/*!***************************************!*\
  !*** ./node_modules/lodash-es/has.js ***!
  \***************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseHas_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseHas.js */ "./node_modules/lodash-es/_baseHas.js");
/* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");



/**
 * Checks if `path` is a direct property of `object`.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 * @example
 *
 * var object = { 'a': { 'b': 2 } };
 * var other = _.create({ 'a': _.create({ 'b': 2 }) });
 *
 * _.has(object, 'a');
 * // => true
 *
 * _.has(object, 'a.b');
 * // => true
 *
 * _.has(object, ['a', 'b']);
 * // => true
 *
 * _.has(other, 'a');
 * // => false
 */
function has(object, path) {
  return object != null && (0,_hasPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, _baseHas_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (has);


/***/ }),

/***/ "./node_modules/lodash-es/hasIn.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash-es/hasIn.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseHasIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseHasIn.js */ "./node_modules/lodash-es/_baseHasIn.js");
/* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");



/**
 * Checks if `path` is a direct or inherited property of `object`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 * @example
 *
 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
 *
 * _.hasIn(object, 'a');
 * // => true
 *
 * _.hasIn(object, 'a.b');
 * // => true
 *
 * _.hasIn(object, ['a', 'b']);
 * // => true
 *
 * _.hasIn(object, 'b');
 * // => false
 */
function hasIn(object, path) {
  return object != null && (0,_hasPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, _baseHasIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (hasIn);


/***/ }),

/***/ "./node_modules/lodash-es/identity.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/identity.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This method returns the first argument it receives.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Util
 * @param {*} value Any value.
 * @returns {*} Returns `value`.
 * @example
 *
 * var object = { 'a': 1 };
 *
 * console.log(_.identity(object) === object);
 * // => true
 */
function identity(value) {
  return value;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (identity);


/***/ }),

/***/ "./node_modules/lodash-es/isArguments.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/isArguments.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArguments.js */ "./node_modules/lodash-es/_baseIsArguments.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/**
 * Checks if `value` is likely an `arguments` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 *  else `false`.
 * @example
 *
 * _.isArguments(function() { return arguments; }());
 * // => true
 *
 * _.isArguments([1, 2, 3]);
 * // => false
 */
var isArguments = (0,_baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function() { return arguments; }()) ? _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && hasOwnProperty.call(value, 'callee') &&
    !propertyIsEnumerable.call(value, 'callee');
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArguments);


/***/ }),

/***/ "./node_modules/lodash-es/isArray.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash-es/isArray.js ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is classified as an `Array` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
 * @example
 *
 * _.isArray([1, 2, 3]);
 * // => true
 *
 * _.isArray(document.body.children);
 * // => false
 *
 * _.isArray('abc');
 * // => false
 *
 * _.isArray(_.noop);
 * // => false
 */
var isArray = Array.isArray;

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArray);


/***/ }),

/***/ "./node_modules/lodash-es/isArrayLike.js":
/*!***********************************************!*\
  !*** ./node_modules/lodash-es/isArrayLike.js ***!
  \***********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
/* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");



/**
 * Checks if `value` is array-like. A value is considered array-like if it's
 * not a function and has a `value.length` that's an integer greater than or
 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 * @example
 *
 * _.isArrayLike([1, 2, 3]);
 * // => true
 *
 * _.isArrayLike(document.body.children);
 * // => true
 *
 * _.isArrayLike('abc');
 * // => true
 *
 * _.isArrayLike(_.noop);
 * // => false
 */
function isArrayLike(value) {
  return value != null && (0,_isLength_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.length) && !(0,_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArrayLike);


/***/ }),

/***/ "./node_modules/lodash-es/isArrayLikeObject.js":
/*!*****************************************************!*\
  !*** ./node_modules/lodash-es/isArrayLikeObject.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/**
 * This method is like `_.isArrayLike` except that it also checks if `value`
 * is an object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an array-like object,
 *  else `false`.
 * @example
 *
 * _.isArrayLikeObject([1, 2, 3]);
 * // => true
 *
 * _.isArrayLikeObject(document.body.children);
 * // => true
 *
 * _.isArrayLikeObject('abc');
 * // => false
 *
 * _.isArrayLikeObject(_.noop);
 * // => false
 */
function isArrayLikeObject(value) {
  return (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isArrayLikeObject);


/***/ }),

/***/ "./node_modules/lodash-es/isBuffer.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/isBuffer.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
/* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");



/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;

/**
 * Checks if `value` is a buffer.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
 * @example
 *
 * _.isBuffer(new Buffer(2));
 * // => true
 *
 * _.isBuffer(new Uint8Array(2));
 * // => false
 */
var isBuffer = nativeIsBuffer || _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isBuffer);


/***/ }),

/***/ "./node_modules/lodash-es/isEqual.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash-es/isEqual.js ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");


/**
 * Performs a deep comparison between two values to determine if they are
 * equivalent.
 *
 * **Note:** This method supports comparing arrays, array buffers, booleans,
 * date objects, error objects, maps, numbers, `Object` objects, regexes,
 * sets, strings, symbols, and typed arrays. `Object` objects are compared
 * by their own, not inherited, enumerable properties. Functions and DOM
 * nodes are compared by strict equality, i.e. `===`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.isEqual(object, other);
 * // => true
 *
 * object === other;
 * // => false
 */
function isEqual(value, other) {
  return (0,_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isEqual);


/***/ }),

/***/ "./node_modules/lodash-es/isFunction.js":
/*!**********************************************!*\
  !*** ./node_modules/lodash-es/isFunction.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");



/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    proxyTag = '[object Proxy]';

/**
 * Checks if `value` is classified as a `Function` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
 * @example
 *
 * _.isFunction(_);
 * // => true
 *
 * _.isFunction(/abc/);
 * // => false
 */
function isFunction(value) {
  if (!(0,_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
    return false;
  }
  // The use of `Object#toString` avoids issues with the `typeof` operator
  // in Safari 9 which returns 'object' for typed arrays and other constructors.
  var tag = (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isFunction);


/***/ }),

/***/ "./node_modules/lodash-es/isLength.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/isLength.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isLength);


/***/ }),

/***/ "./node_modules/lodash-es/isMap.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash-es/isMap.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIsMap.js */ "./node_modules/lodash-es/_baseIsMap.js");
/* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
/* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");




/* Node.js helper references. */
var nodeIsMap = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__["default"].isMap;

/**
 * Checks if `value` is classified as a `Map` object.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
 * @example
 *
 * _.isMap(new Map);
 * // => true
 *
 * _.isMap(new WeakMap);
 * // => false
 */
var isMap = nodeIsMap ? (0,_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsMap) : _baseIsMap_js__WEBPACK_IMPORTED_MODULE_2__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isMap);


/***/ }),

/***/ "./node_modules/lodash-es/isObject.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/isObject.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObject);


/***/ }),

/***/ "./node_modules/lodash-es/isObjectLike.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/isObjectLike.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return value != null && typeof value == 'object';
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObjectLike);


/***/ }),

/***/ "./node_modules/lodash-es/isPlainObject.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/isPlainObject.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");




/** `Object#toString` result references. */
var objectTag = '[object Object]';

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);

/**
 * Checks if `value` is a plain object, that is, an object created by the
 * `Object` constructor or one with a `[[Prototype]]` of `null`.
 *
 * @static
 * @memberOf _
 * @since 0.8.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 * }
 *
 * _.isPlainObject(new Foo);
 * // => false
 *
 * _.isPlainObject([1, 2, 3]);
 * // => false
 *
 * _.isPlainObject({ 'x': 0, 'y': 0 });
 * // => true
 *
 * _.isPlainObject(Object.create(null));
 * // => true
 */
function isPlainObject(value) {
  if (!(0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) || (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) != objectTag) {
    return false;
  }
  var proto = (0,_getPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  if (proto === null) {
    return true;
  }
  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  return typeof Ctor == 'function' && Ctor instanceof Ctor &&
    funcToString.call(Ctor) == objectCtorString;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPlainObject);


/***/ }),

/***/ "./node_modules/lodash-es/isSet.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash-es/isSet.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsSet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIsSet.js */ "./node_modules/lodash-es/_baseIsSet.js");
/* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
/* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");




/* Node.js helper references. */
var nodeIsSet = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSet;

/**
 * Checks if `value` is classified as a `Set` object.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
 * @example
 *
 * _.isSet(new Set);
 * // => true
 *
 * _.isSet(new WeakSet);
 * // => false
 */
var isSet = nodeIsSet ? (0,_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsSet) : _baseIsSet_js__WEBPACK_IMPORTED_MODULE_2__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isSet);


/***/ }),

/***/ "./node_modules/lodash-es/isString.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/isString.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");




/** `Object#toString` result references. */
var stringTag = '[object String]';

/**
 * Checks if `value` is classified as a `String` primitive or object.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
 * @example
 *
 * _.isString('abc');
 * // => true
 *
 * _.isString(1);
 * // => false
 */
function isString(value) {
  return typeof value == 'string' ||
    (!(0,_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && (0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) == stringTag);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isString);


/***/ }),

/***/ "./node_modules/lodash-es/isSymbol.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/isSymbol.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
/* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");



/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';

/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */
function isSymbol(value) {
  return typeof value == 'symbol' ||
    ((0,_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && (0,_baseGetTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) == symbolTag);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isSymbol);


/***/ }),

/***/ "./node_modules/lodash-es/isTypedArray.js":
/*!************************************************!*\
  !*** ./node_modules/lodash-es/isTypedArray.js ***!
  \************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIsTypedArray.js */ "./node_modules/lodash-es/_baseIsTypedArray.js");
/* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
/* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");




/* Node.js helper references. */
var nodeIsTypedArray = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray;

/**
 * Checks if `value` is classified as a typed array.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 * @example
 *
 * _.isTypedArray(new Uint8Array);
 * // => true
 *
 * _.isTypedArray([]);
 * // => false
 */
var isTypedArray = nodeIsTypedArray ? (0,_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsTypedArray) : _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_2__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isTypedArray);


/***/ }),

/***/ "./node_modules/lodash-es/keys.js":
/*!****************************************!*\
  !*** ./node_modules/lodash-es/keys.js ***!
  \****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
/* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");




/**
 * Creates an array of the own enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects. See the
 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * for more details.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keys(new Foo);
 * // => ['a', 'b'] (iteration order is not guaranteed)
 *
 * _.keys('hi');
 * // => ['0', '1']
 */
function keys(object) {
  return (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object) ? (0,_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) : (0,_baseKeys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keys);


/***/ }),

/***/ "./node_modules/lodash-es/keysIn.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/keysIn.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
/* harmony import */ var _baseKeysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseKeysIn.js */ "./node_modules/lodash-es/_baseKeysIn.js");
/* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");




/**
 * Creates an array of the own and inherited enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keysIn(new Foo);
 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
 */
function keysIn(object) {
  return (0,_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object) ? (0,_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, true) : (0,_baseKeysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keysIn);


/***/ }),

/***/ "./node_modules/lodash-es/memoize.js":
/*!*******************************************!*\
  !*** ./node_modules/lodash-es/memoize.js ***!
  \*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");


/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/**
 * Creates a function that memoizes the result of `func`. If `resolver` is
 * provided, it determines the cache key for storing the result based on the
 * arguments provided to the memoized function. By default, the first argument
 * provided to the memoized function is used as the map cache key. The `func`
 * is invoked with the `this` binding of the memoized function.
 *
 * **Note:** The cache is exposed as the `cache` property on the memoized
 * function. Its creation may be customized by replacing the `_.memoize.Cache`
 * constructor with one whose instances implement the
 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to have its output memoized.
 * @param {Function} [resolver] The function to resolve the cache key.
 * @returns {Function} Returns the new memoized function.
 * @example
 *
 * var object = { 'a': 1, 'b': 2 };
 * var other = { 'c': 3, 'd': 4 };
 *
 * var values = _.memoize(_.values);
 * values(object);
 * // => [1, 2]
 *
 * values(other);
 * // => [3, 4]
 *
 * object.a = 2;
 * values(object);
 * // => [1, 2]
 *
 * // Modify the result cache.
 * values.cache.set(object, ['a', 'b']);
 * values(object);
 * // => ['a', 'b']
 *
 * // Replace `_.memoize.Cache`.
 * _.memoize.Cache = WeakMap;
 */
function memoize(func, resolver) {
  if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  var memoized = function() {
    var args = arguments,
        key = resolver ? resolver.apply(this, args) : args[0],
        cache = memoized.cache;

    if (cache.has(key)) {
      return cache.get(key);
    }
    var result = func.apply(this, args);
    memoized.cache = cache.set(key, result) || cache;
    return result;
  };
  memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  return memoized;
}

// Expose `MapCache`.
memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (memoize);


/***/ }),

/***/ "./node_modules/lodash-es/merge.js":
/*!*****************************************!*\
  !*** ./node_modules/lodash-es/merge.js ***!
  \*****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
/* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");



/**
 * This method is like `_.assign` except that it recursively merges own and
 * inherited enumerable string keyed properties of source objects into the
 * destination object. Source properties that resolve to `undefined` are
 * skipped if a destination value exists. Array and plain object properties
 * are merged recursively. Other objects and value types are overridden by
 * assignment. Source objects are applied from left to right. Subsequent
 * sources overwrite property assignments of previous sources.
 *
 * **Note:** This method mutates `object`.
 *
 * @static
 * @memberOf _
 * @since 0.5.0
 * @category Object
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @returns {Object} Returns `object`.
 * @example
 *
 * var object = {
 *   'a': [{ 'b': 2 }, { 'd': 4 }]
 * };
 *
 * var other = {
 *   'a': [{ 'c': 3 }, { 'e': 5 }]
 * };
 *
 * _.merge(object, other);
 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
 */
var merge = (0,_createAssigner_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, source, srcIndex) {
  (0,_baseMerge_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, source, srcIndex);
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (merge);


/***/ }),

/***/ "./node_modules/lodash-es/mergeWith.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/mergeWith.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
/* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");



/**
 * This method is like `_.merge` except that it accepts `customizer` which
 * is invoked to produce the merged values of the destination and source
 * properties. If `customizer` returns `undefined`, merging is handled by the
 * method instead. The `customizer` is invoked with six arguments:
 * (objValue, srcValue, key, object, source, stack).
 *
 * **Note:** This method mutates `object`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Object
 * @param {Object} object The destination object.
 * @param {...Object} sources The source objects.
 * @param {Function} customizer The function to customize assigned values.
 * @returns {Object} Returns `object`.
 * @example
 *
 * function customizer(objValue, srcValue) {
 *   if (_.isArray(objValue)) {
 *     return objValue.concat(srcValue);
 *   }
 * }
 *
 * var object = { 'a': [1], 'b': [2] };
 * var other = { 'a': [3], 'b': [4] };
 *
 * _.mergeWith(object, other, customizer);
 * // => { 'a': [1, 3], 'b': [2, 4] }
 */
var mergeWith = (0,_createAssigner_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, source, srcIndex, customizer) {
  (0,_baseMerge_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, source, srcIndex, customizer);
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mergeWith);


/***/ }),

/***/ "./node_modules/lodash-es/now.js":
/*!***************************************!*\
  !*** ./node_modules/lodash-es/now.js ***!
  \***************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");


/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */
var now = function() {
  return _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Date.now();
};

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (now);


/***/ }),

/***/ "./node_modules/lodash-es/pick.js":
/*!****************************************!*\
  !*** ./node_modules/lodash-es/pick.js ***!
  \****************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _basePick_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePick.js */ "./node_modules/lodash-es/_basePick.js");
/* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");



/**
 * Creates an object composed of the picked `object` properties.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The source object.
 * @param {...(string|string[])} [paths] The property paths to pick.
 * @returns {Object} Returns the new object.
 * @example
 *
 * var object = { 'a': 1, 'b': '2', 'c': 3 };
 *
 * _.pick(object, ['a', 'c']);
 * // => { 'a': 1, 'c': 3 }
 */
var pick = (0,_flatRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, paths) {
  return object == null ? {} : (0,_basePick_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, paths);
});

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (pick);


/***/ }),

/***/ "./node_modules/lodash-es/result.js":
/*!******************************************!*\
  !*** ./node_modules/lodash-es/result.js ***!
  \******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
/* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
/* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");




/**
 * This method is like `_.get` except that if the resolved value is a
 * function it's invoked with the `this` binding of its parent object and
 * its result is returned.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to resolve.
 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
 * @returns {*} Returns the resolved value.
 * @example
 *
 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
 *
 * _.result(object, 'a[0].b.c1');
 * // => 3
 *
 * _.result(object, 'a[0].b.c2');
 * // => 4
 *
 * _.result(object, 'a[0].b.c3', 'default');
 * // => 'default'
 *
 * _.result(object, 'a[0].b.c3', _.constant('default'));
 * // => 'default'
 */
function result(object, path, defaultValue) {
  path = (0,_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);

  var index = -1,
      length = path.length;

  // Ensure the loop is entered when path is empty.
  if (!length) {
    length = 1;
    object = undefined;
  }
  while (++index < length) {
    var value = object == null ? undefined : object[(0,_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index])];
    if (value === undefined) {
      index = length;
      value = defaultValue;
    }
    object = (0,_isFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) ? value.call(object) : value;
  }
  return object;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (result);


/***/ }),

/***/ "./node_modules/lodash-es/stubArray.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/stubArray.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This method returns a new empty array.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {Array} Returns the new empty array.
 * @example
 *
 * var arrays = _.times(2, _.stubArray);
 *
 * console.log(arrays);
 * // => [[], []]
 *
 * console.log(arrays[0] === arrays[1]);
 * // => false
 */
function stubArray() {
  return [];
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stubArray);


/***/ }),

/***/ "./node_modules/lodash-es/stubFalse.js":
/*!*********************************************!*\
  !*** ./node_modules/lodash-es/stubFalse.js ***!
  \*********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * This method returns `false`.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {boolean} Returns `false`.
 * @example
 *
 * _.times(2, _.stubFalse);
 * // => [false, false]
 */
function stubFalse() {
  return false;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stubFalse);


/***/ }),

/***/ "./node_modules/lodash-es/toNumber.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/toNumber.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
/* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
/* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");




/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;

/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;

/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;

/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */
function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if ((0,_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
    return NAN;
  }
  if ((0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = (0,_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other) ? (other + '') : other;
  }
  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }
  value = (0,_baseTrim_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  var isBinary = reIsBinary.test(value);
  return (isBinary || reIsOctal.test(value))
    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
    : (reIsBadHex.test(value) ? NAN : +value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toNumber);


/***/ }),

/***/ "./node_modules/lodash-es/toPlainObject.js":
/*!*************************************************!*\
  !*** ./node_modules/lodash-es/toPlainObject.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
/* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");



/**
 * Converts `value` to a plain object flattening inherited enumerable string
 * keyed properties of `value` to own properties of the plain object.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {Object} Returns the converted plain object.
 * @example
 *
 * function Foo() {
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.assign({ 'a': 1 }, new Foo);
 * // => { 'a': 1, 'b': 2 }
 *
 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
 * // => { 'a': 1, 'b': 2, 'c': 3 }
 */
function toPlainObject(value) {
  return (0,_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, (0,_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value));
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toPlainObject);


/***/ }),

/***/ "./node_modules/lodash-es/toString.js":
/*!********************************************!*\
  !*** ./node_modules/lodash-es/toString.js ***!
  \********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");


/**
 * Converts `value` to a string. An empty string is returned for `null`
 * and `undefined` values. The sign of `-0` is preserved.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 * @example
 *
 * _.toString(null);
 * // => ''
 *
 * _.toString(-0);
 * // => '-0'
 *
 * _.toString([1, 2, 3]);
 * // => '1,2,3'
 */
function toString(value) {
  return value == null ? '' : (0,_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toString);


/***/ }),

/***/ "./node_modules/mergebounce/mergebounce.js":
/*!*************************************************!*\
  !*** ./node_modules/mergebounce/mergebounce.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lodash_es_merge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es/merge.js */ "./node_modules/lodash-es/merge.js");
/* harmony import */ var lodash_es_mergeWith_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es/mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");



/** Error message constants. */ const FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */ const nativeMax = Math.max;
const nativeMin = Math.min;
function toNumber(value) {
    if (typeof value === 'number') {
        return value;
    }
    if (typeof value === 'string') {
        const parsed = parseFloat(value);
        return isNaN(parsed) ? 0 : parsed;
    }
    return 0;
}
function isObject(value) {
    const type = typeof value;
    return value != null && (type === 'object' || type === 'function');
}
/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 *
 * This function differs from lodash's debounce by merging all passed objects
 * before passing them to the final invoked function.
 *
 * Because of this, invoking can only happen on the trailing edge, since
 * passed-in data would be discarded if invoking happened on the leading edge.
 *
 * If `wait` is `0`, `func` invocation is deferred until to the next tick,
 * similar to `setTimeout` with a timeout of `0`.
 *
 * @static
 * @category Function
 * @param {Function} func The function to mergebounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.concatArrays=false]
 *  By default arrays will be treated as objects when being merged. When
 *  merging two arrays, the values in the 2nd arrray will replace the
 *  corresponding values (i.e. those with the same indexes) in the first array.
 *  When `concatArrays` is set to `true`, arrays will be concatenated instead.
 * @param {boolean} [options.dedupeArrays=false]
 *  This option is similar to `concatArrays`, except that the concatenated
 *  array will also be deduplicated. Thus any entries that are concatenated to the
 *  existing array, which are already contained in the existing array, will
 *  first be removed.
 * @param {boolean} [options.promise=false]
 *  By default, when calling a merge-debounced function that doesn't execute
 *  immediately, you'll receive the result from its previous execution, or
 *  `undefined` if it has never executed before. By setting the `promise`
 *  option to `true`, a promise will be returned instead of the previous
 *  execution result when the function is debounced. The promise will resolve
 *  with the result of the next execution, as soon as it happens.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * window.addEventListener('resize', mergebounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * element.addEventListner('click', mergebounce(sendMail, 300));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * const mergebounced = mergebounce(batchLog, 250, { 'maxWait': 1000 });
 * const source = new EventSource('/stream');
 * jQuery(source).on('message', mergebounced);
 *
 * // Cancel the trailing debounced invocation.
 * window.addEventListener('popstate', mergebounced.cancel);
 */ function mergebounce(func, wait, options = {}) {
    let lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, maxing = false;
    let promise = options.promise ? (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)() : null;
    if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
    }
    wait = toNumber(wait) || 0;
    if (isObject(options)) {
        maxing = 'maxWait' in options;
        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
    }
    function invokeFunc(time) {
        const args = lastArgs;
        const thisArg = lastThis;
        const existingPromise = promise;
        lastArgs = lastThis = undefined;
        lastInvokeTime = time;
        result = func.apply(thisArg, args);
        if (options.promise) {
            existingPromise.resolve(result);
            promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
        }
        return options.promise ? existingPromise : result;
    }
    function leadingEdge(time) {
        // Reset any `maxWait` timer.
        lastInvokeTime = time;
        // Start the timer for the trailing edge.
        timerId = setTimeout(timerExpired, wait);
        return options.promise ? promise : result;
    }
    function remainingWait(time) {
        const timeSinceLastCall = time - lastCallTime;
        const timeSinceLastInvoke = time - lastInvokeTime;
        const timeWaiting = wait - timeSinceLastCall;
        return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
    }
    function shouldInvoke(time) {
        const timeSinceLastCall = time - lastCallTime;
        const timeSinceLastInvoke = time - lastInvokeTime;
        // Either this is the first call, activity has stopped and we're at the
        // trailing edge, the system time has gone backwards and we're treating
        // it as the trailing edge, or we've hit the `maxWait` limit.
        return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
    }
    function timerExpired() {
        const time = Date.now();
        if (shouldInvoke(time)) {
            return trailingEdge(time);
        }
        // Restart the timer.
        timerId = setTimeout(timerExpired, remainingWait(time));
    }
    function trailingEdge(time) {
        timerId = undefined;
        // Only invoke if we have `lastArgs` which means `func` has been
        // debounced at least once.
        if (lastArgs) {
            return invokeFunc(time);
        }
        lastArgs = lastThis = undefined;
        return options.promise ? promise : result;
    }
    function cancel() {
        if (timerId !== undefined) {
            clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = undefined;
    }
    function flush() {
        return timerId === undefined ? result : trailingEdge(Date.now());
    }
    function concatArrays(objValue, srcValue) {
        if (Array.isArray(objValue) && Array.isArray(srcValue)) {
            if (options === null || options === void 0 ? void 0 : options.dedupeArrays) {
                return objValue.concat(srcValue.filter((i)=>objValue.indexOf(i) === -1));
            } else {
                return objValue.concat(srcValue);
            }
        }
    }
    function mergeArguments(args) {
        if (lastArgs === null || lastArgs === void 0 ? void 0 : lastArgs.length) {
            if (!args.length) {
                return lastArgs;
            }
            if ((options === null || options === void 0 ? void 0 : options.concatArrays) || (options === null || options === void 0 ? void 0 : options.dedupeArrays)) {
                return (0,lodash_es_mergeWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lastArgs, args, concatArrays);
            } else {
                return (0,lodash_es_merge_js__WEBPACK_IMPORTED_MODULE_2__["default"])(lastArgs, args);
            }
        } else {
            return args || [];
        }
    }
    function debounced() {
        const time = Date.now();
        const isInvoking = shouldInvoke(time);
        lastArgs = mergeArguments(Array.from(arguments));
        lastThis = this;
        lastCallTime = time;
        if (isInvoking) {
            if (timerId === undefined) {
                return leadingEdge(lastCallTime);
            }
            if (maxing) {
                // Handle invocations in a tight loop.
                clearTimeout(timerId);
                timerId = setTimeout(timerExpired, wait);
                return invokeFunc(lastCallTime);
            }
        }
        if (timerId === undefined) {
            timerId = setTimeout(timerExpired, wait);
        }
        return options.promise ? promise : result;
    }
    debounced.cancel = cancel;
    debounced.flush = flush;
    return debounced;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mergebounce);


/***/ }),

/***/ "./node_modules/pluggable.js/src/pluggable.js":
/*!****************************************************!*\
  !*** ./node_modules/pluggable.js/src/pluggable.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   enable: () => (/* binding */ enable)
/* harmony export */ });
/*
       ____  __                        __    __         _
      / __ \/ /_  __ ___   ___  ____ _/ /_  / /__      (_)____
     / /_/ / / / / / __ \/ __ \/ __/ / __ \/ / _ \    / / ___/
    / ____/ / /_/ / /_/ / /_/ / /_/ / /_/ / /  __/   / (__  )
   /_/   /_/\__,_/\__, /\__, /\__/_/_.___/_/\___(_)_/ /____/
                 /____//____/                    /___/
 */ // Pluggable.js lets you to make your Javascript code pluggable while still
// keeping sensitive objects and data private through closures.
// `wrappedOverride` creates a partially applied wrapper function
// that makes sure to set the proper super method when the
// overriding method is called. This is done to enable
// chaining of plugin methods, all the way up to the
// original method.
function wrappedOverride(key, value, super_method, default_super, ...args) {
    if (typeof super_method === "function") {
        if (typeof this.__super__ === "undefined") {
            /* We're not on the context of the plugged object.
             * This can happen when the overridden method is called via
             * an event handler or when it's a constructor.
             *
             * In this case, we simply tack on the  __super__ obj.
             */ this.__super__ = default_super;
        }
        this.__super__[key] = super_method.bind(this);
    }
    return value.apply(this, args);
}
// The `PluginSocket` class contains the plugin architecture, and gets
// created whenever `pluggable.enable(obj);` is called on the object
// that you want to make pluggable.
// You can also see it as the thing into which the plugins are plugged.
// It takes two parameters, first, the object being made pluggable, and
// then the name by which the pluggable object may be referenced on the
// __super__ object (inside overrides).
class PluginSocket {
    // `_overrideAttribute` overrides an attribute on the original object
    // (the thing being plugged into).
    //
    // If the attribute being overridden is a function, then the original
    // function will still be available via the `__super__` attribute.
    //
    // If the same function is being overridden multiple times, then
    // the original function will be available at the end of a chain of
    // functions, starting from the most recent override, all the way
    // back to the original function, each being referenced by the
    // previous' __super__ attribute.
    //
    // For example:
    //
    // `plugin2.MyFunc.__super__.myFunc => plugin1.MyFunc.__super__.myFunc => original.myFunc`
    _overrideAttribute(key, plugin) {
        const value = plugin.overrides[key];
        if (typeof value === "function") {
            const default_super = {};
            default_super[this.name] = this.plugged;
            const super_method = this.plugged[key];
            this.plugged[key] = function(...args) {
                return wrappedOverride.apply(this, [
                    key,
                    value,
                    super_method,
                    default_super,
                    ...args
                ]);
            };
        } else {
            this.plugged[key] = value;
        }
    }
    _extendObject(obj, attributes) {
        if (!obj.prototype.__super__) {
            obj.prototype.__super__ = {};
            obj.prototype.__super__[this.name] = this.plugged;
        }
        for (const [key, value] of Object.entries(attributes)){
            if (key === 'events') {
                obj.prototype[key] = Object.assign(value, obj.prototype[key]);
            } else if (typeof value === 'function') {
                // We create a partially applied wrapper function, that
                // makes sure to set the proper super method when the
                // overriding method is called. This is done to enable
                // chaining of plugin methods, all the way up to the
                // original method.
                const default_super = {};
                default_super[this.name] = this.plugged;
                const super_method = obj.prototype[key];
                obj.prototype[key] = function(...args) {
                    return wrappedOverride.apply(this, [
                        key,
                        value,
                        super_method,
                        default_super,
                        ...args
                    ]);
                };
            } else {
                obj.prototype[key] = value;
            }
        }
    }
    // Plugins can specify dependencies (by means of the
    // `dependencies` list attribute) which refers to dependencies
    // which will be initialized first, before the plugin itself gets initialized.
    //
    // If `strict_plugin_dependencies` is set to `false` (on the object being
    // made pluggable), then no error will be thrown if any of these plugins aren't
    // available.
    loadPluginDependencies(plugin) {
        var _plugin_dependencies;
        (_plugin_dependencies = plugin.dependencies) === null || _plugin_dependencies === void 0 ? void 0 : _plugin_dependencies.forEach((name)=>{
            const dep = this.plugins[name];
            if (dep) {
                var _dep_dependencies;
                if ((_dep_dependencies = dep.dependencies) === null || _dep_dependencies === void 0 ? void 0 : _dep_dependencies.includes(plugin.__name__)) {
                    /* FIXME: circular dependency checking is only one level deep. */ throw "Found a circular dependency between the plugins \"" + plugin.__name__ + "\" and \"" + name + "\"";
                }
                this.initializePlugin(dep);
            } else {
                this.throwUndefinedDependencyError("Could not find dependency \"" + name + "\" " + "for the plugin \"" + plugin.__name__ + "\". " + "If it's needed, make sure it's loaded by require.js");
            }
        });
    }
    throwUndefinedDependencyError(msg) {
        if (this.plugged.strict_plugin_dependencies) {
            throw msg;
        } else {
            if (console.warn) {
                console.warn(msg);
            } else {
                console.log(msg);
            }
        }
    }
    // `applyOverrides` is called by initializePlugin. It applies any
    // and all overrides of methods or Backbone views and models that
    // are defined on any of the plugins.
    applyOverrides(plugin) {
        Object.keys(plugin.overrides || {}).forEach((key)=>{
            const override = plugin.overrides[key];
            if (typeof override === "object") {
                if (typeof this.plugged[key] === 'undefined') {
                    this.throwUndefinedDependencyError(`Plugin "${plugin.__name__}" tried to override "${key}" but it's not found.`);
                } else {
                    this._extendObject(this.plugged[key], override);
                }
            } else {
                this._overrideAttribute(key, plugin);
            }
        });
    }
    // `initializePlugin` applies the overrides (if any) defined on all
    // the registered plugins and then calls the initialize method of the plugin
    initializePlugin(plugin) {
        var _plugin_enabled;
        if (!Object.keys(this.allowed_plugins).includes(plugin.__name__)) {
            /* Don't initialize disallowed plugins. */ return;
        }
        if (this.initialized_plugins.includes(plugin.__name__)) {
            /* Don't initialize plugins twice, otherwise we get
            * infinite recursion in overridden methods.
            */ return;
        }
        if (typeof plugin.enabled === 'boolean' && plugin.enabled || ((_plugin_enabled = plugin.enabled) === null || _plugin_enabled === void 0 ? void 0 : _plugin_enabled.call(plugin, this.plugged)) || plugin.enabled == null) {
            Object.assign(plugin, this.properties);
            if (plugin.dependencies) {
                this.loadPluginDependencies(plugin);
            }
            this.applyOverrides(plugin);
            if (typeof plugin.initialize === "function") {
                plugin.initialize.bind(plugin)(this);
            }
            this.initialized_plugins.push(plugin.__name__);
        }
    }
    // `registerPlugin` registers (or inserts, if you'd like) a plugin,
    // by adding it to the `plugins` map on the PluginSocket instance.
    registerPlugin(name, plugin) {
        if (name in this.plugins) {
            throw new Error('Error: Plugin name ' + name + ' is already taken');
        }
        plugin.__name__ = name;
        this.plugins[name] = plugin;
    }
    // `initializePlugins` should get called once all plugins have been
    // registered. It will then iterate through all the plugins, calling
    // `initializePlugin` for each.
    // The passed in  properties variable is an object with attributes and methods
    // which will be attached to the plugins.
    initializePlugins(properties = {}, whitelist = [], blacklist = []) {
        if (!Object.keys(this.plugins).length) {
            return;
        }
        this.properties = properties;
        this.allowed_plugins = {};
        for (const [key, plugin] of Object.entries(this.plugins)){
            if ((!whitelist.length || whitelist.includes(key)) && !blacklist.includes(key)) {
                this.allowed_plugins[key] = plugin;
            }
        }
        Object.values(this.allowed_plugins).forEach((o)=>this.initializePlugin(o));
    }
    constructor(plugged, name){
        this.name = name;
        this.plugged = plugged;
        if (typeof this.plugged.__super__ === 'undefined') {
            this.plugged.__super__ = {};
        } else if (typeof this.plugged.__super__ === 'string') {
            this.plugged.__super__ = {
                '__string__': this.plugged.__super__
            };
        }
        this.plugged.__super__[name] = this.plugged;
        this.plugins = {};
        this.initialized_plugins = [];
    }
}
function enable(object, name, attrname) {
    // Call the `enable` method to make an object pluggable
    //
    // It takes three parameters:
    // - `object`: The object that gets made pluggable.
    // - `name`: The string name by which the now pluggable object
    //     may be referenced on the __super__ obj (in overrides).
    //     The default value is "plugged".
    // - `attrname`: The string name of the attribute on the now
    //     pluggable object, which refers to the PluginSocket instance
    //     that gets created.
    if (typeof attrname === "undefined") {
        attrname = "pluginSocket";
    }
    if (typeof name === 'undefined') {
        name = 'plugged';
    }
    object[attrname] = new PluginSocket(object, name);
    return object;
}

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    enable
});


/***/ }),

/***/ "./node_modules/sizzle/dist/sizzle.js":
/*!********************************************!*\
  !*** ./node_modules/sizzle/dist/sizzle.js ***!
  \********************************************/
/***/ ((module, exports, __webpack_require__) => {

var __WEBPACK_AMD_DEFINE_RESULT__;/*!
 * Sizzle CSS Selector Engine v2.3.10
 * https://sizzlejs.com/
 *
 * Copyright JS Foundation and other contributors
 * Released under the MIT license
 * https://js.foundation/
 *
 * Date: 2023-02-14
 */
( function( window ) {
var i,
	support,
	Expr,
	getText,
	isXML,
	tokenize,
	compile,
	select,
	outermostContext,
	sortInput,
	hasDuplicate,

	// Local document vars
	setDocument,
	document,
	docElem,
	documentIsHTML,
	rbuggyQSA,
	rbuggyMatches,
	matches,
	contains,

	// Instance-specific data
	expando = "sizzle" + 1 * new Date(),
	preferredDoc = window.document,
	dirruns = 0,
	done = 0,
	classCache = createCache(),
	tokenCache = createCache(),
	compilerCache = createCache(),
	nonnativeSelectorCache = createCache(),
	sortOrder = function( a, b ) {
		if ( a === b ) {
			hasDuplicate = true;
		}
		return 0;
	},

	// Instance methods
	hasOwn = ( {} ).hasOwnProperty,
	arr = [],
	pop = arr.pop,
	pushNative = arr.push,
	push = arr.push,
	slice = arr.slice,

	// Use a stripped-down indexOf as it's faster than native
	// https://jsperf.com/thor-indexof-vs-for/5
	indexOf = function( list, elem ) {
		var i = 0,
			len = list.length;
		for ( ; i < len; i++ ) {
			if ( list[ i ] === elem ) {
				return i;
			}
		}
		return -1;
	},

	booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
		"ismap|loop|multiple|open|readonly|required|scoped",

	// Regular expressions

	// http://www.w3.org/TR/css3-selectors/#whitespace
	whitespace = "[\\x20\\t\\r\\n\\f]",

	// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
	identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
		"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",

	// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
	attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +

		// Operator (capture 2)
		"*([*^$|!~]?=)" + whitespace +

		// "Attribute values must be CSS identifiers [capture 5]
		// or strings [capture 3 or capture 4]"
		"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
		whitespace + "*\\]",

	pseudos = ":(" + identifier + ")(?:\\((" +

		// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
		// 1. quoted (capture 3; capture 4 or capture 5)
		"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +

		// 2. simple (capture 6)
		"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +

		// 3. anything else (capture 2)
		".*" +
		")\\)|)",

	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
	rwhitespace = new RegExp( whitespace + "+", "g" ),
	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
		whitespace + "+$", "g" ),

	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
	rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
		"*" ),
	rdescend = new RegExp( whitespace + "|>" ),

	rpseudo = new RegExp( pseudos ),
	ridentifier = new RegExp( "^" + identifier + "$" ),

	matchExpr = {
		"ID": new RegExp( "^#(" + identifier + ")" ),
		"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
		"TAG": new RegExp( "^(" + identifier + "|[*])" ),
		"ATTR": new RegExp( "^" + attributes ),
		"PSEUDO": new RegExp( "^" + pseudos ),
		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
			whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
			whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
		"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),

		// For use in libraries implementing .is()
		// We use this for POS matching in `select`
		"needsContext": new RegExp( "^" + whitespace +
			"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
			"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
	},

	rhtml = /HTML$/i,
	rinputs = /^(?:input|select|textarea|button)$/i,
	rheader = /^h\d$/i,

	rnative = /^[^{]+\{\s*\[native \w/,

	// Easily-parseable/retrievable ID or TAG or CLASS selectors
	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,

	rsibling = /[+~]/,

	// CSS escapes
	// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
	runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
	funescape = function( escape, nonHex ) {
		var high = "0x" + escape.slice( 1 ) - 0x10000;

		return nonHex ?

			// Strip the backslash prefix from a non-hex escape sequence
			nonHex :

			// Replace a hexadecimal escape sequence with the encoded Unicode code point
			// Support: IE <=11+
			// For values outside the Basic Multilingual Plane (BMP), manually construct a
			// surrogate pair
			high < 0 ?
				String.fromCharCode( high + 0x10000 ) :
				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
	},

	// CSS string/identifier serialization
	// https://drafts.csswg.org/cssom/#common-serializing-idioms
	rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
	fcssescape = function( ch, asCodePoint ) {
		if ( asCodePoint ) {

			// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
			if ( ch === "\0" ) {
				return "\uFFFD";
			}

			// Control characters and (dependent upon position) numbers get escaped as code points
			return ch.slice( 0, -1 ) + "\\" +
				ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
		}

		// Other potentially-special ASCII characters get backslash-escaped
		return "\\" + ch;
	},

	// Used for iframes
	// See setDocument()
	// Removing the function wrapper causes a "Permission Denied"
	// error in IE
	unloadHandler = function() {
		setDocument();
	},

	inDisabledFieldset = addCombinator(
		function( elem ) {
			return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
		},
		{ dir: "parentNode", next: "legend" }
	);

// Optimize for push.apply( _, NodeList )
try {
	push.apply(
		( arr = slice.call( preferredDoc.childNodes ) ),
		preferredDoc.childNodes
	);

	// Support: Android<4.0
	// Detect silently failing push.apply
	// eslint-disable-next-line no-unused-expressions
	arr[ preferredDoc.childNodes.length ].nodeType;
} catch ( e ) {
	push = { apply: arr.length ?

		// Leverage slice if possible
		function( target, els ) {
			pushNative.apply( target, slice.call( els ) );
		} :

		// Support: IE<9
		// Otherwise append directly
		function( target, els ) {
			var j = target.length,
				i = 0;

			// Can't trust NodeList.length
			while ( ( target[ j++ ] = els[ i++ ] ) ) {}
			target.length = j - 1;
		}
	};
}

function Sizzle( selector, context, results, seed ) {
	var m, i, elem, nid, match, groups, newSelector,
		newContext = context && context.ownerDocument,

		// nodeType defaults to 9, since context defaults to document
		nodeType = context ? context.nodeType : 9;

	results = results || [];

	// Return early from calls with invalid selector or context
	if ( typeof selector !== "string" || !selector ||
		nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {

		return results;
	}

	// Try to shortcut find operations (as opposed to filters) in HTML documents
	if ( !seed ) {
		setDocument( context );
		context = context || document;

		if ( documentIsHTML ) {

			// If the selector is sufficiently simple, try using a "get*By*" DOM method
			// (excepting DocumentFragment context, where the methods don't exist)
			if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {

				// ID selector
				if ( ( m = match[ 1 ] ) ) {

					// Document context
					if ( nodeType === 9 ) {
						if ( ( elem = context.getElementById( m ) ) ) {

							// Support: IE, Opera, Webkit
							// TODO: identify versions
							// getElementById can match elements by name instead of ID
							if ( elem.id === m ) {
								results.push( elem );
								return results;
							}
						} else {
							return results;
						}

					// Element context
					} else {

						// Support: IE, Opera, Webkit
						// TODO: identify versions
						// getElementById can match elements by name instead of ID
						if ( newContext && ( elem = newContext.getElementById( m ) ) &&
							contains( context, elem ) &&
							elem.id === m ) {

							results.push( elem );
							return results;
						}
					}

				// Type selector
				} else if ( match[ 2 ] ) {
					push.apply( results, context.getElementsByTagName( selector ) );
					return results;

				// Class selector
				} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
					context.getElementsByClassName ) {

					push.apply( results, context.getElementsByClassName( m ) );
					return results;
				}
			}

			// Take advantage of querySelectorAll
			if ( support.qsa &&
				!nonnativeSelectorCache[ selector + " " ] &&
				( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&

				// Support: IE 8 only
				// Exclude object elements
				( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {

				newSelector = selector;
				newContext = context;

				// qSA considers elements outside a scoping root when evaluating child or
				// descendant combinators, which is not what we want.
				// In such cases, we work around the behavior by prefixing every selector in the
				// list with an ID selector referencing the scope context.
				// The technique has to be used as well when a leading combinator is used
				// as such selectors are not recognized by querySelectorAll.
				// Thanks to Andrew Dupont for this technique.
				if ( nodeType === 1 &&
					( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {

					// Expand context for sibling selectors
					newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
						context;

					// We can use :scope instead of the ID hack if the browser
					// supports it & if we're not changing the context.
					if ( newContext !== context || !support.scope ) {

						// Capture the context ID, setting it first if necessary
						if ( ( nid = context.getAttribute( "id" ) ) ) {
							nid = nid.replace( rcssescape, fcssescape );
						} else {
							context.setAttribute( "id", ( nid = expando ) );
						}
					}

					// Prefix every selector in the list
					groups = tokenize( selector );
					i = groups.length;
					while ( i-- ) {
						groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
							toSelector( groups[ i ] );
					}
					newSelector = groups.join( "," );
				}

				try {
					push.apply( results,
						newContext.querySelectorAll( newSelector )
					);
					return results;
				} catch ( qsaError ) {
					nonnativeSelectorCache( selector, true );
				} finally {
					if ( nid === expando ) {
						context.removeAttribute( "id" );
					}
				}
			}
		}
	}

	// All others
	return select( selector.replace( rtrim, "$1" ), context, results, seed );
}

/**
 * Create key-value caches of limited size
 * @returns {function(string, object)} Returns the Object data after storing it on itself with
 *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
 *	deleting the oldest entry
 */
function createCache() {
	var keys = [];

	function cache( key, value ) {

		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
		if ( keys.push( key + " " ) > Expr.cacheLength ) {

			// Only keep the most recent entries
			delete cache[ keys.shift() ];
		}
		return ( cache[ key + " " ] = value );
	}
	return cache;
}

/**
 * Mark a function for special use by Sizzle
 * @param {Function} fn The function to mark
 */
function markFunction( fn ) {
	fn[ expando ] = true;
	return fn;
}

/**
 * Support testing using an element
 * @param {Function} fn Passed the created element and returns a boolean result
 */
function assert( fn ) {
	var el = document.createElement( "fieldset" );

	try {
		return !!fn( el );
	} catch ( e ) {
		return false;
	} finally {

		// Remove from its parent by default
		if ( el.parentNode ) {
			el.parentNode.removeChild( el );
		}

		// release memory in IE
		el = null;
	}
}

/**
 * Adds the same handler for all of the specified attrs
 * @param {String} attrs Pipe-separated list of attributes
 * @param {Function} handler The method that will be applied
 */
function addHandle( attrs, handler ) {
	var arr = attrs.split( "|" ),
		i = arr.length;

	while ( i-- ) {
		Expr.attrHandle[ arr[ i ] ] = handler;
	}
}

/**
 * Checks document order of two siblings
 * @param {Element} a
 * @param {Element} b
 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
 */
function siblingCheck( a, b ) {
	var cur = b && a,
		diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
			a.sourceIndex - b.sourceIndex;

	// Use IE sourceIndex if available on both nodes
	if ( diff ) {
		return diff;
	}

	// Check if b follows a
	if ( cur ) {
		while ( ( cur = cur.nextSibling ) ) {
			if ( cur === b ) {
				return -1;
			}
		}
	}

	return a ? 1 : -1;
}

/**
 * Returns a function to use in pseudos for input types
 * @param {String} type
 */
function createInputPseudo( type ) {
	return function( elem ) {
		var name = elem.nodeName.toLowerCase();
		return name === "input" && elem.type === type;
	};
}

/**
 * Returns a function to use in pseudos for buttons
 * @param {String} type
 */
function createButtonPseudo( type ) {
	return function( elem ) {
		var name = elem.nodeName.toLowerCase();
		return ( name === "input" || name === "button" ) && elem.type === type;
	};
}

/**
 * Returns a function to use in pseudos for :enabled/:disabled
 * @param {Boolean} disabled true for :disabled; false for :enabled
 */
function createDisabledPseudo( disabled ) {

	// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
	return function( elem ) {

		// Only certain elements can match :enabled or :disabled
		// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
		// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
		if ( "form" in elem ) {

			// Check for inherited disabledness on relevant non-disabled elements:
			// * listed form-associated elements in a disabled fieldset
			//   https://html.spec.whatwg.org/multipage/forms.html#category-listed
			//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
			// * option elements in a disabled optgroup
			//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
			// All such elements have a "form" property.
			if ( elem.parentNode && elem.disabled === false ) {

				// Option elements defer to a parent optgroup if present
				if ( "label" in elem ) {
					if ( "label" in elem.parentNode ) {
						return elem.parentNode.disabled === disabled;
					} else {
						return elem.disabled === disabled;
					}
				}

				// Support: IE 6 - 11
				// Use the isDisabled shortcut property to check for disabled fieldset ancestors
				return elem.isDisabled === disabled ||

					// Where there is no isDisabled, check manually
					/* jshint -W018 */
					elem.isDisabled !== !disabled &&
					inDisabledFieldset( elem ) === disabled;
			}

			return elem.disabled === disabled;

		// Try to winnow out elements that can't be disabled before trusting the disabled property.
		// Some victims get caught in our net (label, legend, menu, track), but it shouldn't
		// even exist on them, let alone have a boolean value.
		} else if ( "label" in elem ) {
			return elem.disabled === disabled;
		}

		// Remaining elements are neither :enabled nor :disabled
		return false;
	};
}

/**
 * Returns a function to use in pseudos for positionals
 * @param {Function} fn
 */
function createPositionalPseudo( fn ) {
	return markFunction( function( argument ) {
		argument = +argument;
		return markFunction( function( seed, matches ) {
			var j,
				matchIndexes = fn( [], seed.length, argument ),
				i = matchIndexes.length;

			// Match elements found at the specified indexes
			while ( i-- ) {
				if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
					seed[ j ] = !( matches[ j ] = seed[ j ] );
				}
			}
		} );
	} );
}

/**
 * Checks a node for validity as a Sizzle context
 * @param {Element|Object=} context
 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
 */
function testContext( context ) {
	return context && typeof context.getElementsByTagName !== "undefined" && context;
}

// Expose support vars for convenience
support = Sizzle.support = {};

/**
 * Detects XML nodes
 * @param {Element|Object} elem An element or a document
 * @returns {Boolean} True iff elem is a non-HTML XML node
 */
isXML = Sizzle.isXML = function( elem ) {
	var namespace = elem && elem.namespaceURI,
		docElem = elem && ( elem.ownerDocument || elem ).documentElement;

	// Support: IE <=8
	// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
	// https://bugs.jquery.com/ticket/4833
	return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
};

/**
 * Sets document-related variables once based on the current document
 * @param {Element|Object} [doc] An element or document object to use to set the document
 * @returns {Object} Returns the current document
 */
setDocument = Sizzle.setDocument = function( node ) {
	var hasCompare, subWindow,
		doc = node ? node.ownerDocument || node : preferredDoc;

	// Return early if doc is invalid or already selected
	// Support: IE 11+, Edge 17 - 18+
	// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
	// two documents; shallow comparisons work.
	// eslint-disable-next-line eqeqeq
	if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
		return document;
	}

	// Update global variables
	document = doc;
	docElem = document.documentElement;
	documentIsHTML = !isXML( document );

	// Support: IE 9 - 11+, Edge 12 - 18+
	// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
	// Support: IE 11+, Edge 17 - 18+
	// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
	// two documents; shallow comparisons work.
	// eslint-disable-next-line eqeqeq
	if ( preferredDoc != document &&
		( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {

		// Support: IE 11, Edge
		if ( subWindow.addEventListener ) {
			subWindow.addEventListener( "unload", unloadHandler, false );

		// Support: IE 9 - 10 only
		} else if ( subWindow.attachEvent ) {
			subWindow.attachEvent( "onunload", unloadHandler );
		}
	}

	// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
	// Safari 4 - 5 only, Opera <=11.6 - 12.x only
	// IE/Edge & older browsers don't support the :scope pseudo-class.
	// Support: Safari 6.0 only
	// Safari 6.0 supports :scope but it's an alias of :root there.
	support.scope = assert( function( el ) {
		docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
		return typeof el.querySelectorAll !== "undefined" &&
			!el.querySelectorAll( ":scope fieldset div" ).length;
	} );

	// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
	// Make sure the the `:has()` argument is parsed unforgivingly.
	// We include `*` in the test to detect buggy implementations that are
	// _selectively_ forgiving (specifically when the list includes at least
	// one valid selector).
	// Note that we treat complete lack of support for `:has()` as if it were
	// spec-compliant support, which is fine because use of `:has()` in such
	// environments will fail in the qSA path and fall back to jQuery traversal
	// anyway.
	support.cssHas = assert( function() {
		try {
			document.querySelector( ":has(*,:jqfake)" );
			return false;
		} catch ( e ) {
			return true;
		}
	} );

	/* Attributes
	---------------------------------------------------------------------- */

	// Support: IE<8
	// Verify that getAttribute really returns attributes and not properties
	// (excepting IE8 booleans)
	support.attributes = assert( function( el ) {
		el.className = "i";
		return !el.getAttribute( "className" );
	} );

	/* getElement(s)By*
	---------------------------------------------------------------------- */

	// Check if getElementsByTagName("*") returns only elements
	support.getElementsByTagName = assert( function( el ) {
		el.appendChild( document.createComment( "" ) );
		return !el.getElementsByTagName( "*" ).length;
	} );

	// Support: IE<9
	support.getElementsByClassName = rnative.test( document.getElementsByClassName );

	// Support: IE<10
	// Check if getElementById returns elements by name
	// The broken getElementById methods don't pick up programmatically-set names,
	// so use a roundabout getElementsByName test
	support.getById = assert( function( el ) {
		docElem.appendChild( el ).id = expando;
		return !document.getElementsByName || !document.getElementsByName( expando ).length;
	} );

	// ID filter and find
	if ( support.getById ) {
		Expr.filter[ "ID" ] = function( id ) {
			var attrId = id.replace( runescape, funescape );
			return function( elem ) {
				return elem.getAttribute( "id" ) === attrId;
			};
		};
		Expr.find[ "ID" ] = function( id, context ) {
			if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
				var elem = context.getElementById( id );
				return elem ? [ elem ] : [];
			}
		};
	} else {
		Expr.filter[ "ID" ] =  function( id ) {
			var attrId = id.replace( runescape, funescape );
			return function( elem ) {
				var node = typeof elem.getAttributeNode !== "undefined" &&
					elem.getAttributeNode( "id" );
				return node && node.value === attrId;
			};
		};

		// Support: IE 6 - 7 only
		// getElementById is not reliable as a find shortcut
		Expr.find[ "ID" ] = function( id, context ) {
			if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
				var node, i, elems,
					elem = context.getElementById( id );

				if ( elem ) {

					// Verify the id attribute
					node = elem.getAttributeNode( "id" );
					if ( node && node.value === id ) {
						return [ elem ];
					}

					// Fall back on getElementsByName
					elems = context.getElementsByName( id );
					i = 0;
					while ( ( elem = elems[ i++ ] ) ) {
						node = elem.getAttributeNode( "id" );
						if ( node && node.value === id ) {
							return [ elem ];
						}
					}
				}

				return [];
			}
		};
	}

	// Tag
	Expr.find[ "TAG" ] = support.getElementsByTagName ?
		function( tag, context ) {
			if ( typeof context.getElementsByTagName !== "undefined" ) {
				return context.getElementsByTagName( tag );

			// DocumentFragment nodes don't have gEBTN
			} else if ( support.qsa ) {
				return context.querySelectorAll( tag );
			}
		} :

		function( tag, context ) {
			var elem,
				tmp = [],
				i = 0,

				// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
				results = context.getElementsByTagName( tag );

			// Filter out possible comments
			if ( tag === "*" ) {
				while ( ( elem = results[ i++ ] ) ) {
					if ( elem.nodeType === 1 ) {
						tmp.push( elem );
					}
				}

				return tmp;
			}
			return results;
		};

	// Class
	Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
		if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
			return context.getElementsByClassName( className );
		}
	};

	/* QSA/matchesSelector
	---------------------------------------------------------------------- */

	// QSA and matchesSelector support

	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
	rbuggyMatches = [];

	// qSa(:focus) reports false when true (Chrome 21)
	// We allow this because of a bug in IE8/9 that throws an error
	// whenever `document.activeElement` is accessed on an iframe
	// So, we allow :focus to pass through QSA all the time to avoid the IE error
	// See https://bugs.jquery.com/ticket/13378
	rbuggyQSA = [];

	if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {

		// Build QSA regex
		// Regex strategy adopted from Diego Perini
		assert( function( el ) {

			var input;

			// Select is set to empty string on purpose
			// This is to test IE's treatment of not explicitly
			// setting a boolean content attribute,
			// since its presence should be enough
			// https://bugs.jquery.com/ticket/12359
			docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
				"<select id='" + expando + "-\r\\' msallowcapture=''>" +
				"<option selected=''></option></select>";

			// Support: IE8, Opera 11-12.16
			// Nothing should be selected when empty strings follow ^= or $= or *=
			// The test attribute must be unknown in Opera but "safe" for WinRT
			// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
			if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
			}

			// Support: IE8
			// Boolean attributes and "value" are not treated correctly
			if ( !el.querySelectorAll( "[selected]" ).length ) {
				rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
			}

			// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
			if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
				rbuggyQSA.push( "~=" );
			}

			// Support: IE 11+, Edge 15 - 18+
			// IE 11/Edge don't find elements on a `[name='']` query in some cases.
			// Adding a temporary attribute to the document before the selection works
			// around the issue.
			// Interestingly, IE 10 & older don't seem to have the issue.
			input = document.createElement( "input" );
			input.setAttribute( "name", "" );
			el.appendChild( input );
			if ( !el.querySelectorAll( "[name='']" ).length ) {
				rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
					whitespace + "*(?:''|\"\")" );
			}

			// Webkit/Opera - :checked should return selected option elements
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
			// IE8 throws error here and will not see later tests
			if ( !el.querySelectorAll( ":checked" ).length ) {
				rbuggyQSA.push( ":checked" );
			}

			// Support: Safari 8+, iOS 8+
			// https://bugs.webkit.org/show_bug.cgi?id=136851
			// In-page `selector#id sibling-combinator selector` fails
			if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
				rbuggyQSA.push( ".#.+[+~]" );
			}

			// Support: Firefox <=3.6 - 5 only
			// Old Firefox doesn't throw on a badly-escaped identifier.
			el.querySelectorAll( "\\\f" );
			rbuggyQSA.push( "[\\r\\n\\f]" );
		} );

		assert( function( el ) {
			el.innerHTML = "<a href='' disabled='disabled'></a>" +
				"<select disabled='disabled'><option/></select>";

			// Support: Windows 8 Native Apps
			// The type and name attributes are restricted during .innerHTML assignment
			var input = document.createElement( "input" );
			input.setAttribute( "type", "hidden" );
			el.appendChild( input ).setAttribute( "name", "D" );

			// Support: IE8
			// Enforce case-sensitivity of name attribute
			if ( el.querySelectorAll( "[name=d]" ).length ) {
				rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
			}

			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
			// IE8 throws error here and will not see later tests
			if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
				rbuggyQSA.push( ":enabled", ":disabled" );
			}

			// Support: IE9-11+
			// IE's :disabled selector does not pick up the children of disabled fieldsets
			docElem.appendChild( el ).disabled = true;
			if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
				rbuggyQSA.push( ":enabled", ":disabled" );
			}

			// Support: Opera 10 - 11 only
			// Opera 10-11 does not throw on post-comma invalid pseudos
			el.querySelectorAll( "*,:x" );
			rbuggyQSA.push( ",.*:" );
		} );
	}

	if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
		docElem.webkitMatchesSelector ||
		docElem.mozMatchesSelector ||
		docElem.oMatchesSelector ||
		docElem.msMatchesSelector ) ) ) ) {

		assert( function( el ) {

			// Check to see if it's possible to do matchesSelector
			// on a disconnected node (IE 9)
			support.disconnectedMatch = matches.call( el, "*" );

			// This should fail with an exception
			// Gecko does not error, returns false instead
			matches.call( el, "[s!='']:x" );
			rbuggyMatches.push( "!=", pseudos );
		} );
	}

	if ( !support.cssHas ) {

		// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
		// Our regular `try-catch` mechanism fails to detect natively-unsupported
		// pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
		// in browsers that parse the `:has()` argument as a forgiving selector list.
		// https://drafts.csswg.org/selectors/#relational now requires the argument
		// to be parsed unforgivingly, but browsers have not yet fully adjusted.
		rbuggyQSA.push( ":has" );
	}

	rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
	rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );

	/* Contains
	---------------------------------------------------------------------- */
	hasCompare = rnative.test( docElem.compareDocumentPosition );

	// Element contains another
	// Purposefully self-exclusive
	// As in, an element does not contain itself
	contains = hasCompare || rnative.test( docElem.contains ) ?
		function( a, b ) {

			// Support: IE <9 only
			// IE doesn't have `contains` on `document` so we need to check for
			// `documentElement` presence.
			// We need to fall back to `a` when `documentElement` is missing
			// as `ownerDocument` of elements within `<template/>` may have
			// a null one - a default behavior of all modern browsers.
			var adown = a.nodeType === 9 && a.documentElement || a,
				bup = b && b.parentNode;
			return a === bup || !!( bup && bup.nodeType === 1 && (
				adown.contains ?
					adown.contains( bup ) :
					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
			) );
		} :
		function( a, b ) {
			if ( b ) {
				while ( ( b = b.parentNode ) ) {
					if ( b === a ) {
						return true;
					}
				}
			}
			return false;
		};

	/* Sorting
	---------------------------------------------------------------------- */

	// Document order sorting
	sortOrder = hasCompare ?
	function( a, b ) {

		// Flag for duplicate removal
		if ( a === b ) {
			hasDuplicate = true;
			return 0;
		}

		// Sort on method existence if only one input has compareDocumentPosition
		var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
		if ( compare ) {
			return compare;
		}

		// Calculate position if both inputs belong to the same document
		// Support: IE 11+, Edge 17 - 18+
		// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
		// two documents; shallow comparisons work.
		// eslint-disable-next-line eqeqeq
		compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
			a.compareDocumentPosition( b ) :

			// Otherwise we know they are disconnected
			1;

		// Disconnected nodes
		if ( compare & 1 ||
			( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {

			// Choose the first element that is related to our preferred document
			// Support: IE 11+, Edge 17 - 18+
			// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
			// two documents; shallow comparisons work.
			// eslint-disable-next-line eqeqeq
			if ( a == document || a.ownerDocument == preferredDoc &&
				contains( preferredDoc, a ) ) {
				return -1;
			}

			// Support: IE 11+, Edge 17 - 18+
			// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
			// two documents; shallow comparisons work.
			// eslint-disable-next-line eqeqeq
			if ( b == document || b.ownerDocument == preferredDoc &&
				contains( preferredDoc, b ) ) {
				return 1;
			}

			// Maintain original order
			return sortInput ?
				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
				0;
		}

		return compare & 4 ? -1 : 1;
	} :
	function( a, b ) {

		// Exit early if the nodes are identical
		if ( a === b ) {
			hasDuplicate = true;
			return 0;
		}

		var cur,
			i = 0,
			aup = a.parentNode,
			bup = b.parentNode,
			ap = [ a ],
			bp = [ b ];

		// Parentless nodes are either documents or disconnected
		if ( !aup || !bup ) {

			// Support: IE 11+, Edge 17 - 18+
			// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
			// two documents; shallow comparisons work.
			/* eslint-disable eqeqeq */
			return a == document ? -1 :
				b == document ? 1 :
				/* eslint-enable eqeqeq */
				aup ? -1 :
				bup ? 1 :
				sortInput ?
				( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
				0;

		// If the nodes are siblings, we can do a quick check
		} else if ( aup === bup ) {
			return siblingCheck( a, b );
		}

		// Otherwise we need full lists of their ancestors for comparison
		cur = a;
		while ( ( cur = cur.parentNode ) ) {
			ap.unshift( cur );
		}
		cur = b;
		while ( ( cur = cur.parentNode ) ) {
			bp.unshift( cur );
		}

		// Walk down the tree looking for a discrepancy
		while ( ap[ i ] === bp[ i ] ) {
			i++;
		}

		return i ?

			// Do a sibling check if the nodes have a common ancestor
			siblingCheck( ap[ i ], bp[ i ] ) :

			// Otherwise nodes in our document sort first
			// Support: IE 11+, Edge 17 - 18+
			// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
			// two documents; shallow comparisons work.
			/* eslint-disable eqeqeq */
			ap[ i ] == preferredDoc ? -1 :
			bp[ i ] == preferredDoc ? 1 :
			/* eslint-enable eqeqeq */
			0;
	};

	return document;
};

Sizzle.matches = function( expr, elements ) {
	return Sizzle( expr, null, null, elements );
};

Sizzle.matchesSelector = function( elem, expr ) {
	setDocument( elem );

	if ( support.matchesSelector && documentIsHTML &&
		!nonnativeSelectorCache[ expr + " " ] &&
		( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
		( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {

		try {
			var ret = matches.call( elem, expr );

			// IE 9's matchesSelector returns false on disconnected nodes
			if ( ret || support.disconnectedMatch ||

				// As well, disconnected nodes are said to be in a document
				// fragment in IE 9
				elem.document && elem.document.nodeType !== 11 ) {
				return ret;
			}
		} catch ( e ) {
			nonnativeSelectorCache( expr, true );
		}
	}

	return Sizzle( expr, document, null, [ elem ] ).length > 0;
};

Sizzle.contains = function( context, elem ) {

	// Set document vars if needed
	// Support: IE 11+, Edge 17 - 18+
	// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
	// two documents; shallow comparisons work.
	// eslint-disable-next-line eqeqeq
	if ( ( context.ownerDocument || context ) != document ) {
		setDocument( context );
	}
	return contains( context, elem );
};

Sizzle.attr = function( elem, name ) {

	// Set document vars if needed
	// Support: IE 11+, Edge 17 - 18+
	// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
	// two documents; shallow comparisons work.
	// eslint-disable-next-line eqeqeq
	if ( ( elem.ownerDocument || elem ) != document ) {
		setDocument( elem );
	}

	var fn = Expr.attrHandle[ name.toLowerCase() ],

		// Don't get fooled by Object.prototype properties (jQuery #13807)
		val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
			fn( elem, name, !documentIsHTML ) :
			undefined;

	return val !== undefined ?
		val :
		support.attributes || !documentIsHTML ?
			elem.getAttribute( name ) :
			( val = elem.getAttributeNode( name ) ) && val.specified ?
				val.value :
				null;
};

Sizzle.escape = function( sel ) {
	return ( sel + "" ).replace( rcssescape, fcssescape );
};

Sizzle.error = function( msg ) {
	throw new Error( "Syntax error, unrecognized expression: " + msg );
};

/**
 * Document sorting and removing duplicates
 * @param {ArrayLike} results
 */
Sizzle.uniqueSort = function( results ) {
	var elem,
		duplicates = [],
		j = 0,
		i = 0;

	// Unless we *know* we can detect duplicates, assume their presence
	hasDuplicate = !support.detectDuplicates;
	sortInput = !support.sortStable && results.slice( 0 );
	results.sort( sortOrder );

	if ( hasDuplicate ) {
		while ( ( elem = results[ i++ ] ) ) {
			if ( elem === results[ i ] ) {
				j = duplicates.push( i );
			}
		}
		while ( j-- ) {
			results.splice( duplicates[ j ], 1 );
		}
	}

	// Clear input after sorting to release objects
	// See https://github.com/jquery/sizzle/pull/225
	sortInput = null;

	return results;
};

/**
 * Utility function for retrieving the text value of an array of DOM nodes
 * @param {Array|Element} elem
 */
getText = Sizzle.getText = function( elem ) {
	var node,
		ret = "",
		i = 0,
		nodeType = elem.nodeType;

	if ( !nodeType ) {

		// If no nodeType, this is expected to be an array
		while ( ( node = elem[ i++ ] ) ) {

			// Do not traverse comment nodes
			ret += getText( node );
		}
	} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {

		// Use textContent for elements
		// innerText usage removed for consistency of new lines (jQuery #11153)
		if ( typeof elem.textContent === "string" ) {
			return elem.textContent;
		} else {

			// Traverse its children
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
				ret += getText( elem );
			}
		}
	} else if ( nodeType === 3 || nodeType === 4 ) {
		return elem.nodeValue;
	}

	// Do not include comment or processing instruction nodes

	return ret;
};

Expr = Sizzle.selectors = {

	// Can be adjusted by the user
	cacheLength: 50,

	createPseudo: markFunction,

	match: matchExpr,

	attrHandle: {},

	find: {},

	relative: {
		">": { dir: "parentNode", first: true },
		" ": { dir: "parentNode" },
		"+": { dir: "previousSibling", first: true },
		"~": { dir: "previousSibling" }
	},

	preFilter: {
		"ATTR": function( match ) {
			match[ 1 ] = match[ 1 ].replace( runescape, funescape );

			// Move the given value to match[3] whether quoted or unquoted
			match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
				match[ 5 ] || "" ).replace( runescape, funescape );

			if ( match[ 2 ] === "~=" ) {
				match[ 3 ] = " " + match[ 3 ] + " ";
			}

			return match.slice( 0, 4 );
		},

		"CHILD": function( match ) {

			/* matches from matchExpr["CHILD"]
				1 type (only|nth|...)
				2 what (child|of-type)
				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
				4 xn-component of xn+y argument ([+-]?\d*n|)
				5 sign of xn-component
				6 x of xn-component
				7 sign of y-component
				8 y of y-component
			*/
			match[ 1 ] = match[ 1 ].toLowerCase();

			if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {

				// nth-* requires argument
				if ( !match[ 3 ] ) {
					Sizzle.error( match[ 0 ] );
				}

				// numeric x and y parameters for Expr.filter.CHILD
				// remember that false/true cast respectively to 0/1
				match[ 4 ] = +( match[ 4 ] ?
					match[ 5 ] + ( match[ 6 ] || 1 ) :
					2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
				match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );

				// other types prohibit arguments
			} else if ( match[ 3 ] ) {
				Sizzle.error( match[ 0 ] );
			}

			return match;
		},

		"PSEUDO": function( match ) {
			var excess,
				unquoted = !match[ 6 ] && match[ 2 ];

			if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
				return null;
			}

			// Accept quoted arguments as-is
			if ( match[ 3 ] ) {
				match[ 2 ] = match[ 4 ] || match[ 5 ] || "";

			// Strip excess characters from unquoted arguments
			} else if ( unquoted && rpseudo.test( unquoted ) &&

				// Get excess from tokenize (recursively)
				( excess = tokenize( unquoted, true ) ) &&

				// advance to the next closing parenthesis
				( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {

				// excess is a negative index
				match[ 0 ] = match[ 0 ].slice( 0, excess );
				match[ 2 ] = unquoted.slice( 0, excess );
			}

			// Return only captures needed by the pseudo filter method (type and argument)
			return match.slice( 0, 3 );
		}
	},

	filter: {

		"TAG": function( nodeNameSelector ) {
			var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
			return nodeNameSelector === "*" ?
				function() {
					return true;
				} :
				function( elem ) {
					return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
				};
		},

		"CLASS": function( className ) {
			var pattern = classCache[ className + " " ];

			return pattern ||
				( pattern = new RegExp( "(^|" + whitespace +
					")" + className + "(" + whitespace + "|$)" ) ) && classCache(
						className, function( elem ) {
							return pattern.test(
								typeof elem.className === "string" && elem.className ||
								typeof elem.getAttribute !== "undefined" &&
									elem.getAttribute( "class" ) ||
								""
							);
				} );
		},

		"ATTR": function( name, operator, check ) {
			return function( elem ) {
				var result = Sizzle.attr( elem, name );

				if ( result == null ) {
					return operator === "!=";
				}
				if ( !operator ) {
					return true;
				}

				result += "";

				/* eslint-disable max-len */

				return operator === "=" ? result === check :
					operator === "!=" ? result !== check :
					operator === "^=" ? check && result.indexOf( check ) === 0 :
					operator === "*=" ? check && result.indexOf( check ) > -1 :
					operator === "$=" ? check && result.slice( -check.length ) === check :
					operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
					false;
				/* eslint-enable max-len */

			};
		},

		"CHILD": function( type, what, _argument, first, last ) {
			var simple = type.slice( 0, 3 ) !== "nth",
				forward = type.slice( -4 ) !== "last",
				ofType = what === "of-type";

			return first === 1 && last === 0 ?

				// Shortcut for :nth-*(n)
				function( elem ) {
					return !!elem.parentNode;
				} :

				function( elem, _context, xml ) {
					var cache, uniqueCache, outerCache, node, nodeIndex, start,
						dir = simple !== forward ? "nextSibling" : "previousSibling",
						parent = elem.parentNode,
						name = ofType && elem.nodeName.toLowerCase(),
						useCache = !xml && !ofType,
						diff = false;

					if ( parent ) {

						// :(first|last|only)-(child|of-type)
						if ( simple ) {
							while ( dir ) {
								node = elem;
								while ( ( node = node[ dir ] ) ) {
									if ( ofType ?
										node.nodeName.toLowerCase() === name :
										node.nodeType === 1 ) {

										return false;
									}
								}

								// Reverse direction for :only-* (if we haven't yet done so)
								start = dir = type === "only" && !start && "nextSibling";
							}
							return true;
						}

						start = [ forward ? parent.firstChild : parent.lastChild ];

						// non-xml :nth-child(...) stores cache data on `parent`
						if ( forward && useCache ) {

							// Seek `elem` from a previously-cached index

							// ...in a gzip-friendly way
							node = parent;
							outerCache = node[ expando ] || ( node[ expando ] = {} );

							// Support: IE <9 only
							// Defend against cloned attroperties (jQuery gh-1709)
							uniqueCache = outerCache[ node.uniqueID ] ||
								( outerCache[ node.uniqueID ] = {} );

							cache = uniqueCache[ type ] || [];
							nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
							diff = nodeIndex && cache[ 2 ];
							node = nodeIndex && parent.childNodes[ nodeIndex ];

							while ( ( node = ++nodeIndex && node && node[ dir ] ||

								// Fallback to seeking `elem` from the start
								( diff = nodeIndex = 0 ) || start.pop() ) ) {

								// When found, cache indexes on `parent` and break
								if ( node.nodeType === 1 && ++diff && node === elem ) {
									uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
									break;
								}
							}

						} else {

							// Use previously-cached element index if available
							if ( useCache ) {

								// ...in a gzip-friendly way
								node = elem;
								outerCache = node[ expando ] || ( node[ expando ] = {} );

								// Support: IE <9 only
								// Defend against cloned attroperties (jQuery gh-1709)
								uniqueCache = outerCache[ node.uniqueID ] ||
									( outerCache[ node.uniqueID ] = {} );

								cache = uniqueCache[ type ] || [];
								nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
								diff = nodeIndex;
							}

							// xml :nth-child(...)
							// or :nth-last-child(...) or :nth(-last)?-of-type(...)
							if ( diff === false ) {

								// Use the same loop as above to seek `elem` from the start
								while ( ( node = ++nodeIndex && node && node[ dir ] ||
									( diff = nodeIndex = 0 ) || start.pop() ) ) {

									if ( ( ofType ?
										node.nodeName.toLowerCase() === name :
										node.nodeType === 1 ) &&
										++diff ) {

										// Cache the index of each encountered element
										if ( useCache ) {
											outerCache = node[ expando ] ||
												( node[ expando ] = {} );

											// Support: IE <9 only
											// Defend against cloned attroperties (jQuery gh-1709)
											uniqueCache = outerCache[ node.uniqueID ] ||
												( outerCache[ node.uniqueID ] = {} );

											uniqueCache[ type ] = [ dirruns, diff ];
										}

										if ( node === elem ) {
											break;
										}
									}
								}
							}
						}

						// Incorporate the offset, then check against cycle size
						diff -= last;
						return diff === first || ( diff % first === 0 && diff / first >= 0 );
					}
				};
		},

		"PSEUDO": function( pseudo, argument ) {

			// pseudo-class names are case-insensitive
			// http://www.w3.org/TR/selectors/#pseudo-classes
			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
			// Remember that setFilters inherits from pseudos
			var args,
				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
					Sizzle.error( "unsupported pseudo: " + pseudo );

			// The user may use createPseudo to indicate that
			// arguments are needed to create the filter function
			// just as Sizzle does
			if ( fn[ expando ] ) {
				return fn( argument );
			}

			// But maintain support for old signatures
			if ( fn.length > 1 ) {
				args = [ pseudo, pseudo, "", argument ];
				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
					markFunction( function( seed, matches ) {
						var idx,
							matched = fn( seed, argument ),
							i = matched.length;
						while ( i-- ) {
							idx = indexOf( seed, matched[ i ] );
							seed[ idx ] = !( matches[ idx ] = matched[ i ] );
						}
					} ) :
					function( elem ) {
						return fn( elem, 0, args );
					};
			}

			return fn;
		}
	},

	pseudos: {

		// Potentially complex pseudos
		"not": markFunction( function( selector ) {

			// Trim the selector passed to compile
			// to avoid treating leading and trailing
			// spaces as combinators
			var input = [],
				results = [],
				matcher = compile( selector.replace( rtrim, "$1" ) );

			return matcher[ expando ] ?
				markFunction( function( seed, matches, _context, xml ) {
					var elem,
						unmatched = matcher( seed, null, xml, [] ),
						i = seed.length;

					// Match elements unmatched by `matcher`
					while ( i-- ) {
						if ( ( elem = unmatched[ i ] ) ) {
							seed[ i ] = !( matches[ i ] = elem );
						}
					}
				} ) :
				function( elem, _context, xml ) {
					input[ 0 ] = elem;
					matcher( input, null, xml, results );

					// Don't keep the element (issue #299)
					input[ 0 ] = null;
					return !results.pop();
				};
		} ),

		"has": markFunction( function( selector ) {
			return function( elem ) {
				return Sizzle( selector, elem ).length > 0;
			};
		} ),

		"contains": markFunction( function( text ) {
			text = text.replace( runescape, funescape );
			return function( elem ) {
				return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
			};
		} ),

		// "Whether an element is represented by a :lang() selector
		// is based solely on the element's language value
		// being equal to the identifier C,
		// or beginning with the identifier C immediately followed by "-".
		// The matching of C against the element's language value is performed case-insensitively.
		// The identifier C does not have to be a valid language name."
		// http://www.w3.org/TR/selectors/#lang-pseudo
		"lang": markFunction( function( lang ) {

			// lang value must be a valid identifier
			if ( !ridentifier.test( lang || "" ) ) {
				Sizzle.error( "unsupported lang: " + lang );
			}
			lang = lang.replace( runescape, funescape ).toLowerCase();
			return function( elem ) {
				var elemLang;
				do {
					if ( ( elemLang = documentIsHTML ?
						elem.lang :
						elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {

						elemLang = elemLang.toLowerCase();
						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
					}
				} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
				return false;
			};
		} ),

		// Miscellaneous
		"target": function( elem ) {
			var hash = window.location && window.location.hash;
			return hash && hash.slice( 1 ) === elem.id;
		},

		"root": function( elem ) {
			return elem === docElem;
		},

		"focus": function( elem ) {
			return elem === document.activeElement &&
				( !document.hasFocus || document.hasFocus() ) &&
				!!( elem.type || elem.href || ~elem.tabIndex );
		},

		// Boolean properties
		"enabled": createDisabledPseudo( false ),
		"disabled": createDisabledPseudo( true ),

		"checked": function( elem ) {

			// In CSS3, :checked should return both checked and selected elements
			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
			var nodeName = elem.nodeName.toLowerCase();
			return ( nodeName === "input" && !!elem.checked ) ||
				( nodeName === "option" && !!elem.selected );
		},

		"selected": function( elem ) {

			// Accessing this property makes selected-by-default
			// options in Safari work properly
			if ( elem.parentNode ) {
				// eslint-disable-next-line no-unused-expressions
				elem.parentNode.selectedIndex;
			}

			return elem.selected === true;
		},

		// Contents
		"empty": function( elem ) {

			// http://www.w3.org/TR/selectors/#empty-pseudo
			// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
			//   but not by others (comment: 8; processing instruction: 7; etc.)
			// nodeType < 6 works because attributes (2) do not appear as children
			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
				if ( elem.nodeType < 6 ) {
					return false;
				}
			}
			return true;
		},

		"parent": function( elem ) {
			return !Expr.pseudos[ "empty" ]( elem );
		},

		// Element/input types
		"header": function( elem ) {
			return rheader.test( elem.nodeName );
		},

		"input": function( elem ) {
			return rinputs.test( elem.nodeName );
		},

		"button": function( elem ) {
			var name = elem.nodeName.toLowerCase();
			return name === "input" && elem.type === "button" || name === "button";
		},

		"text": function( elem ) {
			var attr;
			return elem.nodeName.toLowerCase() === "input" &&
				elem.type === "text" &&

				// Support: IE <10 only
				// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
				( ( attr = elem.getAttribute( "type" ) ) == null ||
					attr.toLowerCase() === "text" );
		},

		// Position-in-collection
		"first": createPositionalPseudo( function() {
			return [ 0 ];
		} ),

		"last": createPositionalPseudo( function( _matchIndexes, length ) {
			return [ length - 1 ];
		} ),

		"eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
			return [ argument < 0 ? argument + length : argument ];
		} ),

		"even": createPositionalPseudo( function( matchIndexes, length ) {
			var i = 0;
			for ( ; i < length; i += 2 ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		} ),

		"odd": createPositionalPseudo( function( matchIndexes, length ) {
			var i = 1;
			for ( ; i < length; i += 2 ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		} ),

		"lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
			var i = argument < 0 ?
				argument + length :
				argument > length ?
					length :
					argument;
			for ( ; --i >= 0; ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		} ),

		"gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
			var i = argument < 0 ? argument + length : argument;
			for ( ; ++i < length; ) {
				matchIndexes.push( i );
			}
			return matchIndexes;
		} )
	}
};

Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];

// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
	Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
	Expr.pseudos[ i ] = createButtonPseudo( i );
}

// Easy API for creating new setFilters
function setFilters() {}
setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters();

tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
	var matched, match, tokens, type,
		soFar, groups, preFilters,
		cached = tokenCache[ selector + " " ];

	if ( cached ) {
		return parseOnly ? 0 : cached.slice( 0 );
	}

	soFar = selector;
	groups = [];
	preFilters = Expr.preFilter;

	while ( soFar ) {

		// Comma and first run
		if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
			if ( match ) {

				// Don't consume trailing commas as valid
				soFar = soFar.slice( match[ 0 ].length ) || soFar;
			}
			groups.push( ( tokens = [] ) );
		}

		matched = false;

		// Combinators
		if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
			matched = match.shift();
			tokens.push( {
				value: matched,

				// Cast descendant combinators to space
				type: match[ 0 ].replace( rtrim, " " )
			} );
			soFar = soFar.slice( matched.length );
		}

		// Filters
		for ( type in Expr.filter ) {
			if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
				( match = preFilters[ type ]( match ) ) ) ) {
				matched = match.shift();
				tokens.push( {
					value: matched,
					type: type,
					matches: match
				} );
				soFar = soFar.slice( matched.length );
			}
		}

		if ( !matched ) {
			break;
		}
	}

	// Return the length of the invalid excess
	// if we're just parsing
	// Otherwise, throw an error or return tokens
	return parseOnly ?
		soFar.length :
		soFar ?
			Sizzle.error( selector ) :

			// Cache the tokens
			tokenCache( selector, groups ).slice( 0 );
};

function toSelector( tokens ) {
	var i = 0,
		len = tokens.length,
		selector = "";
	for ( ; i < len; i++ ) {
		selector += tokens[ i ].value;
	}
	return selector;
}

function addCombinator( matcher, combinator, base ) {
	var dir = combinator.dir,
		skip = combinator.next,
		key = skip || dir,
		checkNonElements = base && key === "parentNode",
		doneName = done++;

	return combinator.first ?

		// Check against closest ancestor/preceding element
		function( elem, context, xml ) {
			while ( ( elem = elem[ dir ] ) ) {
				if ( elem.nodeType === 1 || checkNonElements ) {
					return matcher( elem, context, xml );
				}
			}
			return false;
		} :

		// Check against all ancestor/preceding elements
		function( elem, context, xml ) {
			var oldCache, uniqueCache, outerCache,
				newCache = [ dirruns, doneName ];

			// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
			if ( xml ) {
				while ( ( elem = elem[ dir ] ) ) {
					if ( elem.nodeType === 1 || checkNonElements ) {
						if ( matcher( elem, context, xml ) ) {
							return true;
						}
					}
				}
			} else {
				while ( ( elem = elem[ dir ] ) ) {
					if ( elem.nodeType === 1 || checkNonElements ) {
						outerCache = elem[ expando ] || ( elem[ expando ] = {} );

						// Support: IE <9 only
						// Defend against cloned attroperties (jQuery gh-1709)
						uniqueCache = outerCache[ elem.uniqueID ] ||
							( outerCache[ elem.uniqueID ] = {} );

						if ( skip && skip === elem.nodeName.toLowerCase() ) {
							elem = elem[ dir ] || elem;
						} else if ( ( oldCache = uniqueCache[ key ] ) &&
							oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {

							// Assign to newCache so results back-propagate to previous elements
							return ( newCache[ 2 ] = oldCache[ 2 ] );
						} else {

							// Reuse newcache so results back-propagate to previous elements
							uniqueCache[ key ] = newCache;

							// A match means we're done; a fail means we have to keep checking
							if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
								return true;
							}
						}
					}
				}
			}
			return false;
		};
}

function elementMatcher( matchers ) {
	return matchers.length > 1 ?
		function( elem, context, xml ) {
			var i = matchers.length;
			while ( i-- ) {
				if ( !matchers[ i ]( elem, context, xml ) ) {
					return false;
				}
			}
			return true;
		} :
		matchers[ 0 ];
}

function multipleContexts( selector, contexts, results ) {
	var i = 0,
		len = contexts.length;
	for ( ; i < len; i++ ) {
		Sizzle( selector, contexts[ i ], results );
	}
	return results;
}

function condense( unmatched, map, filter, context, xml ) {
	var elem,
		newUnmatched = [],
		i = 0,
		len = unmatched.length,
		mapped = map != null;

	for ( ; i < len; i++ ) {
		if ( ( elem = unmatched[ i ] ) ) {
			if ( !filter || filter( elem, context, xml ) ) {
				newUnmatched.push( elem );
				if ( mapped ) {
					map.push( i );
				}
			}
		}
	}

	return newUnmatched;
}

function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
	if ( postFilter && !postFilter[ expando ] ) {
		postFilter = setMatcher( postFilter );
	}
	if ( postFinder && !postFinder[ expando ] ) {
		postFinder = setMatcher( postFinder, postSelector );
	}
	return markFunction( function( seed, results, context, xml ) {
		var temp, i, elem,
			preMap = [],
			postMap = [],
			preexisting = results.length,

			// Get initial elements from seed or context
			elems = seed || multipleContexts(
				selector || "*",
				context.nodeType ? [ context ] : context,
				[]
			),

			// Prefilter to get matcher input, preserving a map for seed-results synchronization
			matcherIn = preFilter && ( seed || !selector ) ?
				condense( elems, preMap, preFilter, context, xml ) :
				elems,

			matcherOut = matcher ?

				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?

					// ...intermediate processing is necessary
					[] :

					// ...otherwise use results directly
					results :
				matcherIn;

		// Find primary matches
		if ( matcher ) {
			matcher( matcherIn, matcherOut, context, xml );
		}

		// Apply postFilter
		if ( postFilter ) {
			temp = condense( matcherOut, postMap );
			postFilter( temp, [], context, xml );

			// Un-match failing elements by moving them back to matcherIn
			i = temp.length;
			while ( i-- ) {
				if ( ( elem = temp[ i ] ) ) {
					matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
				}
			}
		}

		if ( seed ) {
			if ( postFinder || preFilter ) {
				if ( postFinder ) {

					// Get the final matcherOut by condensing this intermediate into postFinder contexts
					temp = [];
					i = matcherOut.length;
					while ( i-- ) {
						if ( ( elem = matcherOut[ i ] ) ) {

							// Restore matcherIn since elem is not yet a final match
							temp.push( ( matcherIn[ i ] = elem ) );
						}
					}
					postFinder( null, ( matcherOut = [] ), temp, xml );
				}

				// Move matched elements from seed to results to keep them synchronized
				i = matcherOut.length;
				while ( i-- ) {
					if ( ( elem = matcherOut[ i ] ) &&
						( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {

						seed[ temp ] = !( results[ temp ] = elem );
					}
				}
			}

		// Add elements to results, through postFinder if defined
		} else {
			matcherOut = condense(
				matcherOut === results ?
					matcherOut.splice( preexisting, matcherOut.length ) :
					matcherOut
			);
			if ( postFinder ) {
				postFinder( null, results, matcherOut, xml );
			} else {
				push.apply( results, matcherOut );
			}
		}
	} );
}

function matcherFromTokens( tokens ) {
	var checkContext, matcher, j,
		len = tokens.length,
		leadingRelative = Expr.relative[ tokens[ 0 ].type ],
		implicitRelative = leadingRelative || Expr.relative[ " " ],
		i = leadingRelative ? 1 : 0,

		// The foundational matcher ensures that elements are reachable from top-level context(s)
		matchContext = addCombinator( function( elem ) {
			return elem === checkContext;
		}, implicitRelative, true ),
		matchAnyContext = addCombinator( function( elem ) {
			return indexOf( checkContext, elem ) > -1;
		}, implicitRelative, true ),
		matchers = [ function( elem, context, xml ) {
			var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
				( checkContext = context ).nodeType ?
					matchContext( elem, context, xml ) :
					matchAnyContext( elem, context, xml ) );

			// Avoid hanging onto element (issue #299)
			checkContext = null;
			return ret;
		} ];

	for ( ; i < len; i++ ) {
		if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
			matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
		} else {
			matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );

			// Return special upon seeing a positional matcher
			if ( matcher[ expando ] ) {

				// Find the next relative operator (if any) for proper handling
				j = ++i;
				for ( ; j < len; j++ ) {
					if ( Expr.relative[ tokens[ j ].type ] ) {
						break;
					}
				}
				return setMatcher(
					i > 1 && elementMatcher( matchers ),
					i > 1 && toSelector(

					// If the preceding token was a descendant combinator, insert an implicit any-element `*`
					tokens
						.slice( 0, i - 1 )
						.concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
					).replace( rtrim, "$1" ),
					matcher,
					i < j && matcherFromTokens( tokens.slice( i, j ) ),
					j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
					j < len && toSelector( tokens )
				);
			}
			matchers.push( matcher );
		}
	}

	return elementMatcher( matchers );
}

function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
	var bySet = setMatchers.length > 0,
		byElement = elementMatchers.length > 0,
		superMatcher = function( seed, context, xml, results, outermost ) {
			var elem, j, matcher,
				matchedCount = 0,
				i = "0",
				unmatched = seed && [],
				setMatched = [],
				contextBackup = outermostContext,

				// We must always have either seed elements or outermost context
				elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),

				// Use integer dirruns iff this is the outermost matcher
				dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
				len = elems.length;

			if ( outermost ) {

				// Support: IE 11+, Edge 17 - 18+
				// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
				// two documents; shallow comparisons work.
				// eslint-disable-next-line eqeqeq
				outermostContext = context == document || context || outermost;
			}

			// Add elements passing elementMatchers directly to results
			// Support: IE<9, Safari
			// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
			for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
				if ( byElement && elem ) {
					j = 0;

					// Support: IE 11+, Edge 17 - 18+
					// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
					// two documents; shallow comparisons work.
					// eslint-disable-next-line eqeqeq
					if ( !context && elem.ownerDocument != document ) {
						setDocument( elem );
						xml = !documentIsHTML;
					}
					while ( ( matcher = elementMatchers[ j++ ] ) ) {
						if ( matcher( elem, context || document, xml ) ) {
							results.push( elem );
							break;
						}
					}
					if ( outermost ) {
						dirruns = dirrunsUnique;
					}
				}

				// Track unmatched elements for set filters
				if ( bySet ) {

					// They will have gone through all possible matchers
					if ( ( elem = !matcher && elem ) ) {
						matchedCount--;
					}

					// Lengthen the array for every element, matched or not
					if ( seed ) {
						unmatched.push( elem );
					}
				}
			}

			// `i` is now the count of elements visited above, and adding it to `matchedCount`
			// makes the latter nonnegative.
			matchedCount += i;

			// Apply set filters to unmatched elements
			// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
			// equals `i`), unless we didn't visit _any_ elements in the above loop because we have
			// no element matchers and no seed.
			// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
			// case, which will result in a "00" `matchedCount` that differs from `i` but is also
			// numerically zero.
			if ( bySet && i !== matchedCount ) {
				j = 0;
				while ( ( matcher = setMatchers[ j++ ] ) ) {
					matcher( unmatched, setMatched, context, xml );
				}

				if ( seed ) {

					// Reintegrate element matches to eliminate the need for sorting
					if ( matchedCount > 0 ) {
						while ( i-- ) {
							if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
								setMatched[ i ] = pop.call( results );
							}
						}
					}

					// Discard index placeholder values to get only actual matches
					setMatched = condense( setMatched );
				}

				// Add matches to results
				push.apply( results, setMatched );

				// Seedless set matches succeeding multiple successful matchers stipulate sorting
				if ( outermost && !seed && setMatched.length > 0 &&
					( matchedCount + setMatchers.length ) > 1 ) {

					Sizzle.uniqueSort( results );
				}
			}

			// Override manipulation of globals by nested matchers
			if ( outermost ) {
				dirruns = dirrunsUnique;
				outermostContext = contextBackup;
			}

			return unmatched;
		};

	return bySet ?
		markFunction( superMatcher ) :
		superMatcher;
}

compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
	var i,
		setMatchers = [],
		elementMatchers = [],
		cached = compilerCache[ selector + " " ];

	if ( !cached ) {

		// Generate a function of recursive functions that can be used to check each element
		if ( !match ) {
			match = tokenize( selector );
		}
		i = match.length;
		while ( i-- ) {
			cached = matcherFromTokens( match[ i ] );
			if ( cached[ expando ] ) {
				setMatchers.push( cached );
			} else {
				elementMatchers.push( cached );
			}
		}

		// Cache the compiled function
		cached = compilerCache(
			selector,
			matcherFromGroupMatchers( elementMatchers, setMatchers )
		);

		// Save selector and tokenization
		cached.selector = selector;
	}
	return cached;
};

/**
 * A low-level selection function that works with Sizzle's compiled
 *  selector functions
 * @param {String|Function} selector A selector or a pre-compiled
 *  selector function built with Sizzle.compile
 * @param {Element} context
 * @param {Array} [results]
 * @param {Array} [seed] A set of elements to match against
 */
select = Sizzle.select = function( selector, context, results, seed ) {
	var i, tokens, token, type, find,
		compiled = typeof selector === "function" && selector,
		match = !seed && tokenize( ( selector = compiled.selector || selector ) );

	results = results || [];

	// Try to minimize operations if there is only one selector in the list and no seed
	// (the latter of which guarantees us context)
	if ( match.length === 1 ) {

		// Reduce context if the leading compound selector is an ID
		tokens = match[ 0 ] = match[ 0 ].slice( 0 );
		if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
			context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {

			context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
				.replace( runescape, funescape ), context ) || [] )[ 0 ];
			if ( !context ) {
				return results;

			// Precompiled matchers will still verify ancestry, so step up a level
			} else if ( compiled ) {
				context = context.parentNode;
			}

			selector = selector.slice( tokens.shift().value.length );
		}

		// Fetch a seed set for right-to-left matching
		i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
		while ( i-- ) {
			token = tokens[ i ];

			// Abort if we hit a combinator
			if ( Expr.relative[ ( type = token.type ) ] ) {
				break;
			}
			if ( ( find = Expr.find[ type ] ) ) {

				// Search, expanding context for leading sibling combinators
				if ( ( seed = find(
					token.matches[ 0 ].replace( runescape, funescape ),
					rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
						context
				) ) ) {

					// If seed is empty or no tokens remain, we can return early
					tokens.splice( i, 1 );
					selector = seed.length && toSelector( tokens );
					if ( !selector ) {
						push.apply( results, seed );
						return results;
					}

					break;
				}
			}
		}
	}

	// Compile and execute a filtering function if one is not provided
	// Provide `match` to avoid retokenization if we modified the selector above
	( compiled || compile( selector, match ) )(
		seed,
		context,
		!documentIsHTML,
		results,
		!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
	);
	return results;
};

// One-time assignments

// Sort stability
support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;

// Support: Chrome 14-35+
// Always assume duplicates if they aren't passed to the comparison function
support.detectDuplicates = !!hasDuplicate;

// Initialize against the default document
setDocument();

// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
// Detached nodes confoundingly follow *each other*
support.sortDetached = assert( function( el ) {

	// Should return 1, but returns 4 (following)
	return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
} );

// Support: IE<8
// Prevent attribute/property "interpolation"
// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !assert( function( el ) {
	el.innerHTML = "<a href='#'></a>";
	return el.firstChild.getAttribute( "href" ) === "#";
} ) ) {
	addHandle( "type|href|height|width", function( elem, name, isXML ) {
		if ( !isXML ) {
			return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
		}
	} );
}

// Support: IE<9
// Use defaultValue in place of getAttribute("value")
if ( !support.attributes || !assert( function( el ) {
	el.innerHTML = "<input/>";
	el.firstChild.setAttribute( "value", "" );
	return el.firstChild.getAttribute( "value" ) === "";
} ) ) {
	addHandle( "value", function( elem, _name, isXML ) {
		if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
			return elem.defaultValue;
		}
	} );
}

// Support: IE<9
// Use getAttributeNode to fetch booleans when getAttribute lies
if ( !assert( function( el ) {
	return el.getAttribute( "disabled" ) == null;
} ) ) {
	addHandle( booleans, function( elem, name, isXML ) {
		var val;
		if ( !isXML ) {
			return elem[ name ] === true ? name.toLowerCase() :
				( val = elem.getAttributeNode( name ) ) && val.specified ?
					val.value :
					null;
		}
	} );
}

// EXPOSE
var _sizzle = window.Sizzle;

Sizzle.noConflict = function() {
	if ( window.Sizzle === Sizzle ) {
		window.Sizzle = _sizzle;
	}

	return Sizzle;
};

if ( true ) {
	!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
		return Sizzle;
	}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));

// Sizzle requires that there be a global window in Common-JS like environments
} else // removed by dead control flow
{}

// EXPOSE

} )( window );


/***/ }),

/***/ "./node_modules/sprintf-js/src/sprintf.js":
/*!************************************************!*\
  !*** ./node_modules/sprintf-js/src/sprintf.js ***!
  \************************************************/
/***/ ((module, exports, __webpack_require__) => {

var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */ !function() {
    'use strict';
    var re = {
        not_string: /[^s]/,
        not_bool: /[^t]/,
        not_type: /[^T]/,
        not_primitive: /[^v]/,
        number: /[diefg]/,
        numeric_arg: /[bcdiefguxX]/,
        json: /[j]/,
        not_json: /[^j]/,
        text: /^[^\x25]+/,
        modulo: /^\x25{2}/,
        placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
        key: /^([a-z_][a-z_\d]*)/i,
        key_access: /^\.([a-z_][a-z_\d]*)/i,
        index_access: /^\[(\d+)\]/,
        sign: /^[+-]/
    };
    function sprintf(key) {
        // `arguments` is not an array, but should be fine for this call
        return sprintf_format(sprintf_parse(key), arguments);
    }
    function vsprintf(fmt, argv) {
        return sprintf.apply(null, [
            fmt
        ].concat(argv || []));
    }
    function sprintf_format(parse_tree, argv) {
        var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign;
        for(i = 0; i < tree_length; i++){
            if (typeof parse_tree[i] === 'string') {
                output += parse_tree[i];
            } else if (typeof parse_tree[i] === 'object') {
                ph = parse_tree[i]; // convenience purposes only
                if (ph.keys) {
                    arg = argv[cursor];
                    for(k = 0; k < ph.keys.length; k++){
                        if (arg == undefined) {
                            throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k - 1]));
                        }
                        arg = arg[ph.keys[k]];
                    }
                } else if (ph.param_no) {
                    arg = argv[ph.param_no];
                } else {
                    arg = argv[cursor++];
                }
                if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
                    arg = arg();
                }
                if (re.numeric_arg.test(ph.type) && typeof arg !== 'number' && isNaN(arg)) {
                    throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg));
                }
                if (re.number.test(ph.type)) {
                    is_positive = arg >= 0;
                }
                switch(ph.type){
                    case 'b':
                        arg = parseInt(arg, 10).toString(2);
                        break;
                    case 'c':
                        arg = String.fromCharCode(parseInt(arg, 10));
                        break;
                    case 'd':
                    case 'i':
                        arg = parseInt(arg, 10);
                        break;
                    case 'j':
                        arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0);
                        break;
                    case 'e':
                        arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential();
                        break;
                    case 'f':
                        arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg);
                        break;
                    case 'g':
                        arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg);
                        break;
                    case 'o':
                        arg = (parseInt(arg, 10) >>> 0).toString(8);
                        break;
                    case 's':
                        arg = String(arg);
                        arg = ph.precision ? arg.substring(0, ph.precision) : arg;
                        break;
                    case 't':
                        arg = String(!!arg);
                        arg = ph.precision ? arg.substring(0, ph.precision) : arg;
                        break;
                    case 'T':
                        arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase();
                        arg = ph.precision ? arg.substring(0, ph.precision) : arg;
                        break;
                    case 'u':
                        arg = parseInt(arg, 10) >>> 0;
                        break;
                    case 'v':
                        arg = arg.valueOf();
                        arg = ph.precision ? arg.substring(0, ph.precision) : arg;
                        break;
                    case 'x':
                        arg = (parseInt(arg, 10) >>> 0).toString(16);
                        break;
                    case 'X':
                        arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase();
                        break;
                }
                if (re.json.test(ph.type)) {
                    output += arg;
                } else {
                    if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
                        sign = is_positive ? '+' : '-';
                        arg = arg.toString().replace(re.sign, '');
                    } else {
                        sign = '';
                    }
                    pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ';
                    pad_length = ph.width - (sign + arg).length;
                    pad = ph.width ? pad_length > 0 ? pad_character.repeat(pad_length) : '' : '';
                    output += ph.align ? sign + arg + pad : pad_character === '0' ? sign + pad + arg : pad + sign + arg;
                }
            }
        }
        return output;
    }
    var sprintf_cache = Object.create(null);
    function sprintf_parse(fmt) {
        if (sprintf_cache[fmt]) {
            return sprintf_cache[fmt];
        }
        var _fmt = fmt, match, parse_tree = [], arg_names = 0;
        while(_fmt){
            if ((match = re.text.exec(_fmt)) !== null) {
                parse_tree.push(match[0]);
            } else if ((match = re.modulo.exec(_fmt)) !== null) {
                parse_tree.push('%');
            } else if ((match = re.placeholder.exec(_fmt)) !== null) {
                if (match[2]) {
                    arg_names |= 1;
                    var field_list = [], replacement_field = match[2], field_match = [];
                    if ((field_match = re.key.exec(replacement_field)) !== null) {
                        field_list.push(field_match[1]);
                        while((replacement_field = replacement_field.substring(field_match[0].length)) !== ''){
                            if ((field_match = re.key_access.exec(replacement_field)) !== null) {
                                field_list.push(field_match[1]);
                            } else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
                                field_list.push(field_match[1]);
                            } else {
                                throw new SyntaxError('[sprintf] failed to parse named argument key');
                            }
                        }
                    } else {
                        throw new SyntaxError('[sprintf] failed to parse named argument key');
                    }
                    match[2] = field_list;
                } else {
                    arg_names |= 2;
                }
                if (arg_names === 3) {
                    throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported');
                }
                parse_tree.push({
                    placeholder: match[0],
                    param_no: match[1],
                    keys: match[2],
                    sign: match[3],
                    pad_char: match[4],
                    align: match[5],
                    width: match[6],
                    precision: match[7],
                    type: match[8]
                });
            } else {
                throw new SyntaxError('[sprintf] unexpected placeholder');
            }
            _fmt = _fmt.substring(match[0].length);
        }
        return sprintf_cache[fmt] = parse_tree;
    }
    /**
     * export to either browser or node.js
     */ /* eslint-disable quote-props */ if (true) {
        exports.sprintf = sprintf;
        exports.vsprintf = vsprintf;
    }
    if (typeof window !== 'undefined') {
        window['sprintf'] = sprintf;
        window['vsprintf'] = vsprintf;
        if (true) {
            !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
                return {
                    'sprintf': sprintf,
                    'vsprintf': vsprintf
                };
            }).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
        }
    }
/* eslint-enable quote-props */ }(); // eslint-disable-line


/***/ }),

/***/ "./node_modules/strophe.js/dist/strophe.browser.esm.js":
/*!*************************************************************!*\
  !*** ./node_modules/strophe.js/dist/strophe.browser.esm.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   $build: () => (/* binding */ $build),
/* harmony export */   $iq: () => (/* binding */ $iq),
/* harmony export */   $msg: () => (/* binding */ $msg),
/* harmony export */   $pres: () => (/* binding */ $pres),
/* harmony export */   Builder: () => (/* binding */ Builder),
/* harmony export */   Request: () => (/* binding */ Request),
/* harmony export */   Stanza: () => (/* binding */ Stanza),
/* harmony export */   Strophe: () => (/* binding */ Strophe),
/* harmony export */   stx: () => (/* binding */ stx),
/* harmony export */   toStanza: () => (/* binding */ toStanza)
/* harmony export */ });
/**
 * Common namespace constants from the XMPP RFCs and XEPs.
 *
 * @typedef { Object } NS
 * @property {string} NS.HTTPBIND - HTTP BIND namespace from XEP 124.
 * @property {string} NS.BOSH - BOSH namespace from XEP 206.
 * @property {string} NS.CLIENT - Main XMPP client namespace.
 * @property {string} NS.AUTH - Legacy authentication namespace.
 * @property {string} NS.ROSTER - Roster operations namespace.
 * @property {string} NS.PROFILE - Profile namespace.
 * @property {string} NS.DISCO_INFO - Service discovery info namespace from XEP 30.
 * @property {string} NS.DISCO_ITEMS - Service discovery items namespace from XEP 30.
 * @property {string} NS.MUC - Multi-User Chat namespace from XEP 45.
 * @property {string} NS.SASL - XMPP SASL namespace from RFC 3920.
 * @property {string} NS.STREAM - XMPP Streams namespace from RFC 3920.
 * @property {string} NS.BIND - XMPP Binding namespace from RFC 3920 and RFC 6120.
 * @property {string} NS.SESSION - XMPP Session namespace from RFC 3920.
 * @property {string} NS.XHTML_IM - XHTML-IM namespace from XEP 71.
 * @property {string} NS.XHTML - XHTML body namespace from XEP 71.
 * @property {string} NS.STANZAS
 * @property {string} NS.FRAMING
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_apply_descriptor_get(receiver, descriptor) {
    if (descriptor.get) {
        return descriptor.get.call(receiver);
    }
    return descriptor.value;
}
function _class_apply_descriptor_set(receiver, descriptor, value) {
    if (descriptor.set) {
        descriptor.set.call(receiver, value);
    } else {
        if (!descriptor.writable) {
            throw new TypeError("attempted to set read only private field");
        }
        descriptor.value = value;
    }
}
function _class_extract_field_descriptor(receiver, privateMap, action) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to " + action + " private field on non-instance");
    }
    return privateMap.get(receiver);
}
function _class_private_field_get(receiver, privateMap) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
    return _class_apply_descriptor_get(receiver, descriptor);
}
function _class_private_field_init(obj, privateMap, value) {
    _check_private_redeclaration(obj, privateMap);
    privateMap.set(obj, value);
}
function _class_private_field_set(receiver, privateMap, value) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
    _class_apply_descriptor_set(receiver, descriptor, value);
    return value;
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
const NS = {
    HTTPBIND: 'http://jabber.org/protocol/httpbind',
    BOSH: 'urn:xmpp:xbosh',
    CLIENT: 'jabber:client',
    SERVER: 'jabber:server',
    AUTH: 'jabber:iq:auth',
    ROSTER: 'jabber:iq:roster',
    PROFILE: 'jabber:iq:profile',
    DISCO_INFO: 'http://jabber.org/protocol/disco#info',
    DISCO_ITEMS: 'http://jabber.org/protocol/disco#items',
    MUC: 'http://jabber.org/protocol/muc',
    SASL: 'urn:ietf:params:xml:ns:xmpp-sasl',
    STREAM: 'http://etherx.jabber.org/streams',
    FRAMING: 'urn:ietf:params:xml:ns:xmpp-framing',
    BIND: 'urn:ietf:params:xml:ns:xmpp-bind',
    SESSION: 'urn:ietf:params:xml:ns:xmpp-session',
    VERSION: 'jabber:iq:version',
    STANZAS: 'urn:ietf:params:xml:ns:xmpp-stanzas',
    XHTML_IM: 'http://jabber.org/protocol/xhtml-im',
    XHTML: 'http://www.w3.org/1999/xhtml'
};
const PARSE_ERROR_NS = 'http://www.w3.org/1999/xhtml';
/**
 * Contains allowed tags, tag attributes, and css properties.
 * Used in the {@link Strophe.createHtml} function to filter incoming html into the allowed XHTML-IM subset.
 * See [XEP-0071](http://xmpp.org/extensions/xep-0071.html#profile-summary) for the list of recommended
 * allowed tags and their attributes.
 */ const XHTML = {
    tags: [
        'a',
        'blockquote',
        'br',
        'cite',
        'em',
        'img',
        'li',
        'ol',
        'p',
        'span',
        'strong',
        'ul',
        'body'
    ],
    attributes: {
        'a': [
            'href'
        ],
        'blockquote': [
            'style'
        ],
        /** @type {never[]} */ 'br': [],
        'cite': [
            'style'
        ],
        /** @type {never[]} */ 'em': [],
        'img': [
            'src',
            'alt',
            'style',
            'height',
            'width'
        ],
        'li': [
            'style'
        ],
        'ol': [
            'style'
        ],
        'p': [
            'style'
        ],
        'span': [
            'style'
        ],
        /** @type {never[]} */ 'strong': [],
        'ul': [
            'style'
        ],
        /** @type {never[]} */ 'body': []
    },
    css: [
        'background-color',
        'color',
        'font-family',
        'font-size',
        'font-style',
        'font-weight',
        'margin-left',
        'margin-right',
        'text-align',
        'text-decoration'
    ]
};
/** @typedef {number} connstatus */ /**
 * Connection status constants for use by the connection handler
 * callback.
 *
 * @typedef {Object} Status
 * @property {connstatus} Status.ERROR - An error has occurred
 * @property {connstatus} Status.CONNECTING - The connection is currently being made
 * @property {connstatus} Status.CONNFAIL - The connection attempt failed
 * @property {connstatus} Status.AUTHENTICATING - The connection is authenticating
 * @property {connstatus} Status.AUTHFAIL - The authentication attempt failed
 * @property {connstatus} Status.CONNECTED - The connection has succeeded
 * @property {connstatus} Status.DISCONNECTED - The connection has been terminated
 * @property {connstatus} Status.DISCONNECTING - The connection is currently being terminated
 * @property {connstatus} Status.ATTACHED - The connection has been attached
 * @property {connstatus} Status.REDIRECT - The connection has been redirected
 * @property {connstatus} Status.CONNTIMEOUT - The connection has timed out
 * @property {connstatus} Status.BINDREQUIRED - The JID resource needs to be bound for this session
 * @property {connstatus} Status.ATTACHFAIL - Failed to attach to a pre-existing session
 * @property {connstatus} Status.RECONNECTING - Not used by Strophe, but added for integrators
 */ const Status = {
    ERROR: 0,
    CONNECTING: 1,
    CONNFAIL: 2,
    AUTHENTICATING: 3,
    AUTHFAIL: 4,
    CONNECTED: 5,
    DISCONNECTED: 6,
    DISCONNECTING: 7,
    ATTACHED: 8,
    REDIRECT: 9,
    CONNTIMEOUT: 10,
    BINDREQUIRED: 11,
    ATTACHFAIL: 12,
    RECONNECTING: 13
};
const ErrorCondition = {
    BAD_FORMAT: 'bad-format',
    CONFLICT: 'conflict',
    MISSING_JID_NODE: 'x-strophe-bad-non-anon-jid',
    NO_AUTH_MECH: 'no-auth-mech',
    UNKNOWN_REASON: 'unknown'
};
/**
 * Logging level indicators.
 * @typedef {0|1|2|3|4} LogLevel
 * @typedef {'DEBUG'|'INFO'|'WARN'|'ERROR'|'FATAL'} LogLevelName
 * @typedef {Record<LogLevelName, LogLevel>} LogLevels
 */ const LOG_LEVELS = {
    DEBUG: 0,
    INFO: 1,
    WARN: 2,
    ERROR: 3,
    FATAL: 4
};
/**
 * DOM element types.
 *
 * - ElementType.NORMAL - Normal element.
 * - ElementType.TEXT - Text data element.
 * - ElementType.FRAGMENT - XHTML fragment element.
 */ const ElementType = {
    NORMAL: 1,
    TEXT: 3,
    CDATA: 4,
    FRAGMENT: 11
};
/**
 * @typedef {import('./constants').LogLevel} LogLevel
 */ let logLevel = LOG_LEVELS.DEBUG;
const log = {
    /**
   * Library consumers can use this function to set the log level of Strophe.
   * The default log level is Strophe.LogLevel.INFO.
   * @param {LogLevel} level
   * @example Strophe.setLogLevel(Strophe.LogLevel.DEBUG);
   */ setLogLevel (level) {
        if (level < LOG_LEVELS.DEBUG || level > LOG_LEVELS.FATAL) {
            throw new Error("Invalid log level supplied to setLogLevel");
        }
        logLevel = level;
    },
    /**
   *
   * Please note that data sent and received over the wire is logged
   * via {@link Strophe.Connection#rawInput|Strophe.Connection.rawInput()}
   * and {@link Strophe.Connection#rawOutput|Strophe.Connection.rawOutput()}.
   *
   * The different levels and their meanings are
   *
   *   DEBUG - Messages useful for debugging purposes.
   *   INFO - Informational messages.  This is mostly information like
   *     'disconnect was called' or 'SASL auth succeeded'.
   *   WARN - Warnings about potential problems.  This is mostly used
   *     to report transient connection errors like request timeouts.
   *   ERROR - Some error occurred.
   *   FATAL - A non-recoverable fatal error occurred.
   *
   * @param {number} level - The log level of the log message.
   *     This will be one of the values in Strophe.LOG_LEVELS.
   * @param {string} msg - The log message.
   */ log (level, msg) {
        if (level < logLevel) {
            return;
        }
        if (level >= LOG_LEVELS.ERROR) {
            var _console;
            (_console = console) === null || _console === void 0 ? void 0 : _console.error(msg);
        } else if (level === LOG_LEVELS.INFO) {
            var _console2;
            (_console2 = console) === null || _console2 === void 0 ? void 0 : _console2.info(msg);
        } else if (level === LOG_LEVELS.WARN) {
            var _console3;
            (_console3 = console) === null || _console3 === void 0 ? void 0 : _console3.warn(msg);
        } else if (level === LOG_LEVELS.DEBUG) {
            var _console4;
            (_console4 = console) === null || _console4 === void 0 ? void 0 : _console4.debug(msg);
        }
    },
    /**
   * Log a message at the Strophe.LOG_LEVELS.DEBUG level.
   * @param {string} msg - The log message.
   */ debug (msg) {
        this.log(LOG_LEVELS.DEBUG, msg);
    },
    /**
   * Log a message at the Strophe.LOG_LEVELS.INFO level.
   * @param {string} msg - The log message.
   */ info (msg) {
        this.log(LOG_LEVELS.INFO, msg);
    },
    /**
   * Log a message at the Strophe.LOG_LEVELS.WARN level.
   * @param {string} msg - The log message.
   */ warn (msg) {
        this.log(LOG_LEVELS.WARN, msg);
    },
    /**
   * Log a message at the Strophe.LOG_LEVELS.ERROR level.
   * @param {string} msg - The log message.
   */ error (msg) {
        this.log(LOG_LEVELS.ERROR, msg);
    },
    /**
   * Log a message at the Strophe.LOG_LEVELS.FATAL level.
   * @param {string} msg - The log message.
   */ fatal (msg) {
        this.log(LOG_LEVELS.FATAL, msg);
    }
};
/* global btoa */ /**
 * Takes a string and turns it into an XML Element.
 * @param {string} string
 * @param {boolean} [throwErrorIfInvalidNS]
 * @returns {Element}
 */ function toElement(string, throwErrorIfInvalidNS) {
    const doc = xmlHtmlNode(string);
    const parserError = getParserError(doc);
    if (parserError) {
        throw new Error(`Parser Error: ${parserError}`);
    }
    const node = getFirstElementChild(doc);
    if ([
        'message',
        'iq',
        'presence'
    ].includes(node.nodeName.toLowerCase()) && node.namespaceURI !== 'jabber:client' && node.namespaceURI !== 'jabber:server') {
        const err_msg = `Invalid namespaceURI ${node.namespaceURI}`;
        if (throwErrorIfInvalidNS) {
            throw new Error(err_msg);
        } else {
            log.error(err_msg);
        }
    }
    return node;
}
/**
 * Properly logs an error to the console
 * @param {Error} e
 */ function handleError(e) {
    if (typeof e.stack !== 'undefined') {
        log.fatal(e.stack);
    }
    log.fatal('error: ' + e.message);
}
/**
 * @param {string} str
 * @return {string}
 */ function utf16to8(str) {
    let out = '';
    const len = str.length;
    for(let i = 0; i < len; i++){
        const c = str.charCodeAt(i);
        if (c >= 0x0000 && c <= 0x007f) {
            out += str.charAt(i);
        } else if (c > 0x07ff) {
            out += String.fromCharCode(0xe0 | c >> 12 & 0x0f);
            out += String.fromCharCode(0x80 | c >> 6 & 0x3f);
            out += String.fromCharCode(0x80 | c >> 0 & 0x3f);
        } else {
            out += String.fromCharCode(0xc0 | c >> 6 & 0x1f);
            out += String.fromCharCode(0x80 | c >> 0 & 0x3f);
        }
    }
    return out;
}
/**
 * @param {ArrayBufferLike} x
 * @param {ArrayBufferLike} y
 */ function xorArrayBuffers(x, y) {
    const xIntArray = new Uint8Array(x);
    const yIntArray = new Uint8Array(y);
    const zIntArray = new Uint8Array(x.byteLength);
    for(let i = 0; i < x.byteLength; i++){
        zIntArray[i] = xIntArray[i] ^ yIntArray[i];
    }
    return zIntArray.buffer;
}
/**
 * @param {ArrayBufferLike} buffer
 * @return {string}
 */ function arrayBufToBase64(buffer) {
    // This function is due to mobz (https://stackoverflow.com/users/1234628/mobz)
    // and Emmanuel (https://stackoverflow.com/users/288564/emmanuel)
    let binary = '';
    const bytes = new Uint8Array(buffer);
    const len = bytes.byteLength;
    for(let i = 0; i < len; i++){
        binary += String.fromCharCode(bytes[i]);
    }
    return btoa(binary);
}
/**
 * @param {string} str
 * @return {ArrayBufferLike}
 */ function base64ToArrayBuf(str) {
    var _Uint8Array$from;
    return (_Uint8Array$from = Uint8Array.from(atob(str), (c)=>c.charCodeAt(0))) === null || _Uint8Array$from === void 0 ? void 0 : _Uint8Array$from.buffer;
}
/**
 * @param {string} str
 * @return {ArrayBufferLike}
 */ function stringToArrayBuf(str) {
    const bytes = new TextEncoder().encode(str);
    return bytes.buffer;
}
/**
 * @param {Cookies} cookies
 */ function addCookies(cookies) {
    if (typeof document === 'undefined') {
        log.error(`addCookies: not adding any cookies, since there's no document object`);
    }
    /**
   * @typedef {Object.<string, string>} Cookie
   *
   * A map of cookie names to string values or to maps of cookie values.
   * @typedef {Cookie|Object.<string, Cookie>} Cookies
   *
   * For example:
   * { "myCookie": "1234" }
   *
   * or:
   * { "myCookie": {
   *    "value": "1234",
   *    "domain": ".example.org",
   *    "path": "/",
   *    "expires": expirationDate
   *    }
   * }
   *
   * These values get passed to {@link Strophe.Connection} via options.cookies
   */ cookies = cookies || {};
    for(const cookieName in cookies){
        if (Object.prototype.hasOwnProperty.call(cookies, cookieName)) {
            let expires = '';
            let domain = '';
            let path = '';
            const cookieObj = cookies[cookieName];
            const isObj = typeof cookieObj === 'object';
            const cookieValue = escape(unescape(isObj ? cookieObj.value : cookieObj));
            if (isObj) {
                expires = cookieObj.expires ? ';expires=' + cookieObj.expires : '';
                domain = cookieObj.domain ? ';domain=' + cookieObj.domain : '';
                path = cookieObj.path ? ';path=' + cookieObj.path : '';
            }
            document.cookie = cookieName + '=' + cookieValue + expires + domain + path;
        }
    }
}
/** @type {Document} */ let _xmlGenerator = null;
/**
 * Get the DOM document to generate elements.
 * @return {Document} - The currently used DOM document.
 */ function xmlGenerator() {
    if (!_xmlGenerator) {
        _xmlGenerator = document.implementation.createDocument('jabber:client', 'strophe', null);
    }
    return _xmlGenerator;
}
/**
 * Creates an XML DOM text node.
 * Provides a cross implementation version of document.createTextNode.
 * @param {string} text - The content of the text node.
 * @return {Text} - A new XML DOM text node.
 */ function xmlTextNode(text) {
    return xmlGenerator().createTextNode(text);
}
/**
 * @param {Element} stanza
 * @return {Element}
 */ function stripWhitespace(stanza) {
    const childNodes = Array.from(stanza.childNodes);
    if (childNodes.length === 1 && childNodes[0].nodeType === ElementType.TEXT) {
        // If the element has only one child and it's a text node, we assume
        // it's significant and don't remove it, even if it's only whitespace.
        return stanza;
    }
    childNodes.forEach((node)=>{
        if (node.nodeName.toLowerCase() === 'body') {
            // We don't remove anything inside <body> elements
            return;
        }
        if (node.nodeType === ElementType.TEXT && !/\S/.test(node.nodeValue)) {
            stanza.removeChild(node);
        } else if (node.nodeType === ElementType.NORMAL) {
            stripWhitespace(/** @type {Element} */ node);
        }
    });
    return stanza;
}
/**
 * Creates an XML DOM node.
 * @param {string} text - The contents of the XML element.
 * @return {XMLDocument}
 */ function xmlHtmlNode(text) {
    const parser = new DOMParser();
    return parser.parseFromString(text, 'text/xml');
}
/**
 * @param {XMLDocument} doc
 * @returns {string|null}
 */ function getParserError(doc) {
    var _doc$firstElementChil;
    const el = ((_doc$firstElementChil = doc.firstElementChild) === null || _doc$firstElementChil === void 0 ? void 0 : _doc$firstElementChil.nodeName) === 'parsererror' ? doc.firstElementChild : doc.getElementsByTagNameNS(PARSE_ERROR_NS, 'parsererror')[0];
    return (el === null || el === void 0 ? void 0 : el.nodeName) === 'parsererror' ? el === null || el === void 0 ? void 0 : el.textContent : null;
}
/**
 * @param {XMLDocument} el
 * @returns {Element}
 */ function getFirstElementChild(el) {
    if (el.firstElementChild) return el.firstElementChild;
    let node, i = 0;
    const nodes = el.childNodes;
    while(node = nodes[i++]){
        if (node.nodeType === 1) return /** @type {Element} */ node;
    }
    return null;
}
/**
 * Create an XML DOM element.
 *
 * This function creates an XML DOM element correctly across all
 * implementations. Note that these are not HTML DOM elements, which
 * aren't appropriate for XMPP stanzas.
 *
 * @param {string} name - The name for the element.
 * @param {Array<Array<string>>|Object.<string,string|number>|string|number} [attrs]
 *    An optional array or object containing
 *    key/value pairs to use as element attributes.
 *    The object should be in the format `{'key': 'value'}`.
 *    The array should have the format `[['key1', 'value1'], ['key2', 'value2']]`.
 * @param {string|number} [text] - The text child data for the element.
 *
 * @return {Element} A new XML DOM element.
 */ function xmlElement(name, attrs, text) {
    if (!name) return null;
    const node = xmlGenerator().createElement(name);
    if (text && (typeof text === 'string' || typeof text === 'number')) {
        node.appendChild(xmlTextNode(text.toString()));
    } else if (typeof attrs === 'string' || typeof attrs === 'number') {
        node.appendChild(xmlTextNode(/** @type {number|string} */ attrs.toString()));
        return node;
    }
    if (!attrs) {
        return node;
    } else if (Array.isArray(attrs)) {
        for (const attr of attrs){
            if (Array.isArray(attr)) {
                // eslint-disable-next-line no-eq-null
                if (attr[0] != null && attr[1] != null) {
                    node.setAttribute(attr[0], attr[1]);
                }
            }
        }
    } else if (typeof attrs === 'object') {
        for (const k of Object.keys(attrs)){
            // eslint-disable-next-line no-eq-null
            if (k && attrs[k] != null) {
                node.setAttribute(k, attrs[k].toString());
            }
        }
    }
    return node;
}
/**
 * Utility method to determine whether a tag is allowed
 * in the XHTML_IM namespace.
 *
 * XHTML tag names are case sensitive and must be lower case.
 * @method Strophe.XHTML.validTag
 * @param {string} tag
 */ function validTag(tag) {
    for(let i = 0; i < XHTML.tags.length; i++){
        if (tag === XHTML.tags[i]) {
            return true;
        }
    }
    return false;
}
/**
 * @typedef {'a'|'blockquote'|'br'|'cite'|'em'|'img'|'li'|'ol'|'p'|'span'|'strong'|'ul'|'body'} XHTMLAttrs
 */ /**
 * Utility method to determine whether an attribute is allowed
 * as recommended per XEP-0071
 *
 * XHTML attribute names are case sensitive and must be lower case.
 * @method Strophe.XHTML.validAttribute
 * @param {string} tag
 * @param {string} attribute
 */ function validAttribute(tag, attribute) {
    const attrs = XHTML.attributes[/** @type {XHTMLAttrs} */ tag];
    if ((attrs === null || attrs === void 0 ? void 0 : attrs.length) > 0) {
        for(let i = 0; i < attrs.length; i++){
            if (attribute === attrs[i]) {
                return true;
            }
        }
    }
    return false;
}
/**
 * @method Strophe.XHTML.validCSS
 * @param {string} style
 */ function validCSS(style) {
    for(let i = 0; i < XHTML.css.length; i++){
        if (style === XHTML.css[i]) {
            return true;
        }
    }
    return false;
}
/**
 * Copy an HTML DOM Element into an XML DOM.
 * This function copies a DOM element and all its descendants and returns
 * the new copy.
 * @param {HTMLElement} elem - A DOM element.
 * @return {Node} - A new, copied DOM element tree.
 */ function createFromHtmlElement(elem) {
    let el;
    const tag = elem.nodeName.toLowerCase(); // XHTML tags must be lower case.
    if (validTag(tag)) {
        try {
            el = xmlElement(tag);
            if (tag in XHTML.attributes) {
                const attrs = XHTML.attributes[/** @type {XHTMLAttrs} */ tag];
                for(let i = 0; i < attrs.length; i++){
                    const attribute = attrs[i];
                    let value = elem.getAttribute(attribute);
                    if (typeof value === 'undefined' || value === null || value === '') {
                        continue;
                    }
                    if (attribute === 'style' && typeof value === 'object') {
                        var _value$cssText;
                        value = /** @type {Object.<'csstext',string>} */ (_value$cssText = value.cssText) !== null && _value$cssText !== void 0 ? _value$cssText : value; // we're dealing with IE, need to get CSS out
                    }
                    // filter out invalid css styles
                    if (attribute === 'style') {
                        const css = [];
                        const cssAttrs = value.split(';');
                        for(let j = 0; j < cssAttrs.length; j++){
                            const attr = cssAttrs[j].split(':');
                            const cssName = attr[0].replace(/^\s*/, '').replace(/\s*$/, '').toLowerCase();
                            if (validCSS(cssName)) {
                                const cssValue = attr[1].replace(/^\s*/, '').replace(/\s*$/, '');
                                css.push(cssName + ': ' + cssValue);
                            }
                        }
                        if (css.length > 0) {
                            value = css.join('; ');
                            el.setAttribute(attribute, value);
                        }
                    } else {
                        el.setAttribute(attribute, value);
                    }
                }
                for(let i = 0; i < elem.childNodes.length; i++){
                    el.appendChild(createHtml(elem.childNodes[i]));
                }
            }
        } catch (_e) {
            // invalid elements
            el = xmlTextNode('');
        }
    } else {
        el = xmlGenerator().createDocumentFragment();
        for(let i = 0; i < elem.childNodes.length; i++){
            el.appendChild(createHtml(elem.childNodes[i]));
        }
    }
    return el;
}
/**
 * Copy an HTML DOM Node into an XML DOM.
 * This function copies a DOM element and all its descendants and returns
 * the new copy.
 * @method Strophe.createHtml
 * @param {Node} node - A DOM element.
 * @return {Node} - A new, copied DOM element tree.
 */ function createHtml(node) {
    if (node.nodeType === ElementType.NORMAL) {
        return createFromHtmlElement(/** @type {HTMLElement} */ node);
    } else if (node.nodeType === ElementType.FRAGMENT) {
        const el = xmlGenerator().createDocumentFragment();
        for(let i = 0; i < node.childNodes.length; i++){
            el.appendChild(createHtml(node.childNodes[i]));
        }
        return el;
    } else if (node.nodeType === ElementType.TEXT) {
        return xmlTextNode(node.nodeValue);
    }
}
/**
 * Copy an XML DOM element.
 *
 * This function copies a DOM element and all its descendants and returns
 * the new copy.
 * @method Strophe.copyElement
 * @param {Node} node - A DOM element.
 * @return {Element|Text} - A new, copied DOM element tree.
 */ function copyElement(node) {
    let out;
    if (node.nodeType === ElementType.NORMAL) {
        const el = /** @type {Element} */ node;
        out = xmlElement(el.tagName);
        for(let i = 0; i < el.attributes.length; i++){
            out.setAttribute(el.attributes[i].nodeName, el.attributes[i].value);
        }
        for(let i = 0; i < el.childNodes.length; i++){
            out.appendChild(copyElement(el.childNodes[i]));
        }
    } else if (node.nodeType === ElementType.TEXT) {
        out = xmlGenerator().createTextNode(node.nodeValue);
    }
    return out;
}
/**
 * Excapes invalid xml characters.
 * @method Strophe.xmlescape
 * @param {string} text - text to escape.
 * @return {string} - Escaped text.
 */ function xmlescape(text) {
    text = text.replace(/\&/g, '&amp;');
    text = text.replace(/</g, '&lt;');
    text = text.replace(/>/g, '&gt;');
    text = text.replace(/'/g, '&apos;');
    text = text.replace(/"/g, '&quot;');
    return text;
}
/**
 * Unexcapes invalid xml characters.
 * @method Strophe.xmlunescape
 * @param {string} text - text to unescape.
 * @return {string} - Unescaped text.
 */ function xmlunescape(text) {
    text = text.replace(/\&amp;/g, '&');
    text = text.replace(/&lt;/g, '<');
    text = text.replace(/&gt;/g, '>');
    text = text.replace(/&apos;/g, "'");
    text = text.replace(/&quot;/g, '"');
    return text;
}
/**
 * Map a function over some or all child elements of a given element.
 *
 * This is a small convenience function for mapping a function over
 * some or all of the children of an element.  If elemName is null, all
 * children will be passed to the function, otherwise only children
 * whose tag names match elemName will be passed.
 *
 * @method Strophe.forEachChild
 * @param {Element} elem - The element to operate on.
 * @param {string} elemName - The child element tag name filter.
 * @param {Function} func - The function to apply to each child.  This
 *    function should take a single argument, a DOM element.
 */ function forEachChild(elem, elemName, func) {
    for(let i = 0; i < elem.childNodes.length; i++){
        const childNode = elem.childNodes[i];
        if (childNode.nodeType === ElementType.NORMAL && (!elemName || this.isTagEqual(childNode, elemName))) {
            func(childNode);
        }
    }
}
/**
 * Compare an element's tag name with a string.
 * This function is case sensitive.
 * @method Strophe.isTagEqual
 * @param {Element} el - A DOM element.
 * @param {string} name - The element name.
 * @return {boolean}
 *  true if the element's tag name matches _el_, and false
 *  otherwise.
 */ function isTagEqual(el, name) {
    return el.tagName === name;
}
/**
 * Get the concatenation of all text children of an element.
 * @method Strophe.getText
 * @param {Element} elem - A DOM element.
 * @return {string} - A String with the concatenated text of all text element children.
 */ function getText(elem) {
    if (!elem) return null;
    let str = '';
    if (!elem.childNodes.length && elem.nodeType === ElementType.TEXT) {
        str += elem.nodeValue;
    }
    for (const child of elem.childNodes){
        if (child.nodeType === ElementType.TEXT) {
            str += child.nodeValue;
        }
    }
    return xmlescape(str);
}
/**
 * Escape the node part (also called local part) of a JID.
 * @method Strophe.escapeNode
 * @param {string} node - A node (or local part).
 * @return {string} An escaped node (or local part).
 */ function escapeNode(node) {
    if (typeof node !== 'string') {
        return node;
    }
    return node.replace(/^\s+|\s+$/g, '').replace(/\\/g, '\\5c').replace(/ /g, '\\20').replace(/\"/g, '\\22').replace(/\&/g, '\\26').replace(/\'/g, '\\27').replace(/\//g, '\\2f').replace(/:/g, '\\3a').replace(/</g, '\\3c').replace(/>/g, '\\3e').replace(/@/g, '\\40');
}
/**
 * Unescape a node part (also called local part) of a JID.
 * @method Strophe.unescapeNode
 * @param {string} node - A node (or local part).
 * @return {string} An unescaped node (or local part).
 */ function unescapeNode(node) {
    if (typeof node !== 'string') {
        return node;
    }
    return node.replace(/\\20/g, ' ').replace(/\\22/g, '"').replace(/\\26/g, '&').replace(/\\27/g, "'").replace(/\\2f/g, '/').replace(/\\3a/g, ':').replace(/\\3c/g, '<').replace(/\\3e/g, '>').replace(/\\40/g, '@').replace(/\\5c/g, '\\');
}
/**
 * Get the node portion of a JID String.
 * @method Strophe.getNodeFromJid
 * @param {string} jid - A JID.
 * @return {string} - A String containing the node.
 */ function getNodeFromJid(jid) {
    if (jid.indexOf('@') < 0) {
        return null;
    }
    return jid.split('@')[0];
}
/**
 * Get the domain portion of a JID String.
 * @method Strophe.getDomainFromJid
 * @param {string} jid - A JID.
 * @return {string} - A String containing the domain.
 */ function getDomainFromJid(jid) {
    const bare = getBareJidFromJid(jid);
    if (bare.indexOf('@') < 0) {
        return bare;
    } else {
        const parts = bare.split('@');
        parts.splice(0, 1);
        return parts.join('@');
    }
}
/**
 * Get the resource portion of a JID String.
 * @method Strophe.getResourceFromJid
 * @param {string} jid - A JID.
 * @return {string} - A String containing the resource.
 */ function getResourceFromJid(jid) {
    if (!jid) {
        return null;
    }
    const s = jid.split('/');
    if (s.length < 2) {
        return null;
    }
    s.splice(0, 1);
    return s.join('/');
}
/**
 * Get the bare JID from a JID String.
 * @method Strophe.getBareJidFromJid
 * @param {string} jid - A JID.
 * @return {string} - A String containing the bare JID.
 */ function getBareJidFromJid(jid) {
    return jid ? jid.split('/')[0] : null;
}
const utils = {
    utf16to8,
    xorArrayBuffers,
    arrayBufToBase64,
    base64ToArrayBuf,
    stringToArrayBuf,
    addCookies
};
var utils$1 = /*#__PURE__*/ Object.freeze({
    __proto__: null,
    toElement: toElement,
    handleError: handleError,
    utf16to8: utf16to8,
    xorArrayBuffers: xorArrayBuffers,
    arrayBufToBase64: arrayBufToBase64,
    base64ToArrayBuf: base64ToArrayBuf,
    stringToArrayBuf: stringToArrayBuf,
    addCookies: addCookies,
    xmlGenerator: xmlGenerator,
    xmlTextNode: xmlTextNode,
    stripWhitespace: stripWhitespace,
    xmlHtmlNode: xmlHtmlNode,
    getParserError: getParserError,
    getFirstElementChild: getFirstElementChild,
    xmlElement: xmlElement,
    validTag: validTag,
    validAttribute: validAttribute,
    validCSS: validCSS,
    createHtml: createHtml,
    copyElement: copyElement,
    xmlescape: xmlescape,
    xmlunescape: xmlunescape,
    forEachChild: forEachChild,
    isTagEqual: isTagEqual,
    getText: getText,
    escapeNode: escapeNode,
    unescapeNode: unescapeNode,
    getNodeFromJid: getNodeFromJid,
    getDomainFromJid: getDomainFromJid,
    getResourceFromJid: getResourceFromJid,
    getBareJidFromJid: getBareJidFromJid,
    'default': utils
});
/**
 * Create a {@link Strophe.Builder}
 * This is an alias for `new Strophe.Builder(name, attrs)`.
 * @param {string} name - The root element name.
 * @param {Object.<string,string|number>} [attrs] - The attributes for the root element in object notation.
 * @return {Builder} A new Strophe.Builder object.
 */ function $build(name, attrs) {
    return new Builder(name, attrs);
}
/**
 * Create a {@link Strophe.Builder} with a `<message/>` element as the root.
 * @param {Object.<string,string>} [attrs] - The <message/> element attributes in object notation.
 * @return {Builder} A new Strophe.Builder object.
 */ function $msg(attrs) {
    return new Builder('message', attrs);
}
/**
 * Create a {@link Strophe.Builder} with an `<iq/>` element as the root.
 * @param {Object.<string,string>} [attrs] - The <iq/> element attributes in object notation.
 * @return {Builder} A new Strophe.Builder object.
 */ function $iq(attrs) {
    return new Builder('iq', attrs);
}
/**
 * Create a {@link Strophe.Builder} with a `<presence/>` element as the root.
 * @param {Object.<string,string>} [attrs] - The <presence/> element attributes in object notation.
 * @return {Builder} A new Strophe.Builder object.
 */ function $pres(attrs) {
    return new Builder('presence', attrs);
}
var /**
   * @typedef {Object.<string, string|number>} StanzaAttrs
   * @property {string} [StanzaAttrs.xmlns]
   */ /** @type {Element} */ _nodeTree = /*#__PURE__*/ new WeakMap(), /** @type {Element} */ _node = /*#__PURE__*/ new WeakMap(), /** @type {string} */ _name = /*#__PURE__*/ new WeakMap(), /** @type {StanzaAttrs} */ _attrs = /*#__PURE__*/ new WeakMap();
/**
 * This class provides an interface similar to JQuery but for building
 * DOM elements easily and rapidly.  All the functions except for `toString()`
 * and tree() return the object, so calls can be chained.
 *
 * The corresponding DOM manipulations to get a similar fragment would be
 * a lot more tedious and probably involve several helper variables.
 *
 * Since adding children makes new operations operate on the child, up()
 * is provided to traverse up the tree.  To add two children, do
 * > builder.c('child1', ...).up().c('child2', ...)
 *
 * The next operation on the Builder will be relative to the second child.
 *
 * @example
 *  // Here's an example using the $iq() builder helper.
 *  $iq({to: 'you', from: 'me', type: 'get', id: '1'})
 *      .c('query', {xmlns: 'strophe:example'})
 *      .c('example')
 *      .toString()
 *
 *  // The above generates this XML fragment
 *  //  <iq to='you' from='me' type='get' id='1'>
 *  //    <query xmlns='strophe:example'>
 *  //      <example/>
 *  //    </query>
 *  //  </iq>
 */ class Builder {
    /**
   * Creates a new Builder object from an XML string.
   * @param {string} str
   * @returns {Builder}
   * @example const stanza = Builder.fromString('<presence from="juliet@example.com/chamber"></presence>');
   */ static fromString(str) {
        const el = toElement(str, true);
        const b = new Builder('');
        _class_private_field_set(b, _nodeTree, el);
        return b;
    }
    buildTree() {
        return xmlElement(_class_private_field_get(this, _name), _class_private_field_get(this, _attrs));
    }
    /** @return {Element} */ get nodeTree() {
        if (!_class_private_field_get(this, _nodeTree)) {
            // Holds the tree being built.
            _class_private_field_set(this, _nodeTree, this.buildTree());
        }
        return _class_private_field_get(this, _nodeTree);
    }
    /** @return {Element} */ get node() {
        if (!_class_private_field_get(this, _node)) {
            _class_private_field_set(this, _node, this.tree());
        }
        return _class_private_field_get(this, _node);
    }
    /** @param {Element} el */ set node(el) {
        _class_private_field_set(this, _node, el);
    }
    /**
   * Render a DOM element and all descendants to a String.
   * @param {Element|Builder} elem - A DOM element.
   * @return {string} - The serialized element tree as a String.
   */ static serialize(elem) {
        if (!elem) return null;
        const el = elem instanceof Builder ? elem.tree() : elem;
        const names = [
            ...Array(el.attributes.length).keys()
        ].map((i)=>el.attributes[i].nodeName);
        names.sort();
        let result = names.reduce((a, n1)=>`${a} ${n1}="${xmlescape(el.attributes.getNamedItem(n1).value)}"`, `<${el.nodeName}`);
        if (el.childNodes.length > 0) {
            result += '>';
            for(let i = 0; i < el.childNodes.length; i++){
                const child = el.childNodes[i];
                switch(child.nodeType){
                    case ElementType.NORMAL:
                        // normal element, so recurse
                        result += Builder.serialize(/** @type {Element} */ child);
                        break;
                    case ElementType.TEXT:
                        // text element to escape values
                        result += xmlescape(child.nodeValue);
                        break;
                    case ElementType.CDATA:
                        // cdata section so don't escape values
                        result += '<![CDATA[' + child.nodeValue + ']]>';
                }
            }
            result += '</' + el.nodeName + '>';
        } else {
            result += '/>';
        }
        return result;
    }
    /**
   * Return the DOM tree.
   *
   * This function returns the current DOM tree as an element object.  This
   * is suitable for passing to functions like Strophe.Connection.send().
   *
   * @return {Element} The DOM tree as a element object.
   */ tree() {
        return this.nodeTree;
    }
    /**
   * Serialize the DOM tree to a String.
   *
   * This function returns a string serialization of the current DOM
   * tree.  It is often used internally to pass data to a
   * Strophe.Request object.
   *
   * @return {string} The serialized DOM tree in a String.
   */ toString() {
        return Builder.serialize(this.tree());
    }
    /**
   * Make the current parent element the new current element.
   * This function is often used after c() to traverse back up the tree.
   *
   * @example
   *  // For example, to add two children to the same element
   *  builder.c('child1', {}).up().c('child2', {});
   *
   * @return {Builder} The Strophe.Builder object.
   */ up() {
        // Depending on context, parentElement is not always available
        this.node = this.node.parentElement ? this.node.parentElement : /** @type {Element} */ this.node.parentNode;
        return this;
    }
    /**
   * Make the root element the new current element.
   *
   * When at a deeply nested element in the tree, this function can be used
   * to jump back to the root of the tree, instead of having to repeatedly
   * call up().
   *
   * @return {Builder} The Strophe.Builder object.
   */ root() {
        this.node = this.tree();
        return this;
    }
    /**
   * Add or modify attributes of the current element.
   *
   * The attributes should be passed in object notation.
   * This function does not move the current element pointer.
   * @param {Object.<string, string|number|null>} moreattrs - The attributes to add/modify in object notation.
   *  If an attribute is set to `null` or `undefined`, it will be removed.
   * @return {Builder} The Strophe.Builder object.
   */ attrs(moreattrs) {
        for(const k in moreattrs){
            if (Object.prototype.hasOwnProperty.call(moreattrs, k)) {
                // eslint-disable-next-line no-eq-null
                if (moreattrs[k] != null) {
                    this.node.setAttribute(k, moreattrs[k].toString());
                } else {
                    this.node.removeAttribute(k);
                }
            }
        }
        return this;
    }
    /**
   * Add a child to the current element and make it the new current
   * element.
   *
   * This function moves the current element pointer to the child,
   * unless text is provided.  If you need to add another child, it
   * is necessary to use up() to go back to the parent in the tree.
   *
   * @param {string} name - The name of the child.
   * @param {Object.<string, string>|string} [attrs] - The attributes of the child in object notation.
   * @param {string} [text] - The text to add to the child.
   *
   * @return {Builder} The Strophe.Builder object.
   */ c(name, attrs, text) {
        const child = xmlElement(name, attrs, text);
        this.node.appendChild(child);
        if (typeof text !== 'string' && typeof text !== 'number') {
            this.node = child;
        }
        return this;
    }
    /**
   * Add a child to the current element and make it the new current
   * element.
   *
   * This function is the same as c() except that instead of using a
   * name and an attributes object to create the child it uses an
   * existing DOM element object.
   *
   * @param {Element|Builder} elem - A DOM element.
   * @return {Builder} The Strophe.Builder object.
   */ cnode(elem) {
        if (elem instanceof Builder) {
            elem = elem.tree();
        }
        let impNode;
        const xmlGen = xmlGenerator();
        try {
            impNode = xmlGen.importNode !== undefined;
        } catch (_e) {
            impNode = false;
        }
        const newElem = impNode ? xmlGen.importNode(elem, true) : copyElement(elem);
        this.node.appendChild(newElem);
        this.node = /** @type {Element} */ newElem;
        return this;
    }
    /**
   * Add a child text element.
   *
   * This *does not* make the child the new current element since there
   * are no children of text elements.
   *
   * @param {string} text - The text data to append to the current element.
   * @return {Builder} The Strophe.Builder object.
   */ t(text) {
        const child = xmlTextNode(text);
        this.node.appendChild(child);
        return this;
    }
    /**
   * Replace current element contents with the HTML passed in.
   *
   * This *does not* make the child the new current element
   *
   * @param {string} html - The html to insert as contents of current element.
   * @return {Builder} The Strophe.Builder object.
   */ h(html) {
        const fragment = xmlGenerator().createElement('body');
        // force the browser to try and fix any invalid HTML tags
        fragment.innerHTML = html;
        // copy cleaned html into an xml dom
        const xhtml = createHtml(fragment);
        while(xhtml.childNodes.length > 0){
            this.node.appendChild(xhtml.childNodes[0]);
        }
        return this;
    }
    /**
   * The attributes should be passed in object notation.
   * @param {string} name - The name of the root element.
   * @param {StanzaAttrs} [attrs] - The attributes for the root element in object notation.
   * @example const b = new Builder('message', {to: 'you', from: 'me'});
   * @example const b = new Builder('messsage', {'xml:lang': 'en'});
   */ constructor(name, attrs){
        _class_private_field_init(this, _nodeTree, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _node, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _name, {
            writable: true,
            value: void 0
        });
        _class_private_field_init(this, _attrs, {
            writable: true,
            value: void 0
        });
        // Set correct namespace for jabber:client elements
        if (name === 'presence' || name === 'message' || name === 'iq') {
            if (attrs && !attrs.xmlns) {
                attrs.xmlns = NS.CLIENT;
            } else if (!attrs) {
                attrs = {
                    xmlns: NS.CLIENT
                };
            }
        }
        _class_private_field_set(this, _name, name);
        _class_private_field_set(this, _attrs, attrs);
    }
}
/**
 * _Private_ variable that keeps track of the request ids for connections.
 */ let _requestId = 0;
/**
 * Helper class that provides a cross implementation abstraction
 * for a BOSH related XMLHttpRequest.
 *
 * The Request class is used internally to encapsulate BOSH request
 * information.  It is not meant to be used from user's code.
 *
 * @property {number} id
 * @property {number} sends
 * @property {XMLHttpRequest} xhr
 */ class Request {
    /**
   * Get a response from the underlying XMLHttpRequest.
   * This function attempts to get a response from the request and checks
   * for errors.
   * @throws "parsererror" - A parser error occured.
   * @throws "bad-format" - The entity has sent XML that cannot be processed.
   * @return {Element} - The DOM element tree of the response.
   */ getResponse() {
        var _this$xhr$responseXML;
        const node = (_this$xhr$responseXML = this.xhr.responseXML) === null || _this$xhr$responseXML === void 0 ? void 0 : _this$xhr$responseXML.documentElement;
        if (node) {
            if (node.tagName === 'parsererror') {
                log.error('invalid response received');
                log.error('responseText: ' + this.xhr.responseText);
                log.error('responseXML: ' + Builder.serialize(node));
                throw new Error('parsererror');
            }
        } else if (this.xhr.responseText) {
            // In Node (with xhr2) or React Native, we may get responseText but no responseXML.
            // We can try to parse it manually.
            log.debug('Got responseText but no responseXML; attempting to parse it with DOMParser...');
            const doc = xmlHtmlNode(this.xhr.responseText);
            const parserError = getParserError(doc);
            if (!doc || parserError) {
                if (parserError) {
                    log.error('invalid response received: ' + parserError);
                    log.error('responseText: ' + this.xhr.responseText);
                }
                const error = new Error();
                error.name = ErrorCondition.BAD_FORMAT;
                throw error;
            }
        }
        return node;
    }
    /**
   * _Private_ helper function to create XMLHttpRequests.
   * This function creates XMLHttpRequests across all implementations.
   * @private
   * @return {XMLHttpRequest}
   */ _newXHR() {
        const xhr = new XMLHttpRequest();
        if (xhr.overrideMimeType) {
            xhr.overrideMimeType('text/xml; charset=utf-8');
        }
        // use Function.bind() to prepend ourselves as an argument
        xhr.onreadystatechange = this.func.bind(null, this);
        return xhr;
    }
    /**
   * Create and initialize a new Request object.
   *
   * @param {Element} elem - The XML data to be sent in the request.
   * @param {Function} func - The function that will be called when the
   *     XMLHttpRequest readyState changes.
   * @param {number} rid - The BOSH rid attribute associated with this request.
   * @param {number} [sends=0] - The number of times this same request has been sent.
   */ constructor(elem, func, rid, sends = 0){
        this.id = ++_requestId;
        this.xmlData = elem;
        this.data = Builder.serialize(elem);
        // save original function in case we need to make a new request
        // from this one.
        this.origFunc = func;
        this.func = func;
        this.rid = rid;
        this.date = NaN;
        this.sends = sends;
        this.abort = false;
        this.dead = null;
        this.age = ()=>this.date ? (new Date().valueOf() - this.date.valueOf()) / 1000 : 0;
        this.timeDead = ()=>this.dead ? (new Date().valueOf() - this.dead.valueOf()) / 1000 : 0;
        this.xhr = this._newXHR();
    }
}
/**
 * A JavaScript library to enable BOSH in Strophejs.
 *
 * this library uses Bidirectional-streams Over Synchronous HTTP (BOSH)
 * to emulate a persistent, stateful, two-way connection to an XMPP server.
 * More information on BOSH can be found in XEP 124.
 */ let timeoutMultiplier = 1.1;
let secondaryTimeoutMultiplier = 0.1;
/**
 * _Private_ helper class that handles BOSH Connections
 * The Bosh class is used internally by Connection
 * to encapsulate BOSH sessions. It is not meant to be used from user's code.
 */ class Bosh {
    /**
   * @param {number} m
   */ static setTimeoutMultiplier(m) {
        timeoutMultiplier = m;
    }
    /**
   * @returns {number}
   */ static getTimeoutMultplier() {
        return timeoutMultiplier;
    }
    /**
   * @param {number} m
   */ static setSecondaryTimeoutMultiplier(m) {
        secondaryTimeoutMultiplier = m;
    }
    /**
   * @returns {number}
   */ static getSecondaryTimeoutMultplier() {
        return secondaryTimeoutMultiplier;
    }
    /**
   * _Private_ helper function to generate the <body/> wrapper for BOSH.
   * @private
   * @return {Builder} - A Builder with a <body/> element.
   */ _buildBody() {
        const bodyWrap = $build('body', {
            'rid': this.rid++,
            'xmlns': NS.HTTPBIND
        });
        if (this.sid !== null) {
            bodyWrap.attrs({
                'sid': this.sid
            });
        }
        if (this._conn.options.keepalive && this._conn._sessionCachingSupported()) {
            this._cacheSession();
        }
        return bodyWrap;
    }
    /**
   * Reset the connection.
   * This function is called by the reset function of the Connection
   */ _reset() {
        this.rid = Math.floor(Math.random() * 4294967295);
        this.sid = null;
        this.errors = 0;
        if (this._conn._sessionCachingSupported()) {
            sessionStorage.removeItem('strophe-bosh-session');
        }
        this._conn.nextValidRid(this.rid);
    }
    /**
   * _Private_ function that initializes the BOSH connection.
   * Creates and sends the Request that initializes the BOSH connection.
   * @param {number} wait - The optional HTTPBIND wait value.  This is the
   *     time the server will wait before returning an empty result for
   *     a request.  The default setting of 60 seconds is recommended.
   *     Other settings will require tweaks to the Strophe.TIMEOUT value.
   * @param {number} hold - The optional HTTPBIND hold value.  This is the
   *     number of connections the server will hold at one time.  This
   *     should almost always be set to 1 (the default).
   * @param {string} route
   */ _connect(wait, hold, route) {
        this.wait = wait || this.wait;
        this.hold = hold || this.hold;
        this.errors = 0;
        const body = this._buildBody().attrs({
            'to': this._conn.domain,
            'xml:lang': 'en',
            'wait': this.wait,
            'hold': this.hold,
            'content': 'text/xml; charset=utf-8',
            'ver': '1.6',
            'xmpp:version': '1.0',
            'xmlns:xmpp': NS.BOSH
        });
        if (route) {
            body.attrs({
                route
            });
        }
        const _connect_cb = this._conn._connect_cb;
        this._requests.push(new Request(body.tree(), this._onRequestStateChange.bind(this, _connect_cb.bind(this._conn)), Number(body.tree().getAttribute('rid'))));
        this._throttledRequestHandler();
    }
    /**
   * Attach to an already created and authenticated BOSH session.
   *
   * This function is provided to allow Strophe to attach to BOSH
   * sessions which have been created externally, perhaps by a Web
   * application.  This is often used to support auto-login type features
   * without putting user credentials into the page.
   *
   * @param {string} jid - The full JID that is bound by the session.
   * @param {string} sid - The SID of the BOSH session.
   * @param {number} rid - The current RID of the BOSH session.  This RID
   *     will be used by the next request.
   * @param {Function} callback The connect callback function.
   * @param {number} wait - The optional HTTPBIND wait value.  This is the
   *     time the server will wait before returning an empty result for
   *     a request.  The default setting of 60 seconds is recommended.
   *     Other settings will require tweaks to the Strophe.TIMEOUT value.
   * @param {number} hold - The optional HTTPBIND hold value.  This is the
   *     number of connections the server will hold at one time.  This
   *     should almost always be set to 1 (the default).
   * @param {number} wind - The optional HTTBIND window value.  This is the
   *     allowed range of request ids that are valid.  The default is 5.
   */ _attach(jid, sid, rid, callback, wait, hold, wind) {
        this._conn.jid = jid;
        this.sid = sid;
        this.rid = rid;
        this._conn.connect_callback = callback;
        this._conn.domain = getDomainFromJid(this._conn.jid);
        this._conn.authenticated = true;
        this._conn.connected = true;
        this.wait = wait || this.wait;
        this.hold = hold || this.hold;
        this.window = wind || this.window;
        this._conn._changeConnectStatus(Status.ATTACHED, null);
    }
    /**
   * Attempt to restore a cached BOSH session
   *
   * @param {string} jid - The full JID that is bound by the session.
   *     This parameter is optional but recommended, specifically in cases
   *     where prebinded BOSH sessions are used where it's important to know
   *     that the right session is being restored.
   * @param {Function} callback The connect callback function.
   * @param {number} wait - The optional HTTPBIND wait value.  This is the
   *     time the server will wait before returning an empty result for
   *     a request.  The default setting of 60 seconds is recommended.
   *     Other settings will require tweaks to the Strophe.TIMEOUT value.
   * @param {number} hold - The optional HTTPBIND hold value.  This is the
   *     number of connections the server will hold at one time.  This
   *     should almost always be set to 1 (the default).
   * @param {number} wind - The optional HTTBIND window value.  This is the
   *     allowed range of request ids that are valid.  The default is 5.
   */ _restore(jid, callback, wait, hold, wind) {
        const session = JSON.parse(sessionStorage.getItem('strophe-bosh-session'));
        if (typeof session !== 'undefined' && session !== null && session.rid && session.sid && session.jid && (typeof jid === 'undefined' || jid === null || getBareJidFromJid(session.jid) === getBareJidFromJid(jid) || // If authcid is null, then it's an anonymous login, so
        // we compare only the domains:
        getNodeFromJid(jid) === null && getDomainFromJid(session.jid) === jid)) {
            this._conn.restored = true;
            this._attach(session.jid, session.sid, session.rid, callback, wait, hold, wind);
        } else {
            const error = new Error('_restore: no restoreable session.');
            error.name = 'StropheSessionError';
            throw error;
        }
    }
    /**
   * _Private_ handler for the beforeunload event.
   * This handler is used to process the Bosh-part of the initial request.
   * @private
   */ _cacheSession() {
        if (this._conn.authenticated) {
            if (this._conn.jid && this.rid && this.sid) {
                sessionStorage.setItem('strophe-bosh-session', JSON.stringify({
                    'jid': this._conn.jid,
                    'rid': this.rid,
                    'sid': this.sid
                }));
            }
        } else {
            sessionStorage.removeItem('strophe-bosh-session');
        }
    }
    /**
   * _Private_ handler for initial connection request.
   * This handler is used to process the Bosh-part of the initial request.
   * @param {Element} bodyWrap - The received stanza.
   */ _connect_cb(bodyWrap) {
        const typ = bodyWrap.getAttribute('type');
        if (typ !== null && typ === 'terminate') {
            // an error occurred
            let cond = bodyWrap.getAttribute('condition');
            log.error('BOSH-Connection failed: ' + cond);
            const conflict = bodyWrap.getElementsByTagName('conflict');
            if (cond !== null) {
                if (cond === 'remote-stream-error' && conflict.length > 0) {
                    cond = 'conflict';
                }
                this._conn._changeConnectStatus(Status.CONNFAIL, cond);
            } else {
                this._conn._changeConnectStatus(Status.CONNFAIL, 'unknown');
            }
            this._conn._doDisconnect(cond);
            return Status.CONNFAIL;
        }
        // check to make sure we don't overwrite these if _connect_cb is
        // called multiple times in the case of missing stream:features
        if (!this.sid) {
            this.sid = bodyWrap.getAttribute('sid');
        }
        const wind = bodyWrap.getAttribute('requests');
        if (wind) {
            this.window = parseInt(wind, 10);
        }
        const hold = bodyWrap.getAttribute('hold');
        if (hold) {
            this.hold = parseInt(hold, 10);
        }
        const wait = bodyWrap.getAttribute('wait');
        if (wait) {
            this.wait = parseInt(wait, 10);
        }
        const inactivity = bodyWrap.getAttribute('inactivity');
        if (inactivity) {
            this.inactivity = parseInt(inactivity, 10);
        }
    }
    /**
   * _Private_ part of Connection.disconnect for Bosh
   * @param {Element|Builder} pres - This stanza will be sent before disconnecting.
   */ _disconnect(pres) {
        this._sendTerminate(pres);
    }
    /**
   * _Private_ function to disconnect.
   * Resets the SID and RID.
   */ _doDisconnect() {
        this.sid = null;
        this.rid = Math.floor(Math.random() * 4294967295);
        if (this._conn._sessionCachingSupported()) {
            sessionStorage.removeItem('strophe-bosh-session');
        }
        this._conn.nextValidRid(this.rid);
    }
    /**
   * _Private_ function to check if the Request queue is empty.
   * @return {boolean} - True, if there are no Requests queued, False otherwise.
   */ _emptyQueue() {
        return this._requests.length === 0;
    }
    /**
   * _Private_ function to call error handlers registered for HTTP errors.
   * @private
   * @param {Request} req - The request that is changing readyState.
   */ _callProtocolErrorHandlers(req) {
        const reqStatus = Bosh._getRequestStatus(req);
        const err_callback = this._conn.protocolErrorHandlers.HTTP[reqStatus];
        if (err_callback) {
            err_callback.call(this, reqStatus);
        }
    }
    /**
   * _Private_ function to handle the error count.
   *
   * Requests are resent automatically until their error count reaches
   * 5.  Each time an error is encountered, this function is called to
   * increment the count and disconnect if the count is too high.
   * @private
   * @param {number} reqStatus - The request status.
   */ _hitError(reqStatus) {
        this.errors++;
        log.warn('request errored, status: ' + reqStatus + ', number of errors: ' + this.errors);
        if (this.errors > 4) {
            this._conn._onDisconnectTimeout();
        }
    }
    /**
   * @callback connectionCallback
   * @param {Connection} connection
   */ /**
   * Called on stream start/restart when no stream:features
   * has been received and sends a blank poll request.
   * @param {connectionCallback} callback
   */ _no_auth_received(callback) {
        log.warn('Server did not yet offer a supported authentication ' + 'mechanism. Sending a blank poll request.');
        if (callback) {
            callback = callback.bind(this._conn);
        } else {
            callback = this._conn._connect_cb.bind(this._conn);
        }
        const body = this._buildBody();
        this._requests.push(new Request(body.tree(), this._onRequestStateChange.bind(this, callback), Number(body.tree().getAttribute('rid'))));
        this._throttledRequestHandler();
    }
    /**
   * _Private_ timeout handler for handling non-graceful disconnection.
   * Cancels all remaining Requests and clears the queue.
   */ _onDisconnectTimeout() {
        this._abortAllRequests();
    }
    /**
   * _Private_ helper function that makes sure all pending requests are aborted.
   */ _abortAllRequests() {
        while(this._requests.length > 0){
            const req = this._requests.pop();
            req.abort = true;
            req.xhr.abort();
            req.xhr.onreadystatechange = function() {};
        }
    }
    /**
   * _Private_ handler called by {@link Connection#_onIdle|Connection._onIdle()}.
   * Sends all queued Requests or polls with empty Request if there are none.
   */ _onIdle() {
        const data = this._conn._data;
        // if no requests are in progress, poll
        if (this._conn.authenticated && this._requests.length === 0 && data.length === 0 && !this._conn.disconnecting) {
            log.debug('no requests during idle cycle, sending blank request');
            data.push(null);
        }
        if (this._conn.paused) {
            return;
        }
        if (this._requests.length < 2 && data.length > 0) {
            const body = this._buildBody();
            for(let i = 0; i < data.length; i++){
                if (data[i] !== null) {
                    if (data[i] === 'restart') {
                        body.attrs({
                            'to': this._conn.domain,
                            'xml:lang': 'en',
                            'xmpp:restart': 'true',
                            'xmlns:xmpp': NS.BOSH
                        });
                    } else {
                        body.cnode(/** @type {Element} */ data[i]).up();
                    }
                }
            }
            delete this._conn._data;
            this._conn._data = [];
            this._requests.push(new Request(body.tree(), this._onRequestStateChange.bind(this, this._conn._dataRecv.bind(this._conn)), Number(body.tree().getAttribute('rid'))));
            this._throttledRequestHandler();
        }
        if (this._requests.length > 0) {
            const time_elapsed = this._requests[0].age();
            if (this._requests[0].dead !== null) {
                if (this._requests[0].timeDead() > Math.floor(timeoutMultiplier * this.wait)) {
                    this._throttledRequestHandler();
                }
            }
            if (time_elapsed > Math.floor(timeoutMultiplier * this.wait)) {
                log.warn('Request ' + this._requests[0].id + ' timed out, over ' + Math.floor(timeoutMultiplier * this.wait) + ' seconds since last activity');
                this._throttledRequestHandler();
            }
        }
    }
    /**
   * Returns the HTTP status code from a {@link Request}
   * @private
   * @param {Request} req - The {@link Request} instance.
   * @param {number} [def] - The default value that should be returned if no status value was found.
   */ static _getRequestStatus(req, def) {
        let reqStatus;
        if (req.xhr.readyState === 4) {
            try {
                reqStatus = req.xhr.status;
            } catch (e) {
                // ignore errors from undefined status attribute. Works
                // around a browser bug
                log.error(`Caught an error while retrieving a request's status, reqStatus: ${reqStatus}, message: ${e.message}`);
            }
        }
        if (typeof reqStatus === 'undefined') {
            reqStatus = typeof def === 'number' ? def : 0;
        }
        return reqStatus;
    }
    /**
   * _Private_ handler for {@link Request} state changes.
   *
   * This function is called when the XMLHttpRequest readyState changes.
   * It contains a lot of error handling logic for the many ways that
   * requests can fail, and calls the request callback when requests
   * succeed.
   * @private
   *
   * @param {Function} func - The handler for the request.
   * @param {Request} req - The request that is changing readyState.
   */ _onRequestStateChange(func, req) {
        log.debug('request id ' + req.id + '.' + req.sends + ' state changed to ' + req.xhr.readyState);
        if (req.abort) {
            req.abort = false;
            return;
        }
        if (req.xhr.readyState !== 4) {
            // The request is not yet complete
            return;
        }
        const reqStatus = Bosh._getRequestStatus(req);
        this.lastResponseHeaders = req.xhr.getAllResponseHeaders();
        if (this._conn.disconnecting && reqStatus >= 400) {
            this._hitError(reqStatus);
            this._callProtocolErrorHandlers(req);
            return;
        }
        const reqIs0 = this._requests[0] === req;
        const reqIs1 = this._requests[1] === req;
        const valid_request = reqStatus > 0 && reqStatus < 500;
        const too_many_retries = req.sends > this._conn.maxRetries;
        if (valid_request || too_many_retries) {
            // remove from internal queue
            this._removeRequest(req);
            log.debug('request id ' + req.id + ' should now be removed');
        }
        if (reqStatus === 200) {
            // request succeeded
            // if request 1 finished, or request 0 finished and request
            // 1 is over _TIMEOUT seconds old, we need to
            // restart the other - both will be in the first spot, as the
            // completed request has been removed from the queue already
            if (reqIs1 || reqIs0 && this._requests.length > 0 && this._requests[0].age() > Math.floor(timeoutMultiplier * this.wait)) {
                this._restartRequest(0);
            }
            this._conn.nextValidRid(req.rid + 1);
            log.debug('request id ' + req.id + '.' + req.sends + ' got 200');
            func(req); // call handler
            this.errors = 0;
        } else if (reqStatus === 0 || reqStatus >= 400 && reqStatus < 600 || reqStatus >= 12000) {
            // request failed
            log.error('request id ' + req.id + '.' + req.sends + ' error ' + reqStatus + ' happened');
            this._hitError(reqStatus);
            this._callProtocolErrorHandlers(req);
            if (reqStatus >= 400 && reqStatus < 500) {
                this._conn._changeConnectStatus(Status.DISCONNECTING, null);
                this._conn._doDisconnect();
            }
        } else {
            log.error('request id ' + req.id + '.' + req.sends + ' error ' + reqStatus + ' happened');
        }
        if (!valid_request && !too_many_retries) {
            this._throttledRequestHandler();
        } else if (too_many_retries && !this._conn.connected) {
            this._conn._changeConnectStatus(Status.CONNFAIL, 'giving-up');
        }
    }
    /**
   * _Private_ function to process a request in the queue.
   *
   * This function takes requests off the queue and sends them and
   * restarts dead requests.
   * @private
   *
   * @param {number} i - The index of the request in the queue.
   */ _processRequest(i) {
        let req = this._requests[i];
        const reqStatus = Bosh._getRequestStatus(req, -1);
        // make sure we limit the number of retries
        if (req.sends > this._conn.maxRetries) {
            this._conn._onDisconnectTimeout();
            return;
        }
        const time_elapsed = req.age();
        const primary_timeout = !isNaN(time_elapsed) && time_elapsed > Math.floor(timeoutMultiplier * this.wait);
        const secondary_timeout = req.dead !== null && req.timeDead() > Math.floor(secondaryTimeoutMultiplier * this.wait);
        const server_error = req.xhr.readyState === 4 && (reqStatus < 1 || reqStatus >= 500);
        if (primary_timeout || secondary_timeout || server_error) {
            if (secondary_timeout) {
                log.error(`Request ${this._requests[i].id} timed out (secondary), restarting`);
            }
            req.abort = true;
            req.xhr.abort();
            // setting to null fails on IE6, so set to empty function
            req.xhr.onreadystatechange = function() {};
            this._requests[i] = new Request(req.xmlData, req.origFunc, req.rid, req.sends);
            req = this._requests[i];
        }
        if (req.xhr.readyState === 0) {
            var _this$_conn$rawOutput, _this$_conn3;
            log.debug('request id ' + req.id + '.' + req.sends + ' posting');
            try {
                const content_type = this._conn.options.contentType || 'text/xml; charset=utf-8';
                req.xhr.open('POST', this._conn.service, this._conn.options.sync ? false : true);
                if (typeof req.xhr.setRequestHeader !== 'undefined') {
                    // IE9 doesn't have setRequestHeader
                    req.xhr.setRequestHeader('Content-Type', content_type);
                }
                if (this._conn.options.withCredentials) {
                    req.xhr.withCredentials = true;
                }
            } catch (e2) {
                log.error('XHR open failed: ' + e2.toString());
                if (!this._conn.connected) {
                    this._conn._changeConnectStatus(Status.CONNFAIL, 'bad-service');
                }
                this._conn.disconnect();
                return;
            }
            // Fires the XHR request -- may be invoked immediately
            // or on a gradually expanding retry window for reconnects
            const sendFunc = ()=>{
                req.date = new Date().valueOf();
                if (this._conn.options.customHeaders) {
                    const headers = this._conn.options.customHeaders;
                    for(const header in headers){
                        if (Object.prototype.hasOwnProperty.call(headers, header)) {
                            req.xhr.setRequestHeader(header, headers[header]);
                        }
                    }
                }
                req.xhr.send(req.data);
            };
            // Implement progressive backoff for reconnects --
            // First retry (send === 1) should also be instantaneous
            if (req.sends > 1) {
                // Using a cube of the retry number creates a nicely
                // expanding retry window
                const backoff = Math.min(Math.floor(timeoutMultiplier * this.wait), Math.pow(req.sends, 3)) * 1000;
                setTimeout(function() {
                    // XXX: setTimeout should be called only with function expressions (23974bc1)
                    sendFunc();
                }, backoff);
            } else {
                sendFunc();
            }
            req.sends++;
            if (this.strip && req.xmlData.nodeName === 'body' && req.xmlData.childNodes.length) {
                var _this$_conn$xmlOutput, _this$_conn;
                (_this$_conn$xmlOutput = (_this$_conn = this._conn).xmlOutput) === null || _this$_conn$xmlOutput === void 0 ? void 0 : _this$_conn$xmlOutput.call(_this$_conn, req.xmlData.children[0]);
            } else {
                var _this$_conn$xmlOutput2, _this$_conn2;
                (_this$_conn$xmlOutput2 = (_this$_conn2 = this._conn).xmlOutput) === null || _this$_conn$xmlOutput2 === void 0 ? void 0 : _this$_conn$xmlOutput2.call(_this$_conn2, req.xmlData);
            }
            (_this$_conn$rawOutput = (_this$_conn3 = this._conn).rawOutput) === null || _this$_conn$rawOutput === void 0 ? void 0 : _this$_conn$rawOutput.call(_this$_conn3, req.data);
        } else {
            log.debug('_processRequest: ' + (i === 0 ? 'first' : 'second') + ' request has readyState of ' + req.xhr.readyState);
        }
    }
    /**
   * _Private_ function to remove a request from the queue.
   * @private
   * @param {Request} req - The request to remove.
   */ _removeRequest(req) {
        log.debug('removing request');
        for(let i = this._requests.length - 1; i >= 0; i--){
            if (req === this._requests[i]) {
                this._requests.splice(i, 1);
            }
        }
        // IE6 fails on setting to null, so set to empty function
        req.xhr.onreadystatechange = function() {};
        this._throttledRequestHandler();
    }
    /**
   * _Private_ function to restart a request that is presumed dead.
   * @private
   *
   * @param {number} i - The index of the request in the queue.
   */ _restartRequest(i) {
        const req = this._requests[i];
        if (req.dead === null) {
            req.dead = new Date();
        }
        this._processRequest(i);
    }
    /**
   * _Private_ function to get a stanza out of a request.
   * Tries to extract a stanza out of a Request Object.
   * When this fails the current connection will be disconnected.
   *
   * @param {Request} req - The Request.
   * @return {Element} - The stanza that was passed.
   */ _reqToData(req) {
        try {
            return req.getResponse();
        } catch (e) {
            if (e.message !== 'parsererror') {
                throw e;
            }
            this._conn.disconnect('strophe-parsererror');
        }
    }
    /**
   * _Private_ function to send initial disconnect sequence.
   *
   * This is the first step in a graceful disconnect.  It sends
   * the BOSH server a terminate body and includes an unavailable
   * presence if authentication has completed.
   * @private
   * @param {Element|Builder} [pres]
   */ _sendTerminate(pres) {
        log.debug('_sendTerminate was called');
        const body = this._buildBody().attrs({
            type: 'terminate'
        });
        const el = pres instanceof Builder ? pres.tree() : pres;
        if (pres) {
            body.cnode(el);
        }
        const req = new Request(body.tree(), this._onRequestStateChange.bind(this, this._conn._dataRecv.bind(this._conn)), Number(body.tree().getAttribute('rid')));
        this._requests.push(req);
        this._throttledRequestHandler();
    }
    /**
   * _Private_ part of the Connection.send function for BOSH
   * Just triggers the RequestHandler to send the messages that are in the queue
   */ _send() {
        clearTimeout(this._conn._idleTimeout);
        this._throttledRequestHandler();
        this._conn._idleTimeout = setTimeout(()=>this._conn._onIdle(), 100);
    }
    /**
   * Send an xmpp:restart stanza.
   */ _sendRestart() {
        this._throttledRequestHandler();
        clearTimeout(this._conn._idleTimeout);
    }
    /**
   * _Private_ function to throttle requests to the connection window.
   *
   * This function makes sure we don't send requests so fast that the
   * request ids overflow the connection window in the case that one
   * request died.
   * @private
   */ _throttledRequestHandler() {
        if (!this._requests) {
            log.debug('_throttledRequestHandler called with ' + 'undefined requests');
        } else {
            log.debug('_throttledRequestHandler called with ' + this._requests.length + ' requests');
        }
        if (!this._requests || this._requests.length === 0) {
            return;
        }
        if (this._requests.length > 0) {
            this._processRequest(0);
        }
        if (this._requests.length > 1 && Math.abs(this._requests[0].rid - this._requests[1].rid) < this.window) {
            this._processRequest(1);
        }
    }
    /**
   * @param {Connection} connection - The Connection that will use BOSH.
   */ constructor(connection){
        var _Bosh$prototype$strip;
        this._conn = connection;
        /* request id for body tags */ this.rid = Math.floor(Math.random() * 4294967295);
        /* The current session ID. */ this.sid = null;
        // default BOSH values
        this.hold = 1;
        this.wait = 60;
        this.window = 5;
        this.errors = 0;
        this.inactivity = null;
        /**
     * BOSH-Connections will have all stanzas wrapped in a <body> tag when
     * passed to {@link Connection#xmlInput|xmlInput()} or {@link Connection#xmlOutput|xmlOutput()}.
     * To strip this tag, User code can set {@link Bosh#strip|strip} to `true`:
     *
     * > // You can set `strip` on the prototype
     * > Bosh.prototype.strip = true;
     *
     * > // Or you can set it on the Bosh instance (which is `._proto` on the connection instance.
     * > const conn = new Connection();
     * > conn._proto.strip = true;
     *
     * This will enable stripping of the body tag in both
     * {@link Connection#xmlInput|xmlInput} and {@link Connection#xmlOutput|xmlOutput}.
     *
     * @property {boolean} [strip=false]
     */ this.strip = (_Bosh$prototype$strip = Bosh.prototype.strip) !== null && _Bosh$prototype$strip !== void 0 ? _Bosh$prototype$strip : false;
        this.lastResponseHeaders = null;
        /** @type {Request[]} */ this._requests = [];
    }
}
/**
 * _Private_ helper class for managing stanza handlers.
 *
 * A Handler encapsulates a user provided callback function to be
 * executed when matching stanzas are received by the connection.
 * Handlers can be either one-off or persistant depending on their
 * return value. Returning true will cause a Handler to remain active, and
 * returning false will remove the Handler.
 *
 * Users will not use Handler objects directly, but instead they
 * will use {@link Connection.addHandler} and
 * {@link Connection.deleteHandler}.
 */ class Handler {
    /**
   * Returns the XML namespace attribute on an element.
   * If `ignoreNamespaceFragment` was passed in for this handler, then the
   * URL fragment will be stripped.
   * @param {Element} elem - The XML element with the namespace.
   * @return {string} - The namespace, with optionally the fragment stripped.
   */ getNamespace(elem) {
        let elNamespace = elem.getAttribute('xmlns');
        if (elNamespace && this.options.ignoreNamespaceFragment) {
            elNamespace = elNamespace.split('#')[0];
        }
        return elNamespace;
    }
    /**
   * Tests if a stanza element (or any of its children) matches the
   * namespace set for this Handler.
   * @param {Element} elem - The XML element to test.
   * @return {boolean} - true if the stanza matches and false otherwise.
   */ namespaceMatch(elem) {
        if (!this.ns || this.getNamespace(elem) === this.ns) {
            return true;
        }
        for (const child of (_elem$children = elem.children) !== null && _elem$children !== void 0 ? _elem$children : []){
            var _elem$children;
            if (this.getNamespace(child) === this.ns) {
                return true;
            } else if (this.namespaceMatch(child)) {
                return true;
            }
        }
        return false;
    }
    /**
   * Tests if a stanza matches the Handler.
   * @param {Element} elem - The XML element to test.
   * @return {boolean} - true if the stanza matches and false otherwise.
   */ isMatch(elem) {
        let from = elem.getAttribute('from');
        if (this.options.matchBareFromJid) {
            from = getBareJidFromJid(from);
        }
        const elem_type = elem.getAttribute('type');
        if (this.namespaceMatch(elem) && (!this.name || isTagEqual(elem, this.name)) && (!this.type || (Array.isArray(this.type) ? this.type.indexOf(elem_type) !== -1 : elem_type === this.type)) && (!this.id || elem.getAttribute('id') === this.id) && (!this.from || from === this.from)) {
            return true;
        }
        return false;
    }
    /**
   * Run the callback on a matching stanza.
   * @param {Element} elem - The DOM element that triggered the Handler.
   * @return {boolean} - A boolean indicating if the handler should remain active.
   */ run(elem) {
        let result = null;
        try {
            result = this.handler(elem);
        } catch (e) {
            handleError(e);
            throw e;
        }
        return result;
    }
    /**
   * Get a String representation of the Handler object.
   * @return {string}
   */ toString() {
        return '{Handler: ' + this.handler + '(' + this.name + ',' + this.id + ',' + this.ns + ')}';
    }
    /**
   * @typedef {Object} HandlerOptions
   * @property {boolean} [HandlerOptions.matchBareFromJid]
   * @property {boolean} [HandlerOptions.ignoreNamespaceFragment]
   */ /**
   * Create and initialize a new Handler.
   *
   * @param {Function} handler - A function to be executed when the handler is run.
   * @param {string} ns - The namespace to match.
   * @param {string} name - The element name to match.
   * @param {string|string[]} type - The stanza type (or types if an array) to match.
   * @param {string} [id] - The element id attribute to match.
   * @param {string} [from] - The element from attribute to match.
   * @param {HandlerOptions} [options] - Handler options
   */ constructor(handler, ns, name, type, id, from, options){
        this.handler = handler;
        this.ns = ns;
        this.name = name;
        this.type = type;
        this.id = id;
        this.options = options || {
            'matchBareFromJid': false,
            'ignoreNamespaceFragment': false
        };
        if (this.options.matchBareFromJid) {
            this.from = from ? getBareJidFromJid(from) : null;
        } else {
            this.from = from;
        }
        // whether the handler is a user handler or a system handler
        this.user = true;
    }
}
/**
 * _Private_ helper class for managing timed handlers.
 *
 * A Strophe.TimedHandler encapsulates a user provided callback that
 * should be called after a certain period of time or at regular
 * intervals.  The return value of the callback determines whether the
 * Strophe.TimedHandler will continue to fire.
 *
 * Users will not use Strophe.TimedHandler objects directly, but instead
 * they will use {@link Strophe.Connection#addTimedHandler|addTimedHandler()} and
 * {@link Strophe.Connection#deleteTimedHandler|deleteTimedHandler()}.
 *
 * @memberof Strophe
 */ class TimedHandler {
    /**
   * Run the callback for the Strophe.TimedHandler.
   *
   * @return {boolean} Returns the result of running the handler,
   *  which is `true` if the Strophe.TimedHandler should be called again,
   *  and `false` otherwise.
   */ run() {
        this.lastCalled = new Date().getTime();
        return this.handler();
    }
    /**
   * Reset the last called time for the Strophe.TimedHandler.
   */ reset() {
        this.lastCalled = new Date().getTime();
    }
    /**
   * Get a string representation of the Strophe.TimedHandler object.
   * @return {string}
   */ toString() {
        return '{TimedHandler: ' + this.handler + '(' + this.period + ')}';
    }
    /**
   * Create and initialize a new Strophe.TimedHandler object.
   * @param {number} period - The number of milliseconds to wait before the
   *     handler is called.
   * @param {Function} handler - The callback to run when the handler fires.  This
   *     function should take no arguments.
   */ constructor(period, handler){
        this.period = period;
        this.handler = handler;
        this.lastCalled = new Date().getTime();
        this.user = true;
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ /**
 * Encapsulates an SASL authentication mechanism.
 *
 * User code may override the priority for each mechanism or disable it completely.
 * See <priority> for information about changing priority and <test> for informatian on
 * how to disable a mechanism.
 *
 * By default, all mechanisms are enabled and t_he priorities are
 *
 *     SCRAM-SHA-512 - 72
 *     SCRAM-SHA-384 - 71
 *     SCRAM-SHA-256 - 70
 *     SCRAM-SHA-1   - 60
 *     PLAIN         - 50
 *     OAUTHBEARER   - 40
 *     X-OAUTH2      - 30
 *     ANONYMOUS     - 20
 *     EXTERNAL      - 10
 *
 * See: {@link Strophe.Connection#registerSASLMechanisms}
 */ class SASLMechanism {
    /**
   * Checks if mechanism able to run.
   * To disable a mechanism, make this return false;
   *
   * To disable plain authentication run
   * > Strophe.SASLPlain.test = function() {
   * >   return false;
   * > }
   *
   * See <SASL mechanisms> for a list of available mechanisms.
   * @param {Connection} _connection - Target Connection.
   * @return {boolean} If mechanism was able to run.
   */ test(_connection) {
        return true;
    }
    /**
   * Called before starting mechanism on some connection.
   * @param {Connection} connection - Target Connection.
   */ onStart(connection) {
        this._connection = connection;
    }
    /**
   * Called by protocol implementation on incoming challenge.
   *
   * By deafult, if the client is expected to send data first (isClientFirst === true),
   * this method is called with `challenge` as null on the first call,
   * unless `clientChallenge` is overridden in the relevant subclass.
   * @param {Connection} _connection - Target Connection.
   * @param {string} [_challenge] - current challenge to handle.
   * @return {string|Promise<string|false>} Mechanism response.
   */ onChallenge(_connection, _challenge) {
        throw new Error('You should implement challenge handling!');
    }
    /**
   * Called by the protocol implementation if the client is expected to send
   * data first in the authentication exchange (i.e. isClientFirst === true).
   * @param {Connection} connection - Target Connection.
   * @return {string|Promise<string|false>} Mechanism response.
   */ clientChallenge(connection) {
        if (!this.isClientFirst) {
            throw new Error('clientChallenge should not be called if isClientFirst is false!');
        }
        return this.onChallenge(connection);
    }
    /**
   * Protocol informs mechanism implementation about SASL failure.
   */ onFailure() {
        this._connection = null;
    }
    /**
   * Protocol informs mechanism implementation about SASL success.
   */ onSuccess() {
        this._connection = null;
    }
    /**
   * PrivateConstructor: Strophe.SASLMechanism
   * SASL auth mechanism abstraction.
   * @param {String} [name] - SASL Mechanism name.
   * @param {Boolean} [isClientFirst] - If client should send response first without challenge.
   * @param {Number} [priority] - Priority.
   */ constructor(name, isClientFirst, priority){
        /** Mechanism name. */ this.mechname = name;
        /**
     * If client sends response without initial server challenge.
     */ this.isClientFirst = isClientFirst;
        /**
     * Determines which {@link SASLMechanism} is chosen for authentication (Higher is better).
     * Users may override this to prioritize mechanisms differently.
     *
     * Example: (This will cause Strophe to choose the mechanism that the server sent first)
     *
     * > Strophe.SASLPlain.priority = Strophe.SASLSHA1.priority;
     *
     * See <SASL mechanisms> for a list of available mechanisms.
     */ this.priority = priority;
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLAnonymous extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.authcid === null;
    }
    /**
   * SASL ANONYMOUS authentication.
   */ constructor(mechname = 'ANONYMOUS', isClientFirst = false, priority = 20){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLExternal extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ onChallenge(connection) {
        /* According to XEP-178, an authzid SHOULD NOT be presented when the
     * authcid contained or implied in the client certificate is the JID (i.e.
     * authzid) with which the user wants to log in as.
     *
     * To NOT send the authzid, the user should therefore set the authcid equal
     * to the JID when instantiating a new Strophe.Connection object.
     */ return connection.authcid === connection.authzid ? '' : connection.authzid;
    }
    /**
   * SASL EXTERNAL authentication.
   *
   * The EXTERNAL mechanism allows a client to request the server to use
   * credentials established by means external to the mechanism to
   * authenticate the client. The external means may be, for instance,
   * TLS services.
   */ constructor(mechname = 'EXTERNAL', isClientFirst = true, priority = 10){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLOAuthBearer extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.pass !== null;
    }
    /**
   * @param {Connection} connection
   */ onChallenge(connection) {
        let auth_str = 'n,';
        if (connection.authcid !== null) {
            auth_str = auth_str + 'a=' + connection.authzid;
        }
        auth_str = auth_str + ',';
        auth_str = auth_str + '\u0001';
        auth_str = auth_str + 'auth=Bearer ';
        auth_str = auth_str + connection.pass;
        auth_str = auth_str + '\u0001';
        auth_str = auth_str + '\u0001';
        return utils.utf16to8(auth_str);
    }
    /**
   * SASL OAuth Bearer authentication.
   */ constructor(mechname = 'OAUTHBEARER', isClientFirst = true, priority = 40){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLPlain extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.authcid !== null;
    }
    /**
   * @param {Connection} connection
   */ onChallenge(connection) {
        const { authcid, authzid, domain, pass } = connection;
        if (!domain) {
            throw new Error('SASLPlain onChallenge: domain is not defined!');
        }
        // Only include authzid if it differs from authcid.
        // See: https://tools.ietf.org/html/rfc6120#section-6.3.8
        let auth_str = authzid !== `${authcid}@${domain}` ? authzid : '';
        auth_str = auth_str + '\u0000';
        auth_str = auth_str + authcid;
        auth_str = auth_str + '\u0000';
        auth_str = auth_str + pass;
        return utils.utf16to8(auth_str);
    }
    /**
   * SASL PLAIN authentication.
   */ constructor(mechname = 'PLAIN', isClientFirst = true, priority = 50){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ /**
 * @param {string} authMessage
 * @param {ArrayBufferLike} clientKey
 * @param {string} hashName
 */ function scramClientProof(authMessage, clientKey, hashName) {
    return _async_to_generator(function*() {
        const storedKey = yield crypto.subtle.importKey('raw', (yield crypto.subtle.digest(hashName, clientKey)), {
            'name': 'HMAC',
            'hash': hashName
        }, false, [
            'sign'
        ]);
        const clientSignature = yield crypto.subtle.sign('HMAC', storedKey, utils.stringToArrayBuf(authMessage));
        return utils.xorArrayBuffers(clientKey, clientSignature);
    })();
}
/**
 * This function parses the information in a SASL SCRAM challenge response,
 * into an object of the form
 * { nonce: String,
 *   salt:  ArrayBuffer,
 *   iter:  Int
 * }
 * Returns undefined on failure.
 * @param {string} challenge
 */ function scramParseChallenge(challenge) {
    let nonce, salt, iter;
    const attribMatch = /([a-z]+)=([^,]+)(,|$)/;
    while(challenge.match(attribMatch)){
        const matches = challenge.match(attribMatch);
        challenge = challenge.replace(matches[0], '');
        switch(matches[1]){
            case 'r':
                nonce = matches[2];
                break;
            case 's':
                salt = utils.base64ToArrayBuf(matches[2]);
                break;
            case 'i':
                iter = parseInt(matches[2], 10);
                break;
            case 'm':
                // Mandatory but unknown extension, per RFC 5802 we should abort
                return undefined;
        }
    }
    // Consider iteration counts less than 4096 insecure, as reccommended by
    // RFC 5802
    if (isNaN(iter) || iter < 4096) {
        log.warn('Failing SCRAM authentication because server supplied iteration count < 4096.');
        return undefined;
    }
    if (!salt) {
        log.warn('Failing SCRAM authentication because server supplied incorrect salt.');
        return undefined;
    }
    return {
        'nonce': nonce,
        'salt': salt,
        'iter': iter
    };
}
/**
 * Derive the client and server keys given a string password,
 * a hash name, and a bit length.
 * Returns an object of the following form:
 * { ck: ArrayBuffer, the client key
 *   sk: ArrayBuffer, the server key
 * }
 * @param {string} password
 * @param {BufferSource} salt
 * @param {number} iter
 * @param {string} hashName
 * @param {number} hashBits
 */ function scramDeriveKeys(password, salt, iter, hashName, hashBits) {
    return _async_to_generator(function*() {
        const saltedPasswordBits = yield crypto.subtle.deriveBits({
            'name': 'PBKDF2',
            'salt': salt,
            'iterations': iter,
            'hash': {
                'name': hashName
            }
        }, (yield crypto.subtle.importKey('raw', utils.stringToArrayBuf(password), 'PBKDF2', false, [
            'deriveBits'
        ])), hashBits);
        const saltedPassword = yield crypto.subtle.importKey('raw', saltedPasswordBits, {
            'name': 'HMAC',
            'hash': hashName
        }, false, [
            'sign'
        ]);
        return {
            'ck': yield crypto.subtle.sign('HMAC', saltedPassword, utils.stringToArrayBuf('Client Key')),
            'sk': yield crypto.subtle.sign('HMAC', saltedPassword, utils.stringToArrayBuf('Server Key'))
        };
    })();
}
/**
 * @param {string} authMessage
 * @param {BufferSource} sk
 * @param {string} hashName
 */ function scramServerSign(authMessage, sk, hashName) {
    return _async_to_generator(function*() {
        const serverKey = yield crypto.subtle.importKey('raw', sk, {
            'name': 'HMAC',
            'hash': hashName
        }, false, [
            'sign'
        ]);
        return crypto.subtle.sign('HMAC', serverKey, utils.stringToArrayBuf(authMessage));
    })();
}
/**
 * Generate an ASCII nonce (not containing the ',' character)
 * @return {string}
 */ function generate_cnonce() {
    // generate 16 random bytes of nonce, base64 encoded
    const bytes = new Uint8Array(16);
    return utils.arrayBufToBase64(crypto.getRandomValues(bytes).buffer);
}
/**
 * @typedef {Object} Password
 * @property {string} Password.name
 * @property {string} Password.ck
 * @property {string} Password.sk
 * @property {number} Password.iter
 * @property {string} salt
 */ const scram = {
    /**
   * On success, sets
   * connection_sasl_data["server-signature"]
   * and
   * connection._sasl_data.keys
   *
   * The server signature should be verified after this function completes..
   *
   * On failure, returns connection._sasl_failure_cb();
   * @param {Connection} connection
   * @param {string} challenge
   * @param {string} hashName
   * @param {number} hashBits
   */ scramResponse (connection, challenge, hashName, hashBits) {
        return _async_to_generator(function*() {
            const cnonce = connection._sasl_data.cnonce;
            const challengeData = scramParseChallenge(challenge);
            // The RFC requires that we verify the (server) nonce has the client
            // nonce as an initial substring.
            if (!challengeData && (challengeData === null || challengeData === void 0 ? void 0 : challengeData.nonce.slice(0, cnonce.length)) !== cnonce) {
                log.warn('Failing SCRAM authentication because server supplied incorrect nonce.');
                connection._sasl_data = {};
                return connection._sasl_failure_cb();
            }
            let clientKey, serverKey;
            const { pass } = connection;
            if (typeof connection.pass === 'string' || connection.pass instanceof String) {
                const keys = yield scramDeriveKeys(/** @type {string} */ pass, challengeData.salt, challengeData.iter, hashName, hashBits);
                clientKey = keys.ck;
                serverKey = keys.sk;
            } else if (// Either restore the client key and server key passed in, or derive new ones
            /** @type {Password} */ (pass === null || pass === void 0 ? void 0 : pass.name) === hashName && /** @type {Password} */ (pass === null || pass === void 0 ? void 0 : pass.salt) === utils.arrayBufToBase64(challengeData.salt) && /** @type {Password} */ (pass === null || pass === void 0 ? void 0 : pass.iter) === challengeData.iter) {
                const { ck, sk } = /** @type {Password} */ pass;
                clientKey = utils.base64ToArrayBuf(ck);
                serverKey = utils.base64ToArrayBuf(sk);
            } else {
                return connection._sasl_failure_cb();
            }
            const clientFirstMessageBare = connection._sasl_data['client-first-message-bare'];
            const serverFirstMessage = challenge;
            const clientFinalMessageBare = `c=biws,r=${challengeData.nonce}`;
            const authMessage = `${clientFirstMessageBare},${serverFirstMessage},${clientFinalMessageBare}`;
            const clientProof = yield scramClientProof(authMessage, clientKey, hashName);
            const serverSignature = yield scramServerSign(authMessage, serverKey, hashName);
            connection._sasl_data['server-signature'] = utils.arrayBufToBase64(serverSignature);
            connection._sasl_data.keys = {
                'name': hashName,
                'iter': challengeData.iter,
                'salt': utils.arrayBufToBase64(challengeData.salt),
                'ck': utils.arrayBufToBase64(clientKey),
                'sk': utils.arrayBufToBase64(serverKey)
            };
            return `${clientFinalMessageBare},p=${utils.arrayBufToBase64(clientProof)}`;
        })();
    },
    /**
   * Returns a string containing the client first message
   * @param {Connection} connection
   * @param {string} test_cnonce
   */ clientChallenge (connection, test_cnonce) {
        const cnonce = test_cnonce || generate_cnonce();
        const client_first_message_bare = `n=${connection.authcid},r=${cnonce}`;
        connection._sasl_data.cnonce = cnonce;
        connection._sasl_data['client-first-message-bare'] = client_first_message_bare;
        return `n,,${client_first_message_bare}`;
    }
};
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLSHA1 extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.authcid !== null;
    }
    /**
   * @param {Connection} connection
   * @param {string} [challenge]
   * @return {Promise<string|false>} Mechanism response.
   */ onChallenge(connection, challenge) {
        return _async_to_generator(function*() {
            return yield scram.scramResponse(connection, challenge, 'SHA-1', 160);
        })();
    }
    /**
   * @param {Connection} connection
   * @param {string} [test_cnonce]
   */ clientChallenge(connection, test_cnonce) {
        return scram.clientChallenge(connection, test_cnonce);
    }
    /**
   * SASL SCRAM SHA 1 authentication.
   */ constructor(mechname = 'SCRAM-SHA-1', isClientFirst = true, priority = 60){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLSHA256 extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.authcid !== null;
    }
    /**
   * @param {Connection} connection
   * @param {string} [challenge]
   */ onChallenge(connection, challenge) {
        return _async_to_generator(function*() {
            return yield scram.scramResponse(connection, challenge, 'SHA-256', 256);
        })();
    }
    /**
   * @param {Connection} connection
   * @param {string} [test_cnonce]
   */ clientChallenge(connection, test_cnonce) {
        return scram.clientChallenge(connection, test_cnonce);
    }
    /**
   * SASL SCRAM SHA 256 authentication.
   */ constructor(mechname = 'SCRAM-SHA-256', isClientFirst = true, priority = 70){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLSHA384 extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.authcid !== null;
    }
    /**
   * @param {Connection} connection
   * @param {string} [challenge]
   */ onChallenge(connection, challenge) {
        return _async_to_generator(function*() {
            return yield scram.scramResponse(connection, challenge, 'SHA-384', 384);
        })();
    }
    /**
   * @param {Connection} connection
   * @param {string} [test_cnonce]
   */ clientChallenge(connection, test_cnonce) {
        return scram.clientChallenge(connection, test_cnonce);
    }
    /**
   * SASL SCRAM SHA 384 authentication.
   */ constructor(mechname = 'SCRAM-SHA-384', isClientFirst = true, priority = 71){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLSHA512 extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.authcid !== null;
    }
    /**
   * @param {Connection} connection
   * @param {string} [challenge]
   */ onChallenge(connection, challenge) {
        return _async_to_generator(function*() {
            return yield scram.scramResponse(connection, challenge, 'SHA-512', 512);
        })();
    }
    /**
   * @param {Connection} connection
   * @param {string} [test_cnonce]
   */ clientChallenge(connection, test_cnonce) {
        return scram.clientChallenge(connection, test_cnonce);
    }
    /**
   * SASL SCRAM SHA 512 authentication.
   */ constructor(mechname = 'SCRAM-SHA-512', isClientFirst = true, priority = 72){
        super(mechname, isClientFirst, priority);
    }
}
/**
 * @typedef {import("./connection.js").default} Connection
 */ class SASLXOAuth2 extends SASLMechanism {
    /**
   * @param {Connection} connection
   */ test(connection) {
        return connection.pass !== null;
    }
    /**
   * @param {Connection} connection
   */ onChallenge(connection) {
        let auth_str = '\u0000';
        if (connection.authcid !== null) {
            auth_str = auth_str + connection.authzid;
        }
        auth_str = auth_str + '\u0000';
        auth_str = auth_str + connection.pass;
        return utils.utf16to8(auth_str);
    }
    /**
   * SASL X-OAuth2 authentication.
   */ constructor(mechname = 'X-OAUTH2', isClientFirst = true, priority = 30){
        super(mechname, isClientFirst, priority);
    }
}
class SessionError extends Error {
    /**
   * @param {string} message
   */ constructor(message){
        super(message);
        this.name = 'StropheSessionError';
    }
}
/**
 * A JavaScript library to enable XMPP over Websocket in Strophejs.
 *
 * This file implements XMPP over WebSockets for Strophejs.
 * If a Connection is established with a Websocket url (ws://...)
 * Strophe will use WebSockets.
 * For more information on XMPP-over-WebSocket see RFC 7395:
 * http://tools.ietf.org/html/rfc7395
 *
 * WebSocket support implemented by Andreas Guth (andreas.guth@rwth-aachen.de)
 */ /**
 * Helper class that handles WebSocket Connections
 *
 * The WebSocket class is used internally by Connection
 * to encapsulate WebSocket sessions. It is not meant to be used from user's code.
 */ class Websocket {
    /**
   * _Private_ helper function to generate the <stream> start tag for WebSockets
   * @private
   * @return {Builder} - A Builder with a <stream> element.
   */ _buildStream() {
        return $build('open', {
            'xmlns': NS.FRAMING,
            'to': this._conn.domain,
            'version': '1.0'
        });
    }
    /**
   * _Private_ checks a message for stream:error
   * @private
   * @param {Element} bodyWrap - The received stanza.
   * @param {number} connectstatus - The ConnectStatus that will be set on error.
   * @return {boolean} - true if there was a streamerror, false otherwise.
   */ _checkStreamError(bodyWrap, connectstatus) {
        let errors;
        if (bodyWrap.getElementsByTagNameNS) {
            errors = bodyWrap.getElementsByTagNameNS(NS.STREAM, 'error');
        } else {
            errors = bodyWrap.getElementsByTagName('stream:error');
        }
        if (errors.length === 0) {
            return false;
        }
        const error = errors[0];
        let condition = '';
        let text = '';
        const ns = 'urn:ietf:params:xml:ns:xmpp-streams';
        for(let i = 0; i < error.childNodes.length; i++){
            const e = error.childNodes[i];
            if (e.nodeType === e.ELEMENT_NODE) {
                /** @type {Element} */ const el = /** @type {any} */ e;
                if (el.getAttribute('xmlns') !== ns) {
                    break;
                }
            }
            if (e.nodeName === 'text') {
                text = e.textContent;
            } else {
                condition = e.nodeName;
            }
        }
        let errorString = 'WebSocket stream error: ';
        if (condition) {
            errorString += condition;
        } else {
            errorString += 'unknown';
        }
        if (text) {
            errorString += ' - ' + text;
        }
        log.error(errorString);
        // close the connection on stream_error
        this._conn._changeConnectStatus(connectstatus, condition);
        this._conn._doDisconnect();
        return true;
    }
    /**
   * Reset the connection.
   *
   * This function is called by the reset function of the Strophe Connection.
   * Is not needed by WebSockets.
   */ _reset() {
        return;
    }
    /**
   * _Private_ function called by Connection.connect
   *
   * Creates a WebSocket for a connection and assigns Callbacks to it.
   * Does nothing if there already is a WebSocket.
   */ _connect() {
        // Ensure that there is no open WebSocket from a previous Connection.
        this._closeSocket();
        /**
     * @typedef {Object} WebsocketLike
     * @property {(str: string) => void} WebsocketLike.send
     * @property {function(): void} WebsocketLike.close
     * @property {function(): void} WebsocketLike.onopen
     * @property {(e: ErrorEvent) => void} WebsocketLike.onerror
     * @property {(e: CloseEvent) => void} WebsocketLike.onclose
     * @property {(message: MessageEvent) => void} WebsocketLike.onmessage
     * @property {string} WebsocketLike.readyState
     */ /** @type {import('ws')|WebSocket|WebsocketLike} */ this.socket = new WebSocket(this._conn.service, 'xmpp');
        this.socket.onopen = ()=>this._onOpen();
        /** @param {ErrorEvent} e */ this.socket.onerror = (e)=>this._onError(e);
        /** @param {CloseEvent} e */ this.socket.onclose = (e)=>this._onClose(e);
        /**
     * Gets replaced with this._onMessage once _onInitialMessage is called
     * @param {MessageEvent} message
     */ this.socket.onmessage = (message)=>this._onInitialMessage(message);
    }
    /**
   * _Private_ function called by Connection._connect_cb
   * checks for stream:error
   * @param {Element} bodyWrap - The received stanza.
   */ _connect_cb(bodyWrap) {
        const error = this._checkStreamError(bodyWrap, Status.CONNFAIL);
        if (error) {
            return Status.CONNFAIL;
        }
    }
    /**
   * _Private_ function that checks the opening <open /> tag for errors.
   *
   * Disconnects if there is an error and returns false, true otherwise.
   * @private
   * @param {Element} message - Stanza containing the <open /> tag.
   */ _handleStreamStart(message) {
        let error = null;
        // Check for errors in the <open /> tag
        const ns = message.getAttribute('xmlns');
        if (typeof ns !== 'string') {
            error = 'Missing xmlns in <open />';
        } else if (ns !== NS.FRAMING) {
            error = 'Wrong xmlns in <open />: ' + ns;
        }
        const ver = message.getAttribute('version');
        if (typeof ver !== 'string') {
            error = 'Missing version in <open />';
        } else if (ver !== '1.0') {
            error = 'Wrong version in <open />: ' + ver;
        }
        if (error) {
            this._conn._changeConnectStatus(Status.CONNFAIL, error);
            this._conn._doDisconnect();
            return false;
        }
        return true;
    }
    /**
   * _Private_ function that handles the first connection messages.
   *
   * On receiving an opening stream tag this callback replaces itself with the real
   * message handler. On receiving a stream error the connection is terminated.
   * @param {MessageEvent} message
   */ _onInitialMessage(message) {
        if (message.data.indexOf('<open ') === 0 || message.data.indexOf('<?xml') === 0) {
            // Strip the XML Declaration, if there is one
            const data = message.data.replace(/^(<\?.*?\?>\s*)*/, '');
            if (data === '') return;
            const streamStart = new DOMParser().parseFromString(data, 'text/xml').documentElement;
            this._conn.xmlInput(streamStart);
            this._conn.rawInput(message.data);
            //_handleStreamSteart will check for XML errors and disconnect on error
            if (this._handleStreamStart(streamStart)) {
                //_connect_cb will check for stream:error and disconnect on error
                this._connect_cb(streamStart);
            }
        } else if (message.data.indexOf('<close ') === 0) {
            // <close xmlns="urn:ietf:params:xml:ns:xmpp-framing />
            // Parse the raw string to an XML element
            const parsedMessage = new DOMParser().parseFromString(message.data, 'text/xml').documentElement;
            // Report this input to the raw and xml handlers
            this._conn.xmlInput(parsedMessage);
            this._conn.rawInput(message.data);
            const see_uri = parsedMessage.getAttribute('see-other-uri');
            if (see_uri) {
                const service = this._conn.service;
                // Valid scenarios: WSS->WSS, WS->ANY
                const isSecureRedirect = service.indexOf('wss:') >= 0 && see_uri.indexOf('wss:') >= 0 || service.indexOf('ws:') >= 0;
                if (isSecureRedirect) {
                    this._conn._changeConnectStatus(Status.REDIRECT, 'Received see-other-uri, resetting connection');
                    this._conn.reset();
                    this._conn.service = see_uri;
                    this._connect();
                }
            } else {
                this._conn._changeConnectStatus(Status.CONNFAIL, 'Received closing stream');
                this._conn._doDisconnect();
            }
        } else {
            this._replaceMessageHandler();
            const string = this._streamWrap(message.data);
            const elem = new DOMParser().parseFromString(string, 'text/xml').documentElement;
            this._conn._connect_cb(elem, null, message.data);
        }
    }
    /**
   * Called by _onInitialMessage in order to replace itself with the general message handler.
   * This method is overridden by WorkerWebsocket, which manages a
   * websocket connection via a service worker and doesn't have direct access
   * to the socket.
   */ _replaceMessageHandler() {
        /** @param {MessageEvent} m */ this.socket.onmessage = (m)=>this._onMessage(m);
    }
    /**
   * _Private_ function called by Connection.disconnect
   * Disconnects and sends a last stanza if one is given
   * @param {Element|Builder} [pres] - This stanza will be sent before disconnecting.
   */ _disconnect(pres) {
        if (this.socket && this.socket.readyState !== WebSocket.CLOSED) {
            if (pres) {
                this._conn.send(pres);
            }
            const close = $build('close', {
                'xmlns': NS.FRAMING
            });
            this._conn.xmlOutput(close.tree());
            const closeString = Builder.serialize(close);
            this._conn.rawOutput(closeString);
            try {
                this.socket.send(closeString);
            } catch (e) {
                log.warn(`Couldn't send <close /> tag. "${e.message}"`);
            }
        }
        setTimeout(()=>this._conn._doDisconnect(), 0);
    }
    /**
   * _Private_ function to disconnect.
   * Just closes the Socket for WebSockets
   */ _doDisconnect() {
        log.debug('WebSockets _doDisconnect was called');
        this._closeSocket();
    }
    /**
   * PrivateFunction _streamWrap
   * _Private_ helper function to wrap a stanza in a <stream> tag.
   * This is used so Strophe can process stanzas from WebSockets like BOSH
   * @param {string} stanza
   */ _streamWrap(stanza) {
        return '<wrapper>' + stanza + '</wrapper>';
    }
    /**
   * _Private_ function to close the WebSocket.
   *
   * Closes the socket if it is still open and deletes it
   */ _closeSocket() {
        if (this.socket) {
            try {
                this.socket.onclose = null;
                this.socket.onerror = null;
                this.socket.onmessage = null;
                this.socket.close();
            } catch (e) {
                log.debug(e.message);
            }
        }
        this.socket = null;
    }
    /**
   * _Private_ function to check if the message queue is empty.
   * @return {true} - True, because WebSocket messages are send immediately after queueing.
   */ _emptyQueue() {
        return true;
    }
    /**
   * _Private_ function to handle websockets closing.
   * @param {CloseEvent} [e]
   */ _onClose(e) {
        if (this._conn.connected && !this._conn.disconnecting) {
            log.error('Websocket closed unexpectedly');
            this._conn._doDisconnect();
        } else if (e && e.code === 1006 && !this._conn.connected && this.socket) {
            // in case the onError callback was not called (Safari 10 does not
            // call onerror when the initial connection fails) we need to
            // dispatch a CONNFAIL status update to be consistent with the
            // behavior on other browsers.
            log.error('Websocket closed unexcectedly');
            this._conn._changeConnectStatus(Status.CONNFAIL, 'The WebSocket connection could not be established or was disconnected.');
            this._conn._doDisconnect();
        } else {
            log.debug('Websocket closed');
        }
    }
    /**
   * @callback connectionCallback
   * @param {Connection} connection
   */ /**
   * Called on stream start/restart when no stream:features
   * has been received.
   * @param {connectionCallback} callback
   */ _no_auth_received(callback) {
        log.error('Server did not offer a supported authentication mechanism');
        this._conn._changeConnectStatus(Status.CONNFAIL, ErrorCondition.NO_AUTH_MECH);
        callback === null || callback === void 0 ? void 0 : callback.call(this._conn);
        this._conn._doDisconnect();
    }
    /**
   * _Private_ timeout handler for handling non-graceful disconnection.
   *
   * This does nothing for WebSockets
   */ _onDisconnectTimeout() {}
    /**
   * _Private_ helper function that makes sure all pending requests are aborted.
   */ _abortAllRequests() {}
    /**
   * _Private_ function to handle websockets errors.
   * @param {Object} error - The websocket error.
   */ _onError(error) {
        log.error('Websocket error ' + JSON.stringify(error));
        this._conn._changeConnectStatus(Status.CONNFAIL, 'The WebSocket connection could not be established or was disconnected.');
        this._disconnect();
    }
    /**
   * _Private_ function called by Connection._onIdle
   * sends all queued stanzas
   */ _onIdle() {
        const data = this._conn._data;
        if (data.length > 0 && !this._conn.paused) {
            for(let i = 0; i < data.length; i++){
                if (data[i] !== null) {
                    const stanza = data[i] === 'restart' ? this._buildStream().tree() : data[i];
                    if (stanza === 'restart') throw new Error('Wrong type for stanza'); // Shut up tsc
                    const rawStanza = Builder.serialize(stanza);
                    this._conn.xmlOutput(stanza);
                    this._conn.rawOutput(rawStanza);
                    this.socket.send(rawStanza);
                }
            }
            this._conn._data = [];
        }
    }
    /**
   * _Private_ function to handle websockets messages.
   *
   * This function parses each of the messages as if they are full documents.
   * [TODO : We may actually want to use a SAX Push parser].
   *
   * Since all XMPP traffic starts with
   * <stream:stream version='1.0'
   *                xml:lang='en'
   *                xmlns='jabber:client'
   *                xmlns:stream='http://etherx.jabber.org/streams'
   *                id='3697395463'
   *                from='SERVER'>
   *
   * The first stanza will always fail to be parsed.
   *
   * Additionally, the seconds stanza will always be <stream:features> with
   * the stream NS defined in the previous stanza, so we need to 'force'
   * the inclusion of the NS in this stanza.
   *
   * @param {MessageEvent} message - The websocket message event
   */ _onMessage(message) {
        let elem;
        // check for closing stream
        const close = '<close xmlns="urn:ietf:params:xml:ns:xmpp-framing" />';
        if (message.data === close) {
            this._conn.rawInput(close);
            this._conn.xmlInput(message);
            if (!this._conn.disconnecting) {
                this._conn._doDisconnect();
            }
            return;
        } else if (message.data.search('<open ') === 0) {
            // This handles stream restarts
            elem = new DOMParser().parseFromString(message.data, 'text/xml').documentElement;
            if (!this._handleStreamStart(elem)) {
                return;
            }
        } else {
            const data = this._streamWrap(message.data);
            elem = new DOMParser().parseFromString(data, 'text/xml').documentElement;
        }
        if (this._checkStreamError(elem, Status.ERROR)) {
            return;
        }
        //handle unavailable presence stanza before disconnecting
        if (this._conn.disconnecting && elem.firstElementChild.nodeName === 'presence' && elem.firstElementChild.getAttribute('type') === 'unavailable') {
            this._conn.xmlInput(elem);
            this._conn.rawInput(Builder.serialize(elem));
            // if we are already disconnecting we will ignore the unavailable stanza and
            // wait for the </stream:stream> tag before we close the connection
            return;
        }
        this._conn._dataRecv(elem, message.data);
    }
    /**
   * _Private_ function to handle websockets connection setup.
   * The opening stream tag is sent here.
   * @private
   */ _onOpen() {
        log.debug('Websocket open');
        const start = this._buildStream();
        this._conn.xmlOutput(start.tree());
        const startString = Builder.serialize(start);
        this._conn.rawOutput(startString);
        this.socket.send(startString);
    }
    /**
   * _Private_ part of the Connection.send function for WebSocket
   * Just flushes the messages that are in the queue
   */ _send() {
        this._conn.flush();
    }
    /**
   * Send an xmpp:restart stanza.
   */ _sendRestart() {
        clearTimeout(this._conn._idleTimeout);
        this._conn._onIdle.bind(this._conn)();
    }
    /**
   * Create and initialize a WebSocket object.
   * Currently only sets the connection Object.
   * @param {Connection} connection - The Connection that will use WebSockets.
   */ constructor(connection){
        this._conn = connection;
        this.strip = 'wrapper';
        const service = connection.service;
        if (service.indexOf('ws:') !== 0 && service.indexOf('wss:') !== 0) {
            // If the service is not an absolute URL, assume it is a path and put the absolute
            // URL together from options, current URL and the path.
            let new_service = '';
            if (connection.options.protocol === 'ws' && location.protocol !== 'https:') {
                new_service += 'ws';
            } else {
                new_service += 'wss';
            }
            new_service += '://' + location.host;
            if (service.indexOf('/') !== 0) {
                new_service += location.pathname + service;
            } else {
                new_service += service;
            }
            connection.service = new_service;
        }
    }
}
/**
 * @license MIT
 * @copyright JC Brand
 */ /**
 * Helper class that handles a websocket connection inside a shared worker.
 */ class WorkerWebsocket extends Websocket {
    /**
   * @private
   */ _setSocket() {
        this.socket = {
            /** @param {string} str */ send: (str)=>this.worker.port.postMessage([
                    'send',
                    str
                ]),
            close: ()=>this.worker.port.postMessage([
                    '_closeSocket'
                ]),
            onopen: ()=>{},
            /** @param {ErrorEvent} e */ onerror: (e)=>this._onError(e),
            /** @param {CloseEvent} e */ onclose: (e)=>this._onClose(e),
            onmessage: ()=>{},
            readyState: null
        };
    }
    _connect() {
        this._setSocket();
        /** @param {MessageEvent} m */ this._messageHandler = (m)=>this._onInitialMessage(m);
        this.worker.port.start();
        this.worker.port.onmessage = (ev)=>this._onWorkerMessage(ev);
        this.worker.port.postMessage([
            '_connect',
            this._conn.service,
            this._conn.jid
        ]);
    }
    /**
   * @param {Function} callback
   */ _attach(callback) {
        this._setSocket();
        /** @param {MessageEvent} m */ this._messageHandler = (m)=>this._onMessage(m);
        this._conn.connect_callback = callback;
        this.worker.port.start();
        this.worker.port.onmessage = (ev)=>this._onWorkerMessage(ev);
        this.worker.port.postMessage([
            '_attach',
            this._conn.service
        ]);
    }
    /**
   * @param {number} status
   * @param {string} jid
   */ _attachCallback(status, jid) {
        if (status === Status.ATTACHED) {
            this._conn.jid = jid;
            this._conn.authenticated = true;
            this._conn.connected = true;
            this._conn.restored = true;
            this._conn._changeConnectStatus(Status.ATTACHED);
        } else if (status === Status.ATTACHFAIL) {
            this._conn.authenticated = false;
            this._conn.connected = false;
            this._conn.restored = false;
            this._conn._changeConnectStatus(Status.ATTACHFAIL);
        }
    }
    /**
   * @param {Element|Builder} pres - This stanza will be sent before disconnecting.
   */ _disconnect(pres) {
        pres && this._conn.send(pres);
        const close = $build('close', {
            'xmlns': NS.FRAMING
        });
        this._conn.xmlOutput(close.tree());
        const closeString = Builder.serialize(close);
        this._conn.rawOutput(closeString);
        this.worker.port.postMessage([
            'send',
            closeString
        ]);
        this._conn._doDisconnect();
    }
    _closeSocket() {
        this.socket.close();
    }
    /**
   * Called by _onInitialMessage in order to replace itself with the general message handler.
   * This method is overridden by WorkerWebsocket, which manages a
   * websocket connection via a service worker and doesn't have direct access
   * to the socket.
   */ _replaceMessageHandler() {
        /** @param {MessageEvent} m */ this._messageHandler = (m)=>this._onMessage(m);
    }
    /**
   * function that handles messages received from the service worker
   * @private
   * @param {MessageEvent} ev
   */ _onWorkerMessage(ev) {
        const { data } = ev;
        const method_name = data[0];
        if (method_name === '_onMessage') {
            this._messageHandler(data[1]);
        } else if (method_name in this) {
            try {
                this[/** @type {'_attachCallback'|'_onOpen'|'_onClose'|'_onError'} */ method_name].apply(this, ev.data.slice(1));
            } catch (e) {
                log.error(e);
            }
        } else if (method_name === 'log') {
            /** @type {Object.<string, number>} */ const lmap = {
                debug: LOG_LEVELS.DEBUG,
                info: LOG_LEVELS.INFO,
                warn: LOG_LEVELS.WARN,
                error: LOG_LEVELS.ERROR,
                fatal: LOG_LEVELS.FATAL
            };
            const level = data[1];
            const msg = data[2];
            log.log(lmap[level], msg);
        } else {
            log.error(`Found unhandled service worker message: ${data}`);
        }
    }
    /**
   * @typedef {import("./connection.js").default} Connection
   */ /**
   * Create and initialize a WorkerWebsocket object.
   * @param {Connection} connection - The Connection
   */ constructor(connection){
        super(connection);
        this._conn = connection;
        this.worker = new SharedWorker(this._conn.options.worker, 'Strophe XMPP Connection');
        this.worker.onerror = (e)=>{
            var _console;
            (_console = console) === null || _console === void 0 ? void 0 : _console.error(e);
            log.error(`Shared Worker Error: ${e}`);
        };
    }
}
/**
 * @typedef {import("./sasl.js").default} SASLMechanism
 * @typedef {import("./request.js").default} Request
 *
 * @typedef {Object} ConnectionOptions
 * @property {Cookies} [cookies]
 *  Allows you to pass in cookies that will be included in HTTP requests.
 *  Relevant to both the BOSH and Websocket transports.
 *
 *  The passed in value must be a map of cookie names and string values.
 *
 *  > { "myCookie": {
 *  >     "value": "1234",
 *  >     "domain": ".example.org",
 *  >     "path": "/",
 *  >     "expires": expirationDate
 *  >     }
 *  > }
 *
 *  Note that cookies can't be set in this way for domains other than the one
 *  that's hosting Strophe (i.e. cross-domain).
 *  Those cookies need to be set under those domains, for example they can be
 *  set server-side by making a XHR call to that domain to ask it to set any
 *  necessary cookies.
 * @property {SASLMechanism[]} [mechanisms]
 *  Allows you to specify the SASL authentication mechanisms that this
 *  instance of Connection (and therefore your XMPP client) will support.
 *
 *  The value must be an array of objects with {@link SASLMechanism}
 *  prototypes.
 *
 *  If nothing is specified, then the following mechanisms (and their
 *  priorities) are registered:
 *
 *      Mechanism       Priority
 *      ------------------------
 *      SCRAM-SHA-512   72
 *      SCRAM-SHA-384   71
 *      SCRAM-SHA-256   70
 *      SCRAM-SHA-1     60
 *      PLAIN           50
 *      OAUTHBEARER     40
 *      X-OAUTH2        30
 *      ANONYMOUS       20
 *      EXTERNAL        10
 *
 * @property {boolean} [explicitResourceBinding]
 *  If `explicitResourceBinding` is set to `true`, then the XMPP client
 *  needs to explicitly call {@link Connection.bind} once the XMPP
 *  server has advertised the `urn:ietf:propertys:xml:ns:xmpp-bind` feature.
 *
 *  Making this step explicit allows client authors to first finish other
 *  stream related tasks, such as setting up an XEP-0198 Stream Management
 *  session, before binding the JID resource for this session.
 *
 * @property {'ws'|'wss'} [protocol]
 *  _Note: This option is only relevant to Websocket connections, and not BOSH_
 *
 *  If you want to connect to the current host with a WebSocket connection you
 *  can tell Strophe to use WebSockets through the "protocol" option.
 *  Valid values are `ws` for WebSocket and `wss` for Secure WebSocket.
 *  So to connect to "wss://CURRENT_HOSTNAME/xmpp-websocket" you would call
 *
 *      const conn = new Strophe.Connection(
 *          "/xmpp-websocket/",
 *          {protocol: "wss"}
 *      );
 *
 *  Note that relative URLs _NOT_ starting with a "/" will also include the path
 *  of the current site.
 *
 *  Also because downgrading security is not permitted by browsers, when using
 *  relative URLs both BOSH and WebSocket connections will use their secure
 *  variants if the current connection to the site is also secure (https).
 *
 * @property {string} [worker]
 *  _Note: This option is only relevant to Websocket connections, and not BOSH_
 *
 *  Set this option to URL from where the shared worker script should be loaded.
 *
 *  To run the websocket connection inside a shared worker.
 *  This allows you to share a single websocket-based connection between
 *  multiple Connection instances, for example one per browser tab.
 *
 *  The script to use is the one in `src/shared-connection-worker.js`.
 *
 * @property {boolean} [sync]
 *  Used to control whether BOSH HTTP requests will be made synchronously or not.
 *  The default behaviour is asynchronous. If you want to make requests
 *  synchronous, make "sync" evaluate to true.
 *
 *  > const conn = new Strophe.Connection("/http-bind/", {sync: true});
 *
 *  You can also toggle this on an already established connection.
 *
 *  > conn.options.sync = true;
 *
 * @property {string[]} [customHeaders]
 *  Used to provide custom HTTP headers to be included in the BOSH HTTP requests.
 *
 * @property {boolean} [keepalive]
 *  Used to instruct Strophe to maintain the current BOSH session across
 *  interruptions such as webpage reloads.
 *
 *  It will do this by caching the sessions tokens in sessionStorage, and when
 *  "restore" is called it will check whether there are cached tokens with
 *  which it can resume an existing session.
 *
 * @property {boolean} [withCredentials]
 *  Used to indicate wether cookies should be included in HTTP requests (by default
 *  they're not).
 *  Set this value to `true` if you are connecting to a BOSH service
 *  and for some reason need to send cookies to it.
 *  In order for this to work cross-domain, the server must also enable
 *  credentials by setting the `Access-Control-Allow-Credentials` response header
 *  to "true". For most usecases however this setting should be false (which
 *  is the default).
 *  Additionally, when using `Access-Control-Allow-Credentials`, the
 *  `Access-Control-Allow-Origin` header can't be set to the wildcard "*", but
 *  instead must be restricted to actual domains.
 *
 * @property {string} [contentType]
 *  Used to change the default Content-Type, which is "text/xml; charset=utf-8".
 *  Can be useful to reduce the amount of CORS preflight requests that are sent
 *  to the server.
 */ /**
 * _Private_ variable Used to store plugin names that need
 * initialization during Connection construction.
 * @type {Object.<string, Object>}
 */ const connectionPlugins = {};
/**
 * **XMPP Connection manager**
 *
 * This class is the main part of Strophe.  It manages a BOSH or websocket
 * connection to an XMPP server and dispatches events to the user callbacks
 * as data arrives.
 *
 * It supports various authentication mechanisms (e.g. SASL PLAIN, SASL SCRAM),
 * and more can be added via
 * {@link Connection#registerSASLMechanisms|registerSASLMechanisms()}.
 *
 * After creating a Connection object, the user will typically
 * call {@link Connection#connect|connect()} with a user supplied callback
 * to handle connection level events like authentication failure,
 * disconnection, or connection complete.
 *
 * The user will also have several event handlers defined by using
 * {@link Connection#addHandler|addHandler()} and
 * {@link Connection#addTimedHandler|addTimedHandler()}.
 * These will allow the user code to respond to interesting stanzas or do
 * something periodically with the connection. These handlers will be active
 * once authentication is finished.
 *
 * To send data to the connection, use {@link Connection#send|send()}.
 *
 * @memberof Strophe
 */ class Connection {
    /**
   * Extends the Connection object with the given plugin.
   * @param {string} name - The name of the extension.
   * @param {Object} ptype - The plugin's prototype.
   */ static addConnectionPlugin(name, ptype) {
        connectionPlugins[name] = ptype;
    }
    /**
   * Select protocal based on this.options or this.service
   */ setProtocol() {
        const proto = this.options.protocol || '';
        if (this.options.worker) {
            this._proto = new WorkerWebsocket(this);
        } else if (this.service.indexOf('ws:') === 0 || this.service.indexOf('wss:') === 0 || proto.indexOf('ws') === 0) {
            this._proto = new Websocket(this);
        } else {
            this._proto = new Bosh(this);
        }
    }
    /**
   * Reset the connection.
   *
   * This function should be called after a connection is disconnected
   * before that connection is reused.
   */ reset() {
        this._proto._reset();
        // SASL
        this.do_session = false;
        this.do_bind = false;
        // handler lists
        this.timedHandlers = [];
        this.handlers = [];
        this.removeTimeds = [];
        this.removeHandlers = [];
        this.addTimeds = [];
        this.addHandlers = [];
        this.authenticated = false;
        this.connected = false;
        this.disconnecting = false;
        this.restored = false;
        this._data = [];
        /** @type {Request[]} */ this._requests = [];
        this._uniqueId = 0;
    }
    /**
   * Pause the request manager.
   *
   * This will prevent Strophe from sending any more requests to the
   * server.  This is very useful for temporarily pausing
   * BOSH-Connections while a lot of send() calls are happening quickly.
   * This causes Strophe to send the data in a single request, saving
   * many request trips.
   */ pause() {
        this.paused = true;
    }
    /**
   * Resume the request manager.
   *
   * This resumes after pause() has been called.
   */ resume() {
        this.paused = false;
    }
    /**
   * Generate a unique ID for use in <iq/> elements.
   *
   * All <iq/> stanzas are required to have unique id attributes.  This
   * function makes creating these easy.  Each connection instance has
   * a counter which starts from zero, and the value of this counter
   * plus a colon followed by the suffix becomes the unique id. If no
   * suffix is supplied, the counter is used as the unique id.
   *
   * Suffixes are used to make debugging easier when reading the stream
   * data, and their use is recommended.  The counter resets to 0 for
   * every new connection for the same reason.  For connections to the
   * same server that authenticate the same way, all the ids should be
   * the same, which makes it easy to see changes.  This is useful for
   * automated testing as well.
   *
   * @param {string} suffix - A optional suffix to append to the id.
   * @returns {string} A unique string to be used for the id attribute.
   */ getUniqueId(suffix) {
        const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
            const r = Math.random() * 16 | 0, v = c === 'x' ? r : r & 0x3 | 0x8;
            return v.toString(16);
        });
        if (typeof suffix === 'string' || typeof suffix === 'number') {
            return uuid + ':' + suffix;
        } else {
            return uuid + '';
        }
    }
    /**
   * Register a handler function for when a protocol (websocker or HTTP)
   * error occurs.
   *
   * NOTE: Currently only HTTP errors for BOSH requests are handled.
   * Patches that handle websocket errors would be very welcome.
   *
   * @example
   *  function onError(err_code){
   *    //do stuff
   *  }
   *
   *  const conn = Strophe.connect('http://example.com/http-bind');
   *  conn.addProtocolErrorHandler('HTTP', 500, onError);
   *  // Triggers HTTP 500 error and onError handler will be called
   *  conn.connect('user_jid@incorrect_jabber_host', 'secret', onConnect);
   *
   * @param {'HTTP'|'websocket'} protocol - 'HTTP' or 'websocket'
   * @param {number} status_code - Error status code (e.g 500, 400 or 404)
   * @param {Function} callback - Function that will fire on Http error
   */ addProtocolErrorHandler(protocol, status_code, callback) {
        this.protocolErrorHandlers[protocol][status_code] = callback;
    }
    /**
   * @typedef {Object} Password
   * @property {string} Password.name
   * @property {string} Password.ck
   * @property {string} Password.sk
   * @property {number} Password.iter
   * @property {string} Password.salt
   */ /**
   * Starts the connection process.
   *
   * As the connection process proceeds, the user supplied callback will
   * be triggered multiple times with status updates.  The callback
   * should take two arguments - the status code and the error condition.
   *
   * The status code will be one of the values in the Strophe.Status
   * constants.  The error condition will be one of the conditions
   * defined in RFC 3920 or the condition 'strophe-parsererror'.
   *
   * The Parameters _wait_, _hold_ and _route_ are optional and only relevant
   * for BOSH connections. Please see XEP 124 for a more detailed explanation
   * of the optional parameters.
   *
   * @param {string} jid - The user's JID.  This may be a bare JID,
   *     or a full JID.  If a node is not supplied, SASL OAUTHBEARER or
   *     SASL ANONYMOUS authentication will be attempted (OAUTHBEARER will
   *     process the provided password value as an access token).
   *   (String or Object) pass - The user's password, or an object containing
   *     the users SCRAM client and server keys, in a fashion described as follows:
   *
   *     { name: String, representing the hash used (eg. SHA-1),
   *       salt: String, base64 encoded salt used to derive the client key,
   *       iter: Int,    the iteration count used to derive the client key,
   *       ck:   String, the base64 encoding of the SCRAM client key
   *       sk:   String, the base64 encoding of the SCRAM server key
   *     }
   * @param {string|Password} pass - The user password
   * @param {Function} callback - The connect callback function.
   * @param {number} [wait] - The optional HTTPBIND wait value.  This is the
   *     time the server will wait before returning an empty result for
   *     a request.  The default setting of 60 seconds is recommended.
   * @param {number} [hold] - The optional HTTPBIND hold value.  This is the
   *     number of connections the server will hold at one time.  This
   *     should almost always be set to 1 (the default).
   * @param {string} [route] - The optional route value.
   * @param {string} [authcid] - The optional alternative authentication identity
   *     (username) if intending to impersonate another user.
   *     When using the SASL-EXTERNAL authentication mechanism, for example
   *     with client certificates, then the authcid value is used to
   *     determine whether an authorization JID (authzid) should be sent to
   *     the server. The authzid should NOT be sent to the server if the
   *     authzid and authcid are the same. So to prevent it from being sent
   *     (for example when the JID is already contained in the client
   *     certificate), set authcid to that same JID. See XEP-178 for more
   *     details.
   *  @param {number} [disconnection_timeout=3000] - The optional disconnection timeout
   *     in milliseconds before _doDisconnect will be called.
   */ connect(jid, pass, callback, wait, hold, route, authcid, disconnection_timeout = 3000) {
        this.jid = jid;
        /** Authorization identity */ this.authzid = getBareJidFromJid(this.jid);
        /** Authentication identity (User name) */ this.authcid = authcid || getNodeFromJid(this.jid);
        /** Authentication identity (User password) */ this.pass = pass;
        /**
     * The SASL SCRAM client and server keys. This variable will be populated with a non-null
     * object of the above described form after a successful SCRAM connection
     */ this.scram_keys = null;
        this.connect_callback = callback;
        this.disconnecting = false;
        this.connected = false;
        this.authenticated = false;
        this.restored = false;
        this.disconnection_timeout = disconnection_timeout;
        // parse jid for domain
        this.domain = getDomainFromJid(this.jid);
        this._changeConnectStatus(Status.CONNECTING, null);
        this._proto._connect(wait, hold, route);
    }
    /**
   * Attach to an already created and authenticated BOSH session.
   *
   * This function is provided to allow Strophe to attach to BOSH
   * sessions which have been created externally, perhaps by a Web
   * application.  This is often used to support auto-login type features
   * without putting user credentials into the page.
   *
   * @param {string|Function} jid - The full JID that is bound by the session.
   * @param {string} [sid] - The SID of the BOSH session.
   * @param {number} [rid] - The current RID of the BOSH session.  This RID
   *     will be used by the next request.
   * @param {Function} [callback] - The connect callback function.
   * @param {number} [wait] - The optional HTTPBIND wait value.  This is the
   *     time the server will wait before returning an empty result for
   *     a request.  The default setting of 60 seconds is recommended.
   *     Other settings will require tweaks to the Strophe.TIMEOUT value.
   * @param {number} [hold] - The optional HTTPBIND hold value.  This is the
   *     number of connections the server will hold at one time.  This
   *     should almost always be set to 1 (the default).
   * @param {number} [wind] - The optional HTTBIND window value.  This is the
   *     allowed range of request ids that are valid.  The default is 5.
   */ attach(jid, sid, rid, callback, wait, hold, wind) {
        if (this._proto instanceof Bosh && typeof jid === 'string') {
            return this._proto._attach(jid, sid, rid, callback, wait, hold, wind);
        } else if (this._proto instanceof WorkerWebsocket && typeof jid === 'function') {
            const callback = jid;
            return this._proto._attach(callback);
        } else {
            throw new SessionError('The "attach" method is not available for your connection protocol');
        }
    }
    /**
   * Attempt to restore a cached BOSH session.
   *
   * This function is only useful in conjunction with providing the
   * "keepalive":true option when instantiating a new {@link Connection}.
   *
   * When "keepalive" is set to true, Strophe will cache the BOSH tokens
   * RID (Request ID) and SID (Session ID) and then when this function is
   * called, it will attempt to restore the session from those cached
   * tokens.
   *
   * This function must therefore be called instead of connect or attach.
   *
   * For an example on how to use it, please see examples/restore.js
   *
   * @param {string} jid - The user's JID.  This may be a bare JID or a full JID.
   * @param {Function} callback - The connect callback function.
   * @param {number} [wait] - The optional HTTPBIND wait value.  This is the
   *     time the server will wait before returning an empty result for
   *     a request.  The default setting of 60 seconds is recommended.
   * @param {number} [hold] - The optional HTTPBIND hold value.  This is the
   *     number of connections the server will hold at one time.  This
   *     should almost always be set to 1 (the default).
   * @param {number} [wind] - The optional HTTBIND window value.  This is the
   *     allowed range of request ids that are valid.  The default is 5.
   */ restore(jid, callback, wait, hold, wind) {
        if (!(this._proto instanceof Bosh) || !this._sessionCachingSupported()) {
            throw new SessionError('The "restore" method can only be used with a BOSH connection.');
        }
        if (this._sessionCachingSupported()) {
            this._proto._restore(jid, callback, wait, hold, wind);
        }
    }
    /**
   * Checks whether sessionStorage and JSON are supported and whether we're
   * using BOSH.
   */ _sessionCachingSupported() {
        if (this._proto instanceof Bosh) {
            if (!JSON) {
                return false;
            }
            try {
                sessionStorage.setItem('_strophe_', '_strophe_');
                sessionStorage.removeItem('_strophe_');
            } catch (_e) {
                return false;
            }
            return true;
        }
        return false;
    }
    /**
   * User overrideable function that receives XML data coming into the
   * connection.
   *
   * The default function does nothing.  User code can override this with
   * > Connection.xmlInput = function (elem) {
   * >   (user code)
   * > };
   *
   * Due to limitations of current Browsers' XML-Parsers the opening and closing
   * <stream> tag for WebSocket-Connoctions will be passed as selfclosing here.
   *
   * BOSH-Connections will have all stanzas wrapped in a <body> tag. See
   * <Bosh.strip> if you want to strip this tag.
   *
   * @param {Node|MessageEvent} _elem - The XML data received by the connection.
   */ xmlInput(_elem) {
        return;
    }
    /**
   * User overrideable function that receives XML data sent to the
   * connection.
   *
   * The default function does nothing.  User code can override this with
   * > Connection.xmlOutput = function (elem) {
   * >   (user code)
   * > };
   *
   * Due to limitations of current Browsers' XML-Parsers the opening and closing
   * <stream> tag for WebSocket-Connoctions will be passed as selfclosing here.
   *
   * BOSH-Connections will have all stanzas wrapped in a <body> tag. See
   * <Bosh.strip> if you want to strip this tag.
   *
   * @param {Element} _elem - The XMLdata sent by the connection.
   */ xmlOutput(_elem) {
        return;
    }
    /**
   * User overrideable function that receives raw data coming into the
   * connection.
   *
   * The default function does nothing.  User code can override this with
   * > Connection.rawInput = function (data) {
   * >   (user code)
   * > };
   *
   * @param {string} _data - The data received by the connection.
   */ rawInput(_data) {
        return;
    }
    /**
   * User overrideable function that receives raw data sent to the
   * connection.
   *
   * The default function does nothing.  User code can override this with
   * > Connection.rawOutput = function (data) {
   * >   (user code)
   * > };
   *
   * @param {string} _data - The data sent by the connection.
   */ rawOutput(_data) {
        return;
    }
    /**
   * User overrideable function that receives the new valid rid.
   *
   * The default function does nothing. User code can override this with
   * > Connection.nextValidRid = function (rid) {
   * >    (user code)
   * > };
   *
   * @param {number} _rid - The next valid rid
   */ nextValidRid(_rid) {
        return;
    }
    /**
   * Send a stanza.
   *
   * This function is called to push data onto the send queue to
   * go out over the wire.  Whenever a request is sent to the BOSH
   * server, all pending data is sent and the queue is flushed.
   *
   * @param {Element|Builder|Element[]|Builder[]} stanza - The stanza to send
   */ send(stanza) {
        if (stanza === null) return;
        if (Array.isArray(stanza)) {
            stanza.forEach((s)=>this._queueData(s instanceof Builder ? s.tree() : s));
        } else {
            const el = stanza instanceof Builder ? stanza.tree() : stanza;
            this._queueData(el);
        }
        this._proto._send();
    }
    /**
   * Immediately send any pending outgoing data.
   *
   * Normally send() queues outgoing data until the next idle period
   * (100ms), which optimizes network use in the common cases when
   * several send()s are called in succession. flush() can be used to
   * immediately send all pending data.
   */ flush() {
        // cancel the pending idle period and run the idle function
        // immediately
        clearTimeout(this._idleTimeout);
        this._onIdle();
    }
    /**
   * Helper function to send presence stanzas. The main benefit is for
   * sending presence stanzas for which you expect a responding presence
   * stanza with the same id (for example when leaving a chat room).
   *
   * @param {Element} stanza - The stanza to send.
   * @param {Function} [callback] - The callback function for a successful request.
   * @param {Function} [errback] - The callback function for a failed or timed
   *    out request.  On timeout, the stanza will be null.
   * @param {number} [timeout] - The time specified in milliseconds for a
   *    timeout to occur.
   * @return {string} The id used to send the presence.
   */ sendPresence(stanza, callback, errback, timeout) {
        /** @type {TimedHandler} */ let timeoutHandler = null;
        const el = stanza instanceof Builder ? stanza.tree() : stanza;
        let id = el.getAttribute('id');
        if (!id) {
            // inject id if not found
            id = this.getUniqueId('sendPresence');
            el.setAttribute('id', id);
        }
        if (typeof callback === 'function' || typeof errback === 'function') {
            const handler = this.addHandler(/** @param {Element} stanza */ (stanza)=>{
                // remove timeout handler if there is one
                if (timeoutHandler) this.deleteTimedHandler(timeoutHandler);
                if (stanza.getAttribute('type') === 'error') {
                    errback === null || errback === void 0 ? void 0 : errback(stanza);
                } else if (callback) {
                    callback(stanza);
                }
            }, null, 'presence', null, id);
            // if timeout specified, set up a timeout handler.
            if (timeout) {
                timeoutHandler = this.addTimedHandler(timeout, ()=>{
                    // get rid of normal handler
                    this.deleteHandler(handler);
                    // call errback on timeout with null stanza
                    errback === null || errback === void 0 ? void 0 : errback(null);
                    return false;
                });
            }
        }
        this.send(el);
        return id;
    }
    /**
   * Helper function to send IQ stanzas.
   *
   * @param {Element|Builder} stanza - The stanza to send.
   * @param {Function} [callback] - The callback function for a successful request.
   * @param {Function} [errback] - The callback function for a failed or timed
   *     out request.  On timeout, the stanza will be null.
   * @param {number} [timeout] - The time specified in milliseconds for a
   *     timeout to occur.
   * @return {string} The id used to send the IQ.
   */ sendIQ(stanza, callback, errback, timeout) {
        /** @type {TimedHandler} */ let timeoutHandler = null;
        const el = stanza instanceof Builder ? stanza.tree() : stanza;
        let id = el.getAttribute('id');
        if (!id) {
            // inject id if not found
            id = this.getUniqueId('sendIQ');
            el.setAttribute('id', id);
        }
        if (typeof callback === 'function' || typeof errback === 'function') {
            const handler = this.addHandler(/** @param {Element} stanza */ (stanza)=>{
                // remove timeout handler if there is one
                if (timeoutHandler) this.deleteTimedHandler(timeoutHandler);
                const iqtype = stanza.getAttribute('type');
                if (iqtype === 'result') {
                    callback === null || callback === void 0 ? void 0 : callback(stanza);
                } else if (iqtype === 'error') {
                    errback === null || errback === void 0 ? void 0 : errback(stanza);
                } else {
                    const error = new Error(`Got bad IQ type of ${iqtype}`);
                    error.name = 'StropheError';
                    throw error;
                }
            }, null, 'iq', [
                'error',
                'result'
            ], id);
            // if timeout specified, set up a timeout handler.
            if (timeout) {
                timeoutHandler = this.addTimedHandler(timeout, ()=>{
                    // get rid of normal handler
                    this.deleteHandler(handler);
                    // call errback on timeout with null stanza
                    errback === null || errback === void 0 ? void 0 : errback(null);
                    return false;
                });
            }
        }
        this.send(el);
        return id;
    }
    /**
   * Queue outgoing data for later sending.  Also ensures that the data
   * is a DOMElement.
   * @private
   * @param {Element} element
   */ _queueData(element) {
        if (element === null || !element.tagName || !element.childNodes) {
            const error = new Error('Cannot queue non-DOMElement.');
            error.name = 'StropheError';
            throw error;
        }
        this._data.push(element);
    }
    /**
   * Send an xmpp:restart stanza.
   * @private
   */ _sendRestart() {
        this._data.push('restart');
        this._proto._sendRestart();
        this._idleTimeout = setTimeout(()=>this._onIdle(), 100);
    }
    /**
   * Add a timed handler to the connection.
   *
   * This function adds a timed handler.  The provided handler will
   * be called every period milliseconds until it returns false,
   * the connection is terminated, or the handler is removed.  Handlers
   * that wish to continue being invoked should return true.
   *
   * Because of method binding it is necessary to save the result of
   * this function if you wish to remove a handler with
   * deleteTimedHandler().
   *
   * Note that user handlers are not active until authentication is
   * successful.
   *
   * @param {number} period - The period of the handler.
   * @param {Function} handler - The callback function.
   * @return {TimedHandler} A reference to the handler that can be used to remove it.
   */ addTimedHandler(period, handler) {
        const thand = new TimedHandler(period, handler);
        this.addTimeds.push(thand);
        return thand;
    }
    /**
   * Delete a timed handler for a connection.
   *
   * This function removes a timed handler from the connection.  The
   * handRef parameter is *not* the function passed to addTimedHandler(),
   * but is the reference returned from addTimedHandler().
   * @param {TimedHandler} handRef - The handler reference.
   */ deleteTimedHandler(handRef) {
        // this must be done in the Idle loop so that we don't change
        // the handlers during iteration
        this.removeTimeds.push(handRef);
    }
    /**
   * @typedef {Object} HandlerOptions
   * @property {boolean} [HandlerOptions.matchBareFromJid]
   * @property {boolean} [HandlerOptions.ignoreNamespaceFragment]
   */ /**
   * Add a stanza handler for the connection.
   *
   * This function adds a stanza handler to the connection.  The
   * handler callback will be called for any stanza that matches
   * the parameters.  Note that if multiple parameters are supplied,
   * they must all match for the handler to be invoked.
   *
   * The handler will receive the stanza that triggered it as its argument.
   * *The handler should return true if it is to be invoked again;
   * returning false will remove the handler after it returns.*
   *
   * As a convenience, the ns parameters applies to the top level element
   * and also any of its immediate children.  This is primarily to make
   * matching /iq/query elements easy.
   *
   * ### Options
   *
   * With the options argument, you can specify boolean flags that affect how
   * matches are being done.
   *
   * Currently two flags exist:
   *
   * * *matchBareFromJid*:
   *     When set to true, the from parameter and the
   *     from attribute on the stanza will be matched as bare JIDs instead
   *     of full JIDs. To use this, pass {matchBareFromJid: true} as the
   *     value of options. The default value for matchBareFromJid is false.
   *
   * * *ignoreNamespaceFragment*:
   *     When set to true, a fragment specified on the stanza's namespace
   *     URL will be ignored when it's matched with the one configured for
   *     the handler.
   *
   *     This means that if you register like this:
   *
   *     >   connection.addHandler(
   *     >       handler,
   *     >       'http://jabber.org/protocol/muc',
   *     >       null, null, null, null,
   *     >       {'ignoreNamespaceFragment': true}
   *     >   );
   *
   *     Then a stanza with XML namespace of
   *     'http://jabber.org/protocol/muc#user' will also be matched. If
   *     'ignoreNamespaceFragment' is false, then only stanzas with
   *     'http://jabber.org/protocol/muc' will be matched.
   *
   * ### Deleting the handler
   *
   * The return value should be saved if you wish to remove the handler
   * with `deleteHandler()`.
   *
   * @param {Function} handler - The user callback.
   * @param {string} ns - The namespace to match.
   * @param {string} name - The stanza name to match.
   * @param {string|string[]} type - The stanza type (or types if an array) to match.
   * @param {string} [id] - The stanza id attribute to match.
   * @param {string} [from] - The stanza from attribute to match.
   * @param {HandlerOptions} [options] - The handler options
   * @return {Handler} A reference to the handler that can be used to remove it.
   */ addHandler(handler, ns, name, type, id, from, options) {
        const hand = new Handler(handler, ns, name, type, id, from, options);
        this.addHandlers.push(hand);
        return hand;
    }
    /**
   * Delete a stanza handler for a connection.
   *
   * This function removes a stanza handler from the connection.  The
   * handRef parameter is *not* the function passed to addHandler(),
   * but is the reference returned from addHandler().
   *
   * @param {Handler} handRef - The handler reference.
   */ deleteHandler(handRef) {
        // this must be done in the Idle loop so that we don't change
        // the handlers during iteration
        this.removeHandlers.push(handRef);
        // If a handler is being deleted while it is being added,
        // prevent it from getting added
        const i = this.addHandlers.indexOf(handRef);
        if (i >= 0) {
            this.addHandlers.splice(i, 1);
        }
    }
    /**
   * Register the SASL mechanisms which will be supported by this instance of
   * Connection (i.e. which this XMPP client will support).
   * @param {SASLMechanism[]} mechanisms - Array of objects with SASLMechanism prototypes
   */ registerSASLMechanisms(mechanisms) {
        this.mechanisms = {};
        (mechanisms || [
            SASLAnonymous,
            SASLExternal,
            SASLOAuthBearer,
            SASLXOAuth2,
            SASLPlain,
            SASLSHA1,
            SASLSHA256,
            SASLSHA384,
            SASLSHA512
        ]).forEach((m)=>this.registerSASLMechanism(m));
    }
    /**
   * Register a single SASL mechanism, to be supported by this client.
   * @param {any} Mechanism - Object with a Strophe.SASLMechanism prototype
   */ registerSASLMechanism(Mechanism) {
        const mechanism = new Mechanism();
        this.mechanisms[mechanism.mechname] = mechanism;
    }
    /**
   * Start the graceful disconnection process.
   *
   * This function starts the disconnection process.  This process starts
   * by sending unavailable presence and sending BOSH body of type
   * terminate.  A timeout handler makes sure that disconnection happens
   * even if the BOSH server does not respond.
   * If the Connection object isn't connected, at least tries to abort all pending requests
   * so the connection object won't generate successful requests (which were already opened).
   *
   * The user supplied connection callback will be notified of the
   * progress as this process happens.
   *
   * @param {string} [reason] - The reason the disconnect is occuring.
   */ disconnect(reason) {
        this._changeConnectStatus(Status.DISCONNECTING, reason);
        if (reason) {
            log.info('Disconnect was called because: ' + reason);
        } else {
            log.debug('Disconnect was called');
        }
        if (this.connected) {
            let pres = null;
            this.disconnecting = true;
            if (this.authenticated) {
                pres = $pres({
                    'xmlns': NS.CLIENT,
                    'type': 'unavailable'
                });
            }
            // setup timeout handler
            this._disconnectTimeout = this._addSysTimedHandler(this.disconnection_timeout, this._onDisconnectTimeout.bind(this));
            this._proto._disconnect(pres);
        } else {
            log.debug('Disconnect was called before Strophe connected to the server');
            this._proto._abortAllRequests();
            this._doDisconnect();
        }
    }
    /**
   * _Private_ helper function that makes sure plugins and the user's
   * callback are notified of connection status changes.
   * @param {number} status - the new connection status, one of the values
   *     in Strophe.Status
   * @param {string|null} [condition] - the error condition
   * @param {Element} [elem] - The triggering stanza.
   */ _changeConnectStatus(status, condition, elem) {
        // notify all plugins listening for status changes
        for(const k in connectionPlugins){
            if (Object.prototype.hasOwnProperty.call(connectionPlugins, k)) {
                // @ts-ignore
                const plugin = this[k];
                if (plugin.statusChanged) {
                    try {
                        plugin.statusChanged(status, condition);
                    } catch (err) {
                        log.error(`${k} plugin caused an exception changing status: ${err}`);
                    }
                }
            }
        }
        // notify the user's callback
        if (this.connect_callback) {
            try {
                this.connect_callback(status, condition, elem);
            } catch (e) {
                handleError(e);
                log.error(`User connection callback caused an exception: ${e}`);
            }
        }
    }
    /**
   * _Private_ function to disconnect.
   *
   * This is the last piece of the disconnection logic.  This resets the
   * connection and alerts the user's connection callback.
   * @param {string|null} [condition] - the error condition
   */ _doDisconnect(condition) {
        if (typeof this._idleTimeout === 'number') {
            clearTimeout(this._idleTimeout);
        }
        // Cancel Disconnect Timeout
        if (this._disconnectTimeout !== null) {
            this.deleteTimedHandler(this._disconnectTimeout);
            this._disconnectTimeout = null;
        }
        log.debug('_doDisconnect was called');
        this._proto._doDisconnect();
        this.authenticated = false;
        this.disconnecting = false;
        this.restored = false;
        // delete handlers
        this.handlers = [];
        this.timedHandlers = [];
        this.removeTimeds = [];
        this.removeHandlers = [];
        this.addTimeds = [];
        this.addHandlers = [];
        // tell the parent we disconnected
        this._changeConnectStatus(Status.DISCONNECTED, condition);
        this.connected = false;
    }
    /**
   * _Private_ handler to processes incoming data from the the connection.
   *
   * Except for _connect_cb handling the initial connection request,
   * this function handles the incoming data for all requests.  This
   * function also fires stanza handlers that match each incoming
   * stanza.
   * @param {Element | Request} req - The request that has data ready.
   * @param {string} [raw] - The stanza as raw string.
   */ _dataRecv(req, raw) {
        const elem = /** @type {Element} */ '_reqToData' in this._proto ? this._proto._reqToData(/** @type {Request} */ req) : req;
        if (elem === null) {
            return;
        }
        if (this.xmlInput !== Connection.prototype.xmlInput) {
            if (elem.nodeName === this._proto.strip && elem.childNodes.length) {
                this.xmlInput(elem.childNodes[0]);
            } else {
                this.xmlInput(elem);
            }
        }
        if (this.rawInput !== Connection.prototype.rawInput) {
            if (raw) {
                this.rawInput(raw);
            } else {
                this.rawInput(Builder.serialize(elem));
            }
        }
        // remove handlers scheduled for deletion
        while(this.removeHandlers.length > 0){
            const hand = this.removeHandlers.pop();
            const i = this.handlers.indexOf(hand);
            if (i >= 0) {
                this.handlers.splice(i, 1);
            }
        }
        // add handlers scheduled for addition
        while(this.addHandlers.length > 0){
            this.handlers.push(this.addHandlers.pop());
        }
        // handle graceful disconnect
        if (this.disconnecting && this._proto._emptyQueue()) {
            this._doDisconnect();
            return;
        }
        const type = elem.getAttribute('type');
        if (type !== null && type === 'terminate') {
            // Don't process stanzas that come in after disconnect
            if (this.disconnecting) {
                return;
            }
            // an error occurred
            let cond = elem.getAttribute('condition');
            const conflict = elem.getElementsByTagName('conflict');
            if (cond !== null) {
                if (cond === 'remote-stream-error' && conflict.length > 0) {
                    cond = 'conflict';
                }
                this._changeConnectStatus(Status.CONNFAIL, cond);
            } else {
                this._changeConnectStatus(Status.CONNFAIL, ErrorCondition.UNKNOWN_REASON);
            }
            this._doDisconnect(cond);
            return;
        }
        // send each incoming stanza through the handler chain
        forEachChild(elem, null, /** @param {Element} child */ (child)=>{
            const matches = [];
            this.handlers = this.handlers.reduce((handlers, handler)=>{
                try {
                    if (handler.isMatch(child) && (this.authenticated || !handler.user)) {
                        if (handler.run(child)) {
                            handlers.push(handler);
                        }
                        matches.push(handler);
                    } else {
                        handlers.push(handler);
                    }
                } catch (e) {
                    // if the handler throws an exception, we consider it as false
                    log.warn('Removing Strophe handlers due to uncaught exception: ' + e.message);
                }
                return handlers;
            }, []);
            // If no handler was fired for an incoming IQ with type="set",
            // then we return an IQ error stanza with service-unavailable.
            if (!matches.length && this.iqFallbackHandler.isMatch(child)) {
                this.iqFallbackHandler.run(child);
            }
        });
    }
    /**
   * @callback connectionCallback
   * @param {Connection} connection
   */ /**
   * _Private_ handler for initial connection request.
   *
   * This handler is used to process the initial connection request
   * response from the BOSH server. It is used to set up authentication
   * handlers and start the authentication process.
   *
   * SASL authentication will be attempted if available, otherwise
   * the code will fall back to legacy authentication.
   *
   * @param {Element | Request} req - The current request.
   * @param {connectionCallback} _callback - low level (xmpp) connect callback function.
   *     Useful for plugins with their own xmpp connect callback (when they
   *     want to do something special).
   * @param {string} [raw] - The stanza as raw string.
   */ _connect_cb(req, _callback, raw) {
        log.debug('_connect_cb was called');
        this.connected = true;
        let bodyWrap;
        try {
            bodyWrap = /** @type {Element} */ '_reqToData' in this._proto ? this._proto._reqToData(/** @type {Request} */ req) : req;
        } catch (e) {
            if (e.name !== ErrorCondition.BAD_FORMAT) {
                throw e;
            }
            this._changeConnectStatus(Status.CONNFAIL, ErrorCondition.BAD_FORMAT);
            this._doDisconnect(ErrorCondition.BAD_FORMAT);
        }
        if (!bodyWrap) {
            return;
        }
        if (this.xmlInput !== Connection.prototype.xmlInput) {
            if (bodyWrap.nodeName === this._proto.strip && bodyWrap.childNodes.length) {
                this.xmlInput(bodyWrap.childNodes[0]);
            } else {
                this.xmlInput(bodyWrap);
            }
        }
        if (this.rawInput !== Connection.prototype.rawInput) {
            if (raw) {
                this.rawInput(raw);
            } else {
                this.rawInput(Builder.serialize(bodyWrap));
            }
        }
        const conncheck = this._proto._connect_cb(bodyWrap);
        if (conncheck === Status.CONNFAIL) {
            return;
        }
        // Check for the stream:features tag
        let hasFeatures;
        if (bodyWrap.getElementsByTagNameNS) {
            hasFeatures = bodyWrap.getElementsByTagNameNS(NS.STREAM, 'features').length > 0;
        } else {
            hasFeatures = bodyWrap.getElementsByTagName('stream:features').length > 0 || bodyWrap.getElementsByTagName('features').length > 0;
        }
        if (!hasFeatures) {
            this._proto._no_auth_received(_callback);
            return;
        }
        const matched = Array.from(bodyWrap.getElementsByTagName('mechanism')).map((m)=>this.mechanisms[m.textContent]).filter((m)=>m);
        if (matched.length === 0) {
            if (bodyWrap.getElementsByTagName('auth').length === 0) {
                // There are no matching SASL mechanisms and also no legacy
                // auth available.
                this._proto._no_auth_received(_callback);
                return;
            }
        }
        if (this.do_authentication !== false) {
            this.authenticate(matched);
        }
    }
    /**
   * Sorts an array of objects with prototype SASLMechanism according to
   * their priorities.
   * @param {SASLMechanism[]} mechanisms - Array of SASL mechanisms.
   */ sortMechanismsByPriority(mechanisms) {
        // Sorting mechanisms according to priority.
        for(let i = 0; i < mechanisms.length - 1; ++i){
            let higher = i;
            for(let j = i + 1; j < mechanisms.length; ++j){
                if (mechanisms[j].priority > mechanisms[higher].priority) {
                    higher = j;
                }
            }
            if (higher !== i) {
                const swap = mechanisms[i];
                mechanisms[i] = mechanisms[higher];
                mechanisms[higher] = swap;
            }
        }
        return mechanisms;
    }
    /**
   * Set up authentication
   *
   * Continues the initial connection request by setting up authentication
   * handlers and starting the authentication process.
   *
   * SASL authentication will be attempted if available, otherwise
   * the code will fall back to legacy authentication.
   *
   * @param {SASLMechanism[]} matched - Array of SASL mechanisms supported.
   */ authenticate(matched) {
        if (!this._attemptSASLAuth(matched)) {
            this._attemptLegacyAuth();
        }
    }
    /**
   * Iterate through an array of SASL mechanisms and attempt authentication
   * with the highest priority (enabled) mechanism.
   *
   * @private
   * @param {SASLMechanism[]} mechanisms - Array of SASL mechanisms.
   * @return {Boolean} mechanism_found - true or false, depending on whether a
   *  valid SASL mechanism was found with which authentication could be started.
   */ _attemptSASLAuth(mechanisms) {
        mechanisms = this.sortMechanismsByPriority(mechanisms || []);
        let mechanism_found = false;
        for(let i = 0; i < mechanisms.length; ++i){
            if (!mechanisms[i].test(this)) {
                continue;
            }
            this._sasl_success_handler = this._addSysHandler(this._sasl_success_cb.bind(this), null, 'success', null, null);
            this._sasl_failure_handler = this._addSysHandler(this._sasl_failure_cb.bind(this), null, 'failure', null, null);
            this._sasl_challenge_handler = this._addSysHandler(this._sasl_challenge_cb.bind(this), null, 'challenge', null, null);
            this._sasl_mechanism = mechanisms[i];
            this._sasl_mechanism.onStart(this);
            const request_auth_exchange = $build('auth', {
                'xmlns': NS.SASL,
                'mechanism': this._sasl_mechanism.mechname
            });
            if (this._sasl_mechanism.isClientFirst) {
                const response = this._sasl_mechanism.clientChallenge(this);
                request_auth_exchange.t(btoa(/** @type {string} */ response));
            }
            this.send(request_auth_exchange.tree());
            mechanism_found = true;
            break;
        }
        return mechanism_found;
    }
    /**
   * _Private_ handler for the SASL challenge
   * @private
   * @param {Element} elem
   */ _sasl_challenge_cb(elem) {
        return _async_to_generator(function*() {
            const challenge = atob(getText(elem));
            const response = yield this._sasl_mechanism.onChallenge(this, challenge);
            const stanza = $build('response', {
                'xmlns': NS.SASL
            });
            if (response) stanza.t(btoa(response));
            this.send(stanza.tree());
            return true;
        }).call(this);
    }
    /**
   * Attempt legacy (i.e. non-SASL) authentication.
   * @private
   */ _attemptLegacyAuth() {
        if (getNodeFromJid(this.jid) === null) {
            // we don't have a node, which is required for non-anonymous
            // client connections
            this._changeConnectStatus(Status.CONNFAIL, ErrorCondition.MISSING_JID_NODE);
            this.disconnect(ErrorCondition.MISSING_JID_NODE);
        } else {
            // Fall back to legacy authentication
            this._changeConnectStatus(Status.AUTHENTICATING, null);
            this._addSysHandler(this._onLegacyAuthIQResult.bind(this), null, null, null, '_auth_1');
            this.send($iq({
                'type': 'get',
                'to': this.domain,
                'id': '_auth_1'
            }).c('query', {
                xmlns: NS.AUTH
            }).c('username', {}).t(getNodeFromJid(this.jid)).tree());
        }
    }
    /**
   * _Private_ handler for legacy authentication.
   *
   * This handler is called in response to the initial <iq type='get'/>
   * for legacy authentication.  It builds an authentication <iq/> and
   * sends it, creating a handler (calling back to _auth2_cb()) to
   * handle the result
   * @private
   * @return {false} `false` to remove the handler.
   */ _onLegacyAuthIQResult() {
        const pass = typeof this.pass === 'string' ? this.pass : '';
        // build plaintext auth iq
        const iq = $iq({
            type: 'set',
            id: '_auth_2'
        }).c('query', {
            xmlns: NS.AUTH
        }).c('username', {}).t(getNodeFromJid(this.jid)).up().c('password').t(pass);
        if (!getResourceFromJid(this.jid)) {
            // since the user has not supplied a resource, we pick
            // a default one here.  unlike other auth methods, the server
            // cannot do this for us.
            this.jid = getBareJidFromJid(this.jid) + '/strophe';
        }
        iq.up().c('resource', {}).t(getResourceFromJid(this.jid));
        this._addSysHandler(this._auth2_cb.bind(this), null, null, null, '_auth_2');
        this.send(iq.tree());
        return false;
    }
    /**
   * _Private_ handler for succesful SASL authentication.
   * @private
   * @param {Element} elem - The matching stanza.
   * @return {false} `false` to remove the handler.
   */ _sasl_success_cb(elem) {
        if (this._sasl_data['server-signature']) {
            let serverSignature;
            const success = atob(getText(elem));
            const attribMatch = /([a-z]+)=([^,]+)(,|$)/;
            const matches = success.match(attribMatch);
            if (matches[1] === 'v') {
                serverSignature = matches[2];
            }
            if (serverSignature !== this._sasl_data['server-signature']) {
                // remove old handlers
                this.deleteHandler(this._sasl_failure_handler);
                this._sasl_failure_handler = null;
                if (this._sasl_challenge_handler) {
                    this.deleteHandler(this._sasl_challenge_handler);
                    this._sasl_challenge_handler = null;
                }
                this._sasl_data = {};
                return this._sasl_failure_cb(null);
            }
        }
        log.info('SASL authentication succeeded.');
        if (this._sasl_data.keys) {
            this.scram_keys = this._sasl_data.keys;
        }
        if (this._sasl_mechanism) {
            this._sasl_mechanism.onSuccess();
        }
        // remove old handlers
        this.deleteHandler(this._sasl_failure_handler);
        this._sasl_failure_handler = null;
        if (this._sasl_challenge_handler) {
            this.deleteHandler(this._sasl_challenge_handler);
            this._sasl_challenge_handler = null;
        }
        /** @type {Handler[]} */ const streamfeature_handlers = [];
        /**
     * @param {Handler[]} handlers
     * @param {Element} elem
     */ const wrapper = (handlers, elem)=>{
            while(handlers.length){
                this.deleteHandler(handlers.pop());
            }
            this._onStreamFeaturesAfterSASL(elem);
            return false;
        };
        streamfeature_handlers.push(this._addSysHandler(/** @param {Element} elem */ (elem)=>wrapper(streamfeature_handlers, elem), null, 'stream:features', null, null));
        streamfeature_handlers.push(this._addSysHandler(/** @param {Element} elem */ (elem)=>wrapper(streamfeature_handlers, elem), NS.STREAM, 'features', null, null));
        // we must send an xmpp:restart now
        this._sendRestart();
        return false;
    }
    /**
   * @private
   * @param {Element} elem - The matching stanza.
   * @return {false} `false` to remove the handler.
   */ _onStreamFeaturesAfterSASL(elem) {
        // save stream:features for future usage
        this.features = elem;
        for(let i = 0; i < elem.childNodes.length; i++){
            const child = elem.childNodes[i];
            if (child.nodeName === 'bind') {
                this.do_bind = true;
            }
            if (child.nodeName === 'session') {
                this.do_session = true;
            }
        }
        if (!this.do_bind) {
            this._changeConnectStatus(Status.AUTHFAIL, null);
            return false;
        } else if (!this.options.explicitResourceBinding) {
            this.bind();
        } else {
            this._changeConnectStatus(Status.BINDREQUIRED, null);
        }
        return false;
    }
    /**
   * Sends an IQ to the XMPP server to bind a JID resource for this session.
   *
   * https://tools.ietf.org/html/rfc6120#section-7.5
   *
   * If `explicitResourceBinding` was set to a truthy value in the options
   * passed to the Connection constructor, then this function needs
   * to be called explicitly by the client author.
   *
   * Otherwise it'll be called automatically as soon as the XMPP server
   * advertises the "urn:ietf:params:xml:ns:xmpp-bind" stream feature.
   */ bind() {
        if (!this.do_bind) {
            log.info(`Connection.prototype.bind called but "do_bind" is false`);
            return;
        }
        this._addSysHandler(this._onResourceBindResultIQ.bind(this), null, null, null, '_bind_auth_2');
        const resource = getResourceFromJid(this.jid);
        if (resource) {
            this.send($iq({
                type: 'set',
                id: '_bind_auth_2'
            }).c('bind', {
                xmlns: NS.BIND
            }).c('resource', {}).t(resource).tree());
        } else {
            this.send($iq({
                type: 'set',
                id: '_bind_auth_2'
            }).c('bind', {
                xmlns: NS.BIND
            }).tree());
        }
    }
    /**
   * _Private_ handler for binding result and session start.
   * @private
   * @param {Element} elem - The matching stanza.
   * @return {false} `false` to remove the handler.
   */ _onResourceBindResultIQ(elem) {
        if (elem.getAttribute('type') === 'error') {
            log.warn('Resource binding failed.');
            const conflict = elem.getElementsByTagName('conflict');
            let condition;
            if (conflict.length > 0) {
                condition = ErrorCondition.CONFLICT;
            }
            this._changeConnectStatus(Status.AUTHFAIL, condition, elem);
            return false;
        }
        // TODO - need to grab errors
        const bind = elem.getElementsByTagName('bind');
        if (bind.length > 0) {
            const jidNode = bind[0].getElementsByTagName('jid');
            if (jidNode.length > 0) {
                this.authenticated = true;
                this.jid = getText(jidNode[0]);
                if (this.do_session) {
                    this._establishSession();
                } else {
                    this._changeConnectStatus(Status.CONNECTED, null);
                }
            }
        } else {
            log.warn('Resource binding failed.');
            this._changeConnectStatus(Status.AUTHFAIL, null, elem);
            return false;
        }
    }
    /**
   * Send IQ request to establish a session with the XMPP server.
   *
   * See https://xmpp.org/rfcs/rfc3921.html#session
   *
   * Note: The protocol for session establishment has been determined as
   * unnecessary and removed in RFC-6121.
   * @private
   */ _establishSession() {
        if (!this.do_session) {
            throw new Error(`Connection.prototype._establishSession ` + `called but apparently ${NS.SESSION} wasn't advertised by the server`);
        }
        this._addSysHandler(this._onSessionResultIQ.bind(this), null, null, null, '_session_auth_2');
        this.send($iq({
            type: 'set',
            id: '_session_auth_2'
        }).c('session', {
            xmlns: NS.SESSION
        }).tree());
    }
    /**
   * _Private_ handler for the server's IQ response to a client's session
   * request.
   *
   * This sets Connection.authenticated to true on success, which
   * starts the processing of user handlers.
   *
   * See https://xmpp.org/rfcs/rfc3921.html#session
   *
   * Note: The protocol for session establishment has been determined as
   * unnecessary and removed in RFC-6121.
   * @private
   * @param {Element} elem - The matching stanza.
   * @return {false} `false` to remove the handler.
   */ _onSessionResultIQ(elem) {
        if (elem.getAttribute('type') === 'result') {
            this.authenticated = true;
            this._changeConnectStatus(Status.CONNECTED, null);
        } else if (elem.getAttribute('type') === 'error') {
            this.authenticated = false;
            log.warn('Session creation failed.');
            this._changeConnectStatus(Status.AUTHFAIL, null, elem);
            return false;
        }
        return false;
    }
    /**
   * _Private_ handler for SASL authentication failure.
   * @param {Element} [elem] - The matching stanza.
   * @return {false} `false` to remove the handler.
   */ _sasl_failure_cb(elem) {
        // delete unneeded handlers
        if (this._sasl_success_handler) {
            this.deleteHandler(this._sasl_success_handler);
            this._sasl_success_handler = null;
        }
        if (this._sasl_challenge_handler) {
            this.deleteHandler(this._sasl_challenge_handler);
            this._sasl_challenge_handler = null;
        }
        if (this._sasl_mechanism) this._sasl_mechanism.onFailure();
        this._changeConnectStatus(Status.AUTHFAIL, null, elem);
        return false;
    }
    /**
   * _Private_ handler to finish legacy authentication.
   *
   * This handler is called when the result from the jabber:iq:auth
   * <iq/> stanza is returned.
   * @private
   * @param {Element} elem - The stanza that triggered the callback.
   * @return {false} `false` to remove the handler.
   */ _auth2_cb(elem) {
        if (elem.getAttribute('type') === 'result') {
            this.authenticated = true;
            this._changeConnectStatus(Status.CONNECTED, null);
        } else if (elem.getAttribute('type') === 'error') {
            this._changeConnectStatus(Status.AUTHFAIL, null, elem);
            this.disconnect('authentication failed');
        }
        return false;
    }
    /**
   * _Private_ function to add a system level timed handler.
   *
   * This function is used to add a TimedHandler for the
   * library code.  System timed handlers are allowed to run before
   * authentication is complete.
   * @param {number} period - The period of the handler.
   * @param {Function} handler - The callback function.
   */ _addSysTimedHandler(period, handler) {
        const thand = new TimedHandler(period, handler);
        thand.user = false;
        this.addTimeds.push(thand);
        return thand;
    }
    /**
   * _Private_ function to add a system level stanza handler.
   *
   * This function is used to add a Handler for the
   * library code.  System stanza handlers are allowed to run before
   * authentication is complete.
   * @param {Function} handler - The callback function.
   * @param {string} ns - The namespace to match.
   * @param {string} name - The stanza name to match.
   * @param {string} type - The stanza type attribute to match.
   * @param {string} id - The stanza id attribute to match.
   */ _addSysHandler(handler, ns, name, type, id) {
        const hand = new Handler(handler, ns, name, type, id);
        hand.user = false;
        this.addHandlers.push(hand);
        return hand;
    }
    /**
   * _Private_ timeout handler for handling non-graceful disconnection.
   *
   * If the graceful disconnect process does not complete within the
   * time allotted, this handler finishes the disconnect anyway.
   * @return {false} `false` to remove the handler.
   */ _onDisconnectTimeout() {
        log.debug('_onDisconnectTimeout was called');
        this._changeConnectStatus(Status.CONNTIMEOUT, null);
        this._proto._onDisconnectTimeout();
        // actually disconnect
        this._doDisconnect();
        return false;
    }
    /**
   * _Private_ handler to process events during idle cycle.
   *
   * This handler is called every 100ms to fire timed handlers that
   * are ready and keep poll requests going.
   */ _onIdle() {
        // add timed handlers scheduled for addition
        // NOTE: we add before remove in the case a timed handler is
        // added and then deleted before the next _onIdle() call.
        while(this.addTimeds.length > 0){
            this.timedHandlers.push(this.addTimeds.pop());
        }
        // remove timed handlers that have been scheduled for deletion
        while(this.removeTimeds.length > 0){
            const thand = this.removeTimeds.pop();
            const i = this.timedHandlers.indexOf(thand);
            if (i >= 0) {
                this.timedHandlers.splice(i, 1);
            }
        }
        // call ready timed handlers
        const now = new Date().getTime();
        const newList = [];
        for(let i = 0; i < this.timedHandlers.length; i++){
            const thand = this.timedHandlers[i];
            if (this.authenticated || !thand.user) {
                const since = thand.lastCalled + thand.period;
                if (since - now <= 0) {
                    if (thand.run()) {
                        newList.push(thand);
                    }
                } else {
                    newList.push(thand);
                }
            }
        }
        this.timedHandlers = newList;
        clearTimeout(this._idleTimeout);
        this._proto._onIdle();
        // reactivate the timer only if connected
        if (this.connected) {
            this._idleTimeout = setTimeout(()=>this._onIdle(), 100);
        }
    }
    /**
   * @typedef {Object.<string, string>} Cookie
   * @typedef {Cookie|Object.<string, Cookie>} Cookies
   */ /**
   * Create and initialize a {@link Connection} object.
   *
   * The transport-protocol for this connection will be chosen automatically
   * based on the given service parameter. URLs starting with "ws://" or
   * "wss://" will use WebSockets, URLs starting with "http://", "https://"
   * or without a protocol will use [BOSH](https://xmpp.org/extensions/xep-0124.html).
   *
   * To make Strophe connect to the current host you can leave out the protocol
   * and host part and just pass the path:
   *
   *  const conn = new Strophe.Connection("/http-bind/");
   *
   * @param {string} service - The BOSH or WebSocket service URL.
   * @param {ConnectionOptions} options - A object containing configuration options
   */ constructor(service, options = {}){
        // The service URL
        this.service = service;
        // Configuration options
        this.options = options;
        this.setProtocol();
        /* The connected JID. */ this.jid = '';
        /* the JIDs domain */ this.domain = null;
        /* stream:features */ this.features = null;
        // SASL
        /**
     * @typedef {Object.<string, any>} SASLData
     * @property {Object} [SASLData.keys]
     */ /** @type {SASLData} */ this._sasl_data = {};
        this.do_bind = false;
        this.do_session = false;
        /** @type {Object.<string, SASLMechanism>} */ this.mechanisms = {};
        /** @type {TimedHandler[]} */ this.timedHandlers = [];
        /** @type {Handler[]} */ this.handlers = [];
        /** @type {TimedHandler[]} */ this.removeTimeds = [];
        /** @type {Handler[]} */ this.removeHandlers = [];
        /** @type {TimedHandler[]} */ this.addTimeds = [];
        /** @type {Handler[]} */ this.addHandlers = [];
        this.protocolErrorHandlers = {
            /** @type {Object.<number, Function>} */ 'HTTP': {},
            /** @type {Object.<number, Function>} */ 'websocket': {}
        };
        this._idleTimeout = null;
        this._disconnectTimeout = null;
        this.authenticated = false;
        this.connected = false;
        this.disconnecting = false;
        this.do_authentication = true;
        this.paused = false;
        this.restored = false;
        /** @type {(Element|'restart')[]} */ this._data = [];
        this._uniqueId = 0;
        this._sasl_success_handler = null;
        this._sasl_failure_handler = null;
        this._sasl_challenge_handler = null;
        // Max retries before disconnecting
        this.maxRetries = 5;
        // Call onIdle callback every 1/10th of a second
        this._idleTimeout = setTimeout(()=>this._onIdle(), 100);
        addCookies(this.options.cookies);
        this.registerSASLMechanisms(this.options.mechanisms);
        // A client must always respond to incoming IQ "set" and "get" stanzas.
        // See https://datatracker.ietf.org/doc/html/rfc6120#section-8.2.3
        //
        // This is a fallback handler which gets called when no other handler
        // was called for a received IQ "set" or "get".
        this.iqFallbackHandler = new Handler(/**
     * @param {Element} iq
     */ (iq)=>this.send($iq({
                type: 'error',
                id: iq.getAttribute('id')
            }).c('error', {
                'type': 'cancel'
            }).c('service-unavailable', {
                'xmlns': NS.STANZAS
            })), null, 'iq', [
            'get',
            'set'
        ]);
        // initialize plugins
        for(const k in connectionPlugins){
            if (Object.prototype.hasOwnProperty.call(connectionPlugins, k)) {
                const F = function() {};
                F.prototype = connectionPlugins[k];
                // @ts-ignore
                this[k] = new F();
                // @ts-ignore
                this[k].init(this);
            }
        }
    }
}
class UnsafeXML extends String {
}
var /** @type {string} */ _string = /*#__PURE__*/ new WeakMap(), /** @type {Array<string>} */ _strings = /*#__PURE__*/ new WeakMap(), /**
   * @typedef {Array<string|Stanza|Builder>} StanzaValue
   * @type {StanzaValue|Array<StanzaValue>}
   */ _values = /*#__PURE__*/ new WeakMap();
/**
 * A Stanza represents a XML element used in XMPP (commonly referred to as stanzas).
 */ class Stanza extends Builder {
    /**
   * A directive which can be used to pass a string of XML as a value to the
   * stx tagged template literal.
   *
   * It's considered "unsafe" because it can pose a security risk if used with
   * untrusted input.
   *
   * @param {string} string
   * @returns {UnsafeXML}
   * @example
   *    const status = '<status>I am busy!</status>';
   *    const pres = stx`
   *       <presence from='juliet@example.com/chamber' id='pres1'>
   *           <show>dnd</show>
   *           ${unsafeXML(status)}
   *       </presence>`;
   *    connection.send(pres);
   */ static unsafeXML(string) {
        return new UnsafeXML(string);
    }
    /**
   * Turns the passed-in string into an XML Element.
   * @param {string} string
   * @param {boolean} [throwErrorIfInvalidNS]
   * @returns {Element}
   */ static toElement(string, throwErrorIfInvalidNS) {
        const doc = xmlHtmlNode(string);
        const parserError = getParserError(doc);
        if (parserError) {
            throw new Error(`Parser Error: ${parserError}`);
        }
        const node = stripWhitespace(getFirstElementChild(doc));
        if ([
            'message',
            'iq',
            'presence'
        ].includes(node.nodeName.toLowerCase()) && node.namespaceURI !== 'jabber:client' && node.namespaceURI !== 'jabber:server') {
            const err_msg = `Invalid namespaceURI ${node.namespaceURI}`;
            if (throwErrorIfInvalidNS) {
                throw new Error(err_msg);
            } else {
                log.error(err_msg);
            }
        }
        return node;
    }
    buildTree() {
        return Stanza.toElement(this.toString(), true);
    }
    /**
   * @return {string}
   */ toString() {
        _class_private_field_set(this, _string, _class_private_field_get(this, _string) || _class_private_field_get(this, _strings).reduce((acc, str, idx)=>{
            const value = _class_private_field_get(this, _values).length > idx ? _class_private_field_get(this, _values)[idx] : '';
            return acc + str + (Array.isArray(value) ? value.map((v)=>v instanceof UnsafeXML || v instanceof Builder ? v : xmlescape(v.toString())).join('') : value instanceof UnsafeXML || value instanceof Builder ? value : xmlescape((value !== null && value !== void 0 ? value : '').toString()));
        }, '').trim());
        return _class_private_field_get(this, _string);
    }
    /**
   * @param {string[]} strings
   * @param {any[]} values
   */ constructor(strings, values){
        super('stanza'), _class_private_field_init(this, _string, {
            writable: true,
            value: void 0
        }), _class_private_field_init(this, _strings, {
            writable: true,
            value: void 0
        }), _class_private_field_init(this, _values, {
            writable: true,
            value: void 0
        });
        _class_private_field_set(this, _strings, strings);
        _class_private_field_set(this, _values, values);
    }
}
/**
 * Tagged template literal function which generates {@link Stanza} objects
 *
 * @example
 *      const pres = stx`<presence type="${type}" xmlns="jabber:client"><show>${show}</show></presence>`
 *
 *      connection.send(msg);
 *
 * @example
 *      const msg = stx`<message
 *          from='sender@example.org'
 *          id='hgn27af1'
 *          to='recipient@example.org'
 *          type='chat'>
 *          <body>Hello world</body>
 *      </message>`;
 *
 *      connection.send(msg);
 *
 * @param {string[]} strings
 * @param {...any} values
 * @returns {Stanza}
 */ function stx(strings, ...values) {
    return new Stanza(strings, values);
}
/*global globalThis */ /**
 * A container for all Strophe library functions.
 *
 * This object is a container for all the objects and constants
 * used in the library.  It is not meant to be instantiated, but to
 * provide a namespace for library objects, constants, and functions.
 *
 * @namespace Strophe
 * @property {Handler} Handler
 * @property {Builder} Builder
 * @property {Request} Request Represents HTTP Requests made for a BOSH connection
 * @property {Bosh} Bosh Support for XMPP-over-HTTP via XEP-0124 (BOSH)
 * @property {Websocket} Websocket Support for XMPP over websocket
 * @property {WorkerWebsocket} WorkerWebsocket Support for XMPP over websocket in a shared worker
 * @property {number} TIMEOUT=1.1 Timeout multiplier. A waiting BOSH HTTP request
 *  will be considered failed after Math.floor(TIMEOUT * wait) seconds have elapsed.
 *  This defaults to 1.1, and with default wait, 66 seconds.
 * @property {number} SECONDARY_TIMEOUT=0.1 Secondary timeout multiplier.
 *  In cases where Strophe can detect early failure, it will consider the request
 *  failed if it doesn't return after `Math.floor(SECONDARY_TIMEOUT * wait)`
 *  seconds have elapsed. This defaults to 0.1, and with default wait, 6 seconds.
 * @property {SASLAnonymous} SASLAnonymous SASL ANONYMOUS authentication.
 * @property {SASLPlain} SASLPlain SASL PLAIN authentication
 * @property {SASLSHA1} SASLSHA1 SASL SCRAM-SHA-1 authentication
 * @property {SASLSHA256} SASLSHA256 SASL SCRAM-SHA-256 authentication
 * @property {SASLSHA384} SASLSHA384 SASL SCRAM-SHA-384 authentication
 * @property {SASLSHA512} SASLSHA512 SASL SCRAM-SHA-512 authentication
 * @property {SASLOAuthBearer} SASLOAuthBearer SASL OAuth Bearer authentication
 * @property {SASLExternal} SASLExternal SASL EXTERNAL authentication
 * @property {SASLXOAuth2} SASLXOAuth2 SASL X-OAuth2 authentication
 * @property {Status} Status
 * @property {Object.<string, string>} NS
 * @property {XHTML} XHTML
 */ const Strophe = _object_spread_props(_object_spread({
    /** @constant: VERSION */ VERSION: '3.0.0',
    /**
   * @returns {number}
   */ get TIMEOUT () {
        return Bosh.getTimeoutMultplier();
    },
    /**
   * @param {number} n
   */ set TIMEOUT (n){
        Bosh.setTimeoutMultiplier(n);
    },
    /**
   * @returns {number}
   */ get SECONDARY_TIMEOUT () {
        return Bosh.getSecondaryTimeoutMultplier();
    },
    /**
   * @param {number} n
   */ set SECONDARY_TIMEOUT (n){
        Bosh.setSecondaryTimeoutMultiplier(n);
    }
}, utils$1, log), {
    Request,
    // Transports
    Bosh,
    Websocket,
    WorkerWebsocket,
    Connection,
    Handler,
    // Available authentication mechanisms
    SASLAnonymous,
    SASLPlain,
    SASLSHA1,
    SASLSHA256,
    SASLSHA384,
    SASLSHA512,
    SASLOAuthBearer,
    SASLExternal,
    SASLXOAuth2,
    Stanza,
    Builder,
    ElementType,
    ErrorCondition,
    LogLevel: LOG_LEVELS,
    /** @type {Object.<string, string>} */ NS,
    SASLMechanism,
    /** @type {Status} */ Status,
    TimedHandler,
    XHTML: _object_spread_props(_object_spread({}, XHTML), {
        validTag: validTag,
        validCSS: validCSS,
        validAttribute: validAttribute
    }),
    /**
   * Render a DOM element and all descendants to a String.
   * @method Strophe.serialize
   * @param {Element|Builder} elem - A DOM element.
   * @return {string} - The serialized element tree as a String.
   */ serialize (elem) {
        return Builder.serialize(elem);
    },
    /**
   * @typedef {import('./constants').LogLevel} LogLevel
   *
   * Library consumers can use this function to set the log level of Strophe.
   * The default log level is Strophe.LogLevel.INFO.
   * @param {LogLevel} level
   * @example Strophe.setLogLevel(Strophe.LogLevel.DEBUG);
   */ setLogLevel (level) {
        log.setLogLevel(level);
    },
    /**
   * This function is used to extend the current namespaces in
   * Strophe.NS. It takes a key and a value with the key being the
   * name of the new namespace, with its actual value.
   * @example: Strophe.addNamespace('PUBSUB', "http://jabber.org/protocol/pubsub");
   *
   * @param {string} name - The name under which the namespace will be
   *     referenced under Strophe.NS
   * @param {string} value - The actual namespace.
   */ addNamespace (name, value) {
        Strophe.NS[name] = value;
    },
    /**
   * Extends the Strophe.Connection object with the given plugin.
   * @param {string} name - The name of the extension.
   * @param {Object} ptype - The plugin's prototype.
   */ addConnectionPlugin (name, ptype) {
        Connection.addConnectionPlugin(name, ptype);
    }
});
globalThis.$build = $build;
globalThis.$iq = $iq;
globalThis.$msg = $msg;
globalThis.$pres = $pres;
globalThis.Strophe = Strophe;
globalThis.stx = stx;
const toStanza = Stanza.toElement;
globalThis.toStanza = Stanza.toElement; // Deprecated



/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
/*!****************************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  \****************************************************************************/
/***/ ((module) => {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js":
/*!********************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
  \********************************************************************/
/***/ ((module) => {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js":
/*!**********************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
  \**********************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
/*!**********************************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
  \**********************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =  true ? __webpack_require__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js":
/*!***************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
  \***************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js":
/*!*********************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
  \*********************************************************************/
/***/ ((module) => {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ "./src/headless/index.js":
/*!*******************************!*\
  !*** ./src/headless/index.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BaseMessage: () => (/* reexport safe */ _shared_message_js__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   Bookmark: () => (/* reexport safe */ _plugins_bookmarks_index_js__WEBPACK_IMPORTED_MODULE_9__.Bookmark),
/* harmony export */   Bookmarks: () => (/* reexport safe */ _plugins_bookmarks_index_js__WEBPACK_IMPORTED_MODULE_9__.Bookmarks),
/* harmony export */   ChatBox: () => (/* reexport safe */ _plugins_chat_index_js__WEBPACK_IMPORTED_MODULE_13__.ChatBox),
/* harmony export */   EmojiPicker: () => (/* reexport safe */ _plugins_emoji_index_js__WEBPACK_IMPORTED_MODULE_8__.EmojiPicker),
/* harmony export */   MAMPlaceholderMessage: () => (/* reexport safe */ _plugins_mam_index_js__WEBPACK_IMPORTED_MODULE_18__.MAMPlaceholderMessage),
/* harmony export */   MUC: () => (/* reexport safe */ _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_19__.MUC),
/* harmony export */   MUCMessage: () => (/* reexport safe */ _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_19__.MUCMessage),
/* harmony export */   MUCMessages: () => (/* reexport safe */ _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_19__.MUCMessages),
/* harmony export */   MUCOccupant: () => (/* reexport safe */ _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_19__.MUCOccupant),
/* harmony export */   MUCOccupants: () => (/* reexport safe */ _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_19__.MUCOccupants),
/* harmony export */   Message: () => (/* reexport safe */ _plugins_chat_index_js__WEBPACK_IMPORTED_MODULE_13__.Message),
/* harmony export */   Messages: () => (/* reexport safe */ _plugins_chat_index_js__WEBPACK_IMPORTED_MODULE_13__.Messages),
/* harmony export */   ModelWithMessages: () => (/* reexport safe */ _shared_model_with_messages_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   Presence: () => (/* reexport safe */ _plugins_roster_index_js__WEBPACK_IMPORTED_MODULE_22__.Presence),
/* harmony export */   Presences: () => (/* reexport safe */ _plugins_roster_index_js__WEBPACK_IMPORTED_MODULE_22__.Presences),
/* harmony export */   Profile: () => (/* reexport safe */ _plugins_status_index_js__WEBPACK_IMPORTED_MODULE_24__.Profile),
/* harmony export */   RosterContact: () => (/* reexport safe */ _plugins_roster_index_js__WEBPACK_IMPORTED_MODULE_22__.RosterContact),
/* harmony export */   RosterContacts: () => (/* reexport safe */ _plugins_roster_index_js__WEBPACK_IMPORTED_MODULE_22__.RosterContacts),
/* harmony export */   RosterFilter: () => (/* reexport safe */ _plugins_roster_index_js__WEBPACK_IMPORTED_MODULE_22__.RosterFilter),
/* harmony export */   VCard: () => (/* reexport safe */ _plugins_vcard_index_js__WEBPACK_IMPORTED_MODULE_25__.VCard),
/* harmony export */   VCards: () => (/* reexport safe */ _plugins_vcard_index_js__WEBPACK_IMPORTED_MODULE_25__.VCards),
/* harmony export */   _converse: () => (/* reexport safe */ _shared_index_js__WEBPACK_IMPORTED_MODULE_3__._converse),
/* harmony export */   api: () => (/* reexport safe */ _shared_index_js__WEBPACK_IMPORTED_MODULE_3__.api),
/* harmony export */   constants: () => (/* binding */ constants),
/* harmony export */   converse: () => (/* reexport safe */ _shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   errors: () => (/* reexport module object */ _shared_errors_js__WEBPACK_IMPORTED_MODULE_27__),
/* harmony export */   i18n: () => (/* reexport safe */ _shared_index_js__WEBPACK_IMPORTED_MODULE_3__.i18n),
/* harmony export */   log: () => (/* reexport safe */ _converse_log__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   parsers: () => (/* reexport safe */ _shared_index_js__WEBPACK_IMPORTED_MODULE_3__.parsers),
/* harmony export */   u: () => (/* reexport safe */ _utils_index_js__WEBPACK_IMPORTED_MODULE_4__["default"])
/* harmony export */ });
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var dayjs_plugin_advancedFormat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs/plugin/advancedFormat */ "./node_modules/dayjs/plugin/advancedFormat.js");
/* harmony import */ var dayjs_plugin_advancedFormat__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs_plugin_advancedFormat__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shared/index.js */ "./src/headless/shared/index.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_message_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shared/message.js */ "./src/headless/shared/message.js");
/* harmony import */ var _shared_model_with_messages_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shared/model-with-messages.js */ "./src/headless/shared/model-with-messages.js");
/* harmony import */ var _plugins_emoji_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./plugins/emoji/index.js */ "./src/headless/plugins/emoji/index.js");
/* harmony import */ var _plugins_bookmarks_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./plugins/bookmarks/index.js */ "./src/headless/plugins/bookmarks/index.js");
/* harmony import */ var _plugins_blocklist_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./plugins/blocklist/index.js */ "./src/headless/plugins/blocklist/index.js");
/* harmony import */ var _plugins_bosh_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./plugins/bosh/index.js */ "./src/headless/plugins/bosh/index.js");
/* harmony import */ var _plugins_caps_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./plugins/caps/index.js */ "./src/headless/plugins/caps/index.js");
/* harmony import */ var _plugins_chat_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./plugins/chat/index.js */ "./src/headless/plugins/chat/index.js");
/* harmony import */ var _plugins_chatboxes_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./plugins/chatboxes/index.js */ "./src/headless/plugins/chatboxes/index.js");
/* harmony import */ var _plugins_disco_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./plugins/disco/index.js */ "./src/headless/plugins/disco/index.js");
/* harmony import */ var _plugins_adhoc_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./plugins/adhoc/index.js */ "./src/headless/plugins/adhoc/index.js");
/* harmony import */ var _plugins_headlines_index_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./plugins/headlines/index.js */ "./src/headless/plugins/headlines/index.js");
/* harmony import */ var _plugins_mam_index_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./plugins/mam/index.js */ "./src/headless/plugins/mam/index.js");
/* harmony import */ var _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./plugins/muc/index.js */ "./src/headless/plugins/muc/index.js");
/* harmony import */ var _plugins_ping_index_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./plugins/ping/index.js */ "./src/headless/plugins/ping/index.js");
/* harmony import */ var _plugins_pubsub_index_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./plugins/pubsub/index.js */ "./src/headless/plugins/pubsub/index.js");
/* harmony import */ var _plugins_roster_index_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./plugins/roster/index.js */ "./src/headless/plugins/roster/index.js");
/* harmony import */ var _plugins_smacks_index_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./plugins/smacks/index.js */ "./src/headless/plugins/smacks/index.js");
/* harmony import */ var _plugins_status_index_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./plugins/status/index.js */ "./src/headless/plugins/status/index.js");
/* harmony import */ var _plugins_vcard_index_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./plugins/vcard/index.js */ "./src/headless/plugins/vcard/index.js");
/* harmony import */ var _plugins_muc_constants_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./plugins/muc/constants.js */ "./src/headless/plugins/muc/constants.js");
/* harmony import */ var _shared_errors_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./shared/errors.js */ "./src/headless/shared/errors.js");



dayjs__WEBPACK_IMPORTED_MODULE_0___default().extend((dayjs_plugin_advancedFormat__WEBPACK_IMPORTED_MODULE_1___default()));







// START: Removable components
// ---------------------------
// The following components may be removed if they're not needed.

 // XEP-0199 XMPP Ping

 // XEP-0206 BOSH
 // XEP-0115 Entity Capabilities
 // RFC-6121 Instant messaging

 // XEP-0030 Service discovery
 // XEP-0050 Ad Hoc Commands
 // Support for headline messages
// XEP-0313 Message Archive Management

// XEP-0045 Multi-user chat

 // XEP-0199 XMPP Ping
 // XEP-0060 Pubsub
// RFC-6121 Contacts Roster

 // XEP-0198 Stream Management

 // XEP-0054 VCard-temp
// ---------------------------
// END: Removable components

const constants = Object.assign({}, _shared_index_js__WEBPACK_IMPORTED_MODULE_3__.constants, _plugins_muc_constants_js__WEBPACK_IMPORTED_MODULE_26__);
Object.assign(_shared_index_js__WEBPACK_IMPORTED_MODULE_3__._converse.constants, constants);


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__["default"]);


/***/ }),

/***/ "./src/headless/plugins/adhoc/api.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/adhoc/api.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/adhoc/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}





const { Strophe, $iq, u, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @typedef {import('./types').AdHocCommandResult} AdHocCommandResult
     */ /**
     * The XEP-0050 Ad-Hoc Commands API
     *
     * This API lets you discover ad-hoc commands available for an entity in the XMPP network.
     *
     * @namespace api.adhoc
     * @memberOf api
     */ adhoc: {
        /**
         * @method api.adhoc.getCommands
         * @param {string} to_jid
         */ getCommands (to_jid) {
            return _async_to_generator(function*() {
                try {
                    return (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.parseForCommands)((yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.items(to_jid, Strophe.NS.ADHOC)));
                } catch (e) {
                    if (e === null) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(`Error: timeout while fetching ad-hoc commands for ${to_jid}`);
                    } else {
                        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(`Error while fetching ad-hoc commands for ${to_jid}`);
                        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(e);
                    }
                    return [];
                }
            })();
        },
        /**
         * @method api.adhoc.fetchCommandForm
         * @param {string} jid
         * @param {string} node
         * @returns {Promise<AdHocCommandResult>}
         */ fetchCommandForm (jid, node) {
            return _async_to_generator(function*() {
                const stanza = $iq({
                    type: 'set',
                    to: jid
                }).c('command', {
                    xmlns: Strophe.NS.ADHOC,
                    action: 'execute',
                    node
                });
                return (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.parseCommandResult)((yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(stanza)));
            })();
        },
        /**
         * @method api.adhoc.runCommand
         * @param {String} jid
         * @param {String} sessionid
         * @param {import('./types').AdHocCommandAction} action
         * @param {String} node
         * @param {Array<{ [k:string]: string }>} inputs
         */ runCommand (jid, sessionid, node, action, inputs) {
            return _async_to_generator(function*() {
                var _result_querySelector;
                const iq = stx`<iq type="set" to="${jid}" xmlns="jabber:client">
                    <command sessionid="${sessionid}" node="${node}" action="${action}" xmlns="${Strophe.NS.ADHOC}">
                        ${![
                    'cancel',
                    'prev'
                ].includes(action) ? stx`
                            <x xmlns="${Strophe.NS.XFORM}" type="submit">
                                ${inputs.map(({ name, value })=>stx`<field var="${name}"><value>${value}</value></field>`)}
                            </x>` : ''}
                    </command>
                </iq>`;
                const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(iq, null, false);
                if (result === null) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn(`A timeout occurred while trying to run an ad-hoc command`);
                    const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
                    return {
                        status: 'error',
                        note: __('A timeout occurred')
                    };
                } else if (u.isErrorStanza(result)) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error('Error while trying to execute an ad-hoc command');
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(result);
                }
                const command = result.querySelector('command');
                const status = command === null || command === void 0 ? void 0 : command.getAttribute('status');
                return _object_spread_props(_object_spread({
                    status
                }, status === 'executing' ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.parseCommandResult)(result) : {}), {
                    note: (_result_querySelector = result.querySelector('note')) === null || _result_querySelector === void 0 ? void 0 : _result_querySelector.textContent
                });
            })();
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/adhoc/index.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/adhoc/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/adhoc/api.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");


const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
Strophe.addNamespace('ADHOC', 'http://jabber.org/protocol/commands');
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-adhoc', {
    dependencies: [
        "converse-disco"
    ],
    initialize () {
        Object.assign(this._converse.api, _api_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
    }
});


/***/ }),

/***/ "./src/headless/plugins/adhoc/utils.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/adhoc/utils.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseCommandResult: () => (/* binding */ parseCommandResult),
/* harmony export */   parseForCommands: () => (/* binding */ parseForCommands)
/* harmony export */ });
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}



const { Strophe, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
/**
 * Given a "result" IQ stanza that contains a list of ad-hoc commands, parse it
 * and return the list of commands as JSON objects.
 * @param {Element} stanza
 * @returns {import('./types').AdHocCommand[]}
 */ function parseForCommands(stanza) {
    const items = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`query[xmlns="${Strophe.NS.DISCO_ITEMS}"][node="${Strophe.NS.ADHOC}"] item`, stanza);
    return items.map(u.getAttributes);
}
/**
 * Given a "result" IQ stanza containing the outcome of an Ad-hoc command that
 * was executed, parse it and return the values as a JSON object.
 * @param {Element} iq
 * @returns {import('./types').AdHocCommandResult}
 */ function parseCommandResult(iq) {
    var _cmd_el_querySelector;
    const cmd_el = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`command[xmlns="${Strophe.NS.ADHOC}"]`, iq).pop();
    const note = cmd_el.querySelector('note');
    var _cmd_el_querySelector_children;
    return _object_spread_props(_object_spread({}, (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_2__.parseXForm)(iq)), {
        sessionid: cmd_el.getAttribute('sessionid'),
        note: note ? {
            text: note.textContent,
            type: /** @type {'info'|'warn'|'error'} */ note.getAttribute('type')
        } : null,
        actions: Array.from((_cmd_el_querySelector_children = (_cmd_el_querySelector = cmd_el.querySelector('actions')) === null || _cmd_el_querySelector === void 0 ? void 0 : _cmd_el_querySelector.children) !== null && _cmd_el_querySelector_children !== void 0 ? _cmd_el_querySelector_children : []).map((a)=>a.nodeName.toLowerCase())
    });
}


/***/ }),

/***/ "./src/headless/plugins/blocklist/api.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/blocklist/api.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/promise.js */ "./src/headless/shared/api/promise.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/blocklist/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { waitUntil } = _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_0__["default"];
/**
 * Groups methods relevant to XEP-0191 Blocking Command
 * @namespace api.blocklist
 * @memberOf api
 */ const blocklist = {
    /**
     * Retrieves the current user's blocklist
     * @returns {Promise<import('./collection').default>}
     */ get () {
        return _async_to_generator(function*() {
            return yield waitUntil('blocklistInitialized');
        })();
    },
    /**
     * Adds a new entity to the blocklist
     * @param {string|string[]} jid
     * @param {boolean} [send_stanza=true]
     * @returns {Promise<import('./collection').default>}
     */ add (jid, send_stanza = true) {
        return _async_to_generator(function*() {
            const blocklist = yield waitUntil('blocklistInitialized');
            const jids = Array.isArray(jid) ? jid : [
                jid
            ];
            if (send_stanza) yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.sendBlockStanza)(jids);
            jids.forEach((jid)=>blocklist.create({
                    jid
                }));
            return blocklist;
        })();
    },
    /**
     * Removes an entity from the blocklist
     * @param {string|string[]} jid
     * @param {boolean} [send_stanza=true]
     * @returns {Promise<import('./collection').default>}
     */ remove (jid, send_stanza = true) {
        return _async_to_generator(function*() {
            const blocklist = yield waitUntil('blocklistInitialized');
            const jids = Array.isArray(jid) ? jid : [
                jid
            ];
            if (send_stanza) yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.sendUnblockStanza)(jids);
            jids.forEach((jid)=>{
                var _blocklist_get;
                return (_blocklist_get = blocklist.get(jid)) === null || _blocklist_get === void 0 ? void 0 : _blocklist_get.destroy();
            });
            blocklist.remove(jids);
            return blocklist;
        })();
    }
};
const blocklist_api = {
    blocklist
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (blocklist_api);


/***/ }),

/***/ "./src/headless/plugins/blocklist/collection.js":
/*!******************************************************!*\
  !*** ./src/headless/plugins/blocklist/collection.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/blocklist/model.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}








const { stx, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_6__["default"].env;
class Blocklist extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Collection {
    get idAttribute() {
        return 'jid';
    }
    initialize() {
        return _async_to_generator(function*() {
            const { session } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"];
            const cache_key = `converse.blocklist-${session.get('bare_jid')}`;
            this.fetched_flag = `${cache_key}-fetched`;
            (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_4__.initStorage)(this, cache_key);
            this.on('add', this.rejectContactRequest);
            yield this.fetchBlocklist();
            /**
         * Triggered once the {@link Blocklist} collection
         * has been created and cached blocklist have been fetched.
         * @event _converse#blocklistInitialized
         * @type {Blocklist}
         * @example _converse.api.listen.on('blocklistInitialized', (blocklist) => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].trigger('blocklistInitialized', this);
        }).call(this);
    }
    /**
     * @param {BlockedEntity} item
     */ rejectContactRequest(item) {
        return _async_to_generator(function*() {
            const roster = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].waitUntil('rosterContactsFetched');
            const contact = roster.get(item.get('jid'));
            if (contact === null || contact === void 0 ? void 0 : contact.get('requesting')) {
                const chat = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].chats.get(contact.get('jid'));
                chat === null || chat === void 0 ? void 0 : chat.close();
                contact.unauthorize().destroy();
            }
        })();
    }
    fetchBlocklist() {
        const deferred = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
        if (window.sessionStorage.getItem(this.fetched_flag)) {
            this.fetch({
                success: ()=>deferred.resolve(),
                error: ()=>deferred.resolve()
            });
        } else {
            this.fetchBlocklistFromServer(deferred);
        }
        return deferred;
    }
    /**
     * @param {Object} deferred
     */ fetchBlocklistFromServer(deferred) {
        return _async_to_generator(function*() {
            const stanza = stx`<iq xmlns="jabber:client"
            type="get"
            id="${u.getUniqueId()}"><blocklist xmlns="urn:xmpp:blocking"/></iq>`;
            try {
                this.onBlocklistReceived(deferred, (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].sendIQ(stanza)));
            } catch (e) {
                _converse_log__WEBPACK_IMPORTED_MODULE_2__["default"].error(e);
                deferred.resolve();
                return;
            }
        }).call(this);
    }
    /**
     * @param {Object} deferred
     * @param {Element} iq
     */ onBlocklistReceived(deferred, iq) {
        return _async_to_generator(function*() {
            Array.from(iq.querySelectorAll('blocklist item')).forEach((item)=>{
                const jid = item.getAttribute('jid');
                const blocked = this.get(jid);
                blocked ? blocked.save({
                    jid
                }) : this.create({
                    jid
                });
            });
            window.sessionStorage.setItem(this.fetched_flag, 'true');
            if (deferred !== undefined) {
                return deferred.resolve();
            }
        }).call(this);
    }
    constructor(){
        super();
        this.model = _model_js__WEBPACK_IMPORTED_MODULE_7__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Blocklist);


/***/ }),

/***/ "./src/headless/plugins/blocklist/index.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/blocklist/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/blocklist/plugin.js");



/***/ }),

/***/ "./src/headless/plugins/blocklist/model.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/blocklist/model.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");


const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
class BlockedEntity extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    get idAttribute() {
        return 'jid';
    }
    getDisplayName() {
        return Strophe.xmlunescape(this.get('name'));
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockedEntity);


/***/ }),

/***/ "./src/headless/plugins/blocklist/plugin.js":
/*!**************************************************!*\
  !*** ./src/headless/plugins/blocklist/plugin.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./collection.js */ "./src/headless/plugins/blocklist/collection.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/blocklist/model.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/blocklist/api.js");
/* harmony import */ var _roster_utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../roster/utils.js */ "./src/headless/plugins/roster/utils.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description Adds support for XEP-0191 Blocking Command
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}








const { Strophe, sizzle } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
Strophe.addNamespace("BLOCKING", "urn:xmpp:blocking");
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add("converse-blocklist", {
    /**
     * @typedef {import('../roster/contact').default} RosterContact
     * @typedef {import('../roster/contacts').default} RosterContacts
     */ dependencies: [
        "converse-disco"
    ],
    initialize () {
        const exports = {
            Blocklist: _collection_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            BlockedEntity: _model_js__WEBPACK_IMPORTED_MODULE_5__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports, exports);
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"], _api_js__WEBPACK_IMPORTED_MODULE_6__["default"]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].promises.add([
            "blocklistInitialized"
        ]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].listen.on("cachedRoster", /** @param {RosterContacts} roster */ (roster)=>_async_to_generator(function*() {
                const domain = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get("domain");
                const blocking_supported = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.supports(Strophe.NS.BLOCKING, domain);
                if (blocking_supported) {
                    const blocklist = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].blocklist.get();
                    const requesting_contacts = roster.filter(/** @param {RosterContact} m */ (m)=>m.get("requesting"));
                    requesting_contacts.forEach(/** @param {RosterContact} m */ (m)=>_async_to_generator(function*() {
                            if (blocklist.get(m.get("jid"))) {
                                (0,_roster_utils_js__WEBPACK_IMPORTED_MODULE_7__.rejectPresenceSubscription)(m.get("jid"));
                                m.destroy();
                            }
                        })());
                }
            })());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].listen.on("getErrorAttributesForMessage", /**
             * @param {import('shared/types').MessageAttributes} attrs
             * @param {import('shared/types').MessageErrorAttributes} new_attrs
             */ (attrs, new_attrs)=>{
            if (attrs.errors.find((e)=>e.name === "blocked" && e.xmlns === `${Strophe.NS.BLOCKING}:errors`)) {
                const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
                new_attrs.error = __("You are blocked from sending messages.");
            }
            return new_attrs;
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].listen.on("connected", ()=>{
            const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
            connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
                const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get("bare_jid");
                const from = stanza.getAttribute("from");
                if (Strophe.getBareJidFromJid(from !== null && from !== void 0 ? from : bare_jid) != bare_jid) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`Received a blocklist push stanza from a suspicious JID ${from}`);
                    return true;
                }
                const add_jids = sizzle(`block[xmlns="${Strophe.NS.BLOCKING}"] item`, stanza).map(/** @param {Element} item */ (item)=>item.getAttribute("jid"));
                if (add_jids.length) _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].blocklist.add(add_jids, false);
                const remove_jids = sizzle(`unblock[xmlns="${Strophe.NS.BLOCKING}"] item`, stanza).map(/** @param {Element} item */ (item)=>item.getAttribute("jid"));
                if (remove_jids.length) _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].blocklist.remove(remove_jids, false);
                return true;
            }, Strophe.NS.BLOCKING, "iq", "set");
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].listen.on("clearSession", ()=>{
            const { state } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
            if (state.blocklist) {
                state.blocklist.clearStore({
                    "silent": true
                });
                window.sessionStorage.removeItem(state.blocklist.fetched_flag);
                delete state.blocklist;
            }
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].listen.on("discoInitialized", ()=>_async_to_generator(function*() {
                const domain = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get("domain");
                if (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.supports(Strophe.NS.BLOCKING, domain)) {
                    _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.blocklist = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.Blocklist();
                }
            })());
    }
});


/***/ }),

/***/ "./src/headless/plugins/blocklist/utils.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/blocklist/utils.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   sendBlockStanza: () => (/* binding */ sendBlockStanza),
/* harmony export */   sendUnblockStanza: () => (/* binding */ sendUnblockStanza)
/* harmony export */ });
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_api_send_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/send.js */ "./src/headless/shared/api/send.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { Strophe, stx, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__["default"].env;
/**
 * Sends an IQ stanza to remove one or more JIDs from the blocklist
 * @param {string|string[]} jid
 */ function sendUnblockStanza(jid) {
    return _async_to_generator(function*() {
        const jids = Array.isArray(jid) ? jid : [
            jid
        ];
        const stanza = stx`
        <iq xmlns="jabber:client" type="set" id="${u.getUniqueId()}">
            <unblock xmlns="${Strophe.NS.BLOCKING}">
                ${jids.map((id)=>stx`<item jid="${id}"/>`)}
            </unblock>
        </iq>`;
        yield _shared_api_send_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(stanza);
    })();
}
/**
 * Sends an IQ stanza to add one or more JIDs from the blocklist
 * @param {string|string[]} jid
 */ function sendBlockStanza(jid) {
    return _async_to_generator(function*() {
        const jids = Array.isArray(jid) ? jid : [
            jid
        ];
        const stanza = stx`
        <iq xmlns="jabber:client" type="set" id="${u.getUniqueId()}">
            <block xmlns="${Strophe.NS.BLOCKING}">
                ${jids.map((id)=>stx`<item jid="${id}"/>`)}
            </block>
        </iq>`;
        yield _shared_api_send_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(stanza);
    })();
}


/***/ }),

/***/ "./src/headless/plugins/bookmarks/api.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/bookmarks/api.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/promise.js */ "./src/headless/shared/api/promise.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { waitUntil } = _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_1__["default"];
/**
 * Groups methods relevant to XEP-0402 (and XEP-0048) MUC bookmarks.
 * @namespace api.bookmarks
 * @memberOf api
 */ const bookmarks = {
    /**
     * Calling this function will result in an IQ stanza being sent out to set
     * the bookmark on the server.
     *
     * @method api.bookmarks.set
     * @param {import('./types').BookmarkAttrs} attrs - The room attributes
     * @param {boolean} [create=true] - Whether the bookmark should be created if it doesn't exist
     * @param {object} [options] - Skeletor set/add options
     * @returns {Promise<import('./model').default>}
     */ set (_0) {
        return _async_to_generator(function*(attrs, create = true, options = {}) {
            const bookmarks = yield waitUntil('bookmarksInitialized');
            return bookmarks.setBookmark(attrs, create, options);
        }).apply(this, arguments);
    },
    /**
     * @method api.bookmarks.get
     * @param {string} jid - The JID of the bookmark to return.
     * @returns {Promise<import('./model').default|undefined>}
     */ get (jid) {
        return _async_to_generator(function*() {
            const bookmarks = yield waitUntil('bookmarksInitialized');
            return bookmarks.get(jid);
        })();
    }
};
const bookmarks_api = {
    bookmarks
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (bookmarks_api);


/***/ }),

/***/ "./src/headless/plugins/bookmarks/collection.js":
/*!******************************************************!*\
  !*** ./src/headless/plugins/bookmarks/collection.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/bookmarks/model.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/plugins/bookmarks/parsers.js");
/* harmony import */ var _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../plugins/muc/index.js */ "./src/headless/plugins/muc/index.js");
/**
 * @typedef {import('../muc/muc.js').default} MUC
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}













const { Strophe, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].env;
class Bookmarks extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Collection {
    get idAttribute() {
        return 'jid';
    }
    initialize() {
        return _async_to_generator(function*() {
            this.on('add', (bm)=>this.openBookmarkedRoom(bm).then((bm)=>this.markRoomAsBookmarked(bm)).catch((e)=>_converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].fatal(e)));
            this.on('remove', this.leaveRoom, this);
            this.on('change:autojoin', this.onAutoJoinChanged, this);
            this.on('remove', /** @param {Bookmark} bookmark */ (_, bookmark)=>this.sendBookmarkStanza(bookmark), this);
            const { session } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
            const cache_key = `converse.room-bookmarks${session.get('bare_jid')}`;
            this.fetched_flag = cache_key + 'fetched';
            (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_10__.initStorage)(this, cache_key);
            yield this.fetchBookmarks();
            /**
         * Triggered once the {@link Bookmarks} collection
         * has been created and cached bookmarks have been fetched.
         * @event _converse#bookmarksInitialized
         * @type {Bookmarks}
         * @example _converse.api.listen.on('bookmarksInitialized', (bookmarks) => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('bookmarksInitialized', this);
        }).call(this);
    }
    static checkBookmarksSupport() {
        return _async_to_generator(function*() {
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
            if (!bare_jid) return false;
            const identity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.getIdentity('pubsub', 'pep', bare_jid);
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('allow_public_bookmarks')) {
                return !!identity;
            } else {
                return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(Strophe.NS.PUBSUB + '#publish-options', bare_jid);
            }
        })();
    }
    /**
     * @param {Bookmark} bookmark
     */ openBookmarkedRoom(bookmark) {
        return _async_to_generator(function*() {
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_respect_autojoin') && bookmark.get('autojoin')) {
                const groupchat = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].rooms.create(bookmark.get('jid'), {
                    nick: bookmark.get('nick'),
                    password: bookmark.get('password')
                });
                groupchat.maybeShow();
            }
            return bookmark;
        })();
    }
    fetchBookmarks() {
        const deferred = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_3__.getOpenPromise)();
        if (window.sessionStorage.getItem(this.fetched_flag)) {
            this.fetch({
                success: ()=>deferred.resolve(),
                error: ()=>deferred.resolve()
            });
        } else {
            this.fetchBookmarksFromServer(deferred);
        }
        return deferred;
    }
    /**
     * @param {import('./types').BookmarkAttrs} attrs
     * @param {boolean} [create=true]
     * @param {object} [options]
     */ setBookmark(attrs, create = true, options = {}) {
        if (!attrs.jid) return _converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].warn('No JID provided for setBookmark');
        let send_stanza = false;
        let bookmark = this.get(attrs.jid);
        if (bookmark) {
            // Check if any attrs changed
            const has_changed = Object.keys(attrs).reduce((result, k)=>{
                var _attrs_k, _bookmark_attributes_k;
                return result || ((_attrs_k = attrs[k]) !== null && _attrs_k !== void 0 ? _attrs_k : '') !== ((_bookmark_attributes_k = bookmark.attributes[k]) !== null && _bookmark_attributes_k !== void 0 ? _bookmark_attributes_k : '');
            }, false);
            if (has_changed) {
                bookmark.save(attrs, options);
                send_stanza = true;
            }
        } else if (create) {
            bookmark = this.create(attrs, options);
            send_stanza = true;
        }
        if (send_stanza) {
            this.sendBookmarkStanza(bookmark).catch((iq)=>this.onBookmarkError(iq));
        }
    }
    /**
     * @param {'urn:xmpp:bookmarks:1'|'storage:bookmarks'} node
     * @param {Bookmark} bookmark
     * @returns {Stanza|Stanza[]}
     */ getPublishedItems(node, bookmark) {
        if (node === Strophe.NS.BOOKMARKS2) {
            var _bookmark_get;
            const extensions = (_bookmark_get = bookmark.get('extensions')) !== null && _bookmark_get !== void 0 ? _bookmark_get : [];
            return stx`<item id="${bookmark.get('jid')}">
                        <conference xmlns="${Strophe.NS.BOOKMARKS2}"
                                name="${bookmark.get('name') || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}"
                                autojoin="${bookmark.get('autojoin')}">
                            ${bookmark.get('nick') ? stx`<nick>${bookmark.get('nick')}</nick>` : ''}
                            ${bookmark.get('password') ? stx`<password>${bookmark.get('password')}</password>` : ''}
                        ${extensions.length ? stx`<extensions>${extensions.map((e)=>strophe_js__WEBPACK_IMPORTED_MODULE_1__.Stanza.fromString(e))}</extensions>` : ''}
                        </conference>
                    </item>`;
        } else {
            return stx`<item id="current">
                <storage xmlns="${Strophe.NS.BOOKMARKS}">
                ${this.map(/** @param {MUC} model */ (model)=>stx`<conference name="${model.get('name')}" autojoin="${model.get('autojoin')}"
                        jid="${model.get('jid')}">
                        ${model.get('nick') ? stx`<nick>${model.get('nick')}</nick>` : ''}
                        ${model.get('password') ? stx`<password>${model.get('password')}</password>` : ''}
                    </conference>`)}
                </storage>
            </item>`;
        }
    }
    /**
     * @param {Bookmark} bookmark
     * @returns {Promise<void|Element>}
     */ sendBookmarkStanza(bookmark) {
        return _async_to_generator(function*() {
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
            const node = (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(`${Strophe.NS.BOOKMARKS2}#compat`, bare_jid)) ? Strophe.NS.BOOKMARKS2 : Strophe.NS.BOOKMARKS;
            const supports_max = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(`${Strophe.NS.PUBSUB}#config-node-max`, bare_jid);
            return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].pubsub.publish(null, node, this.getPublishedItems(node, bookmark), {
                persist_items: true,
                max_items: supports_max ? 'max' : 9999,
                send_last_published_item: 'never',
                access_model: 'whitelist'
            });
        }).call(this);
    }
    /**
     * @param {Element} iq
     */ onBookmarkError(iq) {
        _converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].error('Error while trying to add bookmark');
        _converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].error(iq);
    }
    /**
     * @param {Promise} deferred
     */ fetchBookmarksFromServer(deferred) {
        return _async_to_generator(function*() {
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
            const ns = (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(`${Strophe.NS.BOOKMARKS2}#compat`, bare_jid)) ? Strophe.NS.BOOKMARKS2 : Strophe.NS.BOOKMARKS;
            const stanza = stx`
            <iq type="get" from="${_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.get().jid}" xmlns="jabber:client">
                <pubsub xmlns="${Strophe.NS.PUBSUB}">
                    <items node="${ns}"/>
                </pubsub>
            </iq>`;
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(stanza).then(/** @param {Element} iq */ (iq)=>this.onBookmarksReceived(deferred, iq)).catch(/** @param {Element} iq */ (iq)=>this.onBookmarksReceivedError(deferred, iq));
        }).call(this);
    }
    /**
     * @param {Bookmark} bookmark
     */ markRoomAsBookmarked(bookmark) {
        const { chatboxes } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].state;
        const groupchat = chatboxes.get(bookmark.get('jid'));
        groupchat === null || groupchat === void 0 ? void 0 : groupchat.save('bookmarked', true);
    }
    /**
     * @param {Bookmark} bookmark
     */ onAutoJoinChanged(bookmark) {
        if (bookmark.get('autojoin')) {
            this.openBookmarkedRoom(bookmark);
        } else {
            this.leaveRoom(bookmark);
        }
    }
    /**
     * @param {Bookmark} bookmark
     */ leaveRoom(bookmark) {
        return _async_to_generator(function*() {
            const groupchat = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].rooms.get(bookmark.get('jid'));
            groupchat === null || groupchat === void 0 ? void 0 : groupchat.close();
        })();
    }
    /**
     * @param {Element} stanza
     */ setBookmarksFromStanza(stanza) {
        return _async_to_generator(function*() {
            const bookmarks = yield (0,_parsers_js__WEBPACK_IMPORTED_MODULE_11__.parseStanzaForBookmarks)(stanza);
            bookmarks.forEach(/** @param {import('./types.js').BookmarkAttrs} attrs */ (attrs)=>{
                const bookmark = this.get(attrs.jid);
                bookmark ? bookmark.save(attrs) : this.create(attrs);
            });
        }).call(this);
    }
    /**
     * @param {Object} deferred
     * @param {Element} iq
     */ onBookmarksReceived(deferred, iq) {
        return _async_to_generator(function*() {
            yield this.setBookmarksFromStanza(iq);
            window.sessionStorage.setItem(this.fetched_flag, 'true');
            if (deferred !== undefined) {
                return deferred.resolve();
            }
        }).call(this);
    }
    /**
     * @param {Object} deferred
     * @param {Element} iq
     */ onBookmarksReceivedError(deferred, iq) {
        return _async_to_generator(function*() {
            if (iq === null) {
                const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
                _converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].error('Error: timeout while fetching bookmarks');
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].alert('error', __('Timeout Error'), [
                    __('The server did not return your bookmarks within the allowed time. ' + 'You can reload the page to request them again.')
                ]);
                deferred === null || deferred === void 0 ? void 0 : deferred.reject(new Error('Could not fetch bookmarks'));
            } else {
                const { errors } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].env;
                const e = yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_8__.parseErrorStanza)(iq);
                if (e instanceof errors.ItemNotFoundError) {
                    // Not an exception, the user simply doesn't have any bookmarks.
                    window.sessionStorage.setItem(this.fetched_flag, 'true');
                    deferred === null || deferred === void 0 ? void 0 : deferred.resolve();
                } else {
                    _converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].error('Error while fetching bookmarks');
                    if (iq) _converse_log__WEBPACK_IMPORTED_MODULE_9__["default"].error(iq);
                    deferred === null || deferred === void 0 ? void 0 : deferred.reject(new Error('Could not fetch bookmarks'));
                }
            }
        }).call(this);
    }
    getUnopenedBookmarks() {
        return _async_to_generator(function*() {
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].waitUntil('bookmarksInitialized');
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].waitUntil('chatBoxesFetched');
            const { chatboxes } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].state;
            return this.filter((b)=>!chatboxes.get(b.get('jid')));
        }).call(this);
    }
    constructor(){
        super([], {
            comparator: (/** @type {Bookmark} */ b)=>b.get('name').toLowerCase()
        });
        this.model = _model_js__WEBPACK_IMPORTED_MODULE_4__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Bookmarks);


/***/ }),

/***/ "./src/headless/plugins/bookmarks/index.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/bookmarks/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Bookmark: () => (/* reexport safe */ _model_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   Bookmarks: () => (/* reexport safe */ _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/bookmarks/model.js");
/* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection.js */ "./src/headless/plugins/bookmarks/collection.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/bookmarks/plugin.js");






/***/ }),

/***/ "./src/headless/plugins/bookmarks/model.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/bookmarks/model.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");


const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
class Bookmark extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    get idAttribute() {
        return 'jid';
    }
    getDisplayName() {
        return Strophe.xmlunescape(this.get('name'));
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Bookmark);


/***/ }),

/***/ "./src/headless/plugins/bookmarks/parsers.js":
/*!***************************************************!*\
  !*** ./src/headless/plugins/bookmarks/parsers.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseStanzaForBookmarks: () => (/* binding */ parseStanzaForBookmarks)
/* harmony export */ });
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



const { Strophe, sizzle } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__["default"].env;
/**
 * @param {Element} stanza
 * @returns {Promise<Array<import('./types.js').BookmarkAttrs>>}
 */ function parseStanzaForBookmarks(stanza) {
    return _async_to_generator(function*() {
        let ns;
        let sel;
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
        if (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.supports(`${Strophe.NS.BOOKMARKS2}#compat`, bare_jid)) {
            ns = Strophe.NS.BOOKMARKS2;
            sel = `items[node="${ns}"] item conference`;
        } else {
            ns = Strophe.NS.BOOKMARKS;
            sel = `items[node="${ns}"] item storage[xmlns="${ns}"] conference`;
        }
        return sizzle(sel, stanza).map(/** @param {Element} el */ (el)=>{
            var _el_querySelector, _el_querySelector1, _el_querySelector2;
            const jid = ns === Strophe.NS.BOOKMARKS2 ? el.parentElement.getAttribute('id') : el.getAttribute('jid');
            var _el_querySelector_textContent, _el_querySelector_textContent1, _el_querySelector_children;
            return {
                jid,
                name: el.getAttribute('name') || jid,
                autojoin: [
                    '1',
                    'true'
                ].includes(el.getAttribute('autojoin')),
                nick: (_el_querySelector_textContent = (_el_querySelector = el.querySelector('nick')) === null || _el_querySelector === void 0 ? void 0 : _el_querySelector.textContent) !== null && _el_querySelector_textContent !== void 0 ? _el_querySelector_textContent : '',
                password: (_el_querySelector_textContent1 = (_el_querySelector1 = el.querySelector('password')) === null || _el_querySelector1 === void 0 ? void 0 : _el_querySelector1.textContent) !== null && _el_querySelector_textContent1 !== void 0 ? _el_querySelector_textContent1 : '',
                extensions: Array.from((_el_querySelector_children = (_el_querySelector2 = el.querySelector('extensions')) === null || _el_querySelector2 === void 0 ? void 0 : _el_querySelector2.children) !== null && _el_querySelector_children !== void 0 ? _el_querySelector_children : []).map((c)=>c.outerHTML)
            };
        });
    })();
}


/***/ }),

/***/ "./src/headless/plugins/bookmarks/plugin.js":
/*!**************************************************!*\
  !*** ./src/headless/plugins/bookmarks/plugin.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/bookmarks/model.js");
/* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection.js */ "./src/headless/plugins/bookmarks/collection.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/bookmarks/utils.js");
/* harmony import */ var _plugins_muc_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../plugins/muc/index.js */ "./src/headless/plugins/muc/index.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/bookmarks/api.js");
/**
 * @copyright 2025, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}









const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
Strophe.addNamespace('BOOKMARKS', 'storage:bookmarks');
Strophe.addNamespace('BOOKMARKS2', 'urn:xmpp:bookmarks:1');
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].plugins.add('converse-bookmarks', {
    dependencies: [
        'converse-chatboxes',
        'converse-muc'
    ],
    initialize () {
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.extend({
            allow_bookmarks: true,
            allow_public_bookmarks: false,
            muc_respect_autojoin: true
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].promises.add('bookmarksInitialized');
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"], _api_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
        const exports = {
            Bookmark: _model_js__WEBPACK_IMPORTED_MODULE_0__["default"],
            Bookmarks: _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"], exports); // TODO: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports, exports);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('getNicknameForMUC', /**
             * @param {import('../muc/muc').default} muc
             * @param {string|null} nick
             * @returns {string}
             */ (muc, nick)=>{
            return nick || (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.getNicknameFromBookmark)(muc.get('jid'));
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('parseMUCPresence', /**
             * @param {Element} _stanza
             * @param {import('../muc/types').MUCPresenceAttributes} attrs
             */ (_stanza, attrs)=>{
            if (attrs.is_self && attrs.codes.includes('303')) {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].bookmarks.get(attrs.muc_jid).then(/** @param {Bookmark} bookmark */ (bookmark)=>{
                    if (!bookmark) _converse_log__WEBPACK_IMPORTED_MODULE_7__["default"].warn('parseMUCPresence: no bookmark returned');
                    const { nick, muc_jid: jid } = attrs;
                    var _bookmark_get, _bookmark_get1, _bookmark_get2, _bookmark_get3;
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].bookmarks.set({
                        jid,
                        nick,
                        autojoin: (_bookmark_get = bookmark === null || bookmark === void 0 ? void 0 : bookmark.get('autojoin')) !== null && _bookmark_get !== void 0 ? _bookmark_get : true,
                        password: (_bookmark_get1 = bookmark === null || bookmark === void 0 ? void 0 : bookmark.get('password')) !== null && _bookmark_get1 !== void 0 ? _bookmark_get1 : '',
                        name: (_bookmark_get2 = bookmark === null || bookmark === void 0 ? void 0 : bookmark.get('name')) !== null && _bookmark_get2 !== void 0 ? _bookmark_get2 : '',
                        extensions: (_bookmark_get3 = bookmark === null || bookmark === void 0 ? void 0 : bookmark.get('extensions')) !== null && _bookmark_get3 !== void 0 ? _bookmark_get3 : []
                    });
                });
            }
            return attrs;
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('enteredNewRoom', /** @param {import('../muc/muc').default} muc */ ({ attributes })=>_async_to_generator(function*() {
                const { jid, nick, password, name } = /** @type {import("../muc/types").MUCAttributes} */ attributes;
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].bookmarks.set(_object_spread({
                    jid,
                    autojoin: true,
                    nick
                }, password ? {
                    password
                } : {}, name ? {
                    name
                } : {}));
            })());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('leaveRoom', /** @param {import('../muc/muc').default} muc */ ({ attributes })=>_async_to_generator(function*() {
                const { jid } = /** @type {import("../muc/types").MUCAttributes} */ attributes;
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].bookmarks.set({
                    jid,
                    autojoin: false
                }, false, // Don't trigger a Skeletor `change` event.
                // This MUC is being left explicitly by the user,
                // so we don't want to trigger the `onAutoJoinChanged`
                // listener in ./collection.js to again call `close()`
                // on the MUC.
                {
                    silent: true
                });
            })());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('addClientFeatures', ()=>{
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('allow_bookmarks')) {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.own.features.add(Strophe.NS.BOOKMARKS + '+notify');
            }
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('clearSession', ()=>{
            const { state } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            if (state.bookmarks) {
                state.bookmarks.clearStore({
                    'silent': true
                });
                window.sessionStorage.removeItem(state.bookmarks.fetched_flag);
                delete state.bookmarks;
            }
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('connected', ()=>_async_to_generator(function*() {
                // Add a handler for bookmarks pushed from other connected clients
                const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
                const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
                connection.addHandler(_utils_js__WEBPACK_IMPORTED_MODULE_5__.handleBookmarksPush, Strophe.NS.BOOKMARKS, 'message', 'headline', null, bare_jid);
                connection.addHandler(_utils_js__WEBPACK_IMPORTED_MODULE_5__.handleBookmarksPush, Strophe.NS.BOOKMARKS2, 'message', 'headline', null, bare_jid);
                yield Promise.all([
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].waitUntil('chatBoxesFetched')
                ]);
                (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.initBookmarks)();
            })());
    }
});


/***/ }),

/***/ "./src/headless/plugins/bookmarks/utils.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/bookmarks/utils.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getNicknameFromBookmark: () => (/* binding */ getNicknameFromBookmark),
/* harmony export */   handleBookmarksPush: () => (/* binding */ handleBookmarksPush),
/* harmony export */   initBookmarks: () => (/* binding */ initBookmarks)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection.js */ "./src/headless/plugins/bookmarks/collection.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




function initBookmarks() {
    return _async_to_generator(function*() {
        if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('allow_bookmarks')) {
            return;
        }
        if (yield _collection_js__WEBPACK_IMPORTED_MODULE_3__["default"].checkBookmarksSupport()) {
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.bookmarks = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.Bookmarks();
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
                bookmarks: _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.bookmarks
            }); // TODO: DEPRECATED
        }
    })();
}
/**
 * @param {string} jid - The JID of the bookmark.
 * @returns {string|null} The nickname if found, otherwise null.
 */ function getNicknameFromBookmark(jid) {
    var _converse_state_bookmarks_get, _converse_state_bookmarks;
    if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('allow_bookmarks')) {
        return null;
    }
    return (_converse_state_bookmarks = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.bookmarks) === null || _converse_state_bookmarks === void 0 ? void 0 : (_converse_state_bookmarks_get = _converse_state_bookmarks.get(jid)) === null || _converse_state_bookmarks_get === void 0 ? void 0 : _converse_state_bookmarks_get.get('nick');
}
/**
 * @param {import('../chat/message')} message
 * @returns {true}
 */ function handleBookmarksPush(message) {
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('bookmarksInitialized').then(()=>_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.bookmarks.setBookmarksFromStanza(message)).catch(/** @param {Error} e */ (e)=>_converse_log__WEBPACK_IMPORTED_MODULE_2__["default"].fatal(e));
    return true;
}


/***/ }),

/***/ "./src/headless/plugins/bosh/api.js":
/*!******************************************!*\
  !*** ./src/headless/plugins/bosh/api.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * This API namespace lets you access the BOSH tokens
     * @namespace api.tokens
     * @memberOf api
     */ tokens: {
        /**
         * @method api.tokens.get
         * @param {string} [id] The type of token to return ('rid' or 'sid').
         * @returns {string} A token, either the RID or SID token depending on what's asked for.
         * @example _converse.api.tokens.get('rid');
         */ get (id) {
            const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].connection.get();
            if (!connection) return null;
            if (id.toLowerCase() === 'rid') {
                return connection.rid || connection._proto.rid;
            } else if (id.toLowerCase() === 'sid') {
                return connection.sid || connection._proto.sid;
            }
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/bosh/index.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/bosh/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/bosh/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/bosh/utils.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description Converse.js plugin which add support for XEP-0206: XMPP Over BOSH
 */ 





_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-bosh', {
    enabled () {
        return !_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].api.settings.get("blacklisted_plugins").includes('converse-bosh');
    },
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.extend({
            bosh_service_url: undefined,
            prebind_url: null
        });
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], _api_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('clearSession', _utils_js__WEBPACK_IMPORTED_MODULE_5__.clearSession);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('setUserJID', _utils_js__WEBPACK_IMPORTED_MODULE_5__.saveJIDToSession);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('login', _utils_js__WEBPACK_IMPORTED_MODULE_5__.attemptPrebind);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('addClientFeatures', ()=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.own.features.add(strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.NS.BOSH));
    }
});


/***/ }),

/***/ "./src/headless/plugins/bosh/utils.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/bosh/utils.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   attemptPrebind: () => (/* binding */ attemptPrebind),
/* harmony export */   clearSession: () => (/* binding */ clearSession),
/* harmony export */   restoreBOSHSession: () => (/* binding */ restoreBOSHSession),
/* harmony export */   saveJIDToSession: () => (/* binding */ saveJIDToSession),
/* harmony export */   startNewPreboundBOSHSession: () => (/* binding */ startNewPreboundBOSHSession)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _utils_init_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/init.js */ "./src/headless/utils/init.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/**
 * @typedef {module:shared.api.user} LoginHookPayload
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}









const BOSH_SESSION_ID = 'converse.bosh-session';
let bosh_session;
function initBOSHSession() {
    return _async_to_generator(function*() {
        const id = BOSH_SESSION_ID;
        if (!bosh_session) {
            bosh_session = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__.Model({
                id
            });
            bosh_session.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_5__.createStore)(id, "session");
            yield new Promise((resolve)=>bosh_session.fetch({
                    'success': resolve,
                    'error': resolve
                }));
        }
        let jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('jid');
        if (jid) {
            if (bosh_session.get('jid') !== jid) {
                jid = yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(jid);
                bosh_session.clear({
                    'silent': true
                });
                bosh_session.save({
                    jid
                });
            }
        } else {
            const jid = bosh_session.get('jid');
            jid && (yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(jid));
        }
        return bosh_session;
    })();
}
function startNewPreboundBOSHSession() {
    if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('prebind_url')) {
        throw new Error("startNewPreboundBOSHSession: If you use prebind then you MUST supply a prebind_url");
    }
    const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
    const xhr = new XMLHttpRequest();
    xhr.open('GET', _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('prebind_url'), true);
    xhr.setRequestHeader('Accept', 'application/json, text/javascript');
    xhr.onload = function(event) {
        return _async_to_generator(function*() {
            if (xhr.status >= 200 && xhr.status < 400) {
                const data = JSON.parse(xhr.responseText);
                const jid = yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(data.jid);
                connection.attach(jid, data.sid, data.rid, connection.onConnectStatusChanged, _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.BOSH_WAIT);
            } else {
                xhr.onerror(event);
            }
        })();
    };
    xhr.onerror = function() {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.destroy();
        /**
         * Triggered when fetching prebind tokens failed
         * @event _converse#noResumeableBOSHSession
         * @type { _converse }
         * @example _converse.api.listen.on('noResumeableBOSHSession', _converse => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('noResumeableBOSHSession', _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
    };
    xhr.send();
}
/**
 * @param {unknown} _
 * @param {LoginHookPayload} payload
 */ function attemptPrebind(_, payload) {
    return _async_to_generator(function*() {
        if (payload.success) return payload;
        const { automatic } = payload;
        // See whether there is a BOSH session to re-attach to
        if (yield restoreBOSHSession()) {
            return _object_spread_props(_object_spread({}, payload), {
                success: true
            });
        } else if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.PREBIND && (!automatic || _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get("auto_login"))) {
            startNewPreboundBOSHSession();
            return _object_spread_props(_object_spread({}, payload), {
                success: true
            });
        }
        return payload;
    })();
}
function saveJIDToSession() {
    if (bosh_session !== undefined) {
        bosh_session.save({
            'jid': _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('jid')
        });
    }
}
function clearSession() {
    if (bosh_session === undefined) {
        // Remove manually, even if we don't have the corresponding
        // model, to avoid trying to reconnect to a stale BOSH session
        const id = BOSH_SESSION_ID;
        sessionStorage.removeItem(id);
        sessionStorage.removeItem(`${id}-${id}`);
    } else {
        bosh_session.destroy();
        bosh_session = undefined;
    }
}
function restoreBOSHSession() {
    return _async_to_generator(function*() {
        const jid = (yield initBOSHSession()).get('jid');
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
        if (jid && connection._proto instanceof strophe_js__WEBPACK_IMPORTED_MODULE_3__.Strophe.Bosh) {
            try {
                connection.restore(jid, connection.onConnectStatusChanged);
                return true;
            } catch (e) {
                !(0,_utils_session_js__WEBPACK_IMPORTED_MODULE_6__.isTestEnv)() && _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn("Could not restore session for jid: " + jid + " Error message: " + e.message);
                return false;
            }
        }
        return false;
    })();
}


/***/ }),

/***/ "./src/headless/plugins/caps/index.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/caps/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/caps/utils.js");
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 


const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
Strophe.addNamespace('CAPS', "http://jabber.org/protocol/caps");
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-caps', {
    dependencies: [
        'converse-status'
    ],
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('constructedPresence', (_, p)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.addCapsNode)(p));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('constructedMUCPresence', (_, p)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.addCapsNode)(p));
    }
});


/***/ }),

/***/ "./src/headless/plugins/caps/utils.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/caps/utils.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addCapsNode: () => (/* binding */ addCapsNode)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_arraybuffer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/arraybuffer.js */ "./src/headless/utils/arraybuffer.js");
/**
 * @typedef {import('strophe.js/src/builder.js').Builder} Strophe.Builder
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



const { Strophe, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
function propertySort(array, property) {
    return array.sort((a, b)=>{
        return a[property] > b[property] ? -1 : 1;
    });
}
function generateVerificationString() {
    return _async_to_generator(function*() {
        const identities = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].api.disco.own.identities.get();
        const features = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].api.disco.own.features.get();
        if (identities.length > 1) {
            propertySort(identities, "category");
            propertySort(identities, "type");
            propertySort(identities, "lang");
        }
        let S = identities.reduce((result, id)=>{
            var _id_lang;
            return `${result}${id.category}/${id.type}/${(_id_lang = id === null || id === void 0 ? void 0 : id.lang) !== null && _id_lang !== void 0 ? _id_lang : ''}/${id.name}<`;
        }, "");
        features.sort();
        S = features.reduce((result, feature)=>`${result}${feature}<`, S);
        const ab = yield crypto.subtle.digest('SHA-1', (0,_utils_arraybuffer_js__WEBPACK_IMPORTED_MODULE_2__.stringToArrayBuffer)(S));
        return (0,_utils_arraybuffer_js__WEBPACK_IMPORTED_MODULE_2__.arrayBufferToBase64)(ab);
    })();
}
/**
 * Given a stanza, adds a XEP-0115 CAPS element
 * @param {Strophe.Builder} stanza
 */ function addCapsNode(stanza) {
    return _async_to_generator(function*() {
        const node = stx`<c
        xmlns="${Strophe.NS.CAPS}"
        hash="sha-1"
        node="https://conversejs.org"
        ver="${yield generateVerificationString()}"></c>`;
        stanza.root().cnode(node).up();
        return stanza;
    })();
}


/***/ }),

/***/ "./src/headless/plugins/chat/api.js":
/*!******************************************!*\
  !*** ./src/headless/plugins/chat/api.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/**
 * @typedef {import('./model.js').default} ChatBox
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The "chats" namespace (used for one-on-one chats)
     *
     * @namespace api.chats
     * @memberOf api
     */ chats: {
        /**
         * @method api.chats.create
         * @param {string|string[]} jids An jid or array of jids
         * @param {object} [attrs] An object containing configuration attributes.
         * @returns {Promise<ChatBox|ChatBox[]>}
         */ create (jids, attrs) {
            return _async_to_generator(function*() {
                if (typeof jids === 'string') {
                    if (attrs && !(attrs === null || attrs === void 0 ? void 0 : attrs.fullname)) {
                        var _contact_attributes;
                        const contact = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].contacts.get(jids);
                        attrs.fullname = contact === null || contact === void 0 ? void 0 : (_contact_attributes = contact.attributes) === null || _contact_attributes === void 0 ? void 0 : _contact_attributes.fullname;
                    }
                    const chatbox = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chats.get(jids, attrs, true);
                    if (!chatbox) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_2__["default"].error("Could not open chatbox for JID: " + jids);
                        return;
                    }
                    return chatbox;
                }
                if (Array.isArray(jids)) {
                    return Promise.all(jids.map((jid)=>_async_to_generator(function*() {
                            var _contact_attributes;
                            const contact = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].contacts.get(jids);
                            attrs.fullname = contact === null || contact === void 0 ? void 0 : (_contact_attributes = contact.attributes) === null || _contact_attributes === void 0 ? void 0 : _contact_attributes.fullname;
                            return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chats.get(jid, attrs, true).maybeShow();
                        })()));
                }
                _converse_log__WEBPACK_IMPORTED_MODULE_2__["default"].error("chats.create: You need to provide at least one JID");
                return null;
            })();
        },
        /**
         * Opens a new one-on-one chat.
         *
         * @method api.chats.open
         * @param {String|string[]} jids - e.g. 'buddy@example.com' or ['buddy1@example.com', 'buddy2@example.com']
         * @param {Object} [attrs] - Attributes to be set on the _converse.ChatBox model.
         * @param {Boolean} [attrs.minimized] - Should the chat be created in minimized state.
         * @param {Boolean} [force=false] - By default, a minimized
         *   chat won't be maximized (in `overlayed` view mode) and in
         *   `fullscreen` view mode a newly opened chat won't replace
         *   another chat already in the foreground.
         *   Set `force` to `true` if you want to force the chat to be
         *   maximized or shown.
         * @returns {Promise} Promise which resolves with the
         *   _converse.ChatBox representing the chat.
         *
         * @example
         * // To open a single chat, provide the JID of the contact you're chatting with in that chat:
         * converse.plugins.add('myplugin', {
         *     initialize: function() {
         *         const _converse = this._converse;
         *         // Note, buddy@example.org must be in your contacts roster!
         *         api.chats.open('buddy@example.com').then(chat => {
         *             // Now you can do something with the chat model
         *         });
         *     }
         * });
         *
         * @example
         * // To open an array of chats, provide an array of JIDs:
         * converse.plugins.add('myplugin', {
         *     initialize: function () {
         *         const _converse = this._converse;
         *         // Note, these users must first be in your contacts roster!
         *         api.chats.open(['buddy1@example.com', 'buddy2@example.com']).then(chats => {
         *             // Now you can do something with the chat models
         *         });
         *     }
         * });
         */ open (jids, attrs, force) {
            return _async_to_generator(function*() {
                if (typeof jids === 'string') {
                    const chat = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chats.get(jids, attrs, true);
                    if (chat) {
                        return chat.maybeShow(force);
                    }
                    return chat;
                } else if (Array.isArray(jids)) {
                    return Promise.all(jids.map((j)=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chats.get(j, attrs, true).then((c)=>c && c.maybeShow(force))).filter((c)=>c));
                }
                const err_msg = "chats.open: You need to provide at least one JID";
                _converse_log__WEBPACK_IMPORTED_MODULE_2__["default"].error(err_msg);
                throw new Error(err_msg);
            })();
        },
        /**
         * Retrieves a chat or all chats.
         *
         * @method api.chats.get
         * @param {String|string[]} jids - e.g. 'buddy@example.com' or ['buddy1@example.com', 'buddy2@example.com']
         * @param {Object} [attrs] - Attributes to be set on the _converse.ChatBox model.
         * @param {Boolean} [create=false] - Whether the chat should be created if it's not found.
         * @returns {Promise<ChatBox[]>}
         *
         * @example
         * // To return a single chat, provide the JID of the contact you're chatting with in that chat:
         * const model = await api.chats.get('buddy@example.com');
         *
         * @example
         * // To return an array of chats, provide an array of JIDs:
         * const models = await api.chats.get(['buddy1@example.com', 'buddy2@example.com']);
         *
         * @example
         * // To return all open chats, call the method without any parameters::
         * const models = await api.chats.get();
         *
         */ get (_0) {
            return _async_to_generator(function*(jids, attrs = {}, create = false) {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('chatBoxesFetched');
                /** @param {string} jid */ function _get(jid) {
                    return _async_to_generator(function*() {
                        let model = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.get(jid);
                        if (!model && create) {
                            model = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.create(jid, attrs, _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.ChatBox);
                        } else {
                            model = model && model.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.PRIVATE_CHAT_TYPE ? model : null;
                            if (model && Object.keys(attrs).length) {
                                model.save(attrs);
                            }
                        }
                        return model;
                    })();
                }
                if (jids === undefined) {
                    const chats = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.get();
                    return chats.filter((c)=>c.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.PRIVATE_CHAT_TYPE);
                } else if (typeof jids === 'string') {
                    return _get(jids);
                }
                return Promise.all(jids.map((jid)=>_get(jid)));
            }).apply(this, arguments);
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/chat/index.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/chat/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ChatBox: () => (/* reexport safe */ _model_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   Message: () => (/* reexport safe */ _message_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   Messages: () => (/* reexport safe */ _messages_js__WEBPACK_IMPORTED_MODULE_2__["default"])
/* harmony export */ });
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/chat/model.js");
/* harmony import */ var _message_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./message.js */ "./src/headless/plugins/chat/message.js");
/* harmony import */ var _messages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./messages.js */ "./src/headless/plugins/chat/messages.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/chat/plugin.js");







/***/ }),

/***/ "./src/headless/plugins/chat/message.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/chat/message.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_message_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/message.js */ "./src/headless/shared/message.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





/**
 * Represents a (non-MUC) message.
 * These can be either `chat`, `normal` or `headline` messages.
 * @namespace _converse.Message
 * @memberOf _converse
 * @example const msg = new Message({'message': 'hello world!'});
 */ class Message extends _shared_message_js__WEBPACK_IMPORTED_MODULE_4__["default"] {
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
            // If `type` changes from `error` to `chat`, we want to set the contact. See #2733
            this.on('change:type', ()=>this.setContact());
            yield this.setContact();
            /**
         * Triggered once a {@link Message} has been created and initialized.
         * @event _converse#messageInitialized
         * @type {Message}
         * @example _converse.api.listen.on('messageInitialized', model => { ... });
         */ yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('messageInitialized', this, {
                synchronous: true
            });
            this.initialized.resolve();
        }).call(this);
    }
    setContact() {
        if ([
            'chat',
            'normal'
        ].includes(this.get('type'))) {
            return this.setModelContact(strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getBareJidFromJid(this.get('from')));
        }
    }
    getDisplayName() {
        if (this.contact) {
            return this.contact.getDisplayName();
        } else if (this.vcard) {
            return this.vcard.getDisplayName();
        } else {
            return this.get('from');
        }
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Message);


/***/ }),

/***/ "./src/headless/plugins/chat/messages.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/chat/messages.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _message_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./message.js */ "./src/headless/plugins/chat/message.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);


class Messages extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Collection {
    constructor(){
        super();
        this.comparator = 'time';
        this.model = _message_js__WEBPACK_IMPORTED_MODULE_0__["default"];
        this.fetched = null;
        this.chatbox = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Messages);


/***/ }),

/***/ "./src/headless/plugins/chat/model.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/chat/model.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _shared_actions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/actions.js */ "./src/headless/shared/actions.js");
/* harmony import */ var _shared_model_with_messages_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/model-with-messages.js */ "./src/headless/shared/model-with-messages.js");
/* harmony import */ var _shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../shared/model-with-vcard */ "./src/headless/shared/model-with-vcard.js");
/* harmony import */ var _shared_model_with_contact_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../shared/model-with-contact.js */ "./src/headless/shared/model-with-contact.js");
/* harmony import */ var _shared_color_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../shared/color.js */ "./src/headless/shared/color.js");
/* harmony import */ var _shared_chatbox_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../shared/chatbox.js */ "./src/headless/shared/chatbox.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}













const { Strophe, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
/**
 * Represents a one-on-one chat conversation.
 */ class ChatBox extends (0,_shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_9__["default"])((0,_shared_model_with_messages_js__WEBPACK_IMPORTED_MODULE_8__["default"])((0,_shared_model_with_contact_js__WEBPACK_IMPORTED_MODULE_10__["default"])((0,_shared_color_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_shared_chatbox_js__WEBPACK_IMPORTED_MODULE_12__["default"])))) {
    /**
     * @typedef {import('./message.js').default} Message
     * @typedef {import('../muc/muc.js').default} MUC
     * @typedef {import('../../shared/types').MessageAttributes} MessageAttributes
     * @typedef {import('../../shared/errors').StanzaParseError} StanzaParseError
     */ defaults() {
        return {
            bookmarked: false,
            hidden: (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_6__.isUniView)() && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('singleton'),
            message_type: 'chat',
            num_unread: 0,
            time_opened: this.get('time_opened') || new Date().getTime(),
            time_sent: new Date(0).toISOString(),
            type: _shared_constants_js__WEBPACK_IMPORTED_MODULE_1__.PRIVATE_CHAT_TYPE
        };
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
            const jid = this.get('jid');
            this.setPresence(jid);
            yield this.setModelContact(jid);
            this.on('change:chat_state', ()=>(0,_shared_actions_js__WEBPACK_IMPORTED_MODULE_7__.sendChatState)(this.get('jid'), this.get('chat_state')));
            this.on('change:hidden', ()=>this.get('hidden') && this.setChatState(_shared_constants_js__WEBPACK_IMPORTED_MODULE_1__.INACTIVE));
            yield this.fetchMessages();
            /**
         * Triggered once a {@link ChatBox} has been created and initialized.
         * @event _converse#chatBoxInitialized
         * @type { ChatBox}
         * @example _converse.api.listen.on('chatBoxInitialized', model => { ... });
         */ yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('chatBoxInitialized', this, {
                synchronous: true
            });
            this.initialized.resolve();
        }).call(this);
    }
    /**
     * @param {string} jid
     */ setPresence(jid) {
        return _async_to_generator(function*() {
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].waitUntil('presencesInitialized');
            const { presences } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state;
            this.presence = presences.get(jid) || presences.create({
                jid
            });
            this.presence.on('change:show', (item)=>this.onPresenceChanged(item));
        }).call(this);
    }
    /**
     * @param {MessageAttributes|StanzaParseError} attrs_or_error
     */ onMessage(attrs_or_error) {
        return _async_to_generator(function*() {
            if (u.isErrorObject(attrs_or_error)) {
                const { stanza, message } = /** @type {StanzaParseError} */ attrs_or_error;
                if (stanza) _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(stanza);
                return _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(message);
            }
            const attrs = /** @type {MessageAttributes} */ attrs_or_error;
            const message = this.getDuplicateMessage(attrs);
            if (message) {
                this.updateMessage(message, attrs);
            } else if (!this.handleReceipt(attrs) && !this.handleChatMarker(attrs) && !(yield this.handleRetraction(attrs))) {
                this.setEditable(attrs, attrs.time);
                if (attrs['chat_state'] && attrs.sender === 'them') {
                    this.notifications.set('chat_state', attrs.chat_state);
                }
                if (u.shouldCreateMessage(attrs)) {
                    const msg = (yield this.handleCorrection(attrs)) || (yield this.createMessage(attrs));
                    this.notifications.set({
                        'chat_state': null
                    });
                    this.handleUnreadMessage(msg);
                }
            }
        }).call(this);
    }
    /**
     * @param {import('../roster/presence').default} item
     */ onPresenceChanged(item) {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
        const show = item.get('show');
        const fullname = this.getDisplayName();
        let text;
        if (show === 'offline') {
            text = __('%1$s has gone offline', fullname);
        } else if (show === 'away') {
            text = __('%1$s has gone away', fullname);
        } else if (show === 'dnd') {
            text = __('%1$s is busy', fullname);
        } else if (show === 'online') {
            text = __('%1$s is online', fullname);
        }
        text && this.createMessage({
            message: text,
            type: 'info',
            is_ephemeral: true
        });
    }
    close() {
        var _this = this, _superprop_get_close = ()=>super.close;
        return _async_to_generator(function*() {
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.connected()) {
                // Immediately sending the chat state, because the
                // model is going to be destroyed afterwards.
                this.setChatState(_shared_constants_js__WEBPACK_IMPORTED_MODULE_1__.INACTIVE);
                (0,_shared_actions_js__WEBPACK_IMPORTED_MODULE_7__.sendChatState)(this.get('jid'), this.get('chat_state'));
            }
            yield _superprop_get_close().call(_this);
        }).call(this);
    }
    /**
     * @returns {string|null}
     */ getDisplayName() {
        if (this.contact) {
            const display_name = this.contact.getDisplayName({
                no_jid: true
            });
            if (display_name) return display_name;
        }
        if (this.vcard) {
            return this.vcard.getDisplayName();
        } else {
            return this.get('jid');
        }
    }
    /**
     * @param {string} jid1
     * @param {string} jid2
     */ isSameUser(jid1, jid2) {
        return u.isSameBareJID(jid1, jid2);
    }
    /**
     * @param {MessageAttributes} attrs
     */ handleChatMarker(attrs) {
        const to_bare_jid = Strophe.getBareJidFromJid(attrs.to);
        if (to_bare_jid !== _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid')) {
            return false;
        }
        if (attrs.is_markable) {
            if (this.contact && ![
                'none',
                'to',
                undefined
            ].includes(this.contact.get('subscription')) && !attrs.is_archived && !attrs.is_carbon) {
                (0,_shared_actions_js__WEBPACK_IMPORTED_MODULE_7__.sendMarker)(attrs.from, attrs.msgid, 'received');
            }
            return false;
        } else if (attrs.marker_id) {
            const message = this.messages.findWhere({
                'msgid': attrs.marker_id
            });
            const field_name = `marker_${attrs.marker}`;
            if (message && !message.get(field_name)) {
                message.save({
                    field_name: new Date().toISOString()
                });
            }
            return true;
        }
    }
    /**
     * @param {MessageAttributes} [attrs]
     * @return {Promise<MessageAttributes>}
     */ getOutgoingMessageAttributes(attrs) {
        return _async_to_generator(function*() {
            const is_spoiler = !!this.get('composing_spoiler');
            const origin_id = u.getUniqueId();
            const text = attrs === null || attrs === void 0 ? void 0 : attrs.body;
            const body = text ? u.shortnamesToUnicode(text) : undefined;
            attrs = Object.assign({}, attrs, {
                body,
                from: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('jid'),
                fullname: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.profile.get('fullname'),
                id: origin_id,
                is_spoiler,
                jid: this.get('jid'),
                message: body,
                msgid: origin_id,
                nick: this.get('nickname'),
                origin_id,
                sender: 'me',
                time: new Date().toISOString(),
                type: this.get('message_type')
            }, (yield u.getMediaURLsMetadata(text)));
            /**
         * *Hook* which allows plugins to update the attributes of an outgoing message.
         * These attributes get set on the {@link Message} or
         * {@link MUCMessage} and persisted to storage.
         * @event _converse#getOutgoingMessageAttributes
         * @param {ChatBox|MUC} chat
         *      The chat from which this message will be sent.
         * @param {MessageAttributes} attrs
         *      The message attributes, from which the stanza will be created.
         */ attrs = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].hook('getOutgoingMessageAttributes', this, attrs);
            return attrs;
        }).call(this);
    }
    canPostMessages() {
        return true;
    }
    /**
     * @param {import('../../shared/message').default} message
     */ isChatMessage(message) {
        const type = message.get('type');
        return type === this.get('message_type') || type === 'normal';
    }
    constructor(attrs, options){
        super(attrs, options);
        this.disable_mam = false;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatBox);


/***/ }),

/***/ "./src/headless/plugins/chat/parsers.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/chat/parsers.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseMessage: () => (/* binding */ parseMessage)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _shared_actions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/actions.js */ "./src/headless/shared/actions.js");
/* harmony import */ var _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _shared_parsers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/parsers */ "./src/headless/shared/parsers.js");
/**
 * @module:plugin-chat-parsers
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









const { Strophe, sizzle } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/**
 * Parses a passed in message stanza and returns an object of attributes.
 * @param {Element} stanza - The message stanza
 * @returns {Promise<import('../../shared/types.ts').MessageAttributes|StanzaParseError>}
 */ function parseMessage(stanza) {
    return _async_to_generator(function*() {
        var _stanza_querySelector_textContent, _stanza_querySelector, _contact_attributes, _stanza_querySelector1, _stanza_querySelector2;
        (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.throwErrorIfInvalidForward)(stanza);
        let to_jid = stanza.getAttribute('to');
        const to_resource = Strophe.getResourceFromJid(to_jid);
        const resource = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('resource');
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('filter_by_resource') && to_resource && to_resource !== resource) {
            return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__.StanzaParseError(stanza, `Ignoring incoming message intended for a different resource: ${to_jid}`);
        }
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        const original_stanza = stanza;
        let from_jid = stanza.getAttribute('from') || bare_jid;
        if ((0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.isCarbon)(stanza)) {
            if (from_jid === bare_jid) {
                const selector = `[xmlns="${Strophe.NS.CARBONS}"] > forwarded[xmlns="${Strophe.NS.FORWARD}"] > message`;
                stanza = sizzle(selector, stanza).pop();
                to_jid = stanza.getAttribute('to');
                from_jid = stanza.getAttribute('from');
            } else {
                // Prevent message forging via carbons: https://xmpp.org/extensions/xep-0280.html#security
                (0,_shared_actions_js__WEBPACK_IMPORTED_MODULE_6__.rejectMessage)(stanza, 'Rejecting carbon from invalid JID');
                return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__.StanzaParseError(stanza, `Rejecting carbon from invalid JID ${to_jid}`);
            }
        }
        const is_archived = (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.isArchived)(stanza);
        if (is_archived) {
            if (from_jid === bare_jid) {
                const selector = `[xmlns="${Strophe.NS.MAM}"] > forwarded[xmlns="${Strophe.NS.FORWARD}"] > message`;
                stanza = sizzle(selector, stanza).pop();
                to_jid = stanza.getAttribute('to');
                from_jid = stanza.getAttribute('from');
            } else {
                return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__.StanzaParseError(stanza, `Invalid Stanza: alleged MAM message from ${stanza.getAttribute('from')}`);
            }
        }
        const from_bare_jid = Strophe.getBareJidFromJid(from_jid);
        const is_me = from_bare_jid === bare_jid;
        if (is_me && to_jid === null) {
            return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__.StanzaParseError(stanza, `Don't know how to handle message stanza without 'to' attribute. ${stanza.outerHTML}`);
        }
        const is_headline = (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.isHeadline)(stanza);
        const is_server_message = (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.isServerMessage)(stanza);
        let contact, contact_jid;
        if (!is_headline && !is_server_message) {
            contact_jid = is_me ? Strophe.getBareJidFromJid(to_jid) : from_bare_jid;
            contact = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].contacts.get(contact_jid);
            if (contact === undefined && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('allow_non_roster_messaging')) {
                _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(stanza);
                return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__.StanzaParseError(stanza, `Blocking messaging with a JID not in our roster because allow_non_roster_messaging is false.`);
            }
        }
        const delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, original_stanza).pop();
        const marker = (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getChatMarker)(stanza);
        const now = new Date().toISOString();
        let attrs = Object.assign({
            contact_jid,
            is_archived,
            is_headline,
            is_server_message,
            'body': (_stanza_querySelector = stanza.querySelector('body')) === null || _stanza_querySelector === void 0 ? void 0 : (_stanza_querySelector_textContent = _stanza_querySelector.textContent) === null || _stanza_querySelector_textContent === void 0 ? void 0 : _stanza_querySelector_textContent.trim(),
            'chat_state': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getChatState)(stanza),
            'from': stanza.getAttribute('from'),
            'is_carbon': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.isCarbon)(original_stanza),
            'is_delayed': !!delay,
            'is_markable': !!sizzle(`markable[xmlns="${Strophe.NS.MARKERS}"]`, stanza).length,
            'is_marker': !!marker,
            'is_unstyled': !!sizzle(`unstyled[xmlns="${Strophe.NS.STYLING}"]`, stanza).length,
            'marker_id': marker && marker.getAttribute('id'),
            'nick': contact === null || contact === void 0 ? void 0 : (_contact_attributes = contact.attributes) === null || _contact_attributes === void 0 ? void 0 : _contact_attributes.nickname,
            'receipt_id': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getReceiptId)(stanza),
            'received': new Date().toISOString(),
            'references': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getReferences)(stanza),
            'sender': is_me ? 'me' : 'them',
            'subject': (_stanza_querySelector1 = stanza.querySelector('subject')) === null || _stanza_querySelector1 === void 0 ? void 0 : _stanza_querySelector1.textContent,
            'thread': (_stanza_querySelector2 = stanza.querySelector('thread')) === null || _stanza_querySelector2 === void 0 ? void 0 : _stanza_querySelector2.textContent,
            'time': delay ? dayjs__WEBPACK_IMPORTED_MODULE_3___default()(delay.getAttribute('stamp')).toISOString() : now,
            'to': stanza.getAttribute('to'),
            'type': stanza.getAttribute('type') || 'normal'
        }, (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getErrorAttributes)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getOutOfBandAttributes)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getSpoilerAttributes)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getCorrectionAttributes)(stanza, original_stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getStanzaIDs)(stanza, original_stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getRetractionAttributes)(stanza, original_stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.getEncryptionAttributes)(stanza));
        if (attrs.is_archived) {
            const from = original_stanza.getAttribute('from');
            if (from && from !== bare_jid) {
                return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_7__.StanzaParseError(stanza, `Invalid Stanza: Forged MAM message from ${from}`);
            }
        }
        attrs = Object.assign({
            'message': attrs.body || attrs.error,
            'is_valid_receipt_request': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_8__.isValidReceiptRequest)(stanza, attrs)
        }, attrs);
        // We prefer to use one of the XEP-0359 unique and stable stanza IDs
        // as the Model id, to avoid duplicates.
        attrs['id'] = attrs['origin_id'] || attrs[`stanza_id ${attrs.from}`] || _utils_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].getUniqueId();
        /**
     * *Hook* which allows plugins to add additional parsing
     * @event _converse#parseMessage
     */ attrs = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hook('parseMessage', stanza, attrs);
        // We call this after the hook, to allow plugins (like omemo) to decrypt encrypted
        // messages, since we need to parse the message text to determine whether
        // there are media urls.
        const metadata = yield _utils_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].getMediaURLsMetadata(attrs.is_encrypted ? attrs.plaintext : attrs.body);
        return Object.assign(attrs, metadata);
    })();
}


/***/ }),

/***/ "./src/headless/plugins/chat/plugin.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/chat/plugin.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model.js */ "./src/headless/plugins/chat/model.js");
/* harmony import */ var _message_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./message.js */ "./src/headless/plugins/chat/message.js");
/* harmony import */ var _messages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./messages.js */ "./src/headless/plugins/chat/messages.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _chatboxes_api_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../chatboxes/api.js */ "./src/headless/plugins/chatboxes/api.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/chat/api.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/chat/utils.js");










_shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__["default"].plugins.add('converse-chat', {
    dependencies: [
        'converse-chatboxes',
        'converse-disco'
    ],
    initialize () {
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].settings.extend({
            'allow_message_corrections': 'all',
            'allow_message_retraction': 'all',
            'allow_message_styling': true,
            'auto_join_private_chats': [],
            'clear_messages_on_reconnection': false,
            'filter_by_resource': false,
            'prune_messages_above': undefined,
            'pruning_behavior': 'unscrolled',
            'send_chat_markers': [
                'received',
                'displayed',
                'acknowledged'
            ],
            'send_chat_state_notifications': true
        });
        const exports = {
            ChatBox: _model_js__WEBPACK_IMPORTED_MODULE_0__["default"],
            Message: _message_js__WEBPACK_IMPORTED_MODULE_1__["default"],
            Messages: _messages_js__WEBPACK_IMPORTED_MODULE_2__["default"],
            handleMessageStanza: _utils_js__WEBPACK_IMPORTED_MODULE_9__.handleMessageStanza
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"], exports); // TODO: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].exports, exports);
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"], _api_js__WEBPACK_IMPORTED_MODULE_7__["default"]);
        _chatboxes_api_js__WEBPACK_IMPORTED_MODULE_6__["default"].registry.add(_shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.PRIVATE_CHAT_TYPE, _model_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_9__.routeToChat)();
        addEventListener('hashchange', _utils_js__WEBPACK_IMPORTED_MODULE_9__.routeToChat);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('chatBoxesFetched', _utils_js__WEBPACK_IMPORTED_MODULE_9__.autoJoinChats);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('presencesInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_9__.registerMessageHandlers);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('connected', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_9__.enableCarbons)());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('reconnected', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_9__.enableCarbons)());
    }
});


/***/ }),

/***/ "./src/headless/plugins/chat/utils.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/chat/utils.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   autoJoinChats: () => (/* binding */ autoJoinChats),
/* harmony export */   enableCarbons: () => (/* binding */ enableCarbons),
/* harmony export */   handleMessageStanza: () => (/* binding */ handleMessageStanza),
/* harmony export */   isNewMessage: () => (/* binding */ isNewMessage),
/* harmony export */   registerMessageHandlers: () => (/* binding */ registerMessageHandlers),
/* harmony export */   routeToChat: () => (/* binding */ routeToChat)
/* harmony export */ });
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/parsers */ "./src/headless/shared/parsers.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/plugins/chat/parsers.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/**
 * @module:headless-plugins-chat-utils
 * @typedef {import('./model.js').default} ChatBox
 * @typedef {import('../../shared/types.ts').MessageAttributes} MessageAttributes
 * @typedef {import('../../shared/errors').StanzaParseError} StanzaParseError
 * @typedef {import('strophe.js').Builder} Builder
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









const { Strophe, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
function routeToChat(event) {
    if (!location.hash.startsWith('#converse/chat?jid=')) {
        return;
    }
    event === null || event === void 0 ? void 0 : event.preventDefault();
    const jid = location.hash.split('=').pop();
    if (!u.isValidJID(jid)) {
        return _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(`Invalid JID "${jid}" provided in URL fragment`);
    }
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].chats.open(jid);
}
/**
 * Given a stanza, determine whether it's a new
 * message, i.e. not a MAM archived one.
 * @param {Element|Model|object} message
 */ function isNewMessage(message) {
    if (message instanceof Element) {
        return !(sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`result[xmlns="${Strophe.NS.MAM}"]`, message).length && sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`delay[xmlns="${Strophe.NS.DELAY}"]`, message).length);
    } else if (message instanceof _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Model) {
        message = message.attributes;
    }
    return !(message['is_delayed'] && message['is_archived']);
}
/**
 * @param {Element} stanza
 */ function handleErrorMessage(stanza) {
    return _async_to_generator(function*() {
        const from_jid = Strophe.getBareJidFromJid(stanza.getAttribute('from'));
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
        if (u.isSameBareJID(from_jid, bare_jid)) {
            return;
        }
        const chatbox = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].chatboxes.get(from_jid);
        if ((chatbox === null || chatbox === void 0 ? void 0 : chatbox.get('type')) === _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.PRIVATE_CHAT_TYPE) {
            chatbox === null || chatbox === void 0 ? void 0 : chatbox.handleErrorMessageStanza(stanza);
        }
    })();
}
function autoJoinChats() {
    // Automatically join private chats, based on the
    // "auto_join_private_chats" configuration setting.
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('auto_join_private_chats').forEach(/** @param {string} jid */ (jid)=>{
        if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.chatboxes.where({
            'jid': jid
        }).length) {
            return;
        }
        if (typeof jid === 'string') {
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].chats.open(jid);
        } else {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error('Invalid jid criteria specified for "auto_join_private_chats"');
        }
    });
    /**
     * Triggered once any private chats have been automatically joined as
     * specified by the `auto_join_private_chats` setting.
     * See: https://conversejs.org/docs/html/configuration.html#auto-join-private-chats
     * @event _converse#privateChatsAutoJoined
     * @example _converse.api.listen.on('privateChatsAutoJoined', () => { ... });
     * @example _converse.api.waitUntil('privateChatsAutoJoined').then(() => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('privateChatsAutoJoined');
}
function registerMessageHandlers() {
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().addHandler(/** @param {Element} stanza */ (stanza)=>{
        if ([
            'groupchat',
            'error'
        ].includes(stanza.getAttribute('type')) || (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_6__.isHeadline)(stanza) || (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_6__.isServerMessage)(stanza) || (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_6__.isArchived)(stanza)) {
            return true;
        }
        return _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports.handleMessageStanza(stanza) || true;
    }, null, 'message');
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().addHandler(/** @param {Element} stanza */ (stanza)=>{
        handleErrorMessage(stanza);
        return true;
    }, null, 'message', 'error');
}
/**
 * Handler method for all incoming single-user chat "message" stanzas.
 * @param {Element|Builder} stanza
 */ function handleMessageStanza(stanza) {
    return _async_to_generator(function*() {
        stanza = stanza instanceof Element ? stanza : stanza.tree();
        if ((0,_shared_parsers__WEBPACK_IMPORTED_MODULE_6__.isServerMessage)(stanza)) {
            // Prosody sends headline messages with type `chat`, so we need to filter them out here.
            const from = stanza.getAttribute('from');
            return _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].info(`handleMessageStanza: Ignoring incoming server message from JID: ${from}`);
        }
        if (yield (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_6__.isMUCPrivateMessage)(stanza)) {
            return true;
        }
        let attrs;
        try {
            attrs = yield (0,_parsers_js__WEBPACK_IMPORTED_MODULE_7__.parseMessage)(stanza);
        } catch (e) {
            return _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(e);
        }
        if (u.isErrorObject(attrs)) {
            const { stanza, message } = /** @type {StanzaParseError} */ attrs;
            if (stanza) _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(stanza);
            return _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(message);
        }
        const { body, plaintext, contact_jid, nick } = /** @type {MessageAttributes} */ attrs;
        // XXX: Need to take XEP-428 <fallback> into consideration
        const has_body = !!(body || plaintext);
        const chatbox = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].chats.get(contact_jid, {
            nickname: nick
        }, has_body);
        yield chatbox === null || chatbox === void 0 ? void 0 : chatbox.queueMessage(attrs);
        /**
     * @typedef {Object} MessageData
     * An object containing the original message stanza, as well as the
     * parsed attributes.
     * @property {Element} stanza
     * @property {MessageAttributes} stanza
     * @property {ChatBox} chatbox
     */ const data = {
            stanza,
            attrs,
            chatbox
        };
        /**
     * Triggered when a message stanza is been received and processed.
     * @event _converse#message
     * @type {MessageData} data
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('message', data);
    })();
}
/**
 * Ask the XMPP server to enable Message Carbons
 * See [XEP-0280](https://xmpp.org/extensions/xep-0280.html#enabling)
 */ function enableCarbons() {
    return _async_to_generator(function*() {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
        const domain = Strophe.getDomainFromJid(bare_jid);
        const supported = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.supports(Strophe.NS.CARBONS, domain);
        if (!supported) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn("Not enabling carbons because it's not supported!");
            return;
        }
        const iq = new Strophe.Builder('iq', {
            'from': _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().jid,
            'type': 'set'
        }).c('enable', {
            xmlns: Strophe.NS.CARBONS
        });
        const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].sendIQ(iq, null, false);
        if (result === null) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(`A timeout occurred while trying to enable carbons`);
        } else if (u.isErrorStanza(result)) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn('An error occurred while trying to enable message carbons.');
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(result);
        } else {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].debug('Message carbons have been enabled.');
        }
    })();
}


/***/ }),

/***/ "./src/headless/plugins/chatboxes/api.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/chatboxes/api.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/promise.js */ "./src/headless/shared/api/promise.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/chatboxes/utils.js");
/**
 * @typedef {import('@converse/skeletor').Model} Model
 * @typedef {import('../chat/model.js').default} ChatBox
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



const { waitUntil } = _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_1__["default"];
const _chatBoxTypes = {};
/**
 * The "chatboxes" namespace.
 *
 * @namespace api.chatboxes
 * @memberOf api
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @typedef {new (attrs: object, options: object) => ChatBox} ModelClass
     */ /**
     * @method api.chatboxes.create
     * @param {string|string[]} jids - A JID or array of JIDs
     * @param {Object} attrs An object containing configuration attributes
     * @param {ModelClass} model - The type of chatbox that should be created
     */ create (_0) {
        return _async_to_generator(function*(jids = [], attrs = {}, model) {
            yield waitUntil('chatBoxesFetched');
            if (typeof jids === 'string') {
                return (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.createChatBox)(jids, attrs, model);
            } else {
                return Promise.all(jids.map((jid)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.createChatBox)(jid, attrs, model)));
            }
        }).apply(this, arguments);
    },
    /**
     * @method api.chatboxes.get
     * @param {string|string[]} [jids] - A JID or array of JIDs
     */ get (jids) {
        return _async_to_generator(function*() {
            yield waitUntil('chatBoxesFetched');
            const { chatboxes } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
            if (jids === undefined) {
                return chatboxes.models;
            } else if (typeof jids === 'string') {
                return chatboxes.get(jids.toLowerCase());
            } else {
                jids = jids.map((j)=>j.toLowerCase());
                return chatboxes.models.filter((m)=>jids.includes(m.get('jid')));
            }
        })();
    },
    /**
     * The "chatboxes" registry.
     * Allows you to register more chatbox types that can be created via
     * `api.chatboxes.create`.
     * @namespace api.chatboxes.registry
     * @memberOf api.chatboxes
     */ registry: {
        /**
         * @method api.chatboxes.registry.add
         * Add another type of chatbox that can be added to this collection.
         * This is used in the `createModel` function to determine what type of
         * chatbox class to instantiate (e.g. ChatBox, MUC, Feed etc.) based on the
         * passed in attributes.
         * @param {string} type - The type name
         * @param {ModelClass} model - The model which will be instantiated for the given type name.
         */ add (type, model) {
            _chatBoxTypes[type] = model;
        },
        /**
         * @method api.chatboxes.registry.get
         * @param {string} type - The type name
         * @return {ModelClass} model - The model which will be instantiated for the given type name.
         */ get (type) {
            return _chatBoxTypes[type];
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/chatboxes/chatboxes.js":
/*!*****************************************************!*\
  !*** ./src/headless/plugins/chatboxes/chatboxes.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/**
 * @typedef {import('../../plugins/chat/model.js').default} ChatBox
 * @typedef {import('../../plugins/muc/muc').default} MUC
 * @typedef {import('@converse/skeletor').Model} Model
 */ 



class ChatBoxes extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Collection {
    /**
     * @param {Collection} collection
     */ onChatBoxesFetched(collection) {
        collection.filter((c)=>!c.isValid()).forEach((c)=>c.destroy());
        /**
         * Triggered once all chat boxes have been recreated from the browser cache
         * @event _converse#chatBoxesFetched
         * @type {object}
         * @property {ChatBox|MUC} chatbox
         * @property {Element} stanza
         * @example _converse.api.listen.on('chatBoxesFetched', obj => { ... });
         * @example _converse.api.waitUntil('chatBoxesFetched').then(() => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('chatBoxesFetched');
    }
    /**
     * @param {boolean} reconnecting
     */ onConnected(reconnecting) {
        if (reconnecting) return;
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_3__.initStorage)(this, `converse.chatboxes-${bare_jid}`);
        this.fetch({
            'add': true,
            'success': (c)=>this.onChatBoxesFetched(c)
        });
    }
    /**
     * @param {object} attrs
     * @param {object} options
     */ createModel(attrs, options) {
        if (!attrs.type) {
            throw new Error('You need to specify a type of chatbox to be created');
        }
        const ChatBox = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.registry.get(attrs.type);
        return new ChatBox(attrs, options);
    }
    /**
     * @param {Model[]} models
     * @param {object} options
     */ constructor(models, options){
        super(models, Object.assign({
            comparator: 'time_opened'
        }, options));
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatBoxes);


/***/ }),

/***/ "./src/headless/plugins/chatboxes/index.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/chatboxes/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _chatboxes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chatboxes.js */ "./src/headless/plugins/chatboxes/chatboxes.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/chatboxes/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/chatboxes/utils.js");
/* harmony import */ var _emoji_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../emoji/index.js */ "./src/headless/plugins/emoji/index.js");
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 







const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-chatboxes', {
    dependencies: [
        "converse-emoji",
        "converse-roster",
        "converse-vcard"
    ],
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].promises.add([
            'chatBoxesFetched',
            'chatBoxesInitialized',
            'privateChatsAutoJoined'
        ]);
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], {
            chatboxes: _api_js__WEBPACK_IMPORTED_MODULE_5__["default"]
        });
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], {
            ChatBoxes: _chatboxes_js__WEBPACK_IMPORTED_MODULE_0__["default"]
        }); // TODO: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].exports, {
            ChatBoxes: _chatboxes_js__WEBPACK_IMPORTED_MODULE_0__["default"]
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('addClientFeatures', ()=>{
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.own.features.add(Strophe.NS.MESSAGE_CORRECT);
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.own.features.add(Strophe.NS.HTTPUPLOAD);
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.own.features.add(Strophe.NS.OUTOFBAND);
        });
        let chatboxes;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('pluginsInitialized', ()=>{
            chatboxes = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].exports.ChatBoxes();
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], {
                chatboxes
            }); // TODO: DEPRECATED
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state, {
                chatboxes
            });
            /**
             * Triggered once the _converse.ChatBoxes collection has been initialized.
             * @event _converse#chatBoxesInitialized
             * @example _converse.api.listen.on('chatBoxesInitialized', () => { ... });
             * @example _converse.api.waitUntil('chatBoxesInitialized').then(() => { ... });
             */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].trigger('chatBoxesInitialized');
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('presencesInitialized', (reconnecting)=>chatboxes.onConnected(reconnecting));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('reconnected', ()=>chatboxes.forEach((m)=>m.onReconnection()));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('clearSession', _utils_js__WEBPACK_IMPORTED_MODULE_6__.onClearSession);
        // XXX: Would be nice to keep track of the last open chat and to show that again.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('chatBoxClosed', ()=>{
            if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_4__.isUniView)()) {
                var _converse_state_chatboxes_find;
                (_converse_state_chatboxes_find = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.chatboxes.find((c)=>c.get('jid'))) === null || _converse_state_chatboxes_find === void 0 ? void 0 : _converse_state_chatboxes_find.maybeShow();
            }
        });
    }
});


/***/ }),

/***/ "./src/headless/plugins/chatboxes/utils.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/chatboxes/utils.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createChatBox: () => (/* binding */ createChatBox),
/* harmony export */   onClearSession: () => (/* binding */ onClearSession)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/**
 * @typedef {import('../chat/model.js').default} ChatBox
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





function onClearSession() {
    return _async_to_generator(function*() {
        if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_3__.shouldClearCache)(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"])) {
            const { chatboxes } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state;
            yield Promise.all(chatboxes.map(/** @param {ChatBox} c */ (c)=>{
                var _c_messages;
                return (_c_messages = c.messages) === null || _c_messages === void 0 ? void 0 : _c_messages.clearStore({
                    'silent': true
                });
            }));
            chatboxes.clearStore({
                silent: true
            }, /** @param {import('../../shared/chatbox').default} o */ (o)=>o.get('type') !== _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__.CONTROLBOX_TYPE);
        }
    })();
}
/**
 * @param {string} jid
 * @param {object} attrs
 * @param {new (attrs: object, options: object) => ChatBox} Model
 */ function createChatBox(jid, attrs, Model) {
    return _async_to_generator(function*() {
        jid = strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getBareJidFromJid(jid.toLowerCase());
        Object.assign(attrs, {
            'jid': jid,
            'id': jid
        });
        let chatbox;
        try {
            chatbox = new Model(attrs, {
                'collection': _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.chatboxes
            });
        } catch (e) {
            _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error(e);
            return null;
        }
        yield chatbox.initialized;
        if (!chatbox.isValid()) {
            chatbox.destroy();
            return null;
        }
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.chatboxes.add(chatbox);
        return chatbox;
    })();
}


/***/ }),

/***/ "./src/headless/plugins/disco/api.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/disco/api.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, $iq } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @typedef {import('./entities').default} DiscoEntities
     * @typedef {import('./entity').default} DiscoEntity
     * @typedef {import('./index').DiscoState} DiscoState
     * @typedef {import('@converse/skeletor').Collection} Collection
     */ /**
     * The XEP-0030 service discovery API
     *
     * This API lets you discover information about entities on the
     * XMPP network.
     *
     * @namespace api.disco
     * @memberOf api
     */ disco: {
        /**
         * @namespace api.disco.stream
         * @memberOf api.disco
         */ stream: {
            /**
             * @method api.disco.stream.getFeature
             * @param { String } name The feature name
             * @param { String } xmlns The XML namespace
             * @example _converse.api.disco.stream.getFeature('ver', 'urn:xmpp:features:rosterver')
             */ getFeature (name, xmlns) {
                return _async_to_generator(function*() {
                    yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('streamFeaturesAdded');
                    const stream_features = /** @type {Collection} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.stream_features;
                    if (!name || !xmlns) {
                        throw new Error('name and xmlns need to be provided when calling disco.stream.getFeature');
                    }
                    if (stream_features === undefined && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.connected()) {
                        // Happens during tests when disco lookups happen asynchronously after teardown.
                        const msg = `Tried to get feature ${name} ${xmlns} but stream_features has been torn down`;
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(msg);
                        return;
                    }
                    return stream_features.findWhere({
                        'name': name,
                        'xmlns': xmlns
                    });
                })();
            }
        },
        /**
         * @namespace api.disco.own
         * @memberOf api.disco
         */ own: {
            /**
             * @namespace api.disco.own.identities
             * @memberOf api.disco.own
             */ identities: {
                /**
                 * Lets you add new identities for this client (i.e. instance of Converse)
                 * @method api.disco.own.identities.add
                 *
                 * @param {String} category - server, client, gateway, directory, etc.
                 * @param {String} type - phone, pc, web, etc.
                 * @param {String} name - "Converse"
                 * @param {String} lang - en, el, de, etc.
                 *
                 * @example _converse.api.disco.own.identities.clear();
                 */ add (category, type, name, lang) {
                    const disco = /** @type {DiscoState} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco;
                    for(var i = 0; i < disco._identities.length; i++){
                        if (disco._identities[i].category == category && disco._identities[i].type == type && disco._identities[i].name == name && disco._identities[i].lang == lang) {
                            return false;
                        }
                    }
                    disco._identities.push({
                        category: category,
                        type: type,
                        name: name,
                        lang: lang
                    });
                },
                /**
                 * Clears all previously registered identities.
                 * @method api.disco.own.identities.clear
                 * @example _converse.api.disco.own.identities.clear();
                 */ clear () {
                    /** @type {DiscoState} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco._identities = [];
                },
                /**
                 * Returns all of the identities registered for this client
                 * (i.e. instance of Converse).
                 * @method api.disco.identities.get
                 * @example const identities = api.disco.own.identities.get();
                 */ get () {
                    return /** @type {DiscoState} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco._identities;
                }
            },
            /**
             * @namespace api.disco.own.features
             * @memberOf api.disco.own
             */ features: {
                /**
                 * Lets you register new disco features for this client (i.e. instance of Converse)
                 * @method api.disco.own.features.add
                 * @param { String } name - e.g. http://jabber.org/protocol/caps
                 * @example _converse.api.disco.own.features.add("http://jabber.org/protocol/caps");
                 */ add (name) {
                    const disco = /** @type {DiscoState} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco;
                    for(let i = 0; i < disco._features.length; i++){
                        if (disco._features[i] == name) {
                            return false;
                        }
                    }
                    disco._features.push(name);
                },
                /**
                 * Clears all previously registered features.
                 * @method api.disco.own.features.clear
                 * @example _converse.api.disco.own.features.clear();
                 */ clear () {
                    const disco = /** @type {DiscoState} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco;
                    disco._features = [];
                },
                /**
                 * Returns all of the features registered for this client (i.e. instance of Converse).
                 * @method api.disco.own.features.get
                 * @example const features = api.disco.own.features.get();
                 */ get () {
                    return /** @type {DiscoState} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco._features;
                }
            }
        },
        /**
         * Query for information about an XMPP entity
         *
         * @method api.disco.info
         * @param {string} jid The Jabber ID of the entity to query
         * @param {string} [node] A specific node identifier associated with the JID
         * @returns {promise} Promise which resolves once we have a result from the server.
         */ info (jid, node) {
            const attrs = {
                xmlns: Strophe.NS.DISCO_INFO
            };
            if (node) {
                attrs.node = node;
            }
            const info = $iq({
                'from': _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.get().jid,
                'to': jid,
                'type': 'get'
            }).c('query', attrs);
            return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(info);
        },
        /**
         * Query for items associated with an XMPP entity
         *
         * @method api.disco.items
         * @param {string} jid The Jabber ID of the entity to query for items
         * @param {string} [node] A specific node identifier associated with the JID
         * @returns {promise} Promise which resolves once we have a result from the server.
         */ items (jid, node) {
            const attrs = {
                xmlns: Strophe.NS.DISCO_ITEMS
            };
            if (node) {
                attrs.node = node;
            }
            return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ($iq({
                'from': _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.get().jid,
                'to': jid,
                'type': 'get'
            }).c('query', attrs));
        },
        /**
         * Namespace for methods associated with disco entities
         *
         * @namespace api.disco.entities
         * @memberOf api.disco
         */ entities: {
            /**
             * Get the corresponding `DiscoEntity` instance.
             *
             * @method api.disco.entities.get
             * @param {string} jid The Jabber ID of the entity
             * @param {boolean} [create] Whether the entity should be created if it doesn't exist.
             * @return {Promise<DiscoEntity|DiscoEntities|undefined>}
             * @example _converse.api.disco.entities.get(jid);
             */ get (jid, create = false) {
                return _async_to_generator(function*() {
                    yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('discoInitialized');
                    const disco_entities = /** @type {DiscoEntities} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco_entities;
                    if (!jid) {
                        return disco_entities;
                    }
                    if (disco_entities === undefined) {
                        // Happens during tests when disco lookups happen asynchronously after teardown.
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Tried to look up entity ${jid} but disco_entities has been torn down`);
                        return;
                    }
                    const entity = disco_entities.get(jid);
                    if (entity || !create) {
                        return entity;
                    }
                    return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.create({
                        jid
                    });
                })();
            },
            /**
             * Return any disco items advertised on this entity
             *
             * @method api.disco.entities.items
             * @param {string} jid - The Jabber ID of the entity for which we want to fetch items
             * @example api.disco.entities.items(jid);
             */ items (jid) {
                return _async_to_generator(function*() {
                    const entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid);
                    yield entity.waitUntilItemsFetched;
                    const disco_entities = /** @type {DiscoEntities} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco_entities;
                    return disco_entities.filter((e)=>{
                        var _e_get;
                        return (_e_get = e.get('parent_jids')) === null || _e_get === void 0 ? void 0 : _e_get.includes(jid);
                    });
                })();
            },
            /**
             * Create a new  disco entity. It's identity and features
             * will automatically be fetched from cache or from the
             * XMPP server.
             *
             * Fetching from cache can be disabled by passing in
             * `ignore_cache: true` in the options parameter.
             *
             * @method api.disco.entities.create
             * @param {object} data
             * @param {string} data.jid - The Jabber ID of the entity
             * @param {string} data.parent_jid - The Jabber ID of the parent entity
             * @param {string} data.name
             * @param {object} [options] - Additional options
             * @param {boolean} [options.ignore_cache]
             *     If true, fetch all features from the XMPP server instead of restoring them from cache
             * @example _converse.api.disco.entities.create({ jid }, {'ignore_cache': true});
             */ create (data, options) {
                const disco_entities = /** @type {DiscoEntities} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco_entities;
                return disco_entities.create(data, options);
            }
        },
        /**
         * @namespace api.disco.features
         * @memberOf api.disco
         */ features: {
            /**
             * Return a given feature of a disco entity
             *
             * @method api.disco.features.get
             * @param {string} feature The feature that might be
             *     supported. In the XML stanza, this is the `var`
             *     attribute of the `<feature>` element. For
             *     example: `http://jabber.org/protocol/muc`
             * @param {string} jid The JID of the entity
             *     (and its associated items) which should be queried
             * @returns {Promise<import('@converse/skeletor').Model|import('@converse/skeletor').Model[]>}
             *     A promise which resolves with a list containing
             *     _converse.Entity instances representing the entity
             *     itself or those items associated with the entity if
             *     they support the given feature.
             * @example
             * api.disco.features.get(Strophe.NS.MAM, _converse.bare_jid);
             */ get (feature, jid) {
                return _async_to_generator(function*() {
                    if (!jid) throw new TypeError('api.disco.features.get: You need to provide an entity JID');
                    const entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid, true);
                    if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco_entities === undefined && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.connected()) {
                        // Happens during tests when disco lookups happen asynchronously after teardown.
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Tried to get feature ${feature} for ${jid} but ` + `_converse.disco_entities has been torn down`);
                        return [];
                    }
                    const items = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.items(jid);
                    const promises = [
                        entity.getFeature(feature),
                        ...items.map((i)=>i.getFeature(feature))
                    ];
                    const result = yield Promise.all(promises);
                    return result.filter((f)=>f instanceof Object);
                })();
            },
            /**
             * Returns true if an entity with the given JID, or if one of its
             * associated items, supports a given feature.
             *
             * @method api.disco.features.has
             * @param {string} feature The feature that might be
             *     supported. In the XML stanza, this is the `var`
             *     attribute of the `<feature>` element. For
             *     example: `http://jabber.org/protocol/muc`
             * @param {string} jid The JID of the entity
             *     (and its associated items) which should be queried
             * @returns {Promise<boolean>} A promise which resolves with a boolean
             * @example
             *      api.disco.features.has(Strophe.NS.MAM, _converse.bare_jid);
             */ has (feature, jid) {
                return _async_to_generator(function*() {
                    if (!jid) throw new TypeError('api.disco.feature.has: You need to provide an entity JID');
                    const entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid, true);
                    if (!entity) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`api.disco.has: could not get entity for ${jid}`);
                        return false;
                    }
                    if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.disco_entities === undefined && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.connected()) {
                        // Happens during tests when disco lookups happen asynchronously after teardown.
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Tried to check if ${jid} supports feature ${feature}`);
                        return false;
                    }
                    if (yield entity.getFeature(feature)) {
                        return true;
                    }
                    const items = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.items(jid);
                    const result = yield Promise.all(items.map((i)=>i.getFeature(feature)));
                    return result.map((f)=>f instanceof Object).includes(true);
                })();
            }
        },
        /**
         * Used to determine whether an entity supports a given feature.
         *
         * @method api.disco.supports
         * @param {string} feature The feature that might be
         *     supported. In the XML stanza, this is the `var`
         *     attribute of the `<feature>` element. For
         *     example: `http://jabber.org/protocol/muc`
         * @param {string} jid The JID of the entity
         *     (and its associated items) which should be queried
         * @returns {Promise<boolean>|boolean} A promise which resolves with `true` or `false`.
         * @example
         * if (await api.disco.supports(Strophe.NS.MAM, _converse.bare_jid)) {
         *     // The feature is supported
         * } else {
         *     // The feature is not supported
         * }
         */ supports (feature, jid) {
            try {
                return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.features.has(feature, jid);
            } catch (e) {
                _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(e);
                return false;
            }
        },
        /**
         * Refresh the features, fields and identities associated with a
         * disco entity by refetching them from the server
         * @method api.disco.refresh
         * @param {string} jid The JID of the entity whose features are refreshed.
         * @returns {Promise} A promise which resolves once the features have been refreshed
         * @example
         * await api.disco.refresh('room@conference.example.org');
         */ refresh (jid) {
            return _async_to_generator(function*() {
                if (!jid) throw new TypeError('api.disco.refresh: You need to provide an entity JID');
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('discoInitialized');
                let entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid);
                if (entity) {
                    entity.features.reset();
                    entity.fields.reset();
                    entity.identities.reset();
                    if (!entity.waitUntilFeaturesDiscovered.isPending) {
                        entity.waitUntilFeaturesDiscovered = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
                    }
                    if (!entity.waitUntilItemsFetched.isPending) {
                        entity.waitUntilItemsFetched = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
                    }
                    entity.queryInfo();
                } else {
                    // Create it if it doesn't exist
                    entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.create({
                        jid
                    }, {
                        ignore_cache: true
                    });
                }
                return entity.waitUntilItemsFetched;
            })();
        },
        /**
         * Return all the features associated with a disco entity
         *
         * @method api.disco.getFeatures
         * @param { string } jid The JID of the entity whose features are returned.
         * @returns {promise} A promise which resolves with the returned features
         * @example
         * const features = await api.disco.getFeatures('room@conference.example.org');
         */ getFeatures (jid) {
            return _async_to_generator(function*() {
                if (!jid) throw new TypeError('api.disco.getFeatures: You need to provide an entity JID');
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('discoInitialized');
                let entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid, true);
                entity = yield entity.waitUntilFeaturesDiscovered;
                return entity.features;
            })();
        },
        /**
         * Return all the service discovery extensions fields
         * associated with an entity.
         *
         * See [XEP-0129: Service Discovery Extensions](https://xmpp.org/extensions/xep-0128.html)
         *
         * @method api.disco.getFields
         * @param { string } jid The JID of the entity whose fields are returned.
         * @example
         * const fields = await api.disco.getFields('room@conference.example.org');
         */ getFields (jid) {
            return _async_to_generator(function*() {
                if (!jid) throw new TypeError('api.disco.getFields: You need to provide an entity JID');
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('discoInitialized');
                let entity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid, true);
                entity = yield entity.waitUntilFeaturesDiscovered;
                return entity.fields;
            })();
        },
        /**
         * Get the identity (with the given category and type) for a given disco entity.
         *
         * For example, when determining support for PEP (personal eventing protocol), you
         * want to know whether the user's own JID has an identity with
         * `category='pubsub'` and `type='pep'` as explained in this section of
         * XEP-0163: https://xmpp.org/extensions/xep-0163.html#support
         *
         * @method api.disco.getIdentity
         * @param {string} category -The identity category.
         *     In the XML stanza, this is the `category`
         *     attribute of the `<identity>` element.
         *     For example: 'pubsub'
         * @param {string} type - The identity type.
         *     In the XML stanza, this is the `type`
         *     attribute of the `<identity>` element.
         *     For example: 'pep'
         * @param {string} jid - The JID of the entity which might have the identity
         * @returns {promise} A promise which resolves with a map indicating
         *     whether an identity with a given type is provided by the entity.
         * @example
         * api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid).then(
         *     function (identity) {
         *         if (identity) {
         *             // The entity DOES have this identity
         *         } else {
         *             // The entity DOES NOT have this identity
         *         }
         *     }
         * ).catch(e => log.error(e));
         */ getIdentity (category, type, jid) {
            return _async_to_generator(function*() {
                const e = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.entities.get(jid, true);
                if (e === undefined && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.connected()) {
                    // Happens during tests when disco lookups happen asynchronously after teardown.
                    const msg = `Tried to look up category ${category} for ${jid} ` + `but _converse.disco_entities has been torn down`;
                    _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(msg);
                    return;
                }
                return e.getIdentity(category, type);
            })();
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/disco/entities.js":
/*!************************************************!*\
  !*** ./src/headless/plugins/disco/entities.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _entity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./entity.js */ "./src/headless/plugins/disco/entity.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);



class DiscoEntities extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Collection {
    fetchEntities() {
        return new Promise((resolve, reject)=>{
            this.fetch({
                add: true,
                success: resolve,
                error (_m, e) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error(e);
                    reject(new Error("Could not fetch disco entities"));
                }
            });
        });
    }
    constructor(){
        super();
        this.model = _entity_js__WEBPACK_IMPORTED_MODULE_0__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DiscoEntities);


/***/ }),

/***/ "./src/headless/plugins/disco/entity.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/disco/entity.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









const { Strophe, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
/**
 * @class
 * @namespace _converse.DiscoEntity
 * @memberOf _converse
 *
 * A Disco Entity is a JID addressable entity that can be queried for features.
 *
 * See XEP-0030: https://xmpp.org/extensions/xep-0030.html
 */ class DiscoEntity extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    get idAttribute() {
        return 'jid';
    }
    initialize(_, options) {
        super.initialize();
        this.waitUntilFeaturesDiscovered = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        this.waitUntilItemsFetched = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        this.dataforms = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection();
        let id = `converse.dataforms-${this.get('jid')}`;
        this.dataforms.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_8__.createStore)(id, 'session');
        this.features = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection();
        id = `converse.features-${this.get('jid')}`;
        this.features.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_8__.createStore)(id, 'session');
        this.listenTo(this.features, 'add', this.onFeatureAdded);
        this.fields = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection();
        id = `converse.fields-${this.get('jid')}`;
        this.fields.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_8__.createStore)(id, 'session');
        this.listenTo(this.fields, 'add', this.onFieldAdded);
        this.items = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection();
        id = `converse.items-${this.get('jid')}`;
        this.items.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_8__.createStore)(id, 'session');
        this.identities = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection();
        id = `converse.identities-${this.get('jid')}`;
        this.identities.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_8__.createStore)(id, 'session');
        this.fetchFeatures(options);
    }
    /**
     * Returns a Promise which resolves with a map indicating
     * whether a given identity is provided by this entity.
     * @method _converse.DiscoEntity#getIdentity
     * @param {String} category - The identity category
     * @param {String} type - The identity type
     */ getIdentity(category, type) {
        return _async_to_generator(function*() {
            yield this.waitUntilItemsFetched;
            return this.identities.findWhere({
                category,
                type
            });
        }).call(this);
    }
    /**
     * Returns a Promise which resolves with a map indicating
     * whether a given feature is supported.
     * @method _converse.DiscoEntity#getFeature
     * @param {String} feature - The feature that might be supported.
     */ getFeature(feature) {
        return _async_to_generator(function*() {
            yield this.waitUntilFeaturesDiscovered;
            if (this.features.findWhere({
                var: feature
            })) {
                return this;
            }
        }).call(this);
    }
    onFeatureAdded(feature) {
        feature.entity = this;
        /**
         * Triggered when Converse has learned of a service provided by the XMPP server.
         * See XEP-0030.
         * @event _converse#serviceDiscovered
         * @type { Model }
         * @example _converse.api.listen.on('featuresDiscovered', feature => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('serviceDiscovered', feature);
    }
    onFieldAdded(field) {
        field.entity = this;
        /**
         * Triggered when Converse has learned of a disco extension field.
         * See XEP-0030.
         * @event _converse#discoExtensionFieldDiscovered
         * @example _converse.api.listen.on('discoExtensionFieldDiscovered', () => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('discoExtensionFieldDiscovered', field);
    }
    fetchFeatures(options) {
        return _async_to_generator(function*() {
            if (options.ignore_cache) {
                yield this.queryInfo();
            } else {
                const store_id = this.features.browserStorage.name;
                // Checking only whether features have been cached, even though
                // there are other things that should be cached as well. We assume
                // that if features have been cached, everything else has been also.
                const result = yield this.features.browserStorage.store.getItem(store_id);
                if (result && result.length === 0 || result === null) {
                    yield this.queryInfo();
                } else {
                    yield new Promise((resolve)=>this.fetch({
                            success: resolve,
                            error: resolve
                        }));
                    yield new Promise((resolve)=>this.features.fetch({
                            add: true,
                            success: ()=>{
                                this.waitUntilFeaturesDiscovered.resolve(this);
                                this.trigger('featuresDiscovered');
                                resolve();
                            },
                            error: resolve
                        }));
                    yield new Promise((resolve)=>this.identities.fetch({
                            add: true,
                            success: resolve,
                            error: resolve
                        }));
                    const items = this.get('items');
                    if (Array.isArray(items)) {
                        yield Promise.all(items.map(/** @param {string} jid */ (jid)=>_async_to_generator(function*() {
                                return yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.entities.get(jid, true);
                            })()));
                    } else {
                        yield this.queryForItems();
                    }
                    this.waitUntilItemsFetched.resolve();
                }
            }
        }).call(this);
    }
    queryInfo() {
        return _async_to_generator(function*() {
            let stanza;
            try {
                stanza = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.info(this.get('jid'), null);
            } catch (iq) {
                if (u.isElement(iq)) {
                    const e = yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_5__.parseErrorStanza)(iq);
                    if (e.message !== 'item-not-found') {
                        _converse_log__WEBPACK_IMPORTED_MODULE_6__["default"].error(`Error querying disco#info for ${this.get('jid')}: ${e.message}`);
                    }
                    this.save({
                        error: e.message
                    });
                    this.waitUntilFeaturesDiscovered.resolve(e);
                    this.waitUntilItemsFetched.resolve(e);
                } else {
                    if (iq === null) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_6__["default"].error(`Timeout for disco#info query for ${this.get('jid')}`);
                    } else {
                        _converse_log__WEBPACK_IMPORTED_MODULE_6__["default"].error(`Error querying disco#info for ${this.get('jid')}: ${iq}`);
                    }
                    this.waitUntilFeaturesDiscovered.resolve(iq);
                    this.waitUntilItemsFetched.resolve(iq);
                }
                return;
            }
            this.onInfo(stanza);
        }).call(this);
    }
    /**
     * @param {Element} stanza
     */ onDiscoItems(stanza) {
        const item_els = sizzle__WEBPACK_IMPORTED_MODULE_7___default()(`query[xmlns="${Strophe.NS.DISCO_ITEMS}"] item`, stanza);
        const item_jids = [];
        item_els.forEach((item)=>{
            if (item.getAttribute('node')) {
                // XXX: Ignore nodes for now.
                // See: https://xmpp.org/extensions/xep-0030.html#items-nodes
                return;
            }
            const jid = item.getAttribute('jid');
            let entity = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.disco_entities.get(jid);
            if (entity) {
                const parent_jids = entity.get('parent_jids');
                entity.set({
                    parent_jids: [
                        ...parent_jids,
                        this.get('jid')
                    ]
                });
            } else {
                entity = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.entities.create({
                    jid,
                    parent_jids: [
                        this.get('jid')
                    ],
                    name: item.getAttribute('name')
                });
            }
            item_jids.push(entity.get('jid'));
        });
        this.save({
            items: item_jids
        });
    }
    queryForItems() {
        return _async_to_generator(function*() {
            if (this.identities.where({
                category: 'server'
            }).length === 0) {
                // Don't fetch features and items if this is not a
                // server or a conference component.
                return;
            }
            const stanza = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.items(this.get('jid'));
            this.onDiscoItems(stanza);
        }).call(this);
    }
    /**
     * @param {Element} stanza
     */ onInfo(stanza) {
        return _async_to_generator(function*() {
            Array.from(stanza.querySelectorAll('identity')).forEach((identity)=>{
                this.identities.create({
                    category: identity.getAttribute('category'),
                    type: identity.getAttribute('type'),
                    name: identity.getAttribute('name')
                });
            });
            sizzle__WEBPACK_IMPORTED_MODULE_7___default()(`x[type="result"][xmlns="${Strophe.NS.XFORM}"]`, stanza).forEach((form)=>{
                const data = {};
                sizzle__WEBPACK_IMPORTED_MODULE_7___default()('field', form).forEach((field)=>{
                    var _field_querySelector;
                    data[field.getAttribute('var')] = {
                        'value': (_field_querySelector = field.querySelector('value')) === null || _field_querySelector === void 0 ? void 0 : _field_querySelector.textContent,
                        'type': field.getAttribute('type')
                    };
                });
                this.dataforms.create(data);
            });
            if (stanza.querySelector(`feature[var="${Strophe.NS.DISCO_ITEMS}"]`)) {
                yield this.queryForItems();
            }
            this.waitUntilItemsFetched.resolve();
            Array.from(stanza.querySelectorAll('feature')).forEach((feature)=>{
                this.features.create({
                    'var': feature.getAttribute('var'),
                    'from': stanza.getAttribute('from')
                });
            });
            // XEP-0128 Service Discovery Extensions
            sizzle__WEBPACK_IMPORTED_MODULE_7___default()('x[type="result"][xmlns="jabber:x:data"] field', stanza).forEach((field)=>{
                var _field_querySelector;
                this.fields.create({
                    'var': field.getAttribute('var'),
                    'value': (_field_querySelector = field.querySelector('value')) === null || _field_querySelector === void 0 ? void 0 : _field_querySelector.textContent,
                    'from': stanza.getAttribute('from')
                });
            });
            this.waitUntilFeaturesDiscovered.resolve(this);
            this.trigger('featuresDiscovered');
        }).call(this);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DiscoEntity);


/***/ }),

/***/ "./src/headless/plugins/disco/index.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/disco/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _entities_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./entities.js */ "./src/headless/plugins/disco/entities.js");
/* harmony import */ var _entity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entity.js */ "./src/headless/plugins/disco/entity.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/disco/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/disco/utils.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description Converse plugin which add support for XEP-0030: Service Discovery
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}







const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
/**
 * @typedef {Object} DiscoState
 * @property {Array} _identities
 * @property {Array} _features
 */ _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].plugins.add('converse-disco', {
    initialize () {
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"], _api_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].promises.add('discoInitialized');
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].promises.add('streamFeaturesAdded');
        const exports = {
            DiscoEntity: _entity_js__WEBPACK_IMPORTED_MODULE_1__["default"],
            DiscoEntities: _entities_js__WEBPACK_IMPORTED_MODULE_0__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"], exports); // XXX: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports, exports);
        const disco = {
            _identities: [],
            _features: []
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"], {
            disco
        }); // XXX: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state, {
            disco
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('userSessionInitialized', ()=>_async_to_generator(function*() {
                (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.initStreamFeatures)();
                if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.connfeedback.get('connection_status') === Strophe.Status.ATTACHED) {
                    // When re-attaching to a BOSH session, we fetch the stream features from the cache.
                    yield new Promise((success, error)=>_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.stream_features.fetch({
                            success,
                            error
                        }));
                    (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.notifyStreamFeaturesAdded)();
                }
            })());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('beforeResourceBinding', _utils_js__WEBPACK_IMPORTED_MODULE_6__.populateStreamFeatures);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('reconnected', _utils_js__WEBPACK_IMPORTED_MODULE_6__.initializeDisco);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('connected', _utils_js__WEBPACK_IMPORTED_MODULE_6__.initializeDisco);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('beforeTearDown', ()=>_async_to_generator(function*() {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].promises.add('streamFeaturesAdded');
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].promises.add('discoInitialized');
                const { stream_features } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state;
                if (stream_features) {
                    yield stream_features.clearStore();
                    delete _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.stream_features;
                    Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"], {
                        stream_features: undefined
                    }); // XXX: DEPRECATED
                }
            })());
        // All disco entities stored in sessionStorage and are refetched
        // upon login or reconnection and then stored with new ids, so to
        // avoid sessionStorage filling up, we remove them.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('will-reconnect', _utils_js__WEBPACK_IMPORTED_MODULE_6__.clearSession);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('clearSession', _utils_js__WEBPACK_IMPORTED_MODULE_6__.clearSession);
    }
});


/***/ }),

/***/ "./src/headless/plugins/disco/utils.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/disco/utils.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clearSession: () => (/* binding */ clearSession),
/* harmony export */   initStreamFeatures: () => (/* binding */ initStreamFeatures),
/* harmony export */   initializeDisco: () => (/* binding */ initializeDisco),
/* harmony export */   notifyStreamFeaturesAdded: () => (/* binding */ notifyStreamFeaturesAdded),
/* harmony export */   populateStreamFeatures: () => (/* binding */ populateStreamFeatures)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, $iq } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/**
 * @param {Element} stanza
 */ function onDiscoInfoRequest(stanza) {
    const node = stanza.getElementsByTagName('query')[0].getAttribute('node');
    const attrs = {
        xmlns: Strophe.NS.DISCO_INFO
    };
    if (node) {
        attrs.node = node;
    }
    const iqresult = $iq({
        'type': 'result',
        'id': stanza.getAttribute('id')
    });
    const from = stanza.getAttribute('from');
    if (from !== null) {
        iqresult.attrs({
            'to': from
        });
    }
    iqresult.c('query', attrs);
    _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.disco._identities.forEach((identity)=>{
        const attrs = {
            'category': identity.category,
            'type': identity.type
        };
        if (identity.name) {
            attrs.name = identity.name;
        }
        if (identity.lang) {
            attrs['xml:lang'] = identity.lang;
        }
        iqresult.c('identity', attrs).up();
    });
    _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.disco._features.forEach((f)=>iqresult.c('feature', {
            'var': f
        }).up());
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].send(iqresult.tree());
    return true;
}
function addClientFeatures() {
    // See https://xmpp.org/registrar/disco-categories.html
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.identities.add('client', 'web', 'Converse');
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.features.add(Strophe.NS.CHATSTATES);
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.features.add(Strophe.NS.DISCO_INFO);
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.features.add(Strophe.NS.ROSTERX); // Limited support
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.features.add(Strophe.NS.CARBONS);
    /**
     * Triggered in converse-disco once the core disco features of
     * Converse have been added.
     * @event _converse#addClientFeatures
     * @example _converse.api.listen.on('addClientFeatures', () => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('addClientFeatures');
    return this;
}
function initializeDisco() {
    return _async_to_generator(function*() {
        addClientFeatures();
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get().addHandler((stanza)=>onDiscoInfoRequest(stanza), Strophe.NS.DISCO_INFO, 'iq', 'get', null, null);
        const disco_entities = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.DiscoEntities();
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
            disco_entities
        }); // XXX: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state, {
            disco_entities
        });
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        const id = `converse.disco-entities-${bare_jid}`;
        disco_entities.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_4__.createStore)(id, 'session');
        const collection = yield disco_entities.fetchEntities();
        const domain = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('domain');
        if (collection.length === 0 || !collection.get(domain)) {
            // If we don't have an entity for our own XMPP server, create one.
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.entities.create({
                'jid': domain
            }, {
                'ignore_cache': true
            });
        }
        /**
     * Triggered once the `converse-disco` plugin has been initialized and the
     * `_converse.disco_entities` collection will be available and populated with at
     * least the service discovery features of the user's own server.
     * @event _converse#discoInitialized
     * @example _converse.api.listen.on('discoInitialized', () => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('discoInitialized');
    })();
}
function initStreamFeatures() {
    // Initialize the stream_features collection, and if we're
    // re-attaching to a pre-existing BOSH session, we restore the
    // features from cache.
    // Otherwise the features will be created once we've received them
    // from the server (see populateStreamFeatures).
    if (!_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.stream_features) {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        const id = `converse.stream-features-${bare_jid}`;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].promises.add('streamFeaturesAdded');
        const stream_features = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__.Collection();
        stream_features.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_4__.createStore)(id, "session");
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
            stream_features
        }); // XXX: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state, {
            stream_features
        });
    }
}
function notifyStreamFeaturesAdded() {
    /**
     * Triggered as soon as the stream features are known.
     * If you want to check whether a stream feature is supported before proceeding,
     * then you'll first want to wait for this event.
     * @event _converse#streamFeaturesAdded
     * @example _converse.api.listen.on('streamFeaturesAdded', () => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('streamFeaturesAdded');
}
function populateStreamFeatures() {
    // Strophe.js sets the <stream:features> element on the
    // Strophe.Connection instance.
    //
    // Once this is we populate the stream_features collection
    // and trigger streamFeaturesAdded.
    initStreamFeatures();
    Array.from(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get().features.childNodes).forEach((feature)=>{
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.stream_features.create({
            'name': feature.nodeName,
            'xmlns': feature.getAttribute('xmlns')
        });
    });
    notifyStreamFeaturesAdded();
}
function clearSession() {
    const { disco_entities } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
    disco_entities === null || disco_entities === void 0 ? void 0 : disco_entities.forEach((e)=>e.features.clearStore());
    disco_entities === null || disco_entities === void 0 ? void 0 : disco_entities.forEach((e)=>e.identities.clearStore());
    disco_entities === null || disco_entities === void 0 ? void 0 : disco_entities.forEach((e)=>e.dataforms.clearStore());
    disco_entities === null || disco_entities === void 0 ? void 0 : disco_entities.forEach((e)=>e.fields.clearStore());
    disco_entities === null || disco_entities === void 0 ? void 0 : disco_entities.clearStore();
    delete _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.disco_entities;
    Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
        disco_entities: undefined
    });
}


/***/ }),

/***/ "./src/headless/plugins/emoji/api.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/emoji/api.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


/**
 * @namespace api.emojis
 * @memberOf api
 */ const emojis = {
    /**
     * Initializes Emoji support by downloading the emojis JSON (and any applicable images).
     * @method api.emojis.initialize
     * @returns {Promise}
     */ initialize () {
        return _async_to_generator(function*() {
            if (!_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.initialized) {
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.initialized = true;
                const module = yield __webpack_require__.e(/*! import() | emojis */ "emojis").then(__webpack_require__.t.bind(__webpack_require__, /*! ./emoji.json */ "./src/headless/plugins/emoji/emoji.json", 19));
                /**
             * *Hook* which allows plugins to modify emojis definition.
             *
             * Note: This hook is only fired one time, when Converse is initialized.
             *
             * @event _converse#loadEmojis
             * @param context
             *      An empty context object.
             * @param json
             *      See {@link src/headless/emojis.json} for more information about the content of
             *      this parameter.
             * @example
             *  api.listen.on('loadEmojis', (context, json) => {
             *      json.custom??= {};
             *      json.custom[":my_emoji"] = {
             *          "sn":":my_emoji:","url":"https://example.com/my_emoji.png","c":"custom"
             *      };
             *      delete json.custom[":converse:"];
             *      return json;
             *  });
             */ const json = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].hook('loadEmojis', {}, module.default);
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.json = json;
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.by_sn = Object.keys(json).reduce((result, cat)=>Object.assign(result, json[cat]), {});
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.list = Object.values(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.by_sn);
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.list.sort((a, b)=>a.sn < b.sn ? -1 : a.sn > b.sn ? 1 : 0);
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.shortnames = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.list.map((m)=>m.sn);
                const getShortNames = ()=>_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.shortnames.map((s)=>s.replace(/[+]/g, '\\$&')).join('|');
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.shortnames_regex = new RegExp(getShortNames(), 'gi');
                _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.initialized_promise.resolve();
            }
            return _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.initialized_promise;
        })();
    }
};
const emojis_api = {
    emojis
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (emojis_api);


/***/ }),

/***/ "./src/headless/plugins/emoji/index.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/emoji/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   EmojiPicker: () => (/* reexport safe */ _picker_js__WEBPACK_IMPORTED_MODULE_0__["default"])
/* harmony export */ });
/* harmony import */ var _picker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./picker.js */ "./src/headless/plugins/emoji/picker.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/emoji/plugin.js");





/***/ }),

/***/ "./src/headless/plugins/emoji/picker.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/emoji/picker.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);

/**
 * Model for storing data related to the Emoji picker widget
 */ class EmojiPicker extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            'current_category': 'smileys',
            'current_skintone': '',
            'scroll_position': 0
        };
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EmojiPicker);


/***/ }),

/***/ "./src/headless/plugins/emoji/plugin.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/emoji/plugin.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _picker_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./picker.js */ "./src/headless/plugins/emoji/picker.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/emoji/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/emoji/utils.js");
/**
 * @module converse-emoji
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}







_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].emojis = {
    initialized: false,
    initialized_promise: (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)()
};
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-emoji', {
    initialize () {
        /* The initialize function gets called as soon as the plugin is
         * loaded by converse.js's plugin machinery.
         */ const { ___ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.extend({
            'emoji_image_path': 'https://twemoji.maxcdn.com/v/12.1.6/',
            'emoji_categories': {
                'smileys': ':grinning:',
                'people': ':thumbsup:',
                'activity': ':soccer:',
                'travel': ':motorcycle:',
                'objects': ':bomb:',
                'nature': ':rainbow:',
                'food': ':hotdog:',
                'symbols': ':musical_note:',
                'flags': ':flag_ac:',
                'custom': null
            },
            // We use the triple-underscore method which doesn't actually
            // translate but does signify to gettext that these strings should
            // go into the POT file. The translation then happens in the
            // template. We do this so that users can pass in their own
            // strings via converse.initialize, which is before __ is
            // available.
            'emoji_category_labels': {
                'smileys': ___('Smileys and emotions'),
                'people': ___('People'),
                'activity': ___('Activities'),
                'travel': ___('Travel'),
                'objects': ___('Objects'),
                'nature': ___('Animals and nature'),
                'food': ___('Food and drink'),
                'symbols': ___('Symbols'),
                'flags': ___('Flags'),
                'custom': ___('Stickers')
            }
        });
        const exports = {
            EmojiPicker: _picker_js__WEBPACK_IMPORTED_MODULE_4__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], exports); // XXX: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].exports, exports);
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], _api_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('getOutgoingMessageAttributes', (_chat, attrs)=>_async_to_generator(function*() {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].emojis.initialize();
                const { original_text: text } = attrs;
                return _object_spread_props(_object_spread({}, attrs), {
                    is_only_emojis: text ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.isOnlyEmojis)(text) : false
                });
            })());
        function parseMessage(_stanza, attrs) {
            return _async_to_generator(function*() {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].emojis.initialize();
                return _object_spread_props(_object_spread({}, attrs), {
                    is_only_emojis: attrs.body ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.isOnlyEmojis)(attrs.body) : false
                });
            })();
        }
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('parseMUCMessage', parseMessage);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('parseMessage', parseMessage);
    }
});


/***/ }),

/***/ "./src/headless/plugins/emoji/regexes.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/emoji/regexes.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ASCII_REPLACE_REGEX: () => (/* binding */ ASCII_REPLACE_REGEX),
/* harmony export */   CODEPOINTS_REGEX: () => (/* binding */ CODEPOINTS_REGEX)
/* harmony export */ });
const ASCII_REGEX = '(\\*\\\\0\\/\\*|\\*\\\\O\\/\\*|\\-___\\-|\\:\'\\-\\)|\'\\:\\-\\)|\'\\:\\-D|\\>\\:\\-\\)|>\\:\\-\\)|\'\\:\\-\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:\'\\-\\(|O\\:\\-\\)|0\\:\\-3|0\\:\\-\\)|0;\\^\\)|O;\\-\\)|0;\\-\\)|O\\:\\-3|\\-__\\-|\\:\\-Þ|\\:\\-Þ|\\<\\/3|<\\/3|\\:\'\\)|\\:\\-D|\'\\:\\)|\'\\=\\)|\'\\:D|\'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\=\\)|>\\=\\)|;\\-\\)|\\*\\-\\)|;\\-\\]|;\\^\\)|\'\\:\\(|\'\\=\\(|\\:\\-\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\-\\[|\\>\\:\\(|>\\:\\(|\\:\'\\(|;\\-\\(|\\>\\.\\<|>\\.<|#\\-\\)|%\\-\\)|X\\-\\)|\\\\0\\/|\\\\O\\/|0\\:3|0\\:\\)|O\\:\\)|O\\=\\)|O\\:3|B\\-\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\-P|\\:Þ|\\:Þ|\\:\\-b|\\:\\-O|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:\\-#|\\:\\-\\)|\\(y\\)|\\<3|<3|\\:D|\\=D|;\\)|\\*\\)|;\\]|;D|\\:\\*|\\=\\*|\\:\\(|\\:\\[|\\=\\(|\\:@|;\\(|D\\:|\\:\\$|\\=\\$|#\\)|%\\)|X\\)|B\\)|8\\)|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\=P|\\:b|\\:O|\\:X|\\:#|\\=X|\\=#|\\:\\)|\\=\\]|\\=\\)|\\:\\])';
const ASCII_REPLACE_REGEX = new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)" + ASCII_REGEX + "(?=\\s|$|[!,.?]))", "gi");
const CODEPOINTS_REGEX = /(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5\udeeb\udeec\udef4-\udefa\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd71\udd73-\udd76\udd7a-\udda2\udda5-\uddaa\uddae-\uddb4\uddb7\uddba\uddbc-\uddca\uddd0\uddde-\uddff\ude70-\ude73\ude78-\ude7a\ude80-\ude82\ude90-\ude95]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g;


/***/ }),

/***/ "./src/headless/plugins/emoji/utils.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/emoji/utils.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   convertASCII2Emoji: () => (/* binding */ convertASCII2Emoji),
/* harmony export */   getCodePointReferences: () => (/* binding */ getCodePointReferences),
/* harmony export */   getShortnameReferences: () => (/* binding */ getShortnameReferences),
/* harmony export */   isOnlyEmojis: () => (/* binding */ isOnlyEmojis)
/* harmony export */ });
/* harmony import */ var _regexes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regexes.js */ "./src/headless/plugins/emoji/regexes.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");


const { u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
// Closured cache
const emojis_by_attribute = {};
const ASCII_LIST = {
    '*\\0/*': '1f646',
    '*\\O/*': '1f646',
    '-___-': '1f611',
    ':\'-)': '1f602',
    '\':-)': '1f605',
    '\':-D': '1f605',
    '>:-)': '1f606',
    '\':-(': '1f613',
    '>:-(': '1f620',
    ':\'-(': '1f622',
    'O:-)': '1f607',
    '0:-3': '1f607',
    '0:-)': '1f607',
    '0;^)': '1f607',
    'O;-)': '1f607',
    '0;-)': '1f607',
    'O:-3': '1f607',
    '-__-': '1f611',
    ':-Þ': '1f61b',
    '</3': '1f494',
    ':\')': '1f602',
    ':-D': '1f603',
    '\':)': '1f605',
    '\'=)': '1f605',
    '\':D': '1f605',
    '\'=D': '1f605',
    '>:)': '1f606',
    '>;)': '1f606',
    '>=)': '1f606',
    ';-)': '1f609',
    '*-)': '1f609',
    ';-]': '1f609',
    ';^)': '1f609',
    '\':(': '1f613',
    '\'=(': '1f613',
    ':-*': '1f618',
    ':^*': '1f618',
    '>:P': '1f61c',
    'X-P': '1f61c',
    '>:[': '1f61e',
    ':-(': '1f61e',
    ':-[': '1f61e',
    '>:(': '1f620',
    ':\'(': '1f622',
    ';-(': '1f622',
    '>.<': '1f623',
    '#-)': '1f635',
    '%-)': '1f635',
    'X-)': '1f635',
    '\\0/': '1f646',
    '\\O/': '1f646',
    '0:3': '1f607',
    '0:)': '1f607',
    'O:)': '1f607',
    'O=)': '1f607',
    'O:3': '1f607',
    'B-)': '1f60e',
    '8-)': '1f60e',
    'B-D': '1f60e',
    '8-D': '1f60e',
    '-_-': '1f611',
    '>:\\': '1f615',
    '>:/': '1f615',
    ':-/': '1f615',
    ':-.': '1f615',
    ':-P': '1f61b',
    ':Þ': '1f61b',
    ':-b': '1f61b',
    ':-O': '1f62e',
    'O_O': '1f62e',
    '>:O': '1f62e',
    ':-X': '1f636',
    ':-#': '1f636',
    ':-)': '1f642',
    '(y)': '1f44d',
    '<3': '2764',
    ':D': '1f603',
    '=D': '1f603',
    ';)': '1f609',
    '*)': '1f609',
    ';]': '1f609',
    ';D': '1f609',
    ':*': '1f618',
    '=*': '1f618',
    ':(': '1f61e',
    ':[': '1f61e',
    '=(': '1f61e',
    ':@': '1f620',
    ';(': '1f622',
    'D:': '1f628',
    ':$': '1f633',
    '=$': '1f633',
    '#)': '1f635',
    '%)': '1f635',
    'X)': '1f635',
    'B)': '1f60e',
    '8)': '1f60e',
    ':/': '1f615',
    ':\\': '1f615',
    '=/': '1f615',
    '=\\': '1f615',
    ':L': '1f615',
    '=L': '1f615',
    ':P': '1f61b',
    '=P': '1f61b',
    ':b': '1f61b',
    ':O': '1f62e',
    ':X': '1f636',
    ':#': '1f636',
    '=X': '1f636',
    '=#': '1f636',
    ':)': '1f642',
    '=]': '1f642',
    '=)': '1f642',
    ':]': '1f642'
};
function toCodePoint(unicode_surrogates) {
    const r = [];
    let p = 0;
    let i = 0;
    while(i < unicode_surrogates.length){
        const c = unicode_surrogates.charCodeAt(i++);
        if (p) {
            r.push((0x10000 + (p - 0xD800 << 10) + (c - 0xDC00)).toString(16));
            p = 0;
        } else if (0xD800 <= c && c <= 0xDBFF) {
            p = c;
        } else {
            r.push(c.toString(16));
        }
    }
    return r.join('-');
}
function fromCodePoint(codepoint) {
    let code = typeof codepoint === 'string' ? parseInt(codepoint, 16) : codepoint;
    if (code < 0x10000) {
        return String.fromCharCode(code);
    }
    code -= 0x10000;
    return String.fromCharCode(0xD800 + (code >> 10), 0xDC00 + (code & 0x3FF));
}
/**
 * Converts unicode code points and code pairs to their respective characters
 * @param {string} unicode
 */ function convert(unicode) {
    if (unicode.indexOf("-") > -1) {
        const parts = [];
        const s = unicode.split('-');
        for(let i = 0; i < s.length; i++){
            const part = parseInt(s[i], 16);
            if (part >= 0x10000 && part <= 0x10FFFF) {
                const hi = Math.floor((part - 0x10000) / 0x400) + 0xD800;
                const lo = (part - 0x10000) % 0x400 + 0xDC00;
                parts.push(String.fromCharCode(hi) + String.fromCharCode(lo));
            } else {
                parts.push(String.fromCharCode(part));
            }
        }
        return parts.join('');
    }
    return fromCodePoint(unicode);
}
/**
 * @param {string} str
 */ function convertASCII2Emoji(str) {
    // Replace ASCII smileys
    return str.replace(_regexes_js__WEBPACK_IMPORTED_MODULE_0__.ASCII_REPLACE_REGEX, (entire, _, m2, m3)=>{
        if (typeof m3 === 'undefined' || m3 === '' || !(u.unescapeHTML(m3) in ASCII_LIST)) {
            // if the ascii doesnt exist just return the entire match
            return entire;
        }
        m3 = u.unescapeHTML(m3);
        const unicode = ASCII_LIST[m3].toUpperCase();
        return m2 + convert(unicode);
    });
}
/**
 * @param {string} text
 */ function getShortnameReferences(text) {
    if (!_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.initialized) {
        throw new Error('getShortnameReferences called before emojis are initialized. ' + 'To avoid this problem, first await the converse.emojis.initialized_promise');
    }
    const references = [
        ...text.matchAll(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.shortnames_regex)
    ].filter((ref)=>ref[0].length > 0);
    return references.map((ref)=>{
        var _converse_emojis_by_sn_ref__toLowerCase;
        const cp = (_converse_emojis_by_sn_ref__toLowerCase = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.by_sn[ref[0].toLowerCase()]) === null || _converse_emojis_by_sn_ref__toLowerCase === void 0 ? void 0 : _converse_emojis_by_sn_ref__toLowerCase?.cp; // BAO
        return {
            cp,
            'begin': ref.index,
            'end': ref.index + ref[0].length,
            'shortname': ref[0],
            'emoji': cp ? convert(cp) : null
        };
    });
}
/**
 * @param {string} str
 * @param {Function} callback
 */ function parseStringForEmojis(str, callback) {
    const UFE0Fg = /\uFE0F/g;
    const U200D = String.fromCharCode(0x200D);
    return String(str).replace(_regexes_js__WEBPACK_IMPORTED_MODULE_0__.CODEPOINTS_REGEX, (emoji, _, offset)=>{
        const icon_id = toCodePoint(emoji.indexOf(U200D) < 0 ? emoji.replace(UFE0Fg, '') : emoji);
        if (icon_id) callback(icon_id, emoji, offset);
        return emoji;
    });
}
/**
 * @param {string} text
 */ function getCodePointReferences(text) {
    const references = [];
    parseStringForEmojis(text, (icon_id, emoji, offset)=>{
        var _getEmojisByAttribute_icon_id;
        references.push({
            'begin': offset,
            'cp': icon_id,
            'emoji': emoji,
            'end': offset + emoji.length,
            'shortname': ((_getEmojisByAttribute_icon_id = getEmojisByAttribute('cp')[icon_id]) === null || _getEmojisByAttribute_icon_id === void 0 ? void 0 : _getEmojisByAttribute_icon_id.sn) || ''
        });
    });
    return references;
}
function addEmojisMarkup(text) {
    let list = [
        text
    ];
    [
        ...getShortnameReferences(text),
        ...getCodePointReferences(text)
    ].sort((a, b)=>b.begin - a.begin).forEach((ref)=>{
        const text = list.shift();
        const emoji = ref.emoji || ref.shortname;
        list = [
            text.slice(0, ref.begin) + emoji + text.slice(ref.end),
            ...list
        ];
    });
    return list;
}
/**
 * Replaces all shortnames in the passed in string with their
 * unicode (emoji) representation.
 * @namespace u
 * @method u.shortnamesToUnicode
 * @param { String } str - String containing the shortname(s)
 * @returns { String }
 */ function shortnamesToUnicode(str) {
    return addEmojisMarkup(convertASCII2Emoji(str)).pop();
}
/**
 * Determines whether the passed in string is just a single emoji shortname;
 * @namespace u
 * @method u.isOnlyEmojis
 * @param { String } text - A string which migh be just an emoji shortname
 * @returns { Boolean }
 */ function isOnlyEmojis(text) {
    const words = text.trim().split(/\s+/);
    if (words.length === 0 || words.length > 3) {
        return false;
    }
    const emojis = words.filter((text)=>{
        const refs = getCodePointReferences(u.shortnamesToUnicode(text));
        return refs.length === 1 && (text.toLowerCase() === refs[0]['shortname'] || text === refs[0]['emoji']);
    });
    return emojis.length === words.length;
}
/**
 * @namespace u
 * @method u.getEmojisByAttribute
 * @param { 'category'|'cp'|'sn' } attr
 *  The attribute according to which the returned map should be keyed.
 * @returns { Object }
 *  Map of emojis with the passed in `attr` used as key and a list of emojis as values.
 */ function getEmojisByAttribute(attr) {
    if (emojis_by_attribute[attr]) {
        return emojis_by_attribute[attr];
    }
    if (attr === 'category') {
        return _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.json;
    }
    const all_variants = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.list.map((e)=>e[attr]).filter((c, i, arr)=>arr.indexOf(c) == i);
    emojis_by_attribute[attr] = {};
    all_variants.forEach((v)=>emojis_by_attribute[attr][v] = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].emojis.list.find((i)=>i[attr] === v));
    return emojis_by_attribute[attr];
}
Object.assign(u, {
    getCodePointReferences,
    getShortnameReferences,
    convertASCII2Emoji,
    getEmojisByAttribute,
    isOnlyEmojis,
    shortnamesToUnicode
});


/***/ }),

/***/ "./src/headless/plugins/headlines/api.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/headlines/api.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/**
 * @typedef {import('./feed.js').default} HeadlinesFeed
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The "headlines" namespace, which is used for headline-channels
     * which are read-only channels containing messages of type
     * "headline".
     *
     * @namespace api.headlines
     * @memberOf api
     */ headlines: {
        /**
         * Retrieves a headline-channel or all headline-channels.
         *
         * @method api.headlines.get
         * @param {String|String[]} jids - e.g. 'buddy@example.com' or ['buddy1@example.com', 'buddy2@example.com']
         * @param { Object } [attrs] - Attributes to be set on the _converse.ChatBox model.
         * @param { Boolean } [create=false] - Whether the chat should be created if it's not found.
         * @returns { Promise<HeadlinesFeed[]|HeadlinesFeed> }
         */ get (_0) {
            return _async_to_generator(function*(jids, attrs = {}, create = false) {
                /**
             * @param {string} jid
             * @returns {Promise<HeadlinesFeed>}
             */ function _get(jid) {
                    return _async_to_generator(function*() {
                        let model = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.get(jid);
                        if (!model && create) {
                            const { HeadlinesFeed } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports;
                            model = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.create(jid, attrs, HeadlinesFeed);
                        } else {
                            model = model && model.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_2__.HEADLINES_TYPE ? model : null;
                            if (model && Object.keys(attrs).length) {
                                model.save(attrs);
                            }
                        }
                        return model;
                    })();
                }
                if (jids === undefined) {
                    const chats = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].chatboxes.get();
                    return chats.filter((c)=>c.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_2__.HEADLINES_TYPE);
                } else if (typeof jids === 'string') {
                    return _get(jids);
                }
                return Promise.all(jids.map((jid)=>_get(jid)));
            }).apply(this, arguments);
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/headlines/feed.js":
/*!************************************************!*\
  !*** ./src/headless/plugins/headlines/feed.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ HeadlinesFeed)
/* harmony export */ });
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _shared_chatbox_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/chatbox.js */ "./src/headless/shared/chatbox.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class HeadlinesFeed extends _shared_chatbox_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    defaults() {
        return {
            'bookmarked': false,
            'hidden': (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_1__.isUniView)() && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].settings.get('singleton'),
            'message_type': 'headline',
            'num_unread': 0,
            'time_opened': this.get('time_opened') || new Date().getTime(),
            'time_sent': undefined,
            'type': _shared_constants_js__WEBPACK_IMPORTED_MODULE_2__.HEADLINES_TYPE
        };
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            yield _superprop_get_initialize().call(_this);
            yield this.fetchMessages();
            /**
         * Triggered once a { @link _converse.HeadlinesFeed } has been created and initialized.
         * @event _converse#headlinesFeedInitialized
         * @type {HeadlinesFeed}
         * @example _converse.api.listen.on('headlinesFeedInitialized', model => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].trigger('headlinesFeedInitialized', this);
        }).call(this);
    }
    canPostMessages() {
        return false;
    }
    /**
     * @param {import('../../shared/message').default} message
     */ isChatMessage(message) {
        const type = message.get('type');
        return type === this.get('message_type') || type === 'normal';
    }
    constructor(attrs, options){
        super(attrs, options);
        this.disable_mam = true; // Don't do MAM queries for this box
    }
}
/**
 * Shows headline messages
 */ 


/***/ }),

/***/ "./src/headless/plugins/headlines/index.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/headlines/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _feed_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./feed.js */ "./src/headless/plugins/headlines/feed.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/headlines/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/headlines/utils.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/**
 * @module converse-headlines
 * @copyright 2022, the Converse.js contributors
 */ 






_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-headlines', {
    dependencies: [
        "converse-chat"
    ],
    initialize () {
        const exports = {
            HeadlinesFeed: _feed_js__WEBPACK_IMPORTED_MODULE_0__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], exports); // XXX: DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].exports, exports);
        function registerHeadlineHandler() {
            var _api_connection_get;
            (_api_connection_get = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.addHandler((m)=>{
                (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.onHeadlineMessage)(m);
                return true; // keep the handler
            }, null, 'message');
        }
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('connected', registerHeadlineHandler);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('reconnected', registerHeadlineHandler);
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], _api_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].chatboxes.registry.add(_shared_constants_js__WEBPACK_IMPORTED_MODULE_6__.HEADLINES_TYPE, _feed_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
    }
});


/***/ }),

/***/ "./src/headless/plugins/headlines/utils.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/headlines/utils.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   onHeadlineMessage: () => (/* binding */ onHeadlineMessage)
/* harmony export */ });
/* harmony import */ var _feed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./feed */ "./src/headless/plugins/headlines/feed.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _plugins_chat_parsers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../plugins/chat/parsers.js */ "./src/headless/plugins/chat/parsers.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






/**
 * Handler method for all incoming messages of type "headline".
 * @param { Element } stanza
 */ function onHeadlineMessage(stanza) {
    return _async_to_generator(function*() {
        if ((0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__.isHeadline)(stanza) || (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__.isServerMessage)(stanza)) {
            const from_jid = stanza.getAttribute('from');
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('rosterInitialized');
            if (from_jid.includes('@') && !_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.roster.get(from_jid) && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get("allow_non_roster_messaging")) {
                return;
            }
            if (stanza.querySelector('body') === null) {
                // Avoid creating a chat box if we have nothing to show inside it.
                return;
            }
            const chatbox = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].chatboxes.create(from_jid, {
                'id': from_jid,
                'jid': from_jid,
                'type': _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.HEADLINES_TYPE,
                'from': from_jid
            }, _feed__WEBPACK_IMPORTED_MODULE_0__["default"]);
            const attrs = yield (0,_plugins_chat_parsers_js__WEBPACK_IMPORTED_MODULE_5__.parseMessage)(stanza);
            yield chatbox.createMessage(attrs);
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].trigger('message', {
                chatbox,
                stanza,
                attrs
            });
        }
    })();
}


/***/ }),

/***/ "./src/headless/plugins/mam/api.js":
/*!*****************************************!*\
  !*** ./src/headless/plugins/mam/api.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _shared_rsm_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/rsm.js */ "./src/headless/shared/rsm.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/errors.js */ "./src/headless/shared/errors.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}









const { NS } = strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe;
const { stx, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The [XEP-0313](https://xmpp.org/extensions/xep-0313.html) Message Archive Management API
     *
     * Enables you to query an XMPP server for archived messages.
     *
     * See also the [message-archiving](/docs/html/configuration.html#message-archiving)
     * option in the configuration settings section, which you'll
     * usually want to use in conjunction with this API.
     *
     * @namespace _converse.api.archive
     * @memberOf _converse.api
     */ archive: {
        /**
          * Query for archived messages.
          *
          * The options parameter can also be an instance of
          * RSM to enable easy querying between results pages.
          *
          * @method _converse.api.archive.query
          * @param {import('./types').ArchiveQueryOptions} [options={}] - Optional query parameters
          * @throws {Error} An error is thrown if the XMPP server responds with an error.
          * @returns {Promise<import('./types').MAMQueryResult>}
          *
          * @example
          * // Requesting all archived messages
          * // ================================
          * //
          * // The simplest query that can be made is to simply not pass in any parameters.
          * // Such a query will return all archived messages for the current user.
          *
          * let result;
          * try {
          *     result = await api.archive.query();
          * } catch (e) {
          *     // The query was not successful, perhaps inform the user?
          *     // The IQ stanza returned by the XMPP server is passed in, so that you
          *     // may inspect it and determine what the problem was.
          * }
          * // Do something with the messages, like showing them in your webpage.
          * result.messages.forEach(m => this.showMessage(m));
          *
          * @example
          * // Requesting all archived messages for a particular contact or room
          * // =================================================================
          * //
          * // To query for messages sent between the current user and another user or room,
          * // the query options need to contain the the JID (Jabber ID) of the user or
          * // room under the  `with` key.
          *
          * // For a particular user
          * let result;
          * try {
          *    result = await api.archive.query({ mam: { with: 'john@doe.net' }});
          * } catch (e) {
          *     // The query was not successful
          * }
          *
          * // For a particular room
          * let result;
          * try {
          *    result = await api.archive.query({ mam: { with: 'discuss@conference.doglovers.net' }}, is_groupchat: true });
          * } catch (e) {
          *     // The query was not successful
          * }
          *
          * @example
          * // Requesting all archived messages before or after a certain date
          * // ===============================================================
          * //
          * // The MAM `start` and `end` parameters are used to query for messages
          * // within a certain timeframe. The passed in date values may either be ISO8601
          * // formatted date strings, or JavaScript Date objects.
          *
          *  const options = {
          *      mam: {
          *          'with': 'john@doe.net',
          *          'start': '2010-06-07T00:00:00Z',
          *          'end': '2010-07-07T13:23:54Z'
          *      },
          *  };
          * let result;
          * try {
          *    result = await api.archive.query(options);
          * } catch (e) {
          *     // The query was not successful
          * }
          *
          * @example
          * // Limiting the amount of messages returned
          * // ========================================
          * //
          * // The amount of returned messages may be limited with the `max` parameter.
          * // By default, the messages are returned from oldest to newest.
          *
          * // Return maximum 10 archived messages
          * let result;
          * try {
          *     result = await api.archive.query({ mam: { with: 'john@doe.net', max:10 }});
          * } catch (e) {
          *     // The query was not successful
          * }
          *
          * @example
          * // Paging forwards through a set of archived messages
          * // ==================================================
          * //
          * // When limiting the amount of messages returned per query, you might want to
          * // repeatedly make a further query to fetch the next batch of messages.
          * //
          * // To simplify this usecase for you, the callback method receives not only an array
          * // with the returned archived messages, but also a special RSM (*Result Set Management*)
          * // object which contains the query parameters you passed in, as well
          * // as two utility methods `next`, and `previous`.
          * //
          * // When you call one of these utility methods on the returned RSM object, and then
          * // pass the result into a new query, you'll receive the next or previous batch of
          * // archived messages. Please note, when calling these methods, pass in an integer
          * // to limit your results.
          *
          * const options = { mam: { with: 'john@doe.net' }, rsm: { max:10 }};
          * let result;
          * try {
          *     result = await api.archive.query(options);
          * } catch (e) {
          *     // The query was not successful
          * }
          * // Do something with the messages, like showing them in your webpage.
          * result.messages.forEach(m => this.showMessage(m));
          *
          * while (!result.complete) {
          *     try {
          *         result = await api.archive.query({
          *             mam: { ...options.mam },
          *             rsm: {
          *                 ...options.rsm,
          *                 ...rsm.next(10).query
          *                 }
          *             });
          *     } catch (e) {
          *         // The query was not successful
          *     }
          *     // Do something with the messages, like showing them in your webpage.
          *     result.messages.forEach(m => this.showMessage(m));
          * }
          *
          * @example
          * // Paging backwards through a set of archived messages
          * // ===================================================
          * //
          * // To page backwards through the archive, you need to know the UID of the message
          * // which you'd like to page backwards from and then pass that as value for the
          * // `before` parameter. If you simply want to page backwards from the most recent
          * // message, pass in the `before` parameter with an empty string value `''`.
          *
          * let result;
          * const options = { rsm: { before: '', max:5 }};
          * try {
          *     result = await api.archive.query(options);
          * } catch (e) {
          *     // The query was not successful
          * }
          * // Do something with the messages, like showing them in your webpage.
          * result.messages.forEach(m => this.showMessage(m));
          *
          * // Now we query again, to get the previous batch.
          * try {
          *     try {
          *         result = await api.archive.query({
          *             mam: { ...options.mam },
          *             rsm: {
          *                 ...options.rsm,
          *                 ...rsm.previous(5).query
          *                 }
          *             });
          * } catch (e) {
          *     // The query was not successful
          * }
          * // Do something with the messages, like showing them in your webpage.
          * result.messages.forEach(m => this.showMessage(m));
          *
          */ query () {
            return _async_to_generator(function*(options = {}) {
                var _options_mam;
                if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.connected()) {
                    throw new Error('Can\'t call `api.archive.query` before having established an XMPP session');
                }
                let toJID;
                if (options && options.is_groupchat) {
                    var _options_mam1;
                    if (!((_options_mam1 = options.mam) === null || _options_mam1 === void 0 ? void 0 : _options_mam1.with)) {
                        throw new Error('You need to specify a "with" value containing ' + 'the groupchat JID, when querying groupchat messages.');
                    }
                    toJID = options.mam.with;
                }
                const withJID = !options.is_groupchat && ((_options_mam = options.mam) === null || _options_mam === void 0 ? void 0 : _options_mam.with) || null;
                const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
                const jid = toJID || bare_jid;
                const supported = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.supports(NS.MAM, jid);
                if (!supported) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Did not fetch MAM archive for ${jid} because it doesn't support ${NS.MAM}`);
                    return {
                        messages: []
                    };
                }
                // Validate start and end dates and add them to attrs (in the right format)
                const { start: startDate, end: endDate } = [
                    'start',
                    'end'
                ].reduce((acc, t)=>{
                    var _options_mam;
                    if ((_options_mam = options.mam) === null || _options_mam === void 0 ? void 0 : _options_mam[t]) {
                        const date = dayjs__WEBPACK_IMPORTED_MODULE_3___default()(options.mam[t]);
                        if (date.isValid()) {
                            acc[t] = date.toISOString();
                        } else {
                            throw new TypeError(`archive.query: invalid date provided for: ${t}`);
                        }
                    }
                    return acc;
                }, {
                    start: null,
                    end: null
                });
                const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
                const rsm = options.rsm ? new _shared_rsm_js__WEBPACK_IMPORTED_MODULE_6__.RSM(options.rsm) : {};
                const queryid = u.getUniqueId();
                var _rsm_query;
                const stanza = stx`
                <iq id="${u.getUniqueId()}"
                        ${toJID ? strophe_js__WEBPACK_IMPORTED_MODULE_7__.Stanza.unsafeXML(`to="${strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.xmlescape(toJID)}"`) : ""}
                        type="set"
                        xmlns="jabber:client">
                    <query queryid="${queryid}" xmlns="${NS.MAM}">
                        ${withJID || startDate || endDate ? stx`
                            <x type="submit" xmlns="${NS.XFORM}">
                                <field type="hidden" var="FORM_TYPE"><value>${NS.MAM}</value></field>
                                ${withJID ? stx`<field var="with"><value>${withJID}</value></field>` : ""}
                                ${startDate ? stx`<field var="start"><value>${startDate}</value></field>` : ""}
                                ${endDate ? stx`<field var="end"><value>${endDate}</value></field>` : ""}
                            </x>` : ""}
                        ${Object.keys((_rsm_query = rsm.query) !== null && _rsm_query !== void 0 ? _rsm_query : {}).length ? strophe_js__WEBPACK_IMPORTED_MODULE_7__.Stanza.fromString(rsm.toString()) : ""}
                    </query>
                </iq>`;
                const messages = [];
                const message_handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
                    const result = sizzle__WEBPACK_IMPORTED_MODULE_5___default()(`message > result[xmlns="${NS.MAM}"]`, stanza).pop();
                    if (result === undefined || result.getAttribute('queryid') !== queryid) {
                        return true;
                    }
                    const from = stanza.getAttribute('from') || bare_jid;
                    if (options.is_groupchat) {
                        var _options_mam;
                        if (from !== ((_options_mam = options.mam) === null || _options_mam === void 0 ? void 0 : _options_mam.with)) {
                            _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Ignoring alleged groupchat MAM message from ${stanza.getAttribute('from')}`);
                            return true;
                        }
                    } else if (from !== bare_jid) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Ignoring alleged MAM message from ${stanza.getAttribute('from')}`);
                        return true;
                    }
                    messages.push(stanza);
                    return true;
                }, NS.MAM);
                let error;
                const timeout = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('message_archiving_timeout');
                const iq_result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(stanza, timeout, false);
                if (iq_result === null) {
                    const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
                    const err_msg = __("Timeout while trying to fetch archived messages.");
                    _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(err_msg);
                    error = new _shared_errors_js__WEBPACK_IMPORTED_MODULE_8__.TimeoutError(err_msg);
                    return {
                        messages,
                        error
                    };
                } else if (u.isErrorStanza(iq_result)) {
                    const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
                    const err_msg = __('An error occurred while querying for archived messages.');
                    _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(err_msg);
                    _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(iq_result);
                    error = new Error(err_msg);
                    return {
                        messages,
                        error
                    };
                }
                connection.deleteHandler(message_handler);
                let rsm_result;
                const fin = iq_result && sizzle__WEBPACK_IMPORTED_MODULE_5___default()(`fin[xmlns="${NS.MAM}"]`, iq_result).pop();
                const complete = (fin === null || fin === void 0 ? void 0 : fin.getAttribute('complete')) === 'true';
                const set = sizzle__WEBPACK_IMPORTED_MODULE_5___default()(`set[xmlns="${NS.RSM}"]`, fin).pop();
                if (set) {
                    rsm_result = new _shared_rsm_js__WEBPACK_IMPORTED_MODULE_6__.RSM(_object_spread_props(_object_spread({}, options.rsm), {
                        xml: set
                    }));
                }
                return {
                    messages,
                    rsm: rsm_result,
                    complete
                };
            }).apply(this, arguments);
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/mam/index.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/mam/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MAMPlaceholderMessage: () => (/* reexport safe */ _placeholder_js__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _placeholder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./placeholder.js */ "./src/headless/plugins/mam/placeholder.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/mam/utils.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/mam/plugin.js");




Object.assign(_utils_index_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
    mam: {
        fetchArchivedMessages: _utils_js__WEBPACK_IMPORTED_MODULE_2__.fetchArchivedMessages
    }
});



/***/ }),

/***/ "./src/headless/plugins/mam/placeholder.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/mam/placeholder.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MAMPlaceholderMessage)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



class MAMPlaceholderMessage extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            msgid: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_1__.getUniqueId)(),
            is_ephemeral: false
        };
    }
    fetchMissingMessages() {
        return _async_to_generator(function*() {
            this.set("fetching", true);
            var _this_get;
            const options = {
                rsm: {
                    before: (_this_get = this.get("before")) !== null && _this_get !== void 0 ? _this_get : ""
                },
                mam: {
                    start: this.get("start")
                }
            };
            yield _utils_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].mam.fetchArchivedMessages(this.collection.chatbox, options);
            this.destroy();
        }).call(this);
    }
}



/***/ }),

/***/ "./src/headless/plugins/mam/plugin.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/mam/plugin.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../..//shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _disco_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../disco/index.js */ "./src/headless/plugins/disco/index.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/mam/api.js");
/* harmony import */ var _placeholder_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./placeholder.js */ "./src/headless/plugins/mam/placeholder.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/mam/utils.js");
/**
 * @description XEP-0313 Message Archive Management
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 








const { NS } = strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add("converse-mam", {
    dependencies: [
        "converse-disco",
        "converse-muc"
    ],
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.extend({
            archived_messages_page_size: "50",
            mam_request_all_pages: false,
            message_archiving: undefined,
            // https://xmpp.org/extensions/xep-0313.html#prefs
            message_archiving_timeout: 60000
        });
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], _api_js__WEBPACK_IMPORTED_MODULE_6__["default"]);
        // This is mainly done to aid with tests
        const exports = {
            onMAMError: _utils_js__WEBPACK_IMPORTED_MODULE_8__.onMAMError,
            onMAMPreferences: _utils_js__WEBPACK_IMPORTED_MODULE_8__.onMAMPreferences,
            handleMAMResult: _utils_js__WEBPACK_IMPORTED_MODULE_8__.handleMAMResult,
            MAMPlaceholderMessage: _placeholder_js__WEBPACK_IMPORTED_MODULE_7__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], exports); // XXX DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].exports, exports);
        /************************ Event Handlers ************************/ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on("addClientFeatures", ()=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.own.features.add(NS.MAM));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on("serviceDiscovered", _utils_js__WEBPACK_IMPORTED_MODULE_8__.getMAMPrefsFromFeature);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on("chatRoomViewInitialized", ({ model })=>{
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get("muc_show_logs_before_join")) {
                (0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.preMUCJoinMAMFetch)(model);
                // If we want to show MAM logs before entering the MUC, we need
                // to be informed once it's clear that this MUC supports MAM.
                model.features.on("change:mam_enabled", ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.preMUCJoinMAMFetch)(model));
            }
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on("enteredNewRoom", /** @param {import('../muc/muc').default} muc */ (muc)=>muc.features.get("mam_enabled") && (0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.fetchNewestMessages)(muc));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on("chatReconnected", (chat)=>{
            if (![
                _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__.CHATROOMS_TYPE,
                _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__.PRIVATE_CHAT_TYPE
            ].includes(chat.get("type"))) {
                return;
            }
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.fetchNewestMessages)(chat);
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on("afterMessagesFetched", (chat)=>{
            if (chat.get("type") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__.PRIVATE_CHAT_TYPE) {
                (0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.fetchNewestMessages)(chat);
            }
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.createScrollupPlaceholder)(chat);
        });
    }
});


/***/ }),

/***/ "./src/headless/plugins/mam/utils.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/mam/utils.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createScrollupPlaceholder: () => (/* binding */ createScrollupPlaceholder),
/* harmony export */   fetchArchivedMessages: () => (/* binding */ fetchArchivedMessages),
/* harmony export */   fetchNewestMessages: () => (/* binding */ fetchNewestMessages),
/* harmony export */   getMAMPrefsFromFeature: () => (/* binding */ getMAMPrefsFromFeature),
/* harmony export */   handleMAMResult: () => (/* binding */ handleMAMResult),
/* harmony export */   onMAMError: () => (/* binding */ onMAMError),
/* harmony export */   onMAMPreferences: () => (/* binding */ onMAMPreferences),
/* harmony export */   preMUCJoinMAMFetch: () => (/* binding */ preMUCJoinMAMFetch)
/* harmony export */ });
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _plugins_muc_parsers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../plugins/muc/parsers.js */ "./src/headless/plugins/muc/parsers.js");
/* harmony import */ var _plugins_chat_parsers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../plugins/chat/parsers.js */ "./src/headless/plugins/chat/parsers.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _shared_errors_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../shared/errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _placeholder_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./placeholder.js */ "./src/headless/plugins/mam/placeholder.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/**
 * @typedef {import('../muc/muc').default} MUC
 * @typedef {import('../chat/model').default} ChatBox
 * @typedef {import('@converse/skeletor/src/types/helpers.js').Model} Model
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}












const { NS } = strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe;
const u = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env.utils;
/**
 * @param {Element|Error} e
 * @param {Element} iq
 */ function onMAMError(e, iq) {
    return _async_to_generator(function*() {
        if (u.isElement(e)) {
            const err = yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_11__.parseErrorStanza)(e);
            if ((err === null || err === void 0 ? void 0 : err.name) === "feature-not-implemented") {
                _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(`Message Archive Management (XEP-0313) not supported by ${iq.getAttribute("to")}`);
                return;
            }
        }
        _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(`Error while trying to set archiving preferences for ${iq.getAttribute("to")}.`);
        _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(iq);
    })();
}
/**
 * Handle returned IQ stanza containing Message Archive
 * Management (XEP-0313) preferences.
 *
 * XXX: For now we only handle the global default preference.
 * The XEP also provides for per-JID preferences, which is
 * currently not supported in converse.js.
 *
 * Per JID preferences will be set in chat boxes, so it'll
 * probbaly be handled elsewhere in any case.
 *
 * @param {Element} iq
 * @param {Model} feature
 */ function onMAMPreferences(iq, feature) {
    const preference = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`prefs[xmlns="${NS.MAM}"]`, iq).pop();
    const default_pref = preference.getAttribute("default");
    if (default_pref !== _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("message_archiving")) {
        const stanza = (0,strophe_js__WEBPACK_IMPORTED_MODULE_1__.$iq)({
            "type": "set"
        }).c("prefs", {
            "xmlns": NS.MAM,
            "default": _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("message_archiving")
        });
        Array.from(preference.children).forEach((child)=>stanza.cnode(child).up());
        // XXX: Strictly speaking, the server should respond with the updated prefs
        // (see example 18: https://xmpp.org/extensions/xep-0313.html#config)
        // but Prosody doesn't do this, so we don't rely on it.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].sendIQ(stanza).then(()=>feature.save({
                "preferences": {
                    "default": _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("message_archiving")
                }
            })).catch(/** @param {Error|Element} e */ (e)=>_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports.onMAMError(e, stanza.tree()));
    } else {
        feature.save({
            "preferences": {
                "default": _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("message_archiving")
            }
        });
    }
}
/**
 * @param {Model} feature
 */ function getMAMPrefsFromFeature(feature) {
    const prefs = feature.get("preferences") || {};
    if (feature.get("var") !== NS.MAM || _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("message_archiving") === undefined) {
        return;
    }
    if (prefs["default"] !== _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("message_archiving")) {
        const stanza = (0,strophe_js__WEBPACK_IMPORTED_MODULE_1__.$iq)({
            "type": "get"
        }).c("prefs", {
            "xmlns": NS.MAM
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].sendIQ(stanza).then(/** @param {Element} iq */ (iq)=>_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports.onMAMPreferences(iq, feature)).catch(/** @param {Error|Element} e */ (e)=>_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports.onMAMError(e, stanza.tree()));
    }
}
/**
 * @param {MUC} muc
 */ function preMUCJoinMAMFetch(muc) {
    if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("muc_show_logs_before_join") || !muc.features.get("mam_enabled") || muc.get("prejoin_mam_fetched")) {
        return;
    }
    fetchNewestMessages(muc);
    muc.save({
        prejoin_mam_fetched: true
    });
}
/**
 * @param {ChatBox|MUC} model
 * @param {Error|string} error
 */ function createMessageFromError(model, error) {
    return _async_to_generator(function*() {
        if (error instanceof _shared_errors_js__WEBPACK_IMPORTED_MODULE_9__.TimeoutError) {
            const msg = yield model.createMessage({
                type: "error",
                message: error.message,
                retry_event_id: error.retry_event_id,
                is_ephemeral: 20000
            });
            msg.error = error;
        }
    })();
}
/**
 * @param {ChatBox|MUC} model
 * @param {Object} result
 * @param {Object} query
 * @param {Object} options
 * @param {('forwards'|'backwards'|false)} [should_page=false]
 */ function handleMAMResult(model, result, query, options, should_page = false) {
    return _async_to_generator(function*() {
        const is_muc = model.get("type") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.CHATROOMS_TYPE;
        const doParseMessage = /** @param {Element} s*/ (s)=>is_muc ? (0,_plugins_muc_parsers_js__WEBPACK_IMPORTED_MODULE_6__.parseMUCMessage)(s, /** @type {MUC} */ model) : (0,_plugins_chat_parsers_js__WEBPACK_IMPORTED_MODULE_7__.parseMessage)(s);
        const messages = yield Promise.all(result.messages.map(doParseMessage));
        result.messages = messages;
        /**
     * Synchronous event which allows listeners to first do some
     * work based on the MAM result before calling the handlers here.
     * @event _converse#MAMResult
     */ const data = {
            query,
            "chatbox": model,
            messages
        };
        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger("MAMResult", data, {
            "synchronous": true
        });
        messages.forEach((m)=>model.queueMessage(m));
        if (result.error) {
            const event_id = result.error.retry_event_id = u.getUniqueId();
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.once(event_id, ()=>fetchArchivedMessages(model, options, should_page));
            createMessageFromError(model, result.error);
        }
    })();
}
/**
 * Fetch XEP-0313 archived messages based on the passed in criteria.
 * @param {ChatBox|MUC} model
 * @param {import('./types').FetchArchivedMessagesOptions} [options]
 * @param {('forwards'|'backwards'|false)} [should_page=false] - Determines whether
 *  this function should recursively page through the entire result set if a limited
 *  number of results were returned.
 */ function fetchArchivedMessages(_0) {
    return _async_to_generator(function*(model, options = {}, should_page = false) {
        if (model.disable_mam) return;
        const is_muc = model.get("type") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.CHATROOMS_TYPE;
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("bare_jid");
        const mam_jid = is_muc ? model.get("jid") : bare_jid;
        const supported = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.supports(NS.MAM, mam_jid);
        if (!supported) return;
        const max = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("archived_messages_page_size");
        const query = /** @type {import('./types').ArchiveQueryOptions} */ {
            is_groupchat: is_muc,
            rsm: _object_spread({
                max
            }, options.rsm),
            mam: _object_spread({
                with: model.get("jid")
            }, options.mam)
        };
        const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].archive.query(query);
        yield handleMAMResult(model, result, query, options, should_page);
        if (result.rsm && !result.complete) {
            if (should_page) {
                if (should_page === "forwards") {
                    options = result.rsm.next(max, options.rsm.before).query;
                } else if (should_page === "backwards") {
                    options = result.rsm.previous(max, options.rsm.after).query;
                }
                return fetchArchivedMessages(model, options, should_page);
            } else {
                createGapPlaceholder(model, options, result);
            }
        }
    }).apply(this, arguments);
}
/**
 * Creates a placeholder to fill gaps in the history.
 * @param {ChatBox|MUC} model
 * @param {import('./types').ArchiveQueryOptions} [options]
 * @param {import('./types').MAMQueryResult} [result]
 */ function createGapPlaceholder(model, options, result) {
    return _async_to_generator(function*() {
        var _options_mam;
        const msgs = yield Promise.all(result.messages);
        const is_muc = model.get("type") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.CHATROOMS_TYPE;
        const mam_jid = is_muc ? model.get("jid") : _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("bare_jid");
        const { rsm } = result;
        const key = `stanza_id ${mam_jid}`;
        const adjacent_message = msgs.find((m)=>m[key] === rsm.result.first);
        const adjacent_message_date = new Date(adjacent_message["time"]);
        const msg_data = {
            before: rsm.result.first,
            start: (_options_mam = options.mam) === null || _options_mam === void 0 ? void 0 : _options_mam.start,
            template_hook: "getMessageTemplate",
            time: new Date(adjacent_message_date.getTime() - 1).toISOString()
        };
        if (model.messages.findWhere(msg_data)) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].debug("Gap placeholder already exists, not recreating.");
            return;
        }
        model.messages.add(new _placeholder_js__WEBPACK_IMPORTED_MODULE_10__["default"](msg_data));
    })();
}
/**
 * Creates a placeholder to fetch messages at the top of the chat history.
 * @param {ChatBox|MUC} model
 */ function createScrollupPlaceholder(model) {
    if (model.messages.length) {
        const is_muc = model.get("type") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_8__.CHATROOMS_TYPE;
        const mam_jid = is_muc ? model.get("jid") : _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("bare_jid");
        const key = `stanza_id ${mam_jid}`;
        const oldest_message = model.getOldestMessage();
        if (!oldest_message) return;
        const msg_data = {
            before: oldest_message.get(key),
            template_hook: "getMessageTemplate",
            time: new Date(new Date(oldest_message.get('time')).getTime() - 1).toISOString()
        };
        if (model.messages.findWhere(msg_data)) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].debug("Gap placeholder already exists, not recreating.");
            return;
        }
        model.messages.add(new _placeholder_js__WEBPACK_IMPORTED_MODULE_10__["default"](msg_data));
    }
}
/**
 * Fetches messages that might have been archived *after*
 * the last archived message in our local cache.
 * @param {ChatBox|MUC} model
 */ function fetchNewestMessages(model) {
    if (model.disable_mam) return;
    // XXX: It's important to first get the most recent message, before making any
    // async calls, like `api.disco.supports`, so that we can avoid a race
    // condition with possible new incoming messages.
    // We want the most recent cached message, otherwise we would query with
    // the wrong `start` value. This function used to call
    // `api.disco.supports`, but it's also called in `fetchArchivedMessages`,
    // so it's not necessary here.
    const most_recent_msg = model.getMostRecentMessage();
    const should_page = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("mam_request_all_pages") ? "backwards" : false;
    if (most_recent_msg) {
        return fetchArchivedMessages(model, {
            mam: {
                start: most_recent_msg.get("time")
            },
            rsm: {
                before: ""
            }
        }, should_page);
    } else {
        return fetchArchivedMessages(model, {
            rsm: {
                before: ""
            }
        }, should_page);
    }
}


/***/ }),

/***/ "./src/headless/plugins/muc/affiliations/api.js":
/*!******************************************************!*\
  !*** ./src/headless/plugins/muc/affiliations/api.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/muc/affiliations/utils.js");
/**
 * @module:plugin-muc-affiliations-api
 * @typedef {module:plugin-muc-parsers.MemberListItem} MemberListItem
 */ 
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The "affiliations" namespace groups methods relevant to setting and
     * getting MUC affiliations.
     *
     * @namespace api.rooms.affiliations
     * @memberOf api.rooms
     */ affiliations: {
        /**
         * Set the given affliation for the given JIDs in the specified MUCs
         * @typedef {Object} User
         * @property {string} User.jid - The JID of the user whose affiliation will change
         * @property {Array} User.affiliation - The new affiliation for this user
         * @property {string} [User.reason] - An optional reason for the affiliation change
         *
         * @param {String|Array<String>} muc_jids - The JIDs of the MUCs in
         *  which the affiliation should be set.
         * @param {User[]} users - An array of objects representing users
         *  for whom the affiliation is to be set.
         * @returns {Promise}
         *
         * @example
         *  api.rooms.affiliations.set(
         *      [
         *          'muc1@muc.example.org',
         *          'muc2@muc.example.org'
         *      ], [
         *          {
         *              'jid': 'user@example.org',
         *              'affiliation': 'member',
         *              'reason': "You're one of us now!"
         *          }
         *      ]
         *  )
         */ set (muc_jids, users) {
            users = !Array.isArray(users) ? [
                users
            ] : users;
            muc_jids = !Array.isArray(muc_jids) ? [
                muc_jids
            ] : muc_jids;
            return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.setAffiliations)(muc_jids, users);
        },
        /**
         * Returns an array of {@link MemberListItem} objects, representing occupants
         * that have the given affiliation.
         * @typedef {("admin"|"owner"|"member")} NonOutcastAffiliation
         * @param {NonOutcastAffiliation} affiliation
         * @param {string} jid - The JID of the MUC for which the affiliation list should be fetched
         * @returns {Promise<MemberListItem[]|Error>}
         */ get (affiliation, jid) {
            return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getAffiliationList)(affiliation, jid);
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/muc/affiliations/utils.js":
/*!********************************************************!*\
  !*** ./src/headless/plugins/muc/affiliations/utils.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   computeAffiliationsDelta: () => (/* binding */ computeAffiliationsDelta),
/* harmony export */   getAffiliationList: () => (/* binding */ getAffiliationList),
/* harmony export */   setAffiliation: () => (/* binding */ setAffiliation),
/* harmony export */   setAffiliations: () => (/* binding */ setAffiliations)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../parsers.js */ "./src/headless/plugins/muc/parsers.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @module:muc-affiliations-utils
 * @typedef {module:plugin-muc-parsers.MemberListItem} MemberListItem
 * @typedef {module:plugin-muc-affiliations-api.User} User
 * @typedef {import('@converse/skeletor').Model} Model
 * @typedef {import('../constants').AFFILIATIONS} AFFILIATIONS
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}





const { Strophe, $iq, u, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/**
 * Sends an IQ stanza to the server, asking it for the relevant affiliation list .
 * Returns an array of {@link MemberListItem} objects, representing occupants
 * that have the given affiliation.
 * See: https://xmpp.org/extensions/xep-0045.html#modifymember
 * @param {import('../types').NonOutcastAffiliation} affiliation
 * @param {string} muc_jid - The JID of the MUC for which the affiliation list should be fetched
 * @returns {Promise<MemberListItem[]|Error>}
 */ function getAffiliationList(affiliation, muc_jid) {
    return _async_to_generator(function*() {
        const iq = stx`
        <iq xmlns="jabber:client" to="${muc_jid}" type="get">
            <query xmlns="${Strophe.NS.MUC_ADMIN}">
                <item affiliation="${affiliation}"/>
            </query>
        </iq>`;
        const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(iq, null, false);
        if (result === null) {
            const err_msg = `Error: timeout while fetching ${affiliation} list for MUC ${muc_jid}`;
            const err = new Error(err_msg);
            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(err_msg);
            return err;
        }
        if (u.isErrorStanza(result)) {
            const err_msg = `Error: not allowed to fetch ${affiliation} list for MUC ${muc_jid}`;
            const err = new Error(err_msg);
            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(err_msg);
            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(result);
            return err;
        }
        return (0,_parsers_js__WEBPACK_IMPORTED_MODULE_4__.parseMemberListIQ)(result).filter((p)=>p).sort((a, b)=>a.nick < b.nick ? -1 : a.nick > b.nick ? 1 : 0);
    })();
}
/**
 * Send IQ stanzas to the server to modify affiliations for users in this groupchat.
 * See: https://xmpp.org/extensions/xep-0045.html#modifymember
 * @param {String|Array<String>} muc_jid - The JID(s) of the MUCs in which the
 * @param {Array<User>} users
 * @returns {Promise}
 */ function setAffiliations(muc_jid, users) {
    const affiliations = [
        ...new Set(users.map((u)=>u.affiliation))
    ];
    return Promise.all(affiliations.map((a)=>setAffiliation(a, muc_jid, users)));
}
/**
 * Send IQ stanzas to the server to set an affiliation for
 * the provided JIDs.
 * See: https://xmpp.org/extensions/xep-0045.html#modifymember
 *
 * Prosody doesn't accept multiple JIDs' affiliations
 * being set in one IQ stanza, so as a workaround we send
 * a separate stanza for each JID.
 * Related ticket: https://issues.prosody.im/345
 *
 * @param {AFFILIATIONS[number]} affiliation - The affiliation to be set
 * @param {String|Array<String>} muc_jids - The JID(s) of the MUCs in which the
 *  affiliations need to be set.
 * @param {object} members - A map of jids, affiliations and
 *  optionally reasons. Only those entries with the
 *  same affiliation as being currently set will be considered.
 * @returns {Promise} A promise which resolves and fails depending on the XMPP server response.
 */ function setAffiliation(affiliation, muc_jids, members) {
    if (!Array.isArray(muc_jids)) {
        muc_jids = [
            muc_jids
        ];
    }
    members = members.filter((m)=>[
            undefined,
            affiliation
        ].includes(m.affiliation));
    return Promise.all(muc_jids.reduce((acc, jid)=>[
            ...acc,
            ...members.map((m)=>sendAffiliationIQ(affiliation, jid, m))
        ], []));
}
/**
 * Send an IQ stanza specifying an affiliation change.
 * @param {AFFILIATIONS[number]} affiliation - Affiliation (could also be stored on the member object).
 * @param {string} muc_jid - The JID of the MUC in which the affiliation should be set.
 * @param {object} member - Map containing the member's jid and optionally a reason and affiliation.
 */ function sendAffiliationIQ(affiliation, muc_jid, member) {
    affiliation = member.affiliation || affiliation;
    const iq = $iq({
        to: muc_jid,
        type: 'set'
    }).c('query', {
        xmlns: Strophe.NS.MUC_ADMIN
    }).c('item', _object_spread_props(_object_spread({
        affiliation
    }, affiliation === 'outcast' ? {} : {
        nick: member.nick
    }), {
        jid: member.jid
    }));
    if (member.reason !== undefined) {
        iq.c('reason', member.reason);
    }
    return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(iq);
}
/**
 * Given two lists of objects with 'jid', 'affiliation' and
 * 'reason' properties, return a new list containing
 * those objects that are new, changed or removed
 * (depending on the 'remove_absentees' boolean).
 *
 * The affiliations for new and changed members stay the
 * same, for removed members, the affiliation is set to 'none'.
 *
 * The 'reason' property is not taken into account when
 * comparing whether affiliations have been changed.
 * @param {boolean} exclude_existing - Indicates whether JIDs from
 *      the new list which are also in the old list
 *      (regardless of affiliation) should be excluded
 *      from the delta. One reason to do this
 *      would be when you want to add a JID only if it
 *      doesn't have *any* existing affiliation at all.
 * @param {boolean} remove_absentees - Indicates whether JIDs
 *      from the old list which are not in the new list
 *      should be considered removed and therefore be
 *      included in the delta with affiliation set
 *      to 'none'.
 * @param {array} new_list - Array containing the new affiliations
 * @param {array} old_list - Array containing the old affiliations
 * @returns {array}
 */ function computeAffiliationsDelta(exclude_existing, remove_absentees, new_list, old_list) {
    const new_jids = new_list.map((o)=>o.jid);
    const old_jids = old_list.map((o)=>o.jid);
    // Get the new affiliations
    let delta = new_jids.filter((jid)=>!old_jids.includes(jid)).map((jid)=>new_list[new_jids.indexOf(jid)]);
    if (!exclude_existing) {
        // Get the changed affiliations
        delta = delta.concat(new_list.filter((item)=>{
            const idx = old_jids.indexOf(item.jid);
            return idx >= 0 ? item.affiliation !== old_list[idx].affiliation : false;
        }));
    }
    if (remove_absentees) {
        // Get the removed affiliations
        delta = delta.concat(old_jids.filter((jid)=>!new_jids.includes(jid)).map((jid)=>({
                'jid': jid,
                'affiliation': 'none'
            })));
    }
    return delta;
}


/***/ }),

/***/ "./src/headless/plugins/muc/api.js":
/*!*****************************************!*\
  !*** ./src/headless/plugins/muc/api.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _plugins_chatboxes_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../plugins/chatboxes/api.js */ "./src/headless/plugins/chatboxes/api.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/promise.js */ "./src/headless/shared/api/promise.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _utils_jid_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/jid.js */ "./src/headless/utils/jid.js");
/* harmony import */ var _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/settings/api.js */ "./src/headless/shared/settings/api.js");
/**
 * @typedef {import('./muc.js').default} MUC
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}








const { waitUntil } = _shared_api_promise_js__WEBPACK_IMPORTED_MODULE_3__["default"];
/**
 * The "rooms" namespace groups methods relevant to chatrooms
 * (aka groupchats).
 *
 * @namespace api.rooms
 * @memberOf api
 */ const rooms = {
    /**
     * Creates a new MUC chatroom (aka groupchat)
     *
     * Similar to {@link api.rooms.open}, but creates
     * the chatroom in the background (i.e. doesn't cause a view to open).
     *
     * @method api.rooms.create
     * @param {(string[]|string)} jids The JID or array of
     *     JIDs of the chatroom(s) to create
     * @param {object} [attrs] attrs The room attributes
     * @returns {Promise<MUC[]|MUC>} Promise which resolves with the Model representing the chat.
     */ create (jids, attrs = {}) {
        attrs = typeof attrs === 'string' ? {
            'nick': attrs
        } : attrs || {};
        if (!attrs.nick && _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_7__.settings_api.get('muc_nickname_from_jid')) {
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
            attrs.nick = strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.getNodeFromJid(bare_jid);
        }
        if (jids === undefined) {
            throw new TypeError('rooms.create: You need to provide at least one JID');
        } else if (typeof jids === 'string') {
            return rooms.get((0,_utils_jid_js__WEBPACK_IMPORTED_MODULE_6__.getJIDFromURI)(jids), attrs, true);
        }
        return Promise.all(jids.map((jid)=>/** @type {Promise<MUC>} */ rooms.get((0,_utils_jid_js__WEBPACK_IMPORTED_MODULE_6__.getJIDFromURI)(jid), attrs, true)));
    },
    /**
     * Opens a MUC chatroom (aka groupchat)
     *
     * Similar to {@link api.chats.open}, but for groupchats.
     *
     * @method api.rooms.open
     * @param {string|string[]} jids The room JID or JIDs (if not specified, all
     *     currently open rooms will be returned).
     * @param {object} attrs A map  containing any extra room attributes.
     * @param {string} [attrs.nick] The current user's nickname for the MUC
     * @param {boolean} [attrs.hidden]
     * @param {boolean} [attrs.auto_configure] A boolean, indicating
     *     whether the room should be configured automatically or not.
     *     If set to `true`, then it makes sense to pass in configuration settings.
     * @param {object} [attrs.roomconfig] A map of configuration settings to be used when the room gets
     *     configured automatically. Currently it doesn't make sense to specify
     *     `roomconfig` values if `auto_configure` is set to `false`.
     *     For a list of configuration values that can be passed in, refer to these values
     *     in the [XEP-0045 MUC specification](https://xmpp.org/extensions/xep-0045.html#registrar-formtype-owner).
     *     The values should be named without the `muc#roomconfig_` prefix.
     * @param {boolean} [attrs.minimized] A boolean, indicating whether the room should be opened minimized or not.
     * @param {boolean} [force=false] - By default, a minimized
     *   room won't be maximized (in `overlayed` view mode) and in
     *   `fullscreen` view mode a newly opened room won't replace
     *   another chat already in the foreground.
     *   Set `force` to `true` if you want to force the room to be
     *   maximized or shown.
     * @returns {Promise<MUC[]|MUC>} Promise which resolves with the Model representing the chat.
     *
     * @example
     * api.rooms.open('group@muc.example.com')
     *
     * @example
     * // To return an array of rooms, provide an array of room JIDs:
     * api.rooms.open(['group1@muc.example.com', 'group2@muc.example.com'])
     *
     * @example
     * // To setup a custom nickname when joining the room, provide the optional nick argument:
     * api.rooms.open('group@muc.example.com', {'nick': 'mycustomnick'})
     *
     * @example
     * // For example, opening a room with a specific default configuration:
     * api.rooms.open(
     *     'myroom@conference.example.org',
     *     { 'nick': 'coolguy69',
     *       'auto_configure': true,
     *       'roomconfig': {
     *           'changesubject': false,
     *           'membersonly': true,
     *           'persistentroom': true,
     *           'publicroom': true,
     *           'roomdesc': 'Comfy room for hanging out',
     *           'whois': 'anyone'
     *       }
     *     }
     * );
     */ open (_0) {
        return _async_to_generator(function*(jids, attrs = {}, force = false) {
            yield waitUntil('chatBoxesFetched');
            if (jids === undefined) {
                const err_msg = 'rooms.open: You need to provide at least one JID';
                _converse_log__WEBPACK_IMPORTED_MODULE_2__["default"].error(err_msg);
                throw new TypeError(err_msg);
            } else if (typeof jids === 'string') {
                const room = /** @type {MUC} */ yield rooms.get(jids, attrs, true);
                !attrs.hidden && (room === null || room === void 0 ? void 0 : room.maybeShow(force));
                return room;
            } else {
                const rooms = yield Promise.all(jids.map((jid)=>rooms.get(jid, attrs, true)));
                rooms.forEach((r)=>!attrs.hidden && r.maybeShow(force));
                return rooms;
            }
        }).apply(this, arguments);
    },
    /**
     * Fetches the object representing a MUC chatroom (aka groupchat)
     *
     * @method api.rooms.get
     * @param {string|string[]} [jids] The room JID (if not specified, all rooms will be returned).
     * @param {object} [attrs] A map containing any extra room attributes
     *  to be set if `create` is set to `true`
     * @param {string} [attrs.nick] Specify the nickname
     * @param {string} [attrs.password ] Specify a password if needed to enter a new room
     * @param {boolean} create A boolean indicating whether the room should be created
     *     if not found (default: `false`)
     * @returns {Promise<MUC[]|MUC>}
     * @example
     * api.waitUntil('roomsAutoJoined').then(() => {
     *     const create_if_not_found = true;
     *     api.rooms.get(
     *         'group@muc.example.com',
     *         {'nick': 'dread-pirate-roberts', 'password': 'secret'},
     *         create_if_not_found
     *     )
     * });
     */ get (_0) {
        return _async_to_generator(function*(jids, attrs = {}, create = false) {
            yield waitUntil('chatBoxesFetched');
            /** @param {string} jid */ function _get(jid) {
                return _async_to_generator(function*() {
                    jid = (0,_utils_jid_js__WEBPACK_IMPORTED_MODULE_6__.getJIDFromURI)(jid);
                    let model = yield _plugins_chatboxes_api_js__WEBPACK_IMPORTED_MODULE_1__["default"].get(jid);
                    if (!model && create) {
                        model = yield _plugins_chatboxes_api_js__WEBPACK_IMPORTED_MODULE_1__["default"].create(jid, attrs, _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.MUC);
                    } else {
                        model = model && model.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__.CHATROOMS_TYPE ? model : null;
                        if (model && Object.keys(attrs).length) {
                            model.save(attrs);
                        }
                    }
                    return model;
                })();
            }
            if (jids === undefined) {
                const chats = yield _plugins_chatboxes_api_js__WEBPACK_IMPORTED_MODULE_1__["default"].get();
                return chats.filter((c)=>c.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_4__.CHATROOMS_TYPE);
            } else if (typeof jids === 'string') {
                return _get(jids);
            }
            return Promise.all(jids.map((jid)=>_get(jid)));
        }).apply(this, arguments);
    }
};
const rooms_api = {
    rooms
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (rooms_api);


/***/ }),

/***/ "./src/headless/plugins/muc/constants.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/muc/constants.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACTION_INFO_CODES: () => (/* binding */ ACTION_INFO_CODES),
/* harmony export */   ADMIN_COMMANDS: () => (/* binding */ ADMIN_COMMANDS),
/* harmony export */   AFFILIATIONS: () => (/* binding */ AFFILIATIONS),
/* harmony export */   AFFILIATION_CHANGES: () => (/* binding */ AFFILIATION_CHANGES),
/* harmony export */   AFFILIATION_CHANGES_LIST: () => (/* binding */ AFFILIATION_CHANGES_LIST),
/* harmony export */   DISCONNECT_CODES: () => (/* binding */ DISCONNECT_CODES),
/* harmony export */   INFO_CODES: () => (/* binding */ INFO_CODES),
/* harmony export */   MODERATOR_COMMANDS: () => (/* binding */ MODERATOR_COMMANDS),
/* harmony export */   MUC_NICK_CHANGED_CODE: () => (/* binding */ MUC_NICK_CHANGED_CODE),
/* harmony export */   MUC_ROLE_CHANGES: () => (/* binding */ MUC_ROLE_CHANGES),
/* harmony export */   MUC_ROLE_CHANGES_LIST: () => (/* binding */ MUC_ROLE_CHANGES_LIST),
/* harmony export */   MUC_ROLE_WEIGHTS: () => (/* binding */ MUC_ROLE_WEIGHTS),
/* harmony export */   MUC_TRAFFIC_STATES: () => (/* binding */ MUC_TRAFFIC_STATES),
/* harmony export */   MUC_TRAFFIC_STATES_LIST: () => (/* binding */ MUC_TRAFFIC_STATES_LIST),
/* harmony export */   NEW_NICK_CODES: () => (/* binding */ NEW_NICK_CODES),
/* harmony export */   OWNER_COMMANDS: () => (/* binding */ OWNER_COMMANDS),
/* harmony export */   ROLES: () => (/* binding */ ROLES),
/* harmony export */   ROOMSTATUS: () => (/* binding */ ROOMSTATUS),
/* harmony export */   ROOM_FEATURES: () => (/* binding */ ROOM_FEATURES),
/* harmony export */   STATUS_CODE_STANZAS: () => (/* binding */ STATUS_CODE_STANZAS),
/* harmony export */   VISITOR_COMMANDS: () => (/* binding */ VISITOR_COMMANDS)
/* harmony export */ });
const ACTION_INFO_CODES = [
    '301',
    '333',
    '307',
    '321',
    '322'
];
const NEW_NICK_CODES = [
    '210',
    '303'
];
const ADMIN_COMMANDS = [
    'admin',
    'ban',
    'deop',
    'destroy',
    'member',
    'op',
    'revoke'
];
const AFFILIATIONS = [
    'owner',
    'admin',
    'member',
    'outcast',
    'none'
];
const DISCONNECT_CODES = [
    '301',
    '333',
    '307',
    '321',
    '322',
    '332'
];
const MODERATOR_COMMANDS = [
    'kick',
    'mute',
    'voice',
    'modtools'
];
const OWNER_COMMANDS = [
    'owner'
];
const ROLES = [
    'moderator',
    'participant',
    'visitor'
];
const VISITOR_COMMANDS = [
    'nick'
];
// Which types of stanzas a status code might appear in.
const STATUS_CODE_STANZAS = {
    '100': [
        'message',
        'presence'
    ],
    '101': [
        'message'
    ],
    '102': [
        'message'
    ],
    '103': [
        'message'
    ],
    '104': [
        'message'
    ],
    '110': [
        'presence'
    ],
    '170': [
        'message',
        'presence'
    ],
    '171': [
        'message'
    ],
    '172': [
        'message'
    ],
    '173': [
        'message'
    ],
    '174': [
        'message'
    ],
    '201': [
        'presence'
    ],
    '210': [
        'presence'
    ],
    '301': [
        'presence'
    ],
    '303': [
        'presence'
    ],
    '307': [
        'presence'
    ],
    '321': [
        'presence'
    ],
    '322': [
        'presence'
    ],
    '332': [
        'presence'
    ],
    '333': [
        'presence'
    ]
};
const MUC_ROLE_WEIGHTS = {
    'moderator': 1,
    'participant': 2,
    'visitor': 3,
    'none': 2
};
const AFFILIATION_CHANGES = {
    OWNER: 'owner',
    ADMIN: 'admin',
    MEMBER: 'member',
    EXADMIN: 'exadmin',
    EXOWNER: 'exowner',
    EXOUTCAST: 'exoutcast',
    EXMEMBER: 'exmember'
};
const AFFILIATION_CHANGES_LIST = Object.values(AFFILIATION_CHANGES);
const MUC_TRAFFIC_STATES = {
    ENTERED: 'entered',
    EXITED: 'exited'
};
const MUC_TRAFFIC_STATES_LIST = Object.values(MUC_TRAFFIC_STATES);
const MUC_ROLE_CHANGES = {
    OP: 'op',
    DEOP: 'deop',
    VOICE: 'voice',
    MUTE: 'mute'
};
const MUC_ROLE_CHANGES_LIST = Object.values(MUC_ROLE_CHANGES);
const INFO_CODES = {
    'visibility_changes': [
        '100',
        '102',
        '103',
        '172',
        '173',
        '174'
    ],
    'self': [
        '110'
    ],
    'non_privacy_changes': [
        '104',
        '201'
    ],
    'muc_logging_changes': [
        '170',
        '171'
    ],
    'nickname_changes': [
        '210',
        '303'
    ],
    'disconnected': [
        '301',
        '307',
        '321',
        '322',
        '332',
        '333'
    ],
    'affiliation_changes': [
        ...AFFILIATION_CHANGES_LIST
    ],
    'join_leave_events': [
        ...MUC_TRAFFIC_STATES_LIST
    ],
    'role_changes': [
        ...MUC_ROLE_CHANGES_LIST
    ]
};
const ROOMSTATUS = {
    CONNECTED: 0,
    CONNECTING: 1,
    NICKNAME_REQUIRED: 2,
    PASSWORD_REQUIRED: 3,
    DISCONNECTED: 4,
    ENTERED: 5,
    DESTROYED: 6,
    BANNED: 7,
    CLOSING: 8
};
const ROOM_FEATURES = [
    'passwordprotected',
    'unsecured',
    'hidden',
    'publicroom',
    'membersonly',
    'open',
    'persistent',
    'temporary',
    'nonanonymous',
    'semianonymous',
    'moderated',
    'unmoderated',
    'mam_enabled',
    'vcard-temp'
];
const MUC_NICK_CHANGED_CODE = '303'; // No longer used in code, but useful as reference.
 //
 // const ROOM_FEATURES_MAP = {
 //     'passwordprotected': 'unsecured',
 //     'unsecured': 'passwordprotected',
 //     'hidden': 'publicroom',
 //     'publicroom': 'hidden',
 //     'membersonly': 'open',
 //     'open': 'membersonly',
 //     'persistent': 'temporary',
 //     'temporary': 'persistent',
 //     'nonanonymous': 'semianonymous',
 //     'semianonymous': 'nonanonymous',
 //     'moderated': 'unmoderated',
 //     'unmoderated': 'moderated'
 // };


/***/ }),

/***/ "./src/headless/plugins/muc/index.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/muc/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MUC: () => (/* reexport safe */ _muc_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   MUCMessage: () => (/* reexport safe */ _message_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   MUCMessages: () => (/* reexport safe */ _messages_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   MUCOccupant: () => (/* reexport safe */ _occupant_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   MUCOccupants: () => (/* reexport safe */ _occupants_js__WEBPACK_IMPORTED_MODULE_5__["default"])
/* harmony export */ });
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _message_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./message.js */ "./src/headless/plugins/muc/message.js");
/* harmony import */ var _messages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./messages.js */ "./src/headless/plugins/muc/messages.js");
/* harmony import */ var _muc_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./muc.js */ "./src/headless/plugins/muc/muc.js");
/* harmony import */ var _occupant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./occupant.js */ "./src/headless/plugins/muc/occupant.js");
/* harmony import */ var _occupants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./occupants.js */ "./src/headless/plugins/muc/occupants.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/muc/plugin.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/muc/utils.js");
/* harmony import */ var _affiliations_utils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./affiliations/utils.js */ "./src/headless/plugins/muc/affiliations/utils.js");









Object.assign(_utils_index_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
    muc: {
        isChatRoom: _utils_js__WEBPACK_IMPORTED_MODULE_7__.isChatRoom,
        setAffiliation: _affiliations_utils_js__WEBPACK_IMPORTED_MODULE_8__.setAffiliation,
        getDefaultMUCService: _utils_js__WEBPACK_IMPORTED_MODULE_7__.getDefaultMUCService
    }
});



/***/ }),

/***/ "./src/headless/plugins/muc/message.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/muc/message.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_message_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/message.js */ "./src/headless/shared/message.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class MUCMessage extends _shared_message_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    /**
     * @typedef {import('./occupant').default} MUCOccupant
     */ initialize() {
        super.initialize();
        // If `type` changes from `error` to `groupchat`, we want to set the occupant. See #2733
        this.on('change:type', ()=>this.setOccupant());
        this.setOccupant();
        /**
         * Triggered once a { @link MUCMessage} has been created and initialized.
         * @event _converse#chatRoomMessageInitialized
         * @type {MUCMessage}
         * @example _converse.api.listen.on('chatRoomMessageInitialized', model => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].trigger('chatRoomMessageInitialized', this);
    }
    get occupants() {
        return this.get('type') === 'chat' ? this.chatbox.collection : this.chatbox.occupants;
    }
    getDisplayName() {
        var _this_occupant;
        return ((_this_occupant = this.occupant) === null || _this_occupant === void 0 ? void 0 : _this_occupant.getDisplayName()) || this.get('nick');
    }
    /**
     * Determines whether this messsage may be moderated,
     * based on configuration settings and server support.
     * @method _converse.ChatRoomMessages#mayBeModerated
     * @returns {Promise<boolean>}
     */ mayBeModerated() {
        return _async_to_generator(function*() {
            if (typeof this.get('from_muc') === 'undefined') {
                // If from_muc is not defined, then this message hasn't been
                // reflected yet, which means we won't have a XEP-0359 stanza id.
                return;
            }
            return [
                'all',
                'moderator'
            ].includes(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('allow_message_retraction')) && this.get(`stanza_id ${this.get('from_muc')}`) && (yield this.chatbox.canModerateMessages());
        }).call(this);
    }
    checkValidity() {
        const result = super.checkValidity();
        !result && this.chatbox.debouncedRejoin();
        return result;
    }
    onOccupantRemoved() {
        this.stopListening(this.occupant);
        delete this.occupant;
        this.listenTo(this.occupants, 'add', this.onOccupantAdded);
    }
    /**
     * @param {MUCOccupant} [occupant]
     */ onOccupantAdded(occupant) {
        if (this.get('occupant_id')) {
            if (occupant.get('occupant_id') !== this.get('occupant_id')) {
                return;
            }
        } else if (occupant.get('nick') !== strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getResourceFromJid(this.get('from'))) {
            return;
        }
        this.setOccupant(occupant);
    }
    getOccupant() {
        return this.occupant || this.setOccupant();
    }
    /**
     * @param {MUCOccupant} [occupant]
     * @return {MUCOccupant}
     */ setOccupant(occupant) {
        if (![
            'groupchat',
            'chat'
        ].includes(this.get('type')) || this.isEphemeral()) {
            return;
        }
        if (occupant) {
            this.occupant = occupant;
        } else if (this.get('type') === 'chat' && this.get('sender') === 'them') {
            this.occupant = this.chatbox;
        } else {
            if (this.occupant) return;
            const nick = strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getResourceFromJid(this.get('from'));
            const occupant_id = this.get('occupant_id');
            this.occupant = nick || occupant_id ? this.occupants.findOccupant({
                nick,
                occupant_id
            }) : null;
            if (!this.occupant) {
                const jid = this.get('from_real_jid');
                if (!nick && !occupant_id && !jid) {
                    // Tombstones of retracted messages might have no occupant info
                    return;
                }
                this.occupant = this.occupants.create({
                    nick,
                    occupant_id,
                    jid
                });
                if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('muc_send_probes')) {
                    const jid = `${this.chatbox.get('jid')}/${nick}`;
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].user.presence.send({
                        to: jid,
                        type: 'probe'
                    });
                }
            }
        }
        if (this.get('from_real_jid') !== this.occupant.get('jid')) {
            this.save('from_real_jid', this.occupant.get('jid'));
        }
        this.trigger('occupant:add');
        this.listenTo(this.occupant, 'change', (changed)=>this.trigger('occupant:change', changed));
        this.listenTo(this.occupant, 'vcard:add', (changed)=>this.trigger('occupant:change', changed));
        this.listenTo(this.occupant, 'vcard:change', (changed)=>this.trigger('occupant:change', changed));
        this.listenTo(this.occupant, 'destroy', this.onOccupantRemoved);
        this.stopListening(this.occupants, 'add', this.onOccupantAdded);
        return this.occupant;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCMessage);


/***/ }),

/***/ "./src/headless/plugins/muc/messages.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/muc/messages.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./message */ "./src/headless/plugins/muc/message.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);


/**
 * Collection which stores MUC messages
 */ class MUCMessages extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Collection {
    constructor(attrs, options = {}){
        super(attrs, Object.assign({
            comparator: 'time'
        }, options));
        this.model = _message__WEBPACK_IMPORTED_MODULE_0__["default"];
        this.fetched = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCMessages);


/***/ }),

/***/ "./src/headless/plugins/muc/muc.js":
/*!*****************************************!*\
  !*** ./src/headless/plugins/muc/muc.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var lodash_es_pick__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! lodash-es/pick */ "./node_modules/lodash-es/pick.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_parse_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/parse-helpers */ "./src/headless/utils/parse-helpers.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants.js */ "./src/headless/plugins/muc/constants.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_errors_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../shared/errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _affiliations_utils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./affiliations/utils.js */ "./src/headless/plugins/muc/affiliations/utils.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _utils_init_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../utils/init.js */ "./src/headless/utils/init.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/plugins/muc/parsers.js");
/* harmony import */ var _shared_actions_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../shared/actions.js */ "./src/headless/shared/actions.js");
/* harmony import */ var _shared_chatbox__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../shared/chatbox */ "./src/headless/shared/chatbox.js");
/* harmony import */ var _shared_color__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../shared/color */ "./src/headless/shared/color.js");
/* harmony import */ var _shared_model_with_messages__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../shared/model-with-messages */ "./src/headless/shared/model-with-messages.js");
/* harmony import */ var _shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../shared/model-with-vcard */ "./src/headless/shared/model-with-vcard.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/muc/utils.js");
/* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./session */ "./src/headless/plugins/muc/session.js");
/**
 * @module:headless-plugins-muc-muc
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}




























const { u, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].env;
/**
 * Represents a groupchat conversation.
 */ class MUC extends (0,_shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_23__["default"])((0,_shared_model_with_messages__WEBPACK_IMPORTED_MODULE_22__["default"])((0,_shared_color__WEBPACK_IMPORTED_MODULE_21__["default"])(_shared_chatbox__WEBPACK_IMPORTED_MODULE_20__["default"]))) {
    /**
     * @typedef {import('../../shared/message.js').default} BaseMessage
     * @typedef {import('./message.js').default} MUCMessage
     * @typedef {import('./occupant.js').default} MUCOccupant
     * @typedef {import('./types').NonOutcastAffiliation} NonOutcastAffiliation
     * @typedef {import('./types').MemberListItem} MemberListItem
     * @typedef {import('../../shared/types').MessageAttributes} MessageAttributes
     * @typedef {import('./types').MUCMessageAttributes} MUCMessageAttributes
     * @typedef {import('./types').MUCPresenceAttributes} MUCPresenceAttributes
     * @typedef {module:shared.converse.UserMessage} UserMessage
     * @typedef {import('strophe.js').Builder} Builder
     * @typedef {import('../../shared/errors').StanzaParseError} StanzaParseError
     */ defaults() {
        /** @type {import('./types').DefaultMUCAttributes} */ return {
            bookmarked: false,
            chat_state: undefined,
            closed: false,
            has_activity: false,
            hidden: (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_17__.isUniView)() && !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('singleton'),
            hidden_occupants: !!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('hide_muc_participants'),
            message_type: 'groupchat',
            name: '',
            // For group chats, we distinguish between generally unread
            // messages and those ones that specifically mention the
            // user.
            //
            // To keep things simple, we reuse `num_unread` from
            // ChatBox to indicate unread messages which
            // mention the user and `num_unread_general` to indicate
            // generally unread messages (which *includes* mentions!).
            num_unread_general: 0,
            num_unread: 0,
            roomconfig: {},
            time_opened: this.get('time_opened') || new Date().getTime(),
            time_sent: new Date(0).toISOString(),
            type: _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.CHATROOMS_TYPE
        };
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            this.on('change:closed', ()=>{
                if (!this.get('closed')) {
                    this.initialize();
                }
            });
            if (this.get('closed')) return;
            this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
            this.debouncedRejoin = (0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_26__["default"])(this.rejoin, 250);
            this.initOccupants();
            this.initDiscoModels(); // sendChatState depends on this.features
            this.registerHandlers();
            this.on('change:chat_state', this.sendChatState, this);
            this.on('change:hidden', this.onHiddenChange, this);
            this.on('destroy', this.removeHandlers, this);
            yield this.restoreSession();
            this.session.on('change:connection_status', this.onConnectionStatusChanged, this);
            this.listenTo(this.occupants, 'add', this.onOccupantAdded);
            this.listenTo(this.occupants, 'remove', this.onOccupantRemoved);
            this.listenTo(this.occupants, 'change:presence', this.onOccupantPresenceChanged);
            this.listenTo(this.occupants, 'change:affiliation', this.createAffiliationChangeMessage);
            this.listenTo(this.occupants, 'change:role', this.createRoleChangeMessage);
            const restored = yield this.restoreFromCache();
            if (!restored) {
                yield this.join();
            }
            /**
         * Triggered once a {@link MUC} has been created and initialized.
         * @event _converse#chatRoomInitialized
         * @type { MUC }
         * @example _converse.api.listen.on('chatRoomInitialized', model => { ... });
         */ yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('chatRoomInitialized', this, {
                synchronous: true
            });
            this.initialized.resolve();
        }).call(this);
    }
    isEntered() {
        var _this_session;
        return ((_this_session = this.session) === null || _this_session === void 0 ? void 0 : _this_session.get('connection_status')) === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.ENTERED;
    }
    /**
     * Checks whether this MUC qualifies for subscribing to XEP-0437 Room Activity Indicators (RAI)
     * @returns {Boolean}
     */ isRAICandidate() {
        return this.get('hidden') && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_subscribe_to_rai') && this.getOwnAffiliation() !== 'none';
    }
    /**
     * Checks whether we're still joined and if so, restores the MUC state from cache.
     * @returns {Promise<boolean>} Returns `true` if we're still joined, otherwise returns `false`.
     */ restoreFromCache() {
        return _async_to_generator(function*() {
            if (this.isEntered()) {
                yield this.fetchOccupants().catch(/** @param {Error} e */ (e)=>_converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e));
                if (this.isRAICandidate()) {
                    this.session.save('connection_status', _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED);
                    this.enableRAI();
                    return true;
                } else if (yield this.isJoined()) {
                    yield new Promise((r)=>this.config.fetch({
                            'success': r,
                            'error': r
                        }));
                    yield new Promise((r)=>this.features.fetch({
                            'success': r,
                            'error': r
                        }));
                    yield this.fetchMessages().catch(/** @param {Error} e */ (e)=>_converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e));
                    return true;
                }
            }
            this.session.save('connection_status', _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED);
            this.clearOccupantsCache();
            return false;
        }).call(this);
    }
    /**
     * Join the MUC
     * @param {String} [nick] - The user's nickname
     * @param {String} [password] - Optional password, if required by the groupchat.
     *  Will fall back to the `password` value stored in the room
     *  model (if available).
     *  @returns {Promise<void>}
     */ join(nick, password) {
        return _async_to_generator(function*() {
            if (this.isEntered()) {
                // We have restored a groupchat from session storage,
                // so we don't send out a presence stanza again.
                return;
            }
            // Set this early, so we don't rejoin in onHiddenChange
            this.session.save('connection_status', _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.CONNECTING);
            const is_new = (yield this.refreshDiscoInfo()) instanceof _shared_errors_js__WEBPACK_IMPORTED_MODULE_11__.ItemNotFoundError;
            nick = yield this.getAndPersistNickname(nick);
            if (!nick) {
                (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_16__.safeSave)(this.session, {
                    'connection_status': _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.NICKNAME_REQUIRED
                });
                if (!is_new && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_show_logs_before_join')) {
                    yield this.fetchMessages();
                }
                return;
            }
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send((yield this.constructJoinPresence(password, is_new)));
            if (is_new) yield this.refreshDiscoInfo();
        }).call(this);
    }
    /**
     * Clear stale cache and re-join a MUC we've been in before.
     */ rejoin() {
        this.session.save('connection_status', _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED);
        this.registerHandlers();
        this.clearOccupantsCache();
        return this.join();
    }
    /**
     * @param {string} password
     * @param {boolean} is_new
     */ constructJoinPresence(password, is_new) {
        return _async_to_generator(function*() {
            const maxstanzas = is_new || this.features.get('mam_enabled') ? 0 : _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_history_max_stanzas');
            password = password || this.get('password');
            const { profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].state;
            const show = profile.get('show');
            const status_message = profile.get('status_message');
            const stanza = stx`
            <presence xmlns="jabber:client"
                      id="${(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.getUniqueId)()}"
                      from="${_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.get().jid}"
                      to="${this.getRoomJIDAndNick()}">
                <x xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC}">
                    <history maxstanzas="${maxstanzas}"/>
                    ${password ? stx`<password>${password}</password>` : ''}
                </x>
                ${_shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.PRES_SHOW_VALUES.includes(show) ? stx`<show>${show}</show>` : ''}
                ${status_message ? stx`<status>${status_message}</status>` : ''}
            </presence>`;
            /**
         * *Hook* which allows plugins to update an outgoing MUC join presence stanza
         * @event _converse#constructedMUCPresence
         * @type {Element} The stanza which will be sent out
         */ return yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].hook('constructedMUCPresence', this, stanza);
        }).call(this);
    }
    clearOccupantsCache() {
        if (this.occupants.length) {
            // Remove non-members when reconnecting
            this.occupants.filter((o)=>!o.isMember()).forEach((o)=>o.destroy());
        } else {
            // Looks like we haven't restored occupants from cache, so we clear it.
            this.occupants.clearStore();
        }
    }
    /**
     * Given the passed in MUC message, send a XEP-0333 chat marker.
     * @async
     * @param {BaseMessage} msg
     * @param {('received'|'displayed'|'acknowledged')} [type='displayed']
     * @param {boolean} [force=false] - Whether a marker should be sent for the
     *  message, even if it didn't include a `markable` element.
     */ sendMarkerForMessage(msg, type = 'displayed', force = false) {
        if (!msg || !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('send_chat_markers').includes(type) || (msg === null || msg === void 0 ? void 0 : msg.get('type')) !== 'groupchat') {
            return;
        }
        if ((msg === null || msg === void 0 ? void 0 : msg.get('is_markable')) || force) {
            const key = `stanza_id ${this.get('jid')}`;
            const id = msg.get(key);
            if (!id) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(`Can't send marker for message without stanza ID: ${key}`);
                return Promise.resolve();
            }
            const from_jid = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(msg.get('from'));
            (0,_shared_actions_js__WEBPACK_IMPORTED_MODULE_19__.sendMarker)(from_jid, id, type, msg.get('type'));
        }
        return Promise.resolve();
    }
    /**
     * Finds the last eligible message and then sends a XEP-0333 chat marker for it.
     * @param { ('received'|'displayed'|'acknowledged') } [type='displayed']
     * @param {Boolean} force - Whether a marker should be sent for the
     *  message, even if it didn't include a `markable` element.
     */ sendMarkerForLastMessage(type = 'displayed', force = false) {
        const msgs = Array.from(this.messages.models);
        msgs.reverse();
        const msg = msgs.find((m)=>m.get('sender') === 'them' && (force || m.get('is_markable')));
        msg && this.sendMarkerForMessage(msg, type, force);
    }
    /**
     * Ensures that the user is subscribed to XEP-0437 Room Activity Indicators
     * if `muc_subscribe_to_rai` is set to `true`.
     * Only affiliated users can subscribe to RAI, but this method doesn't
     * check whether the current user is affiliated because it's intended to be
     * called after the MUC has been left and we don't have that information anymore.
     */ enableRAI() {
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_subscribe_to_rai')) {
            const muc_domain = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getDomainFromJid(this.get('jid'));
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].user.presence.send({
                to: muc_domain
            }, (0,strophe_js__WEBPACK_IMPORTED_MODULE_10__.$build)('rai', {
                'xmlns': strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.RAI
            }));
        }
    }
    /**
     * Handler that gets called when the 'hidden' flag is toggled.
     */ onHiddenChange() {
        return _async_to_generator(function*() {
            const roomstatus = _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS;
            const conn_status = this.session.get('connection_status');
            if (this.get('hidden')) {
                if (conn_status === roomstatus.ENTERED) {
                    this.setChatState(_shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.INACTIVE);
                    if (this.isRAICandidate()) {
                        this.sendMarkerForLastMessage('received', true);
                        yield this.leave();
                        this.enableRAI();
                    }
                }
            } else {
                yield this.initialized;
                if (conn_status === roomstatus.DISCONNECTED) this.rejoin();
                this.clearUnreadMsgCounter();
            }
        }).call(this);
    }
    /**
     * @param {MUCOccupant} occupant
     */ onOccupantAdded(occupant) {
        if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.ENTERED) && this.session.get('connection_status') === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.ENTERED && occupant.get('presence') === 'online') {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.ENTERED);
        }
    }
    /**
     * @param {MUCOccupant} occupant
     */ onOccupantRemoved(occupant) {
        if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.EXITED) && this.isEntered() && occupant.get('presence') === 'online') {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.EXITED);
        }
    }
    /**
     * @param {MUCOccupant} occupant
     */ onOccupantPresenceChanged(occupant) {
        if (occupant.get('states').includes('303')) {
            return;
        }
        if (occupant.get('presence') === 'offline' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.EXITED)) {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.EXITED);
        } else if (occupant.get('presence') === 'online' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.ENTERED)) {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES.ENTERED);
        }
    }
    onRoomEntered() {
        return _async_to_generator(function*() {
            yield this.occupants.fetchMembers();
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('clear_messages_on_reconnection')) {
                yield this.clearMessages();
            } else {
                yield this.fetchMessages();
            }
            /**
         * Triggered when the user has entered a new MUC
         * @event _converse#enteredNewRoom
         * @type {MUC}
         * @example _converse.api.listen.on('enteredNewRoom', model => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('enteredNewRoom', this);
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('auto_register_muc_nickname') && (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_REGISTER, this.get('jid')))) {
                this.registerNickname();
            }
        }).call(this);
    }
    onConnectionStatusChanged() {
        return _async_to_generator(function*() {
            if (this.isEntered()) {
                if (this.isRAICandidate()) {
                    try {
                        yield this.leave();
                    } catch (e) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                    }
                    this.enableRAI();
                } else {
                    yield this.onRoomEntered();
                }
            }
        }).call(this);
    }
    onReconnection() {
        return _async_to_generator(function*() {
            yield this.rejoin();
            this.announceReconnection();
        }).call(this);
    }
    getMessagesCollection() {
        return new _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].exports.MUCMessages();
    }
    restoreSession() {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
        const id = `muc.session-${bare_jid}-${this.get('jid')}`;
        this.session = new _session__WEBPACK_IMPORTED_MODULE_25__["default"]({
            id
        });
        (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_13__.initStorage)(this.session, id, 'session');
        return new Promise((r)=>this.session.fetch({
                'success': r,
                'error': r
            }));
    }
    initDiscoModels() {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
        let id = `converse.muc-features-${bare_jid}-${this.get('jid')}`;
        this.features = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model(Object.assign({
            id
        }, _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].ROOM_FEATURES.reduce((acc, feature)=>{
            acc[feature] = false;
            return acc;
        }, {})));
        this.features.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_13__.createStore)(id, 'session');
        this.features.listenTo(_shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"], 'beforeLogout', ()=>this.features.browserStorage.flush());
        id = `converse.muc-config-${bare_jid}-${this.get('jid')}`;
        this.config = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model({
            id
        });
        this.config.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_13__.createStore)(id, 'session');
        this.config.listenTo(_shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"], 'beforeLogout', ()=>this.config.browserStorage.flush());
    }
    initOccupants() {
        this.occupants = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].exports.MUCOccupants();
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
        const id = `converse.occupants-${bare_jid}${this.get('jid')}`;
        this.occupants.browserStorage = (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_13__.createStore)(id, 'session');
        this.occupants.chatroom = this;
        this.occupants.listenTo(_shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"], 'beforeLogout', ()=>this.occupants.browserStorage.flush());
    }
    fetchOccupants() {
        this.occupants.fetched = new Promise((resolve)=>{
            this.occupants.fetch({
                'add': true,
                'silent': true,
                'success': resolve,
                'error': resolve
            });
        });
        return this.occupants.fetched;
    }
    /**
     * If a user's affiliation has been changed, a <presence> stanza is sent
     * out, but if the user is not in a room, a <message> stanza MAY be sent
     * out. This handler handles such message stanzas. See "Example 176" in
     * XEP-0045.
     * @param {Element} stanza
     * @returns {void}
     */ handleAffiliationChangedMessage(stanza) {
        if (stanza.querySelector('body')) {
            // If there's a body, we don't treat it as an affiliation change message.
            return;
        }
        const item = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`x[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_USER}"] item`, stanza).pop();
        if (item) {
            const from = stanza.getAttribute('from');
            const jid = item.getAttribute('jid');
            const data = {
                from,
                states: [],
                jid: strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(jid),
                resource: strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getResourceFromJid(jid)
            };
            const affiliation = item.getAttribute('affiliation');
            if (affiliation) {
                data.affiliation = affiliation;
            }
            const role = item.getAttribute('role');
            if (role) {
                data.role = role;
            }
            const occupant = this.occupants.findOccupant({
                jid: data.jid
            });
            if (occupant) {
                occupant.save(data);
            } else {
                this.occupants.create(data);
            }
        }
    }
    /**
     * @param {Element} stanza
     */ handleErrorMessageStanza(stanza) {
        return _async_to_generator(function*() {
            const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
            const attrs_or_error = yield (0,_parsers_js__WEBPACK_IMPORTED_MODULE_18__.parseMUCMessage)(stanza, this);
            if (u.isErrorObject(attrs_or_error)) {
                const { stanza, message } = /** @type {StanzaParseError} */ attrs_or_error;
                if (stanza) _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(stanza);
                return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(message);
            }
            const attrs = /** @type {MessageAttributes} */ attrs_or_error;
            if (!(yield this.shouldShowErrorMessage(attrs))) {
                return;
            }
            const nick = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getResourceFromJid(attrs.from);
            const occupant = nick ? this.getOccupant(nick) : null;
            const model = occupant ? occupant : this;
            const message = model.getMessageReferencedByError(attrs);
            if (message) {
                const new_attrs = {
                    error: attrs.error,
                    error_condition: attrs.error_condition,
                    error_text: attrs.error_text,
                    error_type: attrs.error_type,
                    editable: false
                };
                if (attrs.msgid === message.get('retraction_id')) {
                    // The error message refers to a retraction
                    new_attrs.retracted = undefined;
                    new_attrs.retraction_id = undefined;
                    new_attrs.retracted_id = undefined;
                    if (!attrs.error) {
                        if (attrs.error_condition === 'forbidden') {
                            new_attrs.error = __("You're not allowed to retract your message.");
                        } else if (attrs.error_condition === 'not-acceptable') {
                            new_attrs.error = __("Your retraction was not delivered because you're not present in the groupchat.");
                        } else {
                            new_attrs.error = __('Sorry, an error occurred while trying to retract your message.');
                        }
                    }
                } else if (!attrs.error) {
                    if (attrs.error_condition === 'forbidden') {
                        new_attrs.error = __("Your message was not delivered because you weren't allowed to send it.");
                    } else if (attrs.error_condition === 'not-acceptable') {
                        new_attrs.error = __("Your message was not delivered because you're not present in the groupchat.");
                    } else {
                        new_attrs.error = __('Sorry, an error occurred while trying to send your message.');
                    }
                }
                message.save(new_attrs);
            } else {
                model.createMessage(attrs);
            }
        }).call(this);
    }
    /**
     * Handles incoming message stanzas from the service that hosts this MUC
     * @param {Element} stanza
     */ handleMessageFromMUCHost(stanza) {
        if (this.isEntered()) {
            // We're not interested in activity indicators when already joined to the room
            return;
        }
        const rai = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`rai[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.RAI}"]`, stanza).pop();
        const active_mucs = Array.from((rai === null || rai === void 0 ? void 0 : rai.querySelectorAll('activity')) || []).map((m)=>m.textContent);
        if (active_mucs.includes(this.get('jid'))) {
            this.save({
                'has_activity': true,
                'num_unread_general': 0
            });
        }
    }
    /**
     * Handles XEP-0452 MUC Mention Notification messages
     * @param {Element} stanza
     */ handleForwardedMentions(stanza) {
        if (this.isEntered()) {
            // Avoid counting mentions twice
            return;
        }
        const msgs = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`mentions[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MENTIONS}"] forwarded[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.FORWARD}"] message[type="groupchat"]`, stanza);
        const muc_jid = this.get('jid');
        const mentions = msgs.filter((m)=>strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(m.getAttribute('from')) === muc_jid);
        if (mentions.length) {
            this.save({
                'has_activity': true,
                'num_unread': this.get('num_unread') + mentions.length
            });
            mentions.forEach(/** @param {Element} stanza */ (stanza)=>_async_to_generator(function*() {
                    const attrs = yield (0,_parsers_js__WEBPACK_IMPORTED_MODULE_18__.parseMUCMessage)(stanza, this);
                    const data = {
                        stanza,
                        attrs,
                        'chatbox': this
                    };
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('message', data);
                }).call(this));
        }
    }
    /**
     * Parses an incoming message stanza and queues it for processing.
     * @param {Builder|Element} stanza
     */ handleMessageStanza(stanza) {
        return _async_to_generator(function*() {
            var _stanza_tree;
            var _stanza_tree1;
            stanza = (_stanza_tree1 = (_stanza_tree = /** @type {Builder} */ stanza.tree) === null || _stanza_tree === void 0 ? void 0 : _stanza_tree.call(stanza)) !== null && _stanza_tree1 !== void 0 ? _stanza_tree1 : /** @type {Element} */ stanza;
            const type = stanza.getAttribute('type');
            if (type === 'error') {
                return this.handleErrorMessageStanza(stanza);
            }
            if (type === 'groupchat') {
                if ((0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_14__.isArchived)(stanza)) {
                    // MAM messages are handled in converse-mam.
                    // We shouldn't get MAM messages here because
                    // they shouldn't have a `type` attribute.
                    return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`Received a MAM message with type "groupchat"`);
                }
            } else if (!type) {
                return this.handleForwardedMentions(stanza);
            }
            let attrs_or_error;
            try {
                attrs_or_error = yield (0,_parsers_js__WEBPACK_IMPORTED_MODULE_18__.parseMUCMessage)(stanza, this);
            } catch (e) {
                return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
            }
            if (u.isErrorObject(attrs_or_error)) {
                const { stanza, message } = /** @type {StanzaParseError} */ attrs_or_error;
                if (stanza) _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(stanza);
                return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(message);
            }
            const attrs = /** @type {MUCMessageAttributes} */ attrs_or_error;
            if (attrs.type === 'groupchat') {
                attrs.codes.forEach((code)=>this.createInfoMessage(code));
                this.fetchFeaturesIfConfigurationChanged(attrs);
            }
            const data = /** @type {import('./types').MUCMessageEventData} */ {
                stanza,
                attrs,
                chatbox: this
            };
            /**
         * Triggered when a groupchat message stanza has been received and parsed.
         * @event _converse#message
         * @type {object}
         * @property {import('./types').MUCMessageEventData} data
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('message', data);
            return attrs && this.queueMessage(attrs);
        }).call(this);
    }
    /**
     * Register presence and message handlers relevant to this groupchat
     */ registerHandlers() {
        const muc_jid = this.get('jid');
        const muc_domain = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getDomainFromJid(muc_jid);
        this.removeHandlers();
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.get();
        this.presence_handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
            this.onPresence(stanza);
            return true;
        }, null, 'presence', null, null, muc_jid, {
            'ignoreNamespaceFragment': true,
            'matchBareFromJid': true
        });
        this.domain_presence_handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
            this.onPresenceFromMUCHost(stanza);
            return true;
        }, null, 'presence', null, null, muc_domain);
        this.message_handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
            this.handleMessageStanza(stanza);
            return true;
        }, null, 'message', null, null, muc_jid, {
            'matchBareFromJid': true
        });
        this.domain_message_handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
            this.handleMessageFromMUCHost(stanza);
            return true;
        }, null, 'message', null, null, muc_domain);
        this.affiliation_message_handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
            this.handleAffiliationChangedMessage(stanza);
            return true;
        }, strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_USER, 'message', null, null, muc_jid);
    }
    removeHandlers() {
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.get();
        // Remove the presence and message handlers that were
        // registered for this groupchat.
        if (this.message_handler) {
            connection === null || connection === void 0 ? void 0 : connection.deleteHandler(this.message_handler);
            delete this.message_handler;
        }
        if (this.domain_message_handler) {
            connection === null || connection === void 0 ? void 0 : connection.deleteHandler(this.domain_message_handler);
            delete this.domain_message_handler;
        }
        if (this.presence_handler) {
            connection === null || connection === void 0 ? void 0 : connection.deleteHandler(this.presence_handler);
            delete this.presence_handler;
        }
        if (this.domain_presence_handler) {
            connection === null || connection === void 0 ? void 0 : connection.deleteHandler(this.domain_presence_handler);
            delete this.domain_presence_handler;
        }
        if (this.affiliation_message_handler) {
            connection === null || connection === void 0 ? void 0 : connection.deleteHandler(this.affiliation_message_handler);
            delete this.affiliation_message_handler;
        }
        return this;
    }
    invitesAllowed() {
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('allow_muc_invitations') && (this.features.get('open') || this.getOwnAffiliation() === 'owner');
    }
    getDisplayName() {
        const name = this.get('name');
        if (name) {
            return name.trim();
        } else if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('locked_muc_domain') === 'hidden') {
            return strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getNodeFromJid(this.get('jid'));
        } else {
            return this.get('jid');
        }
    }
    /**
     * Sends a message stanza to the XMPP server and expects a reflection
     * or error message within a specific timeout period.
     * @param {Builder|Element } message
     * @returns { Promise<Element>|Promise<TimeoutError> } Returns a promise
     *  which resolves with the reflected message stanza or with an error stanza or
     *  {@link TimeoutError}.
     */ sendTimedMessage(message) {
        const el = message instanceof Element ? message : message.tree();
        let id = el.getAttribute('id');
        if (!id) {
            // inject id if not found
            id = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.getUniqueId)('sendIQ');
            el.setAttribute('id', id);
        }
        const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        const timeout = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('stanza_timeout');
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.get();
        const timeoutHandler = connection.addTimedHandler(timeout, ()=>{
            connection.deleteHandler(handler);
            const err = new _shared_errors_js__WEBPACK_IMPORTED_MODULE_11__.TimeoutError('Timeout Error: No response from server');
            promise.resolve(err);
            return false;
        });
        const handler = connection.addHandler(/** @param {Element} stanza */ (stanza)=>{
            timeoutHandler && connection.deleteTimedHandler(timeoutHandler);
            promise.resolve(stanza);
        }, null, 'message', [
            'error',
            'groupchat'
        ], id);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send(el);
        return promise;
    }
    /**
     * Retract one of your messages in this groupchat
     * @param {BaseMessage} message - The message which we're retracting.
     */ retractOwnMessage(message) {
        return _async_to_generator(function*() {
            const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
            const editable = message.get('editable');
            const retraction_id = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.getUniqueId)();
            const id = message.get('id');
            const stanza = stx`
            <message id="${retraction_id}"
                     to="${this.get('jid')}"
                     type="groupchat"
                     xmlns="jabber:client">
                <retract id="${id}" xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.RETRACT}"/>
                <body>/me retracted a message</body>
                <store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.HINTS}"/>
                <fallback xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.FALLBACK}" for="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.RETRACT}" />
            </message>`;
            // Optimistic save
            message.set({
                retracted: new Date().toISOString(),
                retracted_id: id,
                retraction_id: retraction_id,
                editable: false
            });
            const result = yield this.sendTimedMessage(stanza);
            if (u.isErrorStanza(result)) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(result);
            } else if (result instanceof _shared_errors_js__WEBPACK_IMPORTED_MODULE_11__.TimeoutError) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(result);
                message.save({
                    editable,
                    error_type: 'timeout',
                    error: __('A timeout happened while trying to retract your message.'),
                    retracted: undefined,
                    retracted_id: undefined,
                    retraction_id: undefined
                });
            }
        }).call(this);
    }
    /**
     * Retract someone else's message in this groupchat.
     * @param {MUCMessage} message - The message which we're retracting.
     * @param {string} [reason] - The reason for retracting the message.
     * @example
     *  const room = await api.rooms.get(jid);
     *  const message = room.messages.findWhere({'body': 'Get rich quick!'});
     *  room.retractOtherMessage(message, 'spam');
     */ retractOtherMessage(message, reason) {
        return _async_to_generator(function*() {
            const editable = message.get('editable');
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
            // Optimistic save
            message.save({
                moderated: 'retracted',
                moderated_by: bare_jid,
                moderated_id: message.get('msgid'),
                moderation_reason: reason,
                editable: false
            });
            const result = yield this.sendRetractionIQ(message, reason);
            if (result === null || u.isErrorStanza(result)) {
                // Undo the save if something went wrong
                message.save({
                    editable,
                    moderated: undefined,
                    moderated_by: undefined,
                    moderated_id: undefined,
                    moderation_reason: undefined
                });
            }
            return result;
        }).call(this);
    }
    /**
     * Sends an IQ stanza to the XMPP server to retract a message in this groupchat.
     * @param {MUCMessage} message - The message which we're retracting.
     * @param {string} [reason] - The reason for retracting the message.
     */ sendRetractionIQ(message, reason) {
        const iq = stx`
            <iq to="${this.get('jid')}" type="set" xmlns="jabber:client">
                <moderate id="${message.get(`stanza_id ${this.get('jid')}`)}" xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MODERATE}">
                    <retract xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.RETRACT}"/>
                    ${reason ? stx`<reason>${reason}</reason>` : ''}
                </moderate>
            </iq>`;
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(iq, null, false);
    }
    /**
     * Sends an IQ stanza to the XMPP server to destroy this groupchat. Not
     * to be confused with the {@link MUC#destroy}
     * method, which simply removes the room from the local browser storage cache.
     * @param {string} [reason] - The reason for destroying the groupchat.
     * @param {string} [new_jid] - The JID of the new groupchat which replaces this one.
     */ sendDestroyIQ(reason, new_jid) {
        const iq = stx`
            <iq to="${this.get('jid')}" type="set" xmlns="jabber:client">
                <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_OWNER}">
                    <destroy ${new_jid ? strophe_js__WEBPACK_IMPORTED_MODULE_10__.Stanza.unsafeXML(`jid="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.xmlescape(new_jid)}"`) : ''}>
                        ${reason ? stx`<reason>${reason}</reason>` : ''}
                    </destroy>
                </query>
            </iq>`;
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(iq);
    }
    /**
     * Leave the groupchat by sending an unavailable presence stanza, and then
     * tear down the features and disco collections so that they'll be
     * recreated if/when we rejoin.
     * @param {string} [exit_msg] - Message to indicate your reason for leaving
     */ leave(exit_msg) {
        return _async_to_generator(function*() {
            var _converse_state_disco_entities;
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].user.presence.send({
                type: 'unavailable',
                to: this.getRoomJIDAndNick(),
                status: exit_msg
            });
            (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_16__.safeSave)(this.session, {
                connection_status: _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED
            });
            // Delete the features model
            if (this.features) {
                yield new Promise((resolve)=>this.features.destroy({
                        success: resolve,
                        error: (_, e)=>{
                            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                            resolve();
                        }
                    }));
            }
            // Delete disco entity
            const disco_entity = (_converse_state_disco_entities = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].state.disco_entities) === null || _converse_state_disco_entities === void 0 ? void 0 : _converse_state_disco_entities.get(this.get('jid'));
            if (disco_entity) {
                yield new Promise((resolve)=>disco_entity.destroy({
                        success: resolve,
                        error: (_, e)=>{
                            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                            resolve();
                        }
                    }));
            }
        }).call(this);
    }
    /**
     * @typedef {Object} CloseEvent
     * @property {string} name
     * @param {CloseEvent} [ev]
     */ close(ev) {
        var _this = this, _superprop_get_close = ()=>super.close;
        return _async_to_generator(function*() {
            const { ENTERED, CLOSING } = _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS;
            const was_entered = this.session.get('connection_status') === ENTERED;
            (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_16__.safeSave)(this.session, {
                connection_status: CLOSING
            });
            was_entered && this.sendMarkerForLastMessage('received', true);
            yield this.leave();
            this.occupants.clearStore();
            const is_closed_by_user = (ev === null || ev === void 0 ? void 0 : ev.name) !== 'closeAllChatBoxes';
            if (is_closed_by_user) {
                yield this.unregisterNickname();
                if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_clear_messages_on_leave')) {
                    this.clearMessages();
                }
                /**
             * Triggered when the user leaves a MUC
             * @event _converse#leaveRoom
             * @type {MUC}
             * @example _converse.api.listen.on('leaveRoom', model => { ... });
             */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('leaveRoom', this);
            }
            // Delete the session model
            yield new Promise((success)=>this.session.destroy({
                    success,
                    error: (_, e)=>{
                        _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                        success();
                    }
                }));
            return _superprop_get_close().call(_this);
        }).call(this);
    }
    canModerateMessages() {
        const self = this.getOwnOccupant();
        return self && self.isModerator() && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MODERATE, this.get('jid'));
    }
    canPostMessages() {
        return this.isEntered() && !(this.features.get('moderated') && this.getOwnRole() === 'visitor');
    }
    /**
     * @param {import('../../shared/message').default} message
     */ isChatMessage(message) {
        return message.get('type') === this.get('message_type');
    }
    /**
     * Return an array of unique nicknames based on all occupants and messages in this MUC.
     * @returns {String[]}
     */ getAllKnownNicknames() {
        return [
            ...new Set([
                ...this.occupants.map((o)=>o.get('nick')),
                ...this.messages.map((m)=>m.get('nick'))
            ])
        ].filter((n)=>n);
    }
    getAllKnownNicknamesRegex() {
        const longNickString = this.getAllKnownNicknames().map((n)=>_utils_parse_helpers__WEBPACK_IMPORTED_MODULE_4__["default"].escapeRegexString(n)).join('|');
        return RegExp(`(?:\\p{P}|\\p{Z}|^)@(${longNickString})(?![\\w@-])`, 'uig');
    }
    /**
     * @param {string} jid
     */ getOccupantByJID(jid) {
        return this.occupants.findOccupant({
            jid
        });
    }
    /**
     * @param {string} nick
     */ getOccupantByNickname(nick) {
        return this.occupants.findOccupant({
            nick
        });
    }
    /**
     * @param {string} nick
     */ getReferenceURIFromNickname(nick) {
        const muc_jid = this.get('jid');
        const occupant = this.getOccupant(nick);
        const uri = this.features.get('nonanonymous') && (occupant === null || occupant === void 0 ? void 0 : occupant.get('jid')) || `${muc_jid}/${nick}`;
        return encodeURI(`xmpp:${uri}`);
    }
    /**
     * Given a text message, look for `@` mentions and turn them into
     * XEP-0372 references
     * @param { String } text
     */ parseTextForReferences(text) {
        const mentions_regex = RegExp("(\\p{P}|\\p{Z}|^)([@][\\w_-]+(?:\\.\\w+)*)", "giu");
        if (!text || !mentions_regex.test(text)) {
            return [
                text,
                []
            ];
        }
        const getMatchingNickname = _utils_parse_helpers__WEBPACK_IMPORTED_MODULE_4__["default"].findFirstMatchInArray(this.getAllKnownNicknames());
        const matchToReference = (match)=>{
            let at_sign_index = match[0].indexOf('@');
            if (match[0][at_sign_index + 1] === '@') {
                // edge-case
                at_sign_index += 1;
            }
            const begin = match.index + at_sign_index;
            const end = begin + match[0].length - at_sign_index;
            const value = getMatchingNickname(match[1]);
            const type = 'mention';
            const uri = this.getReferenceURIFromNickname(value);
            return {
                begin,
                end,
                value,
                type,
                uri
            };
        };
        const regex = this.getAllKnownNicknamesRegex();
        const mentions = [
            ...text.matchAll(regex)
        ].filter((m)=>!m[0].startsWith('/'));
        const references = mentions.map(matchToReference);
        const [updated_message, updated_references] = _utils_parse_helpers__WEBPACK_IMPORTED_MODULE_4__["default"].reduceTextFromReferences(text, references);
        return [
            updated_message,
            updated_references
        ];
    }
    /**
     * @param {MessageAttributes} [attrs] - A map of attributes to be saved on the message
     */ getOutgoingMessageAttributes(attrs) {
        return _async_to_generator(function*() {
            const is_spoiler = this.get('composing_spoiler');
            let text = '', references;
            if (attrs === null || attrs === void 0 ? void 0 : attrs.body) {
                [text, references] = this.parseTextForReferences(attrs.body);
            }
            const origin_id = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.getUniqueId)();
            const body = text ? u.shortnamesToUnicode(text) : undefined;
            attrs = Object.assign({}, attrs, {
                body,
                is_spoiler,
                origin_id,
                references,
                id: origin_id,
                msgid: origin_id,
                from: `${this.get('jid')}/${this.get('nick')}`,
                fullname: this.get('nick'),
                message: body,
                nick: this.get('nick'),
                sender: 'me',
                type: 'groupchat',
                original_text: text
            }, (yield u.getMediaURLsMetadata(text)));
            /**
         * *Hook* which allows plugins to update the attributes of an outgoing
         * message.
         * @event _converse#getOutgoingMessageAttributes
         */ attrs = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].hook('getOutgoingMessageAttributes', this, attrs);
            return attrs;
        }).call(this);
    }
    /**
     * Utility method to construct the JID for the current user as occupant of the groupchat.
     * @returns {string} - The groupchat JID with the user's nickname added at the end.
     * @example groupchat@conference.example.org/nickname
     */ getRoomJIDAndNick() {
        const nick = this.get('nick');
        const jid = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(this.get('jid'));
        return jid + (nick !== null ? `/${nick}` : '');
    }
    /**
     * Sends a message with the current XEP-0085 chat state of the user
     * as taken from the `chat_state` attribute of the {@link MUC}.
     */ sendChatState() {
        if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('send_chat_state_notifications') || !this.get('chat_state') || !this.isEntered() || this.features.get('moderated') && this.getOwnRole() === 'visitor') {
            return;
        }
        const allowed = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('send_chat_state_notifications');
        if (Array.isArray(allowed) && !allowed.includes(this.get('chat_state'))) {
            return;
        }
        const chat_state = this.get('chat_state');
        if (chat_state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.GONE) return; // <gone/> is not applicable within MUC context
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send(stx`
            <message to="${this.get('jid')}" type="groupchat" xmlns="jabber:client">
                ${chat_state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.INACTIVE ? stx`<inactive xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.CHATSTATES}"/>` : ''}
                ${chat_state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.ACTIVE ? stx`<active xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.CHATSTATES}"/>` : ''}
                ${chat_state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.COMPOSING ? stx`<composing xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.CHATSTATES}"/>` : ''}
                ${chat_state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.PAUSED ? stx`<paused xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.CHATSTATES}"/>` : ''}
                <no-store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.HINTS}"/>
                <no-permanent-store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.HINTS}"/>
            </message>`);
    }
    /**
     * Send a direct invitation as per XEP-0249
     * @param {String} recipient - JID of the person being invited
     * @param {String} [reason] - Reason for the invitation
     */ directInvite(recipient, reason) {
        if (this.features.get('membersonly')) {
            // When inviting to a members-only groupchat, we first add
            // the person to the member list by giving them an
            // affiliation of 'member' otherwise they won't be able to join.
            this.updateMemberLists([
                {
                    jid: recipient,
                    affiliation: 'member',
                    reason
                }
            ]);
        }
        const invitation = stx`
            <message xmlns="jabber:client" to="${recipient}" id="${(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.getUniqueId)()}">
                <x xmlns="jabber:x:conference"
                    jid="${this.get('jid')}"
                    ${this.get('password') ? strophe_js__WEBPACK_IMPORTED_MODULE_10__.Stanza.unsafeXML(`password="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.xmlescape(this.get('password'))}"`) : ''}
                    ${reason ? strophe_js__WEBPACK_IMPORTED_MODULE_10__.Stanza.unsafeXML(`reason="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.xmlescape(reason)}"`) : ''} />
            </message>`;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send(invitation);
        /**
         * After the user has sent out a direct invitation (as per XEP-0249),
         * to a roster contact, asking them to join a room.
         * @event _converse#chatBoxMaximized
         * @type {object}
         * @property {MUC} room
         * @property {string} recipient - The JID of the person being invited
         * @property {string} reason - The original reason for the invitation
         * @example _converse.api.listen.on('chatBoxMaximized', view => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('roomInviteSent', {
            room: this,
            recipient,
            reason
        });
    }
    /**
     * Refresh the disco identity, features and fields for this {@link MUC}.
     * *features* are stored on the features {@link Model} attribute on this {@link MUC}.
     * *fields* are stored on the config {@link Model} attribute on this {@link MUC}.
     * @returns {Promise}
     */ refreshDiscoInfo() {
        return _async_to_generator(function*() {
            const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.refresh(this.get('jid'));
            if (result instanceof _shared_errors_js__WEBPACK_IMPORTED_MODULE_11__.StanzaError) {
                return result;
            }
            return this.getDiscoInfo().catch((e)=>_converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e));
        }).call(this);
    }
    /**
     * Fetch the *extended* MUC info from the server and cache it locally
     * https://xmpp.org/extensions/xep-0045.html#disco-roominfo
     * @returns {Promise}
     */ getDiscoInfo() {
        return _async_to_generator(function*() {
            const identity = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.getIdentity('conference', 'text', this.get('jid'));
            if (identity === null || identity === void 0 ? void 0 : identity.get('name')) {
                this.save({
                    name: identity.get('name')
                });
            } else {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(`No identity or name found for ${this.get('jid')}`);
            }
            yield this.getDiscoInfoFields();
            yield this.getDiscoInfoFeatures();
        }).call(this);
    }
    /**
     * Fetch the *extended* MUC info fields from the server and store them locally
     * in the `config` {@link Model} attribute.
     * See: https://xmpp.org/extensions/xep-0045.html#disco-roominfo
     * @returns {Promise}
     */ getDiscoInfoFields() {
        return _async_to_generator(function*() {
            const fields = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.getFields(this.get('jid'));
            const config = fields.reduce((config, f)=>{
                const name = f.get('var');
                if (name === 'muc#roomconfig_roomname') {
                    config['roomname'] = f.get('value');
                }
                if (name === null || name === void 0 ? void 0 : name.startsWith('muc#roominfo_')) {
                    config[name.replace('muc#roominfo_', '')] = f.get('value');
                }
                return config;
            }, {});
            this.config.save(config);
            if (config['roomname']) this.save({
                name: config['roomname']
            });
        }).call(this);
    }
    /**
     * Use converse-disco to populate the features {@link Model} which
     * is stored as an attibute on this {@link MUC}.
     * The results may be cached. If you want to force fetching the features from the
     * server, call {@link MUC#refreshDiscoInfo} instead.
     * @returns {Promise}
     */ getDiscoInfoFeatures() {
        return _async_to_generator(function*() {
            const features = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.getFeatures(this.get('jid'));
            const attrs = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].ROOM_FEATURES.reduce((acc, feature)=>{
                acc[feature] = false;
                return acc;
            }, {
                'fetched': new Date().toISOString()
            });
            features.each((feature)=>{
                const fieldname = feature.get('var');
                if (!fieldname.startsWith('muc_')) {
                    if (fieldname === strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MAM) {
                        attrs.mam_enabled = true;
                    } else {
                        attrs[fieldname] = true;
                    }
                    return;
                }
                attrs[fieldname.replace('muc_', '')] = true;
            });
            this.features.save(attrs);
        }).call(this);
    }
    /**
     * Given a <field> element, return a copy with a <value> child if
     * we can find a value for it in this rooms config.
     * @param {Element} field
     * @returns {Element}
     */ addFieldValue(field) {
        const type = field.getAttribute('type');
        if (type === 'fixed') {
            return field;
        }
        const fieldname = field.getAttribute('var').replace('muc#roomconfig_', '');
        const config = this.get('roomconfig');
        if (fieldname in config) {
            let values;
            switch(type){
                case 'boolean':
                    values = [
                        config[fieldname] ? 1 : 0
                    ];
                    break;
                case 'list-multi':
                    values = config[fieldname];
                    break;
                default:
                    values = [
                        config[fieldname]
                    ];
            }
            field.innerHTML = values.map((v)=>(0,strophe_js__WEBPACK_IMPORTED_MODULE_10__.$build)('value').t(v)).join('');
        }
        return field;
    }
    /**
     * Automatically configure the groupchat based on this model's
     * 'roomconfig' data.
     * @returns {Promise<Element>}
     * Returns a promise which resolves once a response IQ has
     * been received.
     */ autoConfigureChatRoom() {
        return _async_to_generator(function*() {
            const stanza = yield this.fetchRoomConfiguration();
            const fields = sizzle__WEBPACK_IMPORTED_MODULE_0___default()('field', stanza);
            const configArray = fields.map((f)=>this.addFieldValue(f));
            if (configArray.length) {
                return this.sendConfiguration(configArray);
            }
        }).call(this);
    }
    /**
     * Send an IQ stanza to fetch the groupchat configuration data.
     * Returns a promise which resolves once the response IQ
     * has been received.
     * @returns {Promise<Element>}
     */ fetchRoomConfiguration() {
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(stx`
            <iq to="${this.get('jid')}" type="get" xmlns="jabber:client">
                <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_OWNER}"/>
            </iq>`);
    }
    /**
     * Sends an IQ stanza with the groupchat configuration.
     * @param {Element[]} config - The groupchat configuration
     * @returns {Promise<Element>} - A promise which resolves with
     *  the `result` stanza received from the XMPP server.
     */ sendConfiguration(config = []) {
        const iq = stx`
            <iq to="${this.get('jid')}" type="set" xmlns="jabber:client">
                <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_OWNER}">
                    <x xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.XFORM}" type="submit">
                        ${config.map((el)=>strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.Builder.fromString(el.outerHTML))}
                    </x>
                </query>
            </iq>`;
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(iq);
    }
    onCommandError(err) {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
        _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].fatal(err);
        const message = __('Sorry, an error happened while running the command.') + ' ' + __("Check your browser's developer console for details.");
        this.createMessage({
            message,
            'type': 'error'
        });
    }
    getNickOrJIDFromCommandArgs(args) {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
        if (u.isValidJID(args.trim())) {
            return args.trim();
        }
        if (!args.startsWith('@')) {
            args = '@' + args;
        }
        const result = this.parseTextForReferences(args);
        const references = result[1];
        if (!references.length) {
            const message = __("Error: couldn't find a groupchat participant based on your arguments");
            this.createMessage({
                message,
                'type': 'error'
            });
            return;
        }
        if (references.length > 1) {
            const message = __('Error: found multiple groupchat participant based on your arguments');
            this.createMessage({
                message,
                'type': 'error'
            });
            return;
        }
        const nick_or_jid = references.pop().value;
        const reason = args.split(nick_or_jid, 2)[1];
        if (reason && !reason.startsWith(' ')) {
            const message = __("Error: couldn't find a groupchat participant based on your arguments");
            this.createMessage({
                message,
                'type': 'error'
            });
            return;
        }
        return nick_or_jid;
    }
    validateRoleOrAffiliationChangeArgs(command, args) {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
        if (!args) {
            const message = __('Error: the "%1$s" command takes two arguments, the user\'s nickname and optionally a reason.', command);
            this.createMessage({
                message,
                'type': 'error'
            });
            return false;
        }
        return true;
    }
    getAllowedCommands() {
        let allowed_commands = [
            'clear',
            'help',
            'me',
            'nick',
            'register'
        ];
        if (this.config.get('changesubject') || [
            'owner',
            'admin'
        ].includes(this.getOwnAffiliation())) {
            allowed_commands = [
                ...allowed_commands,
                ...[
                    'subject',
                    'topic'
                ]
            ];
        }
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
        const occupant = this.occupants.findWhere({
            'jid': bare_jid
        });
        if (this.verifyAffiliations([
            'owner'
        ], occupant, false)) {
            allowed_commands = allowed_commands.concat(_constants_js__WEBPACK_IMPORTED_MODULE_8__.OWNER_COMMANDS).concat(_constants_js__WEBPACK_IMPORTED_MODULE_8__.ADMIN_COMMANDS);
        } else if (this.verifyAffiliations([
            'admin'
        ], occupant, false)) {
            allowed_commands = allowed_commands.concat(_constants_js__WEBPACK_IMPORTED_MODULE_8__.ADMIN_COMMANDS);
        }
        if (this.verifyRoles([
            'moderator'
        ], occupant, false)) {
            allowed_commands = allowed_commands.concat(_constants_js__WEBPACK_IMPORTED_MODULE_8__.MODERATOR_COMMANDS).concat(_constants_js__WEBPACK_IMPORTED_MODULE_8__.VISITOR_COMMANDS);
        } else if (!this.verifyRoles([
            'visitor',
            'participant',
            'moderator'
        ], occupant, false)) {
            allowed_commands = allowed_commands.concat(_constants_js__WEBPACK_IMPORTED_MODULE_8__.VISITOR_COMMANDS);
        }
        allowed_commands.sort();
        if (Array.isArray(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_disable_slash_commands'))) {
            return allowed_commands.filter((c)=>!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_disable_slash_commands').includes(c));
        } else {
            return allowed_commands;
        }
    }
    verifyAffiliations(affiliations, occupant, show_error = true) {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
        if (!Array.isArray(affiliations)) {
            throw new TypeError('affiliations must be an Array');
        }
        if (!affiliations.length) {
            return true;
        }
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
        occupant = occupant || this.occupants.findWhere({
            'jid': bare_jid
        });
        if (occupant) {
            const a = occupant.get('affiliation');
            if (affiliations.includes(a)) {
                return true;
            }
        }
        if (show_error) {
            const message = __('Forbidden: you do not have the necessary affiliation in order to do that.');
            this.createMessage({
                message,
                'type': 'error'
            });
        }
        return false;
    }
    verifyRoles(roles, occupant, show_error = true) {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
        if (!Array.isArray(roles)) {
            throw new TypeError('roles must be an Array');
        }
        if (!roles.length) {
            return true;
        }
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get('bare_jid');
        occupant = occupant || this.occupants.findWhere({
            'jid': bare_jid
        });
        if (occupant) {
            const role = occupant.get('role');
            if (roles.includes(role)) {
                return true;
            }
        }
        if (show_error) {
            const message = __('Forbidden: you do not have the necessary role in order to do that.');
            this.createMessage({
                message,
                'type': 'error',
                'is_ephemeral': 20000
            });
        }
        return false;
    }
    /**
     * Returns the `role` which the current user has in this MUC
     * @returns {('none'|'visitor'|'participant'|'moderator')}
     */ getOwnRole() {
        var _this_getOwnOccupant;
        return (_this_getOwnOccupant = this.getOwnOccupant()) === null || _this_getOwnOccupant === void 0 ? void 0 : _this_getOwnOccupant.get('role');
    }
    /**
     * Returns the `affiliation` which the current user has in this MUC
     * @returns {('none'|'outcast'|'member'|'admin'|'owner')}
     */ getOwnAffiliation() {
        var _this_getOwnOccupant;
        return ((_this_getOwnOccupant = this.getOwnOccupant()) === null || _this_getOwnOccupant === void 0 ? void 0 : _this_getOwnOccupant.get('affiliation')) || 'none';
    }
    /**
     * Get the {@link MUCOccupant} instance which
     * represents the current user.
     * @returns {MUCOccupant}
     */ getOwnOccupant() {
        return this.occupants.getOwnOccupant();
    }
    /**
     * Send a presence stanza to update the user's nickname in this MUC.
     * @param {String} nick
     */ setNickname(nick) {
        return _async_to_generator(function*() {
            const jid = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(this.get('jid'));
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send(stx`<presence xmlns="jabber:client"
                    id="${(0,_utils_index_js__WEBPACK_IMPORTED_MODULE_15__.getUniqueId)()}"
                    from="${_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.get().jid}"
                    to="${jid}/${nick}"></presence>`);
        }).call(this);
    }
    /**
     * Send an IQ stanza to modify an occupant's role
     * @param {MUCOccupant} occupant
     * @param {string} role
     * @param {string} reason
     * @param {function} onSuccess - callback for a succesful response
     * @param {function} onError - callback for an error response
     */ setRole(occupant, role, reason, onSuccess, onError) {
        const iq = stx`
            <iq to="${this.get('jid')}" type="set" xmlns="jabber:client">
                <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_ADMIN}">
                    <item nick="${occupant.get('nick')}" role="${role}">
                        ${reason !== null ? stx`<reason>${reason}</reason>` : ''}
                    </item>
                </query>
            </iq>`;
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(iq).then(onSuccess).catch(onError);
    }
    /**
     * @param {string} nickname_or_jid - The nickname or JID of the occupant to be returned
     * @returns {MUCOccupant}
     */ getOccupant(nickname_or_jid) {
        return u.isValidJID(nickname_or_jid) ? this.getOccupantByJID(nickname_or_jid) : this.getOccupantByNickname(nickname_or_jid);
    }
    /**
     * Return an array of occupant models that have the required role
     * @param {string} role
     * @returns {{jid: string, nick: string, role: string}[]}
     */ getOccupantsWithRole(role) {
        return this.getOccupantsSortedBy('nick').filter((o)=>o.get('role') === role).map((item)=>{
            return {
                jid: /** @type {string} */ item.get('jid'),
                nick: /** @type {string} */ item.get('nick'),
                role: /** @type {string} */ item.get('role')
            };
        });
    }
    /**
     * Return an array of occupant models that have the required affiliation
     * @param {string} affiliation
     * @returns {{jid: string, nick: string, affiliation: string}[]}
     */ getOccupantsWithAffiliation(affiliation) {
        return this.getOccupantsSortedBy('nick').filter((o)=>o.get('affiliation') === affiliation).map((item)=>{
            return {
                jid: /** @type {string} */ item.get('jid'),
                nick: /** @type {string} */ item.get('nick'),
                affiliation: /** @type {string} */ item.get('affiliation')
            };
        });
    }
    /**
     * Return an array of occupant models, sorted according to the passed-in attribute.
     * @param {string} attr - The attribute to sort the returned array by
     * @returns {MUCOccupant[]}
     */ getOccupantsSortedBy(attr) {
        return Array.from(this.occupants.models).sort((a, b)=>a.get(attr) < b.get(attr) ? -1 : a.get(attr) > b.get(attr) ? 1 : 0);
    }
    /**
     * Fetch the lists of users with the given affiliations.
     * Then compute the delta between those users and
     * the passed in members, and if it exists, send the delta
     * to the XMPP server to update the member list.
     * @param {object} members - Map of member jids and affiliations.
     * @returns {Promise}
     *  A promise which is resolved once the list has been
     *  updated or once it's been established there's no need
     *  to update the list.
     */ updateMemberLists(members) {
        return _async_to_generator(function*() {
            const muc_jid = this.get('jid');
            /** @type {Array<NonOutcastAffiliation>} */ const all_affiliations = [
                'member',
                'admin',
                'owner'
            ];
            const aff_lists = yield Promise.all(all_affiliations.map((a)=>(0,_affiliations_utils_js__WEBPACK_IMPORTED_MODULE_12__.getAffiliationList)(a, muc_jid)));
            const old_members = aff_lists.reduce(/**
             * @param {MemberListItem[]} acc
             * @param {MemberListItem[]|Error} val
             * @returns {MemberListItem[]}
             */ (acc, val)=>{
                if (val instanceof Error) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(val);
                    return acc;
                }
                return [
                    ...val,
                    ...acc
                ];
            }, []);
            yield (0,_affiliations_utils_js__WEBPACK_IMPORTED_MODULE_12__.setAffiliations)(muc_jid, (0,_affiliations_utils_js__WEBPACK_IMPORTED_MODULE_12__.computeAffiliationsDelta)(true, false, members, /** @type {MemberListItem[]} */ old_members));
            yield this.occupants.fetchMembers();
        }).call(this);
    }
    /**
     * Triggers a hook which gives 3rd party plugins an opportunity to determine
     * the nickname to use.
     * @return {Promise<string>} A promise which resolves with the nickname
     */ getNicknameFromHook() {
        return _async_to_generator(function*() {
            /**
         * *Hook* which allows plugins to determine which nickname to use for
         * the given MUC
         * @event _converse#getNicknameForMUC
         * @type {string} The nickname to use
         */ return yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].hook('getNicknameForMUC', this, null);
        }).call(this);
    }
    /**
     * Given a nick name, save it to the model state, otherwise, look
     * for a server-side reserved nickname or default configured
     * nickname and if found, persist that to the model state.
     * @param {string} nick
     * @returns {Promise<string>} A promise which resolves with the nickname
     */ getAndPersistNickname(nick) {
        return _async_to_generator(function*() {
            nick = nick || this.get('nick') || (yield this.getReservedNick()) || (yield this.getNicknameFromHook()) || _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].exports.getDefaultMUCNickname();
            if (nick) (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_16__.safeSave)(this, {
                nick
            }, {
                silent: true
            });
            return nick;
        }).call(this);
    }
    /**
     * Use service-discovery to ask the XMPP server whether
     * this user has a reserved nickname for this groupchat.
     * If so, we'll use that, otherwise we render the nickname form.
     * @returns {Promise<string>} A promise which resolves with the reserved nick or null
     */ getReservedNick() {
        return _async_to_generator(function*() {
            const stanza = stx`
            <iq to="${this.get('jid')}" type="get" xmlns="jabber:client">
                <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.DISCO_INFO}" node="x-roomuser-item"/>
            </iq>`;
            const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(stanza, null, false);
            if (u.isErrorObject(result)) {
                throw result;
            }
            // Result might be undefined due to a timeout
            const identity_el = result === null || result === void 0 ? void 0 : result.querySelector('query[node="x-roomuser-item"] identity');
            return identity_el ? identity_el.getAttribute('name') : null;
        }).call(this);
    }
    /**
     * Send an IQ stanza to the MUC to register this user's nickname.
     * This sets the user's affiliation to 'member' (if they weren't affiliated
     * before) and reserves the nickname for this user, thereby preventing other
     * users from using it in this MUC.
     * See https://xmpp.org/extensions/xep-0045.html#register
     */ registerNickname() {
        return _async_to_generator(function*() {
            const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
            const nick = this.get('nick');
            const jid = this.get('jid');
            let iq, err_msg;
            try {
                iq = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(stx`<iq to="${jid}" type="get" xmlns="jabber:client">
                    <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_REGISTER}"/>
                </iq>`);
            } catch (e) {
                if (sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`not-allowed[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.STANZAS}"]`, e).length) {
                    err_msg = __("You're not allowed to register yourself in this groupchat.");
                } else if (sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`registration-required[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.STANZAS}"]`, e).length) {
                    err_msg = __("You're not allowed to register in this groupchat because it's members-only.");
                }
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                return err_msg;
            }
            const required_fields = sizzle__WEBPACK_IMPORTED_MODULE_0___default()('field required', iq).map((f)=>f.parentElement);
            if (required_fields.length > 1 && required_fields[0].getAttribute('var') !== 'muc#register_roomnick') {
                return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(`Can't register the user register in the groupchat ${jid} due to the required fields`);
            }
            try {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(stx`<iq to="${jid}" type="set" xmlns="jabber:client">
                    <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_REGISTER}">
                        <x xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.XFORM}" type="submit">
                            <field var="FORM_TYPE">
                                <value>http://jabber.org/protocol/muc#register</value>
                            </field>
                            <field var="muc#register_roomnick">
                                <value>${nick}</value>
                            </field>
                        </x>
                    </query>
                </iq>`);
            } catch (e) {
                const err = yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_14__.parseErrorStanza)(e);
                if ((err === null || err === void 0 ? void 0 : err.name) === 'service-unavailable') {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error("Can't register your nickname in this groupchat, it doesn't support registration.");
                } else if ((err === null || err === void 0 ? void 0 : err.name) === 'bad-request') {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error("Can't register your nickname in this groupchat, invalid data form supplied.");
                } else {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                }
                throw err;
            }
        }).call(this);
    }
    /**
     * Check whether we should unregister the user from this MUC, and if so,
     * call {@link MUC#sendUnregistrationIQ}
     */ unregisterNickname() {
        return _async_to_generator(function*() {
            if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('auto_register_muc_nickname') === 'unregister') {
                try {
                    if (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_REGISTER, this.get('jid'))) {
                        yield this.sendUnregistrationIQ();
                    }
                } catch (e) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                }
            }
        }).call(this);
    }
    /**
     * Send an IQ stanza to the MUC to unregister this user's nickname.
     * If the user had a 'member' affiliation, it'll be removed and their
     * nickname will no longer be reserved and can instead be used (and
     * registered) by other users.
     */ sendUnregistrationIQ() {
        const iq = stx`
            <iq to="${this.get('jid')}" type="set" xmlns="jabber:client">
                <query xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_REGISTER}">
                    <remove/>
                </query>
            </iq>`;
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(iq).catch((e)=>_converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e));
    }
    /**
     * Given a presence stanza, update the occupant model based on its contents.
     * @param {MUCPresenceAttributes} attrs - The presence stanza
     */ updateOccupantsOnPresence(attrs) {
        var _occupant_attributes, _occupant_attributes1;
        if (attrs.type === 'error' || !attrs.jid && !attrs.nick && !attrs.occupant_id) {
            return true;
        }
        const occupant = this.occupants.findOccupant(attrs);
        // Destroy an unavailable occupant if this isn't a nick change operation and if they're not affiliated
        if (attrs.type === 'unavailable' && occupant && !attrs.codes.includes(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_NICK_CHANGED_CODE) && ![
            'admin',
            'owner',
            'member'
        ].includes(attrs['affiliation'])) {
            // Before destroying we set the new attrs, so that we can show the disconnection message
            occupant.set(_object_spread_props(_object_spread({}, attrs), {
                presence: 'offline'
            }));
            occupant.destroy();
            return;
        }
        const presence = attrs.type !== 'unavailable' ? 'online' : 'offline';
        const jid = attrs.jid || '';
        const occupant_attrs = _object_spread_props(_object_spread({}, attrs), {
            presence,
            jid: strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(jid) || (occupant === null || occupant === void 0 ? void 0 : (_occupant_attributes = occupant.attributes) === null || _occupant_attributes === void 0 ? void 0 : _occupant_attributes.jid),
            resource: strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getResourceFromJid(jid) || (occupant === null || occupant === void 0 ? void 0 : (_occupant_attributes1 = occupant.attributes) === null || _occupant_attributes1 === void 0 ? void 0 : _occupant_attributes1.resource)
        });
        if (attrs.is_self) {
            let modified = false;
            if (attrs.codes.includes(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_NICK_CHANGED_CODE)) {
                modified = true;
                this.set('nick', attrs.nick);
            }
            if (this.features.get(strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.OCCUPANTID) && this.get('occupant-id') !== attrs.occupant_id) {
                modified = true;
                this.set('occupant_id', attrs.occupant_id);
            }
            modified && this.save();
        }
        if (occupant) {
            occupant.save(occupant_attrs);
        } else {
            this.occupants.create(occupant_attrs);
        }
    }
    /**
     * @param {MUCMessageAttributes} attrs
     */ fetchFeaturesIfConfigurationChanged(attrs) {
        // 104: configuration change
        // 170: logging enabled
        // 171: logging disabled
        // 172: room no longer anonymous
        // 173: room now semi-anonymous
        // 174: room now fully anonymous
        const codes = [
            '104',
            '170',
            '171',
            '172',
            '173',
            '174'
        ];
        if (attrs.codes.filter((code)=>codes.includes(code)).length) {
            this.refreshDiscoInfo();
        }
    }
    /**
     * Given two JIDs, which can be either user JIDs or MUC occupant JIDs,
     * determine whether they belong to the same user.
     * @param {String} jid1
     * @param {String} jid2
     * @returns {Boolean}
     */ isSameUser(jid1, jid2) {
        const bare_jid1 = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(jid1);
        const bare_jid2 = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getBareJidFromJid(jid2);
        const resource1 = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getResourceFromJid(jid1);
        const resource2 = strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getResourceFromJid(jid2);
        if (u.isSameBareJID(jid1, jid2)) {
            if (bare_jid1 === this.get('jid')) {
                // MUC JIDs
                return resource1 === resource2;
            } else {
                return true;
            }
        } else {
            const occupant1 = bare_jid1 === this.get('jid') ? this.occupants.findOccupant({
                'nick': resource1
            }) : this.occupants.findOccupant({
                'jid': bare_jid1
            });
            const occupant2 = bare_jid2 === this.get('jid') ? this.occupants.findOccupant({
                'nick': resource2
            }) : this.occupants.findOccupant({
                'jid': bare_jid2
            });
            return occupant1 === occupant2;
        }
    }
    isSubjectHidden() {
        return _async_to_generator(function*() {
            const jids = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].user.settings.get('mucs_with_hidden_subject', []);
            return jids.includes(this.get('jid'));
        }).call(this);
    }
    toggleSubjectHiddenState() {
        return _async_to_generator(function*() {
            const muc_jid = this.get('jid');
            const jids = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].user.settings.get('mucs_with_hidden_subject', []);
            if (jids.includes(this.get('jid'))) {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].user.settings.set('mucs_with_hidden_subject', jids.filter((jid)=>jid !== muc_jid));
            } else {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].user.settings.set('mucs_with_hidden_subject', [
                    ...jids,
                    muc_jid
                ]);
            }
        }).call(this);
    }
    /**
     * Handle a possible subject change and return `true` if so.
     * @param {object} attrs - Attributes representing a received
     *  message, as returned by {@link parseMUCMessage}
     */ handleSubjectChange(attrs) {
        return _async_to_generator(function*() {
            const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
            if (typeof attrs.subject === 'string' && !attrs.thread && !attrs.message) {
                // https://xmpp.org/extensions/xep-0045.html#subject-mod
                // -----------------------------------------------------
                // The subject is changed by sending a message of type "groupchat" to the <room@service>,
                // where the <message/> MUST contain a <subject/> element that specifies the new subject but
                // MUST NOT contain a <body/> element (or a <thread/> element).
                const subject = attrs.subject;
                const author = attrs.nick;
                (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_16__.safeSave)(this, {
                    'subject': {
                        author,
                        'text': attrs.subject || ''
                    }
                });
                if (!attrs.is_delayed && author) {
                    const message = subject ? __('Topic set by %1$s', author) : __('Topic cleared by %1$s', author);
                    const prev_msg = this.messages.last();
                    if ((prev_msg === null || prev_msg === void 0 ? void 0 : prev_msg.get('nick')) !== attrs.nick || (prev_msg === null || prev_msg === void 0 ? void 0 : prev_msg.get('type')) !== 'info' || (prev_msg === null || prev_msg === void 0 ? void 0 : prev_msg.get('message')) !== message) {
                        this.createMessage({
                            message,
                            'nick': attrs.nick,
                            'type': 'info',
                            'is_ephemeral': true
                        });
                    }
                    if (yield this.isSubjectHidden()) {
                        this.toggleSubjectHiddenState();
                    }
                }
                return true;
            }
            return false;
        }).call(this);
    }
    /**
     * Set the subject for this {@link MUC}
     * @param {String} value
     */ setSubject(value = '') {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send(stx`
            <message to="${this.get('jid')}" type="groupchat" xmlns="jabber:client">
                <subject>${value}</subject>
            </message>`);
    }
    /**
     * Is this a chat state notification that can be ignored,
     * because it's old or because it's from us.
     * @param {Object} attrs - The message attributes
     */ ignorableCSN(attrs) {
        return attrs.chat_state && !attrs.body && (attrs.is_delayed || this.isOwnMessage(attrs));
    }
    /**
     * Determines whether the message is from ourselves by checking
     * the `from` attribute. Doesn't check the `type` attribute.
     * @param {Object|Element|MUCMessage} msg
     * @returns {boolean}
     */ isOwnMessage(msg) {
        let from;
        if (msg instanceof Element) {
            from = msg.getAttribute('from');
        } else if (msg instanceof _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].exports.MUCMessage) {
            from = msg.get('from');
        } else {
            from = msg.from;
        }
        return strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.getResourceFromJid(from) == this.get('nick');
    }
    /**
     * @param {MUCMessage} message
     * @param {MUCMessageAttributes} attrs
     * @return {object}
     */ getUpdatedMessageAttributes(message, attrs) {
        const new_attrs = _object_spread({}, super.getUpdatedMessageAttributes(message, attrs), (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_27__["default"])(attrs, [
            'from_muc',
            'occupant_id'
        ]));
        if (this.isOwnMessage(attrs)) {
            const stanza_id_keys = Object.keys(attrs).filter((k)=>k.startsWith('stanza_id'));
            Object.assign(new_attrs, _object_spread({}, (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_27__["default"])(attrs, stanza_id_keys)), {
                body: attrs.body
            });
            if (!message.get('received')) {
                new_attrs.received = new Date().toISOString();
            }
        }
        return new_attrs;
    }
    /**
     * Send a MUC-0410 MUC Self-Ping stanza to room to determine
     * whether we're still joined.
     * @returns {Promise<boolean>}
     */ isJoined() {
        return _async_to_generator(function*() {
            if (!this.isEntered()) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].info(`isJoined: not pinging MUC ${this.get('jid')} since we're not entered`);
                return false;
            }
            if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].connection.connected()) {
                yield new Promise((resolve)=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].listen.once('reconnected', resolve));
            }
            return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].ping(`${this.get('jid')}/${this.get('nick')}`);
        }).call(this);
    }
    /**
     * Sends a status update presence (i.e. based on the `<show>` element)
     * @param {import("../status/types").presence_attrs} attrs
     * @param {Element[]|Builder[]|Element|Builder} [child_nodes]
     *  Nodes(s) to be added as child nodes of the `presence` XML element.
     */ sendStatusPresence(attrs, child_nodes) {
        return _async_to_generator(function*() {
            if (this.session.get('connection_status') === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.ENTERED) {
                const presence = yield _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].state.profile.constructPresence(_object_spread_props(_object_spread({}, attrs), {
                    to: `${this.get('jid')}/${this.get('nick')}`
                }), /** @type {Element[]|Builder[]} */ child_nodes === null || child_nodes === void 0 ? void 0 : child_nodes.map((c)=>{
                    var _c_tree;
                    return (_c_tree = c === null || c === void 0 ? void 0 : c.tree()) !== null && _c_tree !== void 0 ? _c_tree : c;
                }));
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].send(presence);
            }
        }).call(this);
    }
    /**
     * Check whether we're still joined and re-join if not
     */ rejoinIfNecessary() {
        return _async_to_generator(function*() {
            if (this.isRAICandidate()) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].debug(`rejoinIfNecessary: not rejoining hidden MUC "${this.get('jid')}" since we're using RAI`);
                return true;
            }
            if (!(yield this.isJoined())) {
                this.rejoin();
                return true;
            }
        }).call(this);
    }
    /**
     * @param {object} attrs
     * @returns {Promise<boolean>}
     */ shouldShowErrorMessage(attrs) {
        var _this = this, _superprop_get_shouldShowErrorMessage = ()=>super.shouldShowErrorMessage;
        return _async_to_generator(function*() {
            if (attrs.error_type === 'Decryption') {
                if (attrs.error_message === 'Message key not found. The counter was repeated or the key was not filled.') {
                    // OMEMO message which we already decrypted before
                    return false;
                } else if (attrs.error_condition === 'not-encrypted-for-this-device') {
                    return false;
                }
            } else if (attrs.error_condition === 'not-acceptable' && (yield this.rejoinIfNecessary())) {
                return false;
            }
            return _superprop_get_shouldShowErrorMessage().call(_this, attrs);
        }).call(this);
    }
    /**
     * Looks whether we already have a moderation message for this
     * incoming message. If so, it's considered "dangling" because
     * it probably hasn't been applied to anything yet, given that
     * the relevant message is only coming in now.
     * @param {object} attrs - Attributes representing a received
     *  message, as returned by {@link parseMUCMessage}
     * @returns {MUCMessage}
     */ findDanglingModeration(attrs) {
        if (!this.messages.length) {
            return null;
        }
        // Only look for dangling moderation if there are newer
        // messages than this one, since moderation come after.
        if (this.messages.last().get('time') > attrs.time) {
            // Search from latest backwards
            const messages = Array.from(this.messages.models);
            const stanza_id = attrs[`stanza_id ${this.get('jid')}`];
            if (!stanza_id) {
                return null;
            }
            messages.reverse();
            return messages.find(({ attributes })=>attributes.moderated === 'retracted' && attributes.moderated_id === stanza_id && attributes.moderated_by);
        }
    }
    /**
     * Handles message moderation based on the passed in attributes.
     * @param {object} attrs - Attributes representing a received
     *  message, as returned by {@link parseMUCMessage}
     * @returns {Promise<boolean>} Returns `true` or `false` depending on
     *  whether a message was moderated or not.
     */ handleModeration(attrs) {
        return _async_to_generator(function*() {
            const MODERATION_ATTRIBUTES = [
                'editable',
                'moderated',
                'moderated_by',
                'moderated_by_id',
                'moderated_id',
                'moderation_reason'
            ];
            if (attrs.moderated === 'retracted') {
                const query = {};
                const key = `stanza_id ${this.get('jid')}`;
                query[key] = attrs.moderated_id;
                const message = this.messages.findWhere(query);
                if (!message) {
                    attrs['dangling_moderation'] = true;
                    yield this.createMessage(attrs);
                    return true;
                }
                message.save((0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_27__["default"])(attrs, MODERATION_ATTRIBUTES));
                return true;
            } else {
                // Check if we have dangling moderation message
                const message = this.findDanglingModeration(attrs);
                if (message) {
                    const moderation_attrs = (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_27__["default"])(message.attributes, MODERATION_ATTRIBUTES);
                    const new_attrs = Object.assign({
                        dangling_moderation: false
                    }, attrs, moderation_attrs);
                    delete new_attrs['id']; // Delete id, otherwise a new cache entry gets created
                    message.save(new_attrs);
                    return true;
                }
            }
            return false;
        }).call(this);
    }
    getNotificationsText() {
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
        const actors_per_state = this.notifications.toJSON();
        const role_changes = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_show_info_messages').filter((role_change)=>_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES_LIST.includes(role_change));
        const join_leave_events = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_show_info_messages').filter((join_leave_event)=>_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES_LIST.includes(join_leave_event));
        const states = [
            ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].CHAT_STATES,
            ...join_leave_events,
            ...role_changes
        ];
        return states.reduce((result, state)=>{
            const existing_actors = actors_per_state[state];
            if (!(existing_actors === null || existing_actors === void 0 ? void 0 : existing_actors.length)) {
                return result;
            }
            const actors = existing_actors.map((a)=>{
                var _this_getOccupant;
                return ((_this_getOccupant = this.getOccupant(a)) === null || _this_getOccupant === void 0 ? void 0 : _this_getOccupant.getDisplayName()) || a;
            });
            if (actors.length === 1) {
                if (state === 'composing') {
                    return `${result}${__('%1$s is typing', actors[0])}\n`;
                } else if (state === 'paused') {
                    return `${result}${__('%1$s has stopped typing', actors[0])}\n`;
                } else if (state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.GONE) {
                    return `${result}${__('%1$s has gone away', actors[0])}\n`;
                } else if (state === 'entered') {
                    return `${result}${__('%1$s has entered the groupchat', actors[0])}\n`;
                } else if (state === 'exited') {
                    return `${result}${__('%1$s has left the groupchat', actors[0])}\n`;
                } else if (state === 'op') {
                    return `${result}${__('%1$s is now a moderator', actors[0])}\n`;
                } else if (state === 'deop') {
                    return `${result}${__('%1$s is no longer a moderator', actors[0])}\n`;
                } else if (state === 'voice') {
                    return `${result}${__('%1$s has been given a voice', actors[0])}\n`;
                } else if (state === 'mute') {
                    return `${result}${__('%1$s has been muted', actors[0])}\n`;
                }
            } else if (actors.length > 1) {
                let actors_str;
                if (actors.length > 3) {
                    actors_str = `${Array.from(actors).slice(0, 2).join(', ')} and others`;
                } else {
                    const last_actor = actors.pop();
                    actors_str = __('%1$s and %2$s', actors.join(', '), last_actor);
                }
                if (state === 'composing') {
                    return `${result}${__('%1$s are typing', actors_str)}\n`;
                } else if (state === 'paused') {
                    return `${result}${__('%1$s have stopped typing', actors_str)}\n`;
                } else if (state === _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.GONE) {
                    return `${result}${__('%1$s have gone away', actors_str)}\n`;
                } else if (state === 'entered') {
                    return `${result}${__('%1$s have entered the groupchat', actors_str)}\n`;
                } else if (state === 'exited') {
                    return `${result}${__('%1$s have left the groupchat', actors_str)}\n`;
                } else if (state === 'op') {
                    return `${result}${__('%1$s are now moderators', actors[0])}\n`;
                } else if (state === 'deop') {
                    return `${result}${__('%1$s are no longer moderators', actors[0])}\n`;
                } else if (state === 'voice') {
                    return `${result}${__('%1$s have been given voices', actors[0])}\n`;
                } else if (state === 'mute') {
                    return `${result}${__('%1$s have been muted', actors[0])}\n`;
                }
            }
            return result;
        }, '');
    }
    /**
     * @param { String } actor - The nickname of the actor that caused the notification
     * @param {String|Array<String>} states - The state or states representing the type of notificcation
     */ removeNotification(actor, states) {
        const actors_per_state = this.notifications.toJSON();
        states = Array.isArray(states) ? states : [
            states
        ];
        states.forEach((state)=>{
            const existing_actors = Array.from(actors_per_state[state] || []);
            if (existing_actors.includes(actor)) {
                const idx = existing_actors.indexOf(actor);
                existing_actors.splice(idx, 1);
                this.notifications.set(state, Array.from(existing_actors));
            }
        });
    }
    /**
     * Update the notifications model by adding the passed in nickname
     * to the array of nicknames that all match a particular state.
     *
     * Removes the nickname from any other states it might be associated with.
     *
     * The state can be a XEP-0085 Chat State or a XEP-0045 join/leave state.
     * @param {String} actor - The nickname of the actor that causes the notification
     * @param {String} state - The state representing the type of notificcation
     */ updateNotifications(actor, state) {
        const actors_per_state = this.notifications.toJSON();
        const existing_actors = actors_per_state[state] || [];
        if (existing_actors.includes(actor)) {
            return;
        }
        const reducer = (out, s)=>{
            if (s === state) {
                out[s] = [
                    ...existing_actors,
                    actor
                ];
            } else {
                out[s] = (actors_per_state[s] || []).filter((a)=>a !== actor);
            }
            return out;
        };
        const actors_per_chat_state = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].CHAT_STATES.reduce(reducer, {});
        const actors_per_traffic_state = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_TRAFFIC_STATES_LIST.reduce(reducer, {});
        const actors_per_role_change = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES_LIST.reduce(reducer, {});
        this.notifications.set(Object.assign(actors_per_chat_state, actors_per_traffic_state, actors_per_role_change));
        setTimeout(()=>this.removeNotification(actor, state), 10000);
    }
    /**
     * @param {MessageAttributes} attrs
     * @returns {boolean}
     */ handleMUCPrivateMessage(attrs) {
        if (attrs.type === 'chat' || attrs.type === null) {
            const occupant = this.occupants.findOccupant(attrs);
            if (occupant) {
                return occupant.queueMessage(attrs);
            }
        // TODO create occupant?
        }
        return false;
    }
    /**
     * @param {MessageAttributes} attrs
     * @returns {boolean}
     */ handleMetadataFastening(attrs) {
        if (attrs.ogp_for_id) {
            if (attrs.from !== this.get('jid')) {
                // For now we only allow metadata from the MUC itself and not
                // from individual users who are deemed less trustworthy.
                return false;
            }
            const message = this.messages.findWhere({
                'origin_id': attrs.ogp_for_id
            });
            if (message) {
                const old_list = message.get('ogp_metadata') || [];
                if (old_list.filter((m)=>m['og:url'] === attrs['og:url']).length) {
                    // Don't add metadata for the same URL again
                    return false;
                }
                const list = [
                    ...old_list,
                    (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_27__["default"])(attrs, _shared_constants_js__WEBPACK_IMPORTED_MODULE_9__.METADATA_ATTRIBUTES)
                ];
                message.save('ogp_metadata', list);
                return true;
            }
        }
        return false;
    }
    /**
     * Given {@link MessageAttributes} look for XEP-0316 Room Notifications and create info
     * messages for them.
     * @param {MUCMessageAttributes} attrs
     * @returns {boolean}
     */ handleMEPNotification(attrs) {
        var _attrs_activities;
        if (attrs.from !== this.get('jid') || !attrs.activities) {
            return false;
        }
        (_attrs_activities = attrs.activities) === null || _attrs_activities === void 0 ? void 0 : _attrs_activities.forEach((activity_attrs)=>{
            const data = Object.assign(attrs, activity_attrs);
            this.createMessage(data);
            // Trigger so that notifications are shown
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].trigger('message', {
                'attrs': data,
                'chatbox': this
            });
        });
        return !!attrs.activities.length;
    }
    /**
     * Returns an already cached message (if it exists) based on the
     * passed in attributes map.
     * @param {object} attrs - Attributes representing a received
     *  message, as returned by {@link parseMUCMessage}
     * @returns {MUCMessage|BaseMessage}
     */ getDuplicateMessage(attrs) {
        var _attrs_activities;
        if ((_attrs_activities = attrs.activities) === null || _attrs_activities === void 0 ? void 0 : _attrs_activities.length) {
            return this.messages.findWhere({
                type: 'mep',
                msgid: attrs.msgid
            });
        } else {
            return super.getDuplicateMessage(attrs);
        }
    }
    /**
     * Handler for all MUC messages sent to this groupchat. This method
     * shouldn't be called directly, instead {@link MUC#queueMessage}
     * should be called.
     * @param {MUCMessageAttributes|StanzaParseError} attrs_or_error - A promise which resolves to the message attributes.
     */ onMessage(attrs_or_error) {
        return _async_to_generator(function*() {
            if (u.isErrorObject(attrs_or_error)) {
                return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(/** @type {Error} */ attrs_or_error.message);
            }
            const attrs = /** @type {MUCMessageAttributes} */ attrs_or_error;
            if (attrs.type === 'error' && !(yield this.shouldShowErrorMessage(attrs))) {
                return;
            }
            const message = this.getDuplicateMessage(attrs);
            if (message) {
                message.get('type') === 'groupchat' && this.updateMessage(message, attrs);
                return;
            } else if (attrs.receipt_id || attrs.is_marker || this.ignorableCSN(attrs)) {
                return;
            }
            if (this.handleMUCPrivateMessage(attrs) || this.handleMetadataFastening(attrs) || this.handleMEPNotification(attrs) || (yield this.handleModeration(attrs)) || (yield this.handleRetraction(attrs)) || (yield this.handleSubjectChange(attrs))) {
                attrs.nick && this.removeNotification(attrs.nick, [
                    'composing',
                    'paused'
                ]);
                return;
            }
            this.setEditable(attrs, attrs.time);
            if (attrs['chat_state']) {
                this.updateNotifications(attrs.nick, attrs.chat_state);
            }
            if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.shouldCreateGroupchatMessage)(attrs)) {
                const msg = (yield this.handleCorrection(attrs)) || (yield this.createMessage(attrs));
                this.removeNotification(attrs.nick, [
                    'composing',
                    'paused'
                ]);
                this.handleUnreadMessage(msg);
            }
        }).call(this);
    }
    /**
     * @param {Element} pres
     */ handleModifyError(pres) {
        var _pres_querySelector;
        const text = (_pres_querySelector = pres.querySelector('error text')) === null || _pres_querySelector === void 0 ? void 0 : _pres_querySelector.textContent;
        if (text) {
            if (this.session.get('connection_status') === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.CONNECTING) {
                this.setDisconnectionState(text);
            } else {
                const attrs = {
                    'type': 'error',
                    'message': text,
                    'is_ephemeral': true
                };
                this.createMessage(attrs);
            }
        }
    }
    /**
     * Handle a presence stanza that disconnects the user from the MUC
     * @param {MUCPresenceAttributes} attrs - The stanza
     */ handleDisconnection(attrs) {
        const { is_self, reason, actor } = attrs;
        const codes = attrs.codes.filter((c)=>_constants_js__WEBPACK_IMPORTED_MODULE_8__.DISCONNECT_CODES.includes(c));
        const disconnected = is_self && codes.length > 0;
        if (!disconnected) {
            return;
        }
        const { STATUS_CODE_MESSAGES } = /** @type {UserMessage} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].labels.muc;
        const message = STATUS_CODE_MESSAGES[codes[0]];
        const status = codes.includes('301') ? _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.BANNED : _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED;
        this.setDisconnectionState(message, reason, actor === null || actor === void 0 ? void 0 : actor.nick, status);
    }
    /**
     * @param {import('./types').MUCStatusCode} code
     * @param {MUCPresenceAttributes} attrs
     */ getActionInfoMessage(code, attrs) {
        const { nick, actor } = attrs;
        const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
        if (code === '301') {
            return (actor === null || actor === void 0 ? void 0 : actor.nick) ? __('%1$s has been banned by %2$s', nick, actor.nick) : __('%1$s has been banned', nick);
        } else if (code === '303') {
            return __("%1$s's nickname has changed", nick);
        } else if (code === '307') {
            return (actor === null || actor === void 0 ? void 0 : actor.nick) ? __('%1$s has been kicked out by %2$s', nick, actor.nick) : __('%1$s has been kicked out', nick);
        } else if (code === '321') {
            return __('%1$s has been removed because of an affiliation change', nick);
        } else if (code === '322') {
            return __('%1$s has been removed for not being a member', nick);
        }
    }
    /**
     * @param {MUCOccupant} occupant
     */ createAffiliationChangeMessage(occupant) {
        const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
        const previous_affiliation = occupant._previousAttributes.affiliation;
        if (!previous_affiliation) {
            // If no previous affiliation was set, then we don't
            // interpret this as an affiliation change.
            // For example, if muc_send_probes is true, then occupants
            // are created based on incoming messages, in which case
            // we don't yet know the affiliation
            return;
        }
        const current_affiliation = occupant.get('affiliation');
        if (previous_affiliation === 'admin' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.EXADMIN)) {
            this.createMessage({
                type: 'info',
                message: __('%1$s is no longer an admin of this groupchat', occupant.get('nick'))
            });
        } else if (previous_affiliation === 'owner' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.EXOWNER)) {
            this.createMessage({
                type: 'info',
                message: __('%1$s is no longer an owner of this groupchat', occupant.get('nick'))
            });
        } else if (previous_affiliation === 'outcast' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.EXOUTCAST)) {
            this.createMessage({
                type: 'info',
                message: __('%1$s is no longer banned from this groupchat', occupant.get('nick'))
            });
        }
        if (current_affiliation === 'none' && previous_affiliation === 'member' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.EXMEMBER)) {
            this.createMessage({
                type: 'info',
                message: __('%1$s is no longer a member of this groupchat', occupant.get('nick'))
            });
        }
        if (current_affiliation === 'member' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.MEMBER)) {
            this.createMessage({
                type: 'info',
                message: __('%1$s is now a member of this groupchat', occupant.get('nick'))
            });
        } else if (current_affiliation === 'admin' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.ADMIN) || current_affiliation == 'owner' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].AFFILIATION_CHANGES.OWNER)) {
            // For example: AppleJack is now an (admin|owner) of this groupchat
            this.createMessage({
                type: 'info',
                message: __('%1$s is now an %2$s of this groupchat', occupant.get('nick'), current_affiliation)
            });
        }
    }
    createRoleChangeMessage(occupant, changed) {
        if (changed === 'none' || occupant.changed.affiliation) {
            // We don't inform of role changes if they accompany affiliation changes.
            return;
        }
        const previous_role = occupant._previousAttributes.role;
        if (previous_role === 'moderator' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.DEOP)) {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.DEOP);
        } else if (previous_role === 'visitor' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.VOICE)) {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.VOICE);
        }
        if (occupant.get('role') === 'visitor' && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.MUTE)) {
            this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.MUTE);
        } else if (occupant.get('role') === 'moderator') {
            if (![
                'owner',
                'admin'
            ].includes(occupant.get('affiliation')) && (0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(_shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.OP)) {
                // Oly show this message if the user isn't already
                // an admin or owner, otherwise this isn't new information.
                this.updateNotifications(occupant.get('nick'), _shared_api_public_js__WEBPACK_IMPORTED_MODULE_7__["default"].MUC_ROLE_CHANGES.OP);
            }
        }
    }
    /**
     * Create an info message based on a received MUC status code in a
     * <presence> stanza.
     * @param {import('./types').MUCStatusCode} code
     * @param {MUCPresenceAttributes} attrs - The original stanza
     */ createInfoMessageFromPresence(code, attrs) {
        const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
        var _attrs_is_self;
        const is_self = (_attrs_is_self = /** @type {MUCPresenceAttributes} */ attrs.is_self) !== null && _attrs_is_self !== void 0 ? _attrs_is_self : false;
        if (!_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible || code === '110' || code === '100' && !is_self) {
            return;
        }
        const { STATUS_CODE_MESSAGES } = /** @type {UserMessage} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].labels.muc;
        const message = STATUS_CODE_MESSAGES[code];
        const data = {
            type: 'info',
            is_ephemeral: true,
            message,
            code
        };
        if (!is_self && _constants_js__WEBPACK_IMPORTED_MODULE_8__.ACTION_INFO_CODES.includes(code)) {
            data.message = this.getActionInfoMessage(code, attrs);
            data.reason = attrs.reason;
        } else if (is_self && _constants_js__WEBPACK_IMPORTED_MODULE_8__.NEW_NICK_CODES.includes(code)) {
            data.message = attrs.nick ? __(message, attrs.nick) : undefined;
        }
        if (data.message) {
            if (code === '201' && this.messages.findWhere(data)) {
                return;
            }
            this.createMessage(data);
        }
    }
    /**
     * Create an info message based on a received MUC status code in a <message> stanza.
     * @param {import('./types').MUCStatusCode} code
     */ createInfoMessage(code) {
        if (!(0,_utils_js__WEBPACK_IMPORTED_MODULE_24__.isInfoVisible)(code) || code === '110') {
            return;
        }
        const { STATUS_CODE_MESSAGES } = /** @type {UserMessage} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].labels.muc;
        const message = STATUS_CODE_MESSAGES[code];
        if (message) {
            this.createMessage({
                type: 'info',
                is_ephemeral: true,
                message,
                code
            });
        }
    }
    /**
     * Set parameters regarding disconnection from this room. This helps to
     * communicate to the user why they were disconnected.
     * @param {string} message - The disconnection message, as received from (or
     *  implied by) the server.
     * @param {string} [reason] - The reason provided for the disconnection
     * @param {string} [actor] - The person (if any) responsible for this disconnection
     * @param {number} [status] - The status code (see `ROOMSTATUS`)
     */ setDisconnectionState(message, reason, actor, status = _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED) {
        this.session.save({
            'connection_status': status,
            'disconnection_actor': actor,
            'disconnection_message': message,
            'disconnection_reason': reason
        });
    }
    /**
     * @param {Element} presence
     */ onNicknameClash(presence) {
        const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_nickname_from_jid')) {
            const nick = presence.getAttribute('from').split('/')[1];
            if (nick === _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].exports.getDefaultMUCNickname()) {
                this.join(nick + '-2');
            } else {
                const del = nick.lastIndexOf('-');
                const num = nick.substring(del + 1, nick.length);
                this.join(nick.substring(0, del + 1) + String(Number(num) + 1));
            }
        } else {
            this.save({
                'nickname_validation_message': __('The nickname you chose is reserved or ' + 'currently in use, please choose a different one.')
            });
            this.session.save({
                'connection_status': _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.NICKNAME_REQUIRED
            });
        }
    }
    /**
     * Parses a <presence> stanza with type "error" and sets the proper
     * `connection_status` value for this {@link MUC} as
     * well as any additional output that can be shown to the user.
     * @param {Element} stanza - The presence stanza
     */ onErrorPresence(stanza) {
        var _sizzle_pop;
        const __ = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].__;
        const error = stanza.querySelector('error');
        const error_type = error.getAttribute('type');
        const reason = (_sizzle_pop = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`text[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.STANZAS}"]`, error).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.textContent;
        if (error_type === 'modify') {
            this.handleModifyError(stanza);
        } else if (error_type === 'auth') {
            if (sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`not-authorized[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.STANZAS}"]`, error).length) {
                this.save({
                    'password_validation_message': reason || __('Password incorrect')
                });
                this.session.save({
                    'connection_status': _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.PASSWORD_REQUIRED
                });
            }
            if (error.querySelector('registration-required')) {
                const message = __('You are not on the member list of this groupchat.');
                this.setDisconnectionState(message, reason);
            } else if (error.querySelector('forbidden')) {
                const { STATUS_CODE_MESSAGES } = /** @type {UserMessage} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].labels.muc;
                this.setDisconnectionState(STATUS_CODE_MESSAGES[301], reason, null, _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.BANNED);
            }
        } else if (error_type === 'cancel') {
            if (error.querySelector('not-allowed')) {
                const message = __('You are not allowed to create new groupchats.');
                this.setDisconnectionState(message, reason);
            } else if (error.querySelector('not-acceptable')) {
                const message = __("Your nickname doesn't conform to this groupchat's policies.");
                this.setDisconnectionState(message, reason);
            } else if (sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`gone[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.STANZAS}"]`, error).length) {
                var _sizzle_pop1;
                const moved_jid = (_sizzle_pop1 = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`gone[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.STANZAS}"]`, error).pop()) === null || _sizzle_pop1 === void 0 ? void 0 : _sizzle_pop1.textContent.replace(/^xmpp:/, '').replace(/\?join$/, '');
                this.save({
                    moved_jid,
                    'destroyed_reason': reason
                });
                this.session.save({
                    'connection_status': _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DESTROYED
                });
            } else if (error.querySelector('conflict')) {
                this.onNicknameClash(stanza);
            } else if (error.querySelector('item-not-found')) {
                const message = __('This groupchat does not (yet) exist.');
                this.setDisconnectionState(message, reason);
            } else if (error.querySelector('service-unavailable')) {
                const message = __('This groupchat has reached its maximum number of participants.');
                this.setDisconnectionState(message, reason);
            } else if (error.querySelector('remote-server-not-found')) {
                const message = __('Remote server not found');
                this.setDisconnectionState(message, reason);
            } else if (error.querySelector('forbidden')) {
                const message = __("You're not allowed to enter this groupchat");
                this.setDisconnectionState(message, reason);
            } else {
                const message = __('An error happened while trying to enter this groupchat');
                this.setDisconnectionState(message, reason);
            }
        }
    }
    /**
     * Listens for incoming presence stanzas from the service that hosts this MUC
     * @param {Element} stanza - The presence stanza
     */ onPresenceFromMUCHost(stanza) {
        if (stanza.getAttribute('type') === 'error') {
            const error = stanza.querySelector('error');
            if ((error === null || error === void 0 ? void 0 : error.getAttribute('type')) === 'wait' && (error === null || error === void 0 ? void 0 : error.querySelector('resource-constraint'))) {
                // If we get a <resource-constraint> error, we assume it's in context of XEP-0437 RAI.
                // We remove this MUC's host from the list of enabled domains and rejoin the MUC.
                if (this.session.get('connection_status') === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.DISCONNECTED) {
                    this.rejoin();
                }
            }
        }
    }
    /**
     * Handles incoming presence stanzas coming from the MUC
     * @param {Element} stanza
     */ onPresence(stanza) {
        return _async_to_generator(function*() {
            if (stanza.getAttribute('type') === 'error') {
                return this.onErrorPresence(stanza);
            }
            const attrs = yield (0,_parsers_js__WEBPACK_IMPORTED_MODULE_18__.parseMUCPresence)(stanza, this);
            attrs.codes.forEach((code)=>_async_to_generator(function*() {
                    this.createInfoMessageFromPresence(code, attrs);
                    if (attrs.is_self && _constants_js__WEBPACK_IMPORTED_MODULE_8__.NEW_NICK_CODES.includes(code)) {
                        this.save('nick', attrs.nick);
                        if (code === '303' && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('auto_register_muc_nickname') && (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].disco.supports(strophe_js__WEBPACK_IMPORTED_MODULE_10__.Strophe.NS.MUC_REGISTER, this.get('jid')))) {
                            try {
                                yield this.registerNickname();
                            } catch (e) {
                                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error('Error: could not register new nickname');
                            }
                        }
                    }
                }).call(this));
            if (attrs.is_self) {
                this.onOwnPresence(attrs);
                if (this.getOwnRole() !== 'none' && this.session.get('connection_status') === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.CONNECTING) {
                    this.session.save('connection_status', _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.CONNECTED);
                }
            } else {
                this.updateOccupantsOnPresence(attrs);
            }
        }).call(this);
    }
    /**
     * Handles a received presence relating to the current user.
     *
     * For locked groupchats (which are by definition "new"), the
     * groupchat will either be auto-configured or created instantly
     * (with default config) or a configuration groupchat will be
     * rendered.
     *
     * If the groupchat is not locked, then the groupchat will be
     * auto-configured only if applicable and if the current
     * user is the groupchat's owner.
     * @param {MUCPresenceAttributes} attrs
     */ onOwnPresence(attrs) {
        return _async_to_generator(function*() {
            yield this.occupants.fetched;
            if (attrs['type'] === 'unavailable') {
                this.handleDisconnection(attrs);
                return;
            }
            const old_status = this.session.get('connection_status');
            if (old_status !== _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.ENTERED && old_status !== _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.CLOSING) {
                // Set connection_status before creating the occupant, but
                // only trigger afterwards, so that plugins can access the
                // occupant in their event handlers.
                this.session.save('connection_status', _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROOMSTATUS.ENTERED, {
                    'silent': true
                });
                this.updateOccupantsOnPresence(attrs);
                this.session.trigger('change:connection_status', this.session, old_status);
            } else {
                this.updateOccupantsOnPresence(attrs);
            }
            const locked_room = attrs.codes.includes('201');
            if (locked_room) {
                if (this.get('auto_configure')) {
                    yield this.autoConfigureChatRoom().then(()=>this.refreshDiscoInfo());
                } else if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get('muc_instant_rooms')) {
                    // Accept default configuration
                    yield this.sendConfiguration().then(()=>this.refreshDiscoInfo());
                } else {
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].modal.show('converse-muc-config-modal', {
                        model: this
                    });
                }
            }
        }).call(this);
    }
    /**
     * Returns a boolean to indicate whether the current user
     * was mentioned in a message.
     * @param {BaseMessage} message - The text message
     */ isUserMentioned(message) {
        const nick = this.get('nick');
        if (message.get('references').length) {
            const mentions = message.get('references').filter((ref)=>ref.type === 'mention').map((ref)=>ref.value);
            return mentions.includes(nick);
        } else {
            return new RegExp(`\\b${nick}\\b`).test(message.get('body'));
        }
    }
    /**
     * @param {BaseMessage} message - The text message
     */ incrementUnreadMsgsCounter(message) {
        const settings = {
            'num_unread_general': this.get('num_unread_general') + 1
        };
        if (this.get('num_unread_general') === 0) {
            settings['first_unread_id'] = message.get('id');
        }
        if (this.isUserMentioned(message)) {
            settings.num_unread = this.get('num_unread') + 1;
        }
        this.save(settings);
    }
    clearUnreadMsgCounter() {
        return _async_to_generator(function*() {
            if (this.get('num_unread_general') > 0 || this.get('num_unread') > 0 || this.get('has_activity')) {
                yield this.sendMarkerForMessage(this.messages.last());
            }
            (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_16__.safeSave)(this, {
                'has_activity': false,
                'num_unread': 0,
                'num_unread_general': 0
            });
        }).call(this);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUC);


/***/ }),

/***/ "./src/headless/plugins/muc/occupant.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/muc/occupant.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/color.js */ "./src/headless/shared/color.js");
/* harmony import */ var _shared_model_with_messages_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/model-with-messages.js */ "./src/headless/shared/model-with-messages.js");
/* harmony import */ var _shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/model-with-vcard */ "./src/headless/shared/model-with-vcard.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants.js */ "./src/headless/plugins/muc/constants.js");
/* harmony import */ var _messages_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./messages.js */ "./src/headless/plugins/muc/messages.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./src/headless/plugins/muc/utils.js");
/* harmony import */ var _shared_actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../shared/actions */ "./src/headless/shared/actions.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}













const { Strophe, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
/**
 * Represents a participant in a MUC
 */ class MUCOccupant extends (0,_shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_shared_model_with_messages_js__WEBPACK_IMPORTED_MODULE_6__["default"])((0,_shared_color_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model))) {
    /**
     * @typedef {import('../../shared/types').MessageAttributes} MessageAttributes
     * @typedef {import('../../shared/errors').StanzaParseError} StanzaParseError
     */ initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            this.lazy_load_vcard = true;
            _superprop_get_initialize().call(_this);
            yield this.fetchMessages();
            this.on("change:nick", ()=>this.setColor());
            this.on("change:jid", ()=>this.setColor());
            this.on("change:chat_state", ()=>(0,_shared_actions__WEBPACK_IMPORTED_MODULE_12__.sendChatState)(this.get("jid"), this.get("chat_state")));
        }).call(this);
    }
    defaults() {
        return {
            hats: [],
            presence: 'offline',
            show: undefined,
            states: [],
            hidden: true,
            num_unread: 0,
            message_type: "chat"
        };
    }
    save(key, val, options) {
        let attrs;
        if (key == null) {
            // eslint-disable-line no-eq-null
            return super.save(key, val, options);
        } else if (typeof key === "object") {
            attrs = key;
            options = val;
        } else {
            (attrs = {})[key] = val;
        }
        if (attrs.occupant_id) {
            attrs.id = attrs.occupant_id;
        }
        return super.save(attrs, options);
    }
    getMessagesCacheKey() {
        const id = this.get('occupant_id') || this.get('jid') || this.get('nick');
        return `converse.muc-private-msgs-${id}-${_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].session.get('bare_jid')}`;
    }
    getMessagesCollection() {
        return new _messages_js__WEBPACK_IMPORTED_MODULE_9__["default"]();
    }
    /**
     * Handler for all MUC private messages sent to this occupant.
     * This method houldn't be called directly, instead {@link MUC#queueMessage} should be called.
     * @param {MessageAttributes|StanzaParseError} attrs_or_error
     */ onMessage(attrs_or_error) {
        return _async_to_generator(function*() {
            if (_utils_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].isErrorObject(attrs_or_error)) {
                const { stanza, message } = /** @type {StanzaParseError} */ attrs_or_error;
                if (stanza) _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error(stanza);
                return _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error(message);
            }
            const attrs = /** @type {MessageAttributes} */ attrs_or_error;
            if (attrs.type === "error" && !(yield this.shouldShowErrorMessage(attrs))) {
                return;
            }
            const message = this.getDuplicateMessage(attrs);
            if (message) {
                this.updateMessage(message, attrs);
                return;
            } else if (yield this.handleRetraction(attrs)) {
                return;
            }
            this.setEditable(attrs, attrs.time);
            if ((0,_utils__WEBPACK_IMPORTED_MODULE_11__.shouldCreateGroupchatMessage)(attrs)) {
                const msg = (yield this.handleCorrection(attrs)) || (yield this.createMessage(attrs));
                this.handleUnreadMessage(msg);
            }
        }).call(this);
    }
    /**
     * @returns {string}
     */ getDisplayName() {
        return this.get("nick") || this.get("jid") || "";
    }
    /**
     * Return roles which may be assigned to this occupant
     * @returns {typeof ROLES} - An array of assignable roles
     */ getAssignableRoles() {
        let disabled = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get("modtools_disable_assign");
        if (!Array.isArray(disabled)) {
            disabled = disabled ? _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROLES : [];
        }
        if (this.get("role") === "moderator") {
            return _constants_js__WEBPACK_IMPORTED_MODULE_8__.ROLES.filter((r)=>!disabled.includes(r));
        } else {
            return [];
        }
    }
    /**
     * Return affiliations which may be assigned by this occupant
     * @returns {typeof AFFILIATIONS} An array of assignable affiliations
     */ getAssignableAffiliations() {
        let disabled = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get("modtools_disable_assign");
        if (!Array.isArray(disabled)) {
            disabled = disabled ? _constants_js__WEBPACK_IMPORTED_MODULE_8__.AFFILIATIONS : [];
        }
        if (this.get("affiliation") === "owner") {
            return _constants_js__WEBPACK_IMPORTED_MODULE_8__.AFFILIATIONS.filter((a)=>!disabled.includes(a));
        } else if (this.get("affiliation") === "admin") {
            return _constants_js__WEBPACK_IMPORTED_MODULE_8__.AFFILIATIONS.filter((a)=>![
                    "owner",
                    "admin",
                    ...disabled
                ].includes(a));
        } else {
            return [];
        }
    }
    isMember() {
        return [
            "admin",
            "owner",
            "member"
        ].includes(this.get("affiliation"));
    }
    isModerator() {
        return [
            "admin",
            "owner"
        ].includes(this.get("affiliation")) || this.get("role") === "moderator";
    }
    isSelf() {
        return this.get("states").includes("110");
    }
    /**
     * @param {MessageAttributes} [attrs]
     * @return {Promise<MessageAttributes>}
     */ getOutgoingMessageAttributes(attrs) {
        return _async_to_generator(function*() {
            const origin_id = _utils_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].getUniqueId();
            const text = attrs === null || attrs === void 0 ? void 0 : attrs.body;
            const body = text ? _utils_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].shortnamesToUnicode(text) : undefined;
            const muc = this.collection.chatroom;
            const own_occupant = muc.getOwnOccupant();
            var _this_get;
            attrs = Object.assign({}, attrs, {
                body,
                from: own_occupant.get("from"),
                fullname: _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].state.profile.get("fullname"),
                id: origin_id,
                jid: this.get("jid"),
                message: body,
                msgid: origin_id,
                nick: own_occupant.get("nickname"),
                origin_id,
                sender: "me",
                time: new Date().toISOString(),
                to: (_this_get = this.get("from")) !== null && _this_get !== void 0 ? _this_get : `${muc.get("jid")}/${this.get("nick")}`,
                type: "chat"
            }, (yield _utils_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].getMediaURLsMetadata(text)));
            /**
         * *Hook* which allows plugins to update the attributes of an outgoing message.
         * These attributes get set on the {@link Message} and persisted.
         * @event _converse#getOutgoingMessageAttributes
         * @param {MUCOccupant} chat
         *      The chat from which this message will be sent.
         * @param {MessageAttributes} attrs
         *      The message attributes, from which the stanza will be created.
         */ attrs = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].hook("getOutgoingMessageAttributes", this, attrs);
            return attrs;
        }).call(this);
    }
    /**
     * @param {import('../chat/message').default} message - The message object
     */ createMessageStanza(message) {
        var _this = this, _superprop_get_createMessageStanza = ()=>super.createMessageStanza;
        return _async_to_generator(function*() {
            const stanza = yield _superprop_get_createMessageStanza().call(_this, message);
            stanza.cnode(stx`<x xmlns="${Strophe.NS.MUC}#user"/>`).root();
            return stanza;
        })();
    }
    /**
     * @param {import('../../shared/message').default} message
     */ isChatMessage(message) {
        return message.get('type') === this.get('message_type');
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCOccupant);


/***/ }),

/***/ "./src/headless/plugins/muc/occupants.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/muc/occupants.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _occupant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./occupant.js */ "./src/headless/plugins/muc/occupant.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _affiliations_utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./affiliations/utils.js */ "./src/headless/plugins/muc/affiliations/utils.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/muc/utils.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/**
 * @typedef {module:plugin-muc-parsers.MemberListItem} MemberListItem
 * @typedef {import('@converse/skeletor/src/types/collection').Attributes} Attributes
 * @typedef {import('@converse/skeletor/src/types/collection').CollectionOptions} CollectionOptions
 * @typedef {import('@converse/skeletor/src/types/collection').Options} Options
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









const { u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
/**
 * A list of {@link MUCOccupant} instances, representing participants in a MUC.
 * @class
 * @memberOf _converse
 */ class MUCOccupants extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__.Collection {
    get model() {
        return _occupant_js__WEBPACK_IMPORTED_MODULE_0__["default"];
    }
    initialize() {
        this.on('change:nick', ()=>this.sort());
        this.on('change:role', ()=>this.sort());
    }
    static getAutoFetchedAffiliationLists() {
        const affs = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('muc_fetch_members');
        return Array.isArray(affs) ? affs : affs ? [
            'member',
            'admin',
            'owner'
        ] : [];
    }
    /**
     * @param {Model|Attributes} attrs
     * @param {Options} [options]
     */ create(attrs, options) {
        if (attrs.id || attrs instanceof _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__.Model) {
            return super.create(attrs, options);
        }
        attrs.id = attrs.occupant_id || (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_8__.getUniqueId)();
        return super.create(attrs, options);
    }
    fetchMembers() {
        return _async_to_generator(function*() {
            var _this_getOwnOccupant;
            if (![
                'member',
                'admin',
                'owner'
            ].includes((_this_getOwnOccupant = this.getOwnOccupant()) === null || _this_getOwnOccupant === void 0 ? void 0 : _this_getOwnOccupant.get('affiliation'))) {
                // https://xmpp.org/extensions/xep-0045.html#affil-priv
                return;
            }
            const affiliations = MUCOccupants.getAutoFetchedAffiliationLists();
            if (affiliations.length === 0) {
                return;
            }
            const muc_jid = this.chatroom.get('jid');
            const aff_lists = yield Promise.all(affiliations.map((a)=>(0,_affiliations_utils_js__WEBPACK_IMPORTED_MODULE_6__.getAffiliationList)(a, muc_jid)));
            const new_members = aff_lists.reduce(/**
             * @param {MemberListItem[]} acc
             * @param {MemberListItem[]|Error} val
             * @returns {MemberListItem[]}
             */ (acc, val)=>{
                if (val instanceof Error) {
                    return acc;
                }
                return [
                    ...val,
                    ...acc
                ];
            }, []);
            const known_affiliations = affiliations.filter((a)=>!u.isErrorObject(aff_lists[affiliations.indexOf(a)]));
            const new_jids = /** @type {MemberListItem[]} */ new_members.map((m)=>m.jid).filter((m)=>m !== undefined);
            const new_nicks = /** @type {MemberListItem[]} */ new_members.map((m)=>!m.jid && m.nick || undefined).filter((m)=>m !== undefined);
            const removed_members = this.filter((m)=>{
                return known_affiliations.includes(m.get('affiliation')) && !new_nicks.includes(m.get('nick')) && !new_jids.includes(m.get('jid'));
            });
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
            removed_members.forEach((occupant)=>{
                if (occupant.get('jid') === bare_jid) {
                    return;
                } else if (occupant.get('show') === 'offline') {
                    occupant.destroy();
                } else {
                    occupant.save('affiliation', null);
                }
            });
            /** @type {MemberListItem[]} */ new_members.forEach((attrs)=>{
                const occupant = this.findOccupant(attrs);
                occupant ? occupant.save(attrs) : this.create(attrs);
            });
            /**
         * Triggered once the member lists for this MUC have been fetched and processed.
         * @event _converse#membersFetched
         * @example _converse.api.listen.on('membersFetched', () => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].trigger('membersFetched');
        }).call(this);
    }
    /**
     * Try to find an existing occupant based on the provided {@link OccupantData} object.
     * Fetching the user by `occupant_id` is the quickest, O(1),
     * since it's a dictionary lookup.
     * Fetching by jid or nick is O(n), since it requires traversing an array.
     * Lookup by occupant_id is done first, then jid, and then nick.
     *
     * @param {import('./types').OccupantData} data
     */ findOccupant(data) {
        if (data.occupant_id) {
            return this.get(data.occupant_id);
        }
        const jid = data.jid && strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.getBareJidFromJid(data.jid);
        return jid && this.findWhere({
            jid
        }) || data.nick && this.findWhere({
            'nick': data.nick
        });
    }
    /**
     * Get the {@link MUCOccupant} instance which
     * represents the current user.
     * @method _converse.MUCOccupants#getOwnOccupant
     * @returns {MUCOccupant}
     */ getOwnOccupant() {
        return this.findOccupant({
            jid: _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid'),
            occupant_id: this.chatroom.get('occupant_id')
        });
    }
    constructor(attrs, options){
        super(attrs, Object.assign({
            comparator: _utils_js__WEBPACK_IMPORTED_MODULE_7__.occupantsComparator
        }, options));
        this.chatroom = null;
    }
}
// @ts-ignore
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCOccupants);


/***/ }),

/***/ "./src/headless/plugins/muc/parsers.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/muc/parsers.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getMEPActivities: () => (/* binding */ getMEPActivities),
/* harmony export */   parseMUCMessage: () => (/* binding */ parseMUCMessage),
/* harmony export */   parseMUCPresence: () => (/* binding */ parseMUCPresence),
/* harmony export */   parseMemberListIQ: () => (/* binding */ parseMemberListIQ)
/* harmony export */ });
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_errors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _shared_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/parsers */ "./src/headless/shared/parsers.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants.js */ "./src/headless/plugins/muc/constants.js");
/**
 * @module:plugin-muc-parsers
 * @typedef {import('../muc/muc.js').default} MUC
 * @typedef {import('./types').MUCMessageAttributes} MUCMessageAttributes
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}







const { Strophe, sizzle, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
const { NS } = Strophe;
/**
 * Parses a message stanza for XEP-0316 MEP notification data
 * @param {Element} stanza - The message stanza
 * @returns {Array} Returns an array of objects representing <activity> elements.
 */ function getMEPActivities(stanza) {
    const items_el = sizzle(`items[node="${Strophe.NS.CONFINFO}"]`, stanza).pop();
    if (!items_el) {
        return null;
    }
    const from = stanza.getAttribute('from');
    const msgid = stanza.getAttribute('id');
    const selector = `item ` + `conference-info[xmlns="${Strophe.NS.CONFINFO}"] ` + `activity[xmlns="${Strophe.NS.ACTIVITY}"]`;
    return sizzle(selector, items_el).map(/** @param {Element} el */ (el)=>{
        var _el_querySelector;
        const message = (_el_querySelector = el.querySelector('text')) === null || _el_querySelector === void 0 ? void 0 : _el_querySelector.textContent;
        if (message) {
            var _el_querySelector1;
            const references = (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getReferences)(stanza);
            const reason = (_el_querySelector1 = el.querySelector('reason')) === null || _el_querySelector1 === void 0 ? void 0 : _el_querySelector1.textContent;
            return {
                from,
                msgid,
                message,
                reason,
                references,
                'type': 'mep'
            };
        }
        return {};
    });
}
/**
 * Given a MUC stanza, check whether it has extended message information that
 * includes the sender's real JID, as described here:
 * https://xmpp.org/extensions/xep-0313.html#business-storeret-muc-archives
 *
 * If so, parse and return that data and return the user's JID
 *
 * Note, this function doesn't check whether this is actually a MAM archived stanza.
 *
 * @param {Element} stanza - The message stanza
 * @returns {Object}
 */ function getJIDFromMUCUserData(stanza) {
    const item = sizzle(`message > x[xmlns="${Strophe.NS.MUC_USER}"] item`, stanza).pop();
    return item === null || item === void 0 ? void 0 : item.getAttribute('jid');
}
/**
 * @param {Element} stanza - The message stanza
 *  message stanza, if it was contained, otherwise it's the message stanza itself.
 * @returns {Object}
 */ function getDeprecatedModerationAttributes(stanza) {
    const fastening = sizzle(`apply-to[xmlns="${Strophe.NS.FASTEN}"]`, stanza).pop();
    if (fastening) {
        const applies_to_id = fastening.getAttribute('id');
        const moderated = sizzle(`moderated[xmlns="${Strophe.NS.MODERATE0}"]`, fastening).pop();
        if (moderated) {
            const retracted = sizzle(`retract[xmlns="${Strophe.NS.RETRACT0}"]`, moderated).pop();
            if (retracted) {
                var _moderated_querySelector;
                return {
                    editable: false,
                    moderated: 'retracted',
                    moderated_by: moderated.getAttribute('by'),
                    moderated_id: applies_to_id,
                    moderation_reason: (_moderated_querySelector = moderated.querySelector('reason')) === null || _moderated_querySelector === void 0 ? void 0 : _moderated_querySelector.textContent
                };
            }
        }
    } else {
        const tombstone = sizzle(`> moderated[xmlns="${Strophe.NS.MODERATE0}"]`, stanza).pop();
        if (tombstone) {
            const retracted = sizzle(`retracted[xmlns="${Strophe.NS.RETRACT0}"]`, tombstone).pop();
            if (retracted) {
                var _tombstone_querySelector;
                return {
                    editable: false,
                    is_tombstone: true,
                    moderated_by: tombstone.getAttribute('by'),
                    retracted: tombstone.getAttribute('stamp'),
                    moderation_reason: (_tombstone_querySelector = tombstone.querySelector('reason')) === null || _tombstone_querySelector === void 0 ? void 0 : _tombstone_querySelector.textContent
                };
            }
        }
    }
    return {};
}
/**
 * @param {Element} stanza - The message stanza
 *  message stanza, if it was contained, otherwise it's the message stanza itself.
 * @returns {Object}
 */ function getModerationAttributes(stanza) {
    const retract = sizzle(`> retract[xmlns="${Strophe.NS.RETRACT}"]`, stanza).pop();
    if (retract) {
        const moderated = sizzle(`moderated[xmlns="${Strophe.NS.MODERATE}"]`, retract).pop();
        if (moderated) {
            var _moderated_querySelector, _retract_querySelector;
            return {
                editable: false,
                moderated: 'retracted',
                moderated_by: moderated.getAttribute('by'),
                moderated_by_id: (_moderated_querySelector = moderated.querySelector('occupant-id')) === null || _moderated_querySelector === void 0 ? void 0 : _moderated_querySelector.getAttribute('id'),
                moderated_id: retract.getAttribute('id'),
                moderation_reason: (_retract_querySelector = retract.querySelector('reason')) === null || _retract_querySelector === void 0 ? void 0 : _retract_querySelector.textContent
            };
        }
    } else {
        const tombstone = sizzle(`retracted[xmlns="${Strophe.NS.RETRACT}"]`, stanza).pop();
        if (tombstone) {
            var _tombstone_querySelector, _tombstone_querySelector1;
            return {
                editable: false,
                is_tombstone: true,
                moderated_by: tombstone.getAttribute('by'),
                moderated_by_id: (_tombstone_querySelector = tombstone.querySelector('occupant-id')) === null || _tombstone_querySelector === void 0 ? void 0 : _tombstone_querySelector.getAttribute('id'),
                retracted: tombstone.getAttribute('stamp'),
                moderation_reason: (_tombstone_querySelector1 = tombstone.querySelector('reason')) === null || _tombstone_querySelector1 === void 0 ? void 0 : _tombstone_querySelector1.textContent
            };
        }
    }
    return getDeprecatedModerationAttributes(stanza);
}
/**
 * @param {Element} stanza
 * @param {'presence'|'message'} type
 * @returns {{codes: Array<import('./types').MUCStatusCode>, is_self: boolean}}
 */ function getStatusCodes(stanza, type) {
    /**
     * @typedef {import('./types').MUCStatusCode} MUCStatusCode
     */ const codes = sizzle(`${type} > x[xmlns="${Strophe.NS.MUC_USER}"] status`, stanza).map(/** @param {Element} s */ (s)=>s.getAttribute('code')).filter(/** @param {MUCStatusCode} c */ (c)=>{
        var _STATUS_CODE_STANZAS_c;
        return (_STATUS_CODE_STANZAS_c = _constants_js__WEBPACK_IMPORTED_MODULE_6__.STATUS_CODE_STANZAS[c]) === null || _STATUS_CODE_STANZAS_c === void 0 ? void 0 : _STATUS_CODE_STANZAS_c.includes(type);
    });
    if (type === 'presence' && codes.includes('333') && codes.includes('307')) {
        // See: https://github.com/xsf/xeps/pull/969/files#diff-ac5113766e59219806793c1f7d967f1bR4966
        codes.splice(codes.indexOf('307'), 1);
    }
    return {
        codes,
        is_self: codes.includes('110')
    };
}
/**
 * @param {Element} stanza
 * @param {MUC} chatbox
 */ function getOccupantID(stanza, chatbox) {
    if (chatbox.features.get(Strophe.NS.OCCUPANTID)) {
        var _sizzle_pop;
        return (_sizzle_pop = sizzle(`occupant-id[xmlns="${Strophe.NS.OCCUPANTID}"]`, stanza).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.getAttribute('id');
    }
}
/**
 * Determines whether the sender of this MUC message is the current user or
 * someone else.
 * @param {MUCMessageAttributes} attrs
 * @param {MUC} chatbox
 * @returns {'me'|'them'}
 */ function getSender(attrs, chatbox) {
    let is_me;
    const own_occupant_id = chatbox.get('occupant_id');
    if (own_occupant_id) {
        is_me = attrs.occupant_id === own_occupant_id;
    } else if (attrs.from_real_jid) {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
        is_me = Strophe.getBareJidFromJid(attrs.from_real_jid) === bare_jid;
    } else {
        is_me = attrs.nick === chatbox.get('nick');
    }
    return is_me ? 'me' : 'them';
}
/**
 * Parses a passed in message stanza and returns an object of attributes.
 * @param {Element} original_stanza - The message stanza
 * @param {MUC} chatbox
 * @returns {Promise<MUCMessageAttributes|StanzaParseError>}
 */ function parseMUCMessage(original_stanza, chatbox) {
    return _async_to_generator(function*() {
        var _stanza_querySelector, _stanza_querySelector1, _chatbox_occupants_findOccupant;
        (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.throwErrorIfInvalidForward)(original_stanza);
        const forwarded_stanza = sizzle(`result[xmlns="${NS.MAM}"] > forwarded[xmlns="${NS.FORWARD}"] > message`, original_stanza).pop();
        const stanza = forwarded_stanza || original_stanza;
        if (sizzle(`message > forwarded[xmlns="${Strophe.NS.FORWARD}"]`, stanza).length) {
            return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_4__.StanzaParseError(stanza, `Invalid Stanza: Forged MAM groupchat message from ${stanza.getAttribute('from')}`);
        }
        let delay;
        let body;
        if (forwarded_stanza) {
            var _forwarded_stanza_querySelector_textContent, _forwarded_stanza_querySelector;
            if (sizzle(`message > forwarded[xmlns="${Strophe.NS.FORWARD}"]`, forwarded_stanza).length) {
                return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_4__.StanzaParseError(original_stanza, `Invalid Stanza: Forged MAM groupchat message from ${original_stanza.getAttribute('from')}`);
            }
            delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, forwarded_stanza.parentElement).pop();
            body = (_forwarded_stanza_querySelector = forwarded_stanza.querySelector(':scope > body')) === null || _forwarded_stanza_querySelector === void 0 ? void 0 : (_forwarded_stanza_querySelector_textContent = _forwarded_stanza_querySelector.textContent) === null || _forwarded_stanza_querySelector_textContent === void 0 ? void 0 : _forwarded_stanza_querySelector_textContent.trim();
        } else {
            var _original_stanza_querySelector_textContent, _original_stanza_querySelector;
            delay = sizzle(`message > delay[xmlns="${Strophe.NS.DELAY}"]`, original_stanza).pop();
            body = (_original_stanza_querySelector = original_stanza.querySelector(':scope > body')) === null || _original_stanza_querySelector === void 0 ? void 0 : (_original_stanza_querySelector_textContent = _original_stanza_querySelector.textContent) === null || _original_stanza_querySelector_textContent === void 0 ? void 0 : _original_stanza_querySelector_textContent.trim();
        }
        const from = stanza.getAttribute('from');
        const marker = (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getChatMarker)(stanza);
        let attrs = /** @type {MUCMessageAttributes} */ Object.assign({
            from,
            body,
            'activities': getMEPActivities(stanza),
            'chat_state': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getChatState)(stanza),
            'from_muc': Strophe.getBareJidFromJid(from),
            'is_archived': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.isArchived)(original_stanza),
            'is_carbon': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.isCarbon)(original_stanza),
            'is_delayed': !!delay,
            'is_forwarded': !!sizzle(`message > forwarded[xmlns="${Strophe.NS.FORWARD}"]`, stanza).length,
            'is_headline': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.isHeadline)(stanza),
            'is_markable': !!sizzle(`message > markable[xmlns="${Strophe.NS.MARKERS}"]`, stanza).length,
            'is_marker': !!marker,
            'is_unstyled': !!sizzle(`message > unstyled[xmlns="${Strophe.NS.STYLING}"]`, stanza).length,
            'marker_id': marker && marker.getAttribute('id'),
            'nick': Strophe.unescapeNode(Strophe.getResourceFromJid(from)),
            'occupant_id': getOccupantID(stanza, chatbox),
            'receipt_id': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getReceiptId)(stanza),
            'received': new Date().toISOString(),
            'references': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getReferences)(stanza),
            'subject': (_stanza_querySelector = stanza.querySelector(':scope > subject')) === null || _stanza_querySelector === void 0 ? void 0 : _stanza_querySelector.textContent,
            'thread': (_stanza_querySelector1 = stanza.querySelector(':scope > thread')) === null || _stanza_querySelector1 === void 0 ? void 0 : _stanza_querySelector1.textContent,
            'time': delay ? dayjs__WEBPACK_IMPORTED_MODULE_0___default()(delay.getAttribute('stamp')).toISOString() : new Date().toISOString(),
            'to': stanza.getAttribute('to'),
            'type': stanza.getAttribute('type')
        }, (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getErrorAttributes)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getOutOfBandAttributes)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getSpoilerAttributes)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getCorrectionAttributes)(stanza, original_stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getStanzaIDs)(stanza, original_stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getOpenGraphMetadata)(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getRetractionAttributes)(stanza, original_stanza), getModerationAttributes(stanza), (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.getEncryptionAttributes)(stanza), getStatusCodes(stanza, 'message'));
        attrs.from_real_jid = attrs.is_archived && getJIDFromMUCUserData(stanza) || ((_chatbox_occupants_findOccupant = chatbox.occupants.findOccupant(attrs)) === null || _chatbox_occupants_findOccupant === void 0 ? void 0 : _chatbox_occupants_findOccupant.get('jid'));
        attrs = Object.assign({
            'is_valid_receipt_request': (0,_shared_parsers__WEBPACK_IMPORTED_MODULE_5__.isValidReceiptRequest)(stanza, attrs),
            'message': attrs.body || attrs.error,
            'sender': getSender(attrs, chatbox)
        }, attrs);
        if (attrs.is_archived && original_stanza.getAttribute('from') !== attrs.from_muc) {
            return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_4__.StanzaParseError(original_stanza, `Invalid Stanza: Forged MAM message from ${original_stanza.getAttribute('from')}`);
        } else if (attrs.is_archived && original_stanza.getAttribute('from') !== chatbox.get('jid')) {
            return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_4__.StanzaParseError(original_stanza, `Invalid Stanza: Forged MAM groupchat message from ${stanza.getAttribute('from')}`);
        } else if (attrs.is_carbon) {
            return new _shared_errors_js__WEBPACK_IMPORTED_MODULE_4__.StanzaParseError(original_stanza, 'Invalid Stanza: MUC messages SHOULD NOT be XEP-0280 carbon copied');
        }
        // We prefer to use one of the XEP-0359 unique and stable stanza IDs as the Model id, to avoid duplicates.
        attrs['id'] = attrs['origin_id'] || attrs[`stanza_id ${attrs.from_muc || attrs.from}`] || u.getUniqueId();
        /**
     * *Hook* which allows plugins to add additional parsing
     * @event _converse#parseMUCMessage
     */ attrs = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].hook('parseMUCMessage', original_stanza, attrs);
        // We call this after the hook, to allow plugins to decrypt encrypted
        // messages, since we need to parse the message text to determine whether
        // there are media urls.
        const metadata = yield u.getMediaURLsMetadata(attrs.is_encrypted ? attrs.plaintext : attrs.body);
        return Object.assign(attrs, metadata);
    })();
}
/**
 * Given an IQ stanza with a member list, create an array of objects containing
 * known member data (e.g. jid, nick, role, affiliation).
 *
 * @param {Element} iq
 * @returns {import('./types').MemberListItem[]}
 */ function parseMemberListIQ(iq) {
    return sizzle(`query[xmlns="${Strophe.NS.MUC_ADMIN}"] item`, iq).map(/** @param {Element} item */ (item)=>{
        const data = {
            'affiliation': item.getAttribute('affiliation')
        };
        const jid = item.getAttribute('jid');
        if (u.isValidJID(jid)) {
            data['jid'] = jid;
        } else {
            // XXX: Prosody sends nick for the jid attribute value
            // Perhaps for anonymous room?
            data['nick'] = jid;
        }
        const nick = item.getAttribute('nick');
        if (nick) {
            data['nick'] = nick;
        }
        const role = item.getAttribute('role');
        if (role) {
            data['role'] = nick;
        }
        return data;
    });
}
/**
 * @param {Element} stanza - The presence stanza
 * @param {string} nick
 * @returns {import('./types').MUCPresenceItemAttributes}
 */ function parsePresenceUserItem(stanza, nick) {
    /**
     * @typedef {import('./types').MUCAffiliation} MUCAffiliation
     * @typedef {import('./types').MUCRole} MUCRole
     */ const item = sizzle(`presence > x[xmlns="${Strophe.NS.MUC_USER}"] item`, stanza).pop();
    if (item) {
        var _item_querySelector;
        const actor = item.querySelector('actor');
        var _actor_getAttribute, _actor_getAttribute1, _item_querySelector_textContent;
        return _object_spread_props(_object_spread({
            affiliation: /** @type {MUCAffiliation} */ item.getAttribute('affiliation'),
            role: /** @type {MUCRole} */ item.getAttribute('role'),
            jid: item.getAttribute('jid'),
            nick: item.getAttribute('nick') || nick
        }, actor ? {
            actor: {
                nick: (_actor_getAttribute = actor === null || actor === void 0 ? void 0 : actor.getAttribute('nick')) !== null && _actor_getAttribute !== void 0 ? _actor_getAttribute : null,
                jid: (_actor_getAttribute1 = actor === null || actor === void 0 ? void 0 : actor.getAttribute('jid')) !== null && _actor_getAttribute1 !== void 0 ? _actor_getAttribute1 : null
            }
        } : {}), {
            reason: (_item_querySelector_textContent = (_item_querySelector = item.querySelector('reason')) === null || _item_querySelector === void 0 ? void 0 : _item_querySelector.textContent) !== null && _item_querySelector_textContent !== void 0 ? _item_querySelector_textContent : null
        });
    }
}
/**
 * Parses a passed in MUC presence stanza and returns an object of attributes.
 * @param {Element} stanza - The presence stanza
 * @param {MUC} chatbox
 * @returns {Promise<import('./types').MUCPresenceAttributes>}
 */ function parseMUCPresence(stanza, chatbox) {
    return _async_to_generator(function*() {
        var _stanza_querySelector, _stanza_querySelector1, _sizzle_pop;
        yield chatbox.initialized;
        /**
     * @typedef {import('./types').MUCPresenceAttributes} MUCPresenceAttributes
     */ const from = stanza.getAttribute('from');
        const type = stanza.getAttribute('type');
        const nick = Strophe.getResourceFromJid(from);
        var _stanza_querySelector_textContent, _stanza_querySelector_textContent1;
        const attrs = /** @type {MUCPresenceAttributes} */ _object_spread({
            from,
            nick,
            type,
            muc_jid: Strophe.getBareJidFromJid(from),
            occupant_id: getOccupantID(stanza, chatbox),
            status: (_stanza_querySelector_textContent = (_stanza_querySelector = stanza.querySelector(':scope > status')) === null || _stanza_querySelector === void 0 ? void 0 : _stanza_querySelector.textContent) !== null && _stanza_querySelector_textContent !== void 0 ? _stanza_querySelector_textContent : undefined,
            show: (_stanza_querySelector_textContent1 = (_stanza_querySelector1 = stanza.querySelector(':scope > show')) === null || _stanza_querySelector1 === void 0 ? void 0 : _stanza_querySelector1.textContent) !== null && _stanza_querySelector_textContent1 !== void 0 ? _stanza_querySelector_textContent1 : undefined,
            image_hash: (_sizzle_pop = sizzle(`presence > x[xmlns="${Strophe.NS.VCARDUPDATE}"] photo`, stanza).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.textContent,
            hats: sizzle(`presence > hats[xmlns="${Strophe.NS.MUC_HATS}"] hat`, stanza).map(/** @param {Element} h */ (h)=>({
                    title: h.getAttribute('title'),
                    uri: h.getAttribute('uri')
                }))
        }, getStatusCodes(stanza, 'presence'), parsePresenceUserItem(stanza, nick));
        /**
     * *Hook* which allows plugins to add additional parsing
     * @event _converse#parseMUCPresence
     */ return /** @type {import('./types').MUCPresenceAttributes}*/ yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].hook('parseMUCPresence', stanza, attrs);
    })();
}


/***/ }),

/***/ "./src/headless/plugins/muc/plugin.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/muc/plugin.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _chat_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../chat/index.js */ "./src/headless/plugins/chat/index.js");
/* harmony import */ var _disco_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../disco/index.js */ "./src/headless/plugins/disco/index.js");
/* harmony import */ var _emoji_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../emoji/index.js */ "./src/headless/plugins/emoji/index.js");
/* harmony import */ var _message_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./message.js */ "./src/headless/plugins/muc/message.js");
/* harmony import */ var _messages_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./messages.js */ "./src/headless/plugins/muc/messages.js");
/* harmony import */ var _muc_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./muc.js */ "./src/headless/plugins/muc/muc.js");
/* harmony import */ var _occupant_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./occupant.js */ "./src/headless/plugins/muc/occupant.js");
/* harmony import */ var _occupants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./occupants.js */ "./src/headless/plugins/muc/occupants.js");
/* harmony import */ var _affiliations_api_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./affiliations/api.js */ "./src/headless/plugins/muc/affiliations/api.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/muc/api.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/muc/utils.js");
/* harmony import */ var _affiliations_utils_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./affiliations/utils.js */ "./src/headless/plugins/muc/affiliations/utils.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./constants.js */ "./src/headless/plugins/muc/constants.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description Implements the core logic for XEP-0045 Multi-User Chat
 */ 
















_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].AFFILIATION_CHANGES = _constants_js__WEBPACK_IMPORTED_MODULE_16__.AFFILIATION_CHANGES;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].AFFILIATION_CHANGES_LIST = _constants_js__WEBPACK_IMPORTED_MODULE_16__.AFFILIATION_CHANGES_LIST;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC_TRAFFIC_STATES = _constants_js__WEBPACK_IMPORTED_MODULE_16__.MUC_TRAFFIC_STATES;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC_TRAFFIC_STATES_LIST = _constants_js__WEBPACK_IMPORTED_MODULE_16__.MUC_TRAFFIC_STATES_LIST;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC_ROLE_CHANGES = _constants_js__WEBPACK_IMPORTED_MODULE_16__.MUC_ROLE_CHANGES;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC_ROLE_CHANGES_LIST = _constants_js__WEBPACK_IMPORTED_MODULE_16__.MUC_ROLE_CHANGES_LIST;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC = {
    INFO_CODES: _constants_js__WEBPACK_IMPORTED_MODULE_16__.INFO_CODES
};
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC_NICK_CHANGED_CODE = _constants_js__WEBPACK_IMPORTED_MODULE_16__.MUC_NICK_CHANGED_CODE;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].ROOM_FEATURES = _constants_js__WEBPACK_IMPORTED_MODULE_16__.ROOM_FEATURES;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].ROOMSTATUS = _constants_js__WEBPACK_IMPORTED_MODULE_16__.ROOMSTATUS;
const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].env;
// Add Strophe Namespaces
Strophe.addNamespace('MUC_ADMIN', Strophe.NS.MUC + '#admin');
Strophe.addNamespace('MUC_OWNER', Strophe.NS.MUC + '#owner');
Strophe.addNamespace('MUC_REGISTER', 'jabber:iq:register');
Strophe.addNamespace('MUC_ROOMCONF', Strophe.NS.MUC + '#roomconfig');
Strophe.addNamespace('MUC_USER', Strophe.NS.MUC + '#user');
Strophe.addNamespace('MUC_HATS', 'urn:xmpp:hats:0');
Strophe.addNamespace('CONFINFO', 'urn:ietf:params:xml:ns:conference-info');
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].plugins.add('converse-muc', {
    dependencies: [
        'converse-chatboxes',
        'converse-chat',
        'converse-disco'
    ],
    initialize () {
        /* The initialize function gets called as soon as the plugin is
         * loaded by converse.js's plugin machinery.
         */ const { __, ___ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_10__["default"];
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].settings.extend({
            allow_muc_invitations: true,
            auto_join_on_invite: false,
            auto_join_rooms: [],
            auto_register_muc_nickname: true,
            colorize_username: false,
            hide_muc_participants: false,
            locked_muc_domain: false,
            modtools_disable_assign: false,
            muc_clear_messages_on_leave: true,
            muc_domain: undefined,
            muc_fetch_members: true,
            muc_history_max_stanzas: undefined,
            muc_instant_rooms: true,
            muc_nickname_from_jid: false,
            muc_send_probes: false,
            muc_show_info_messages: [
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.visibility_changes,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.self,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.non_privacy_changes,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.muc_logging_changes,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.nickname_changes,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.disconnected,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.affiliation_changes,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.join_leave_events,
                ..._shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].MUC.INFO_CODES.role_changes
            ],
            muc_show_logs_before_join: false,
            muc_subscribe_to_rai: false
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].promises.add([
            'roomsAutoJoined'
        ]);
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].settings.get('locked_muc_domain') && typeof _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].settings.get('muc_domain') !== 'string') {
            throw new Error('Config Error: it makes no sense to set locked_muc_domain ' + 'to true when muc_domain is not set');
        }
        // This is for tests (at least until we can import modules inside tests)
        _shared_api_public_js__WEBPACK_IMPORTED_MODULE_12__["default"].env.muc_utils = {
            computeAffiliationsDelta: _affiliations_utils_js__WEBPACK_IMPORTED_MODULE_15__.computeAffiliationsDelta
        };
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"], _api_js__WEBPACK_IMPORTED_MODULE_9__["default"]);
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].rooms, _affiliations_api_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
        /**
         * https://xmpp.org/extensions/xep-0045.html
         * -----------------------------------------
         */ const STATUS_CODE_MESSAGES = {
            '100': __('This groupchat is not anonymous'),
            '102': __('This groupchat now shows unavailable members'),
            '103': __('This groupchat does not show unavailable members'),
            '104': __('The groupchat configuration has changed'),
            '170': __('Groupchat logging is now enabled'),
            '171': __('Groupchat logging is now disabled'),
            '172': __('This groupchat is now no longer anonymous'),
            '173': __('This groupchat is now semi-anonymous'),
            '174': __('This groupchat is now fully-anonymous'),
            '201': __('A new groupchat has been created'),
            // XXX: Note the triple underscore function and not double underscore.
            '210': ___('Your nickname has been automatically set to %1$s'),
            '301': __('You have been banned from this groupchat'),
            // XXX: Note the triple underscore function and not double underscore.
            '303': ___('Your nickname has been changed to %1$s'),
            '307': __('You have been kicked from this groupchat'),
            '321': __('You have been removed from this groupchat because of an affiliation change'),
            '322': __("You have been removed from this groupchat because it has changed to members-only and you're not a member"),
            '332': __('You have been removed from this groupchat because the service hosting it is being shut down'),
            '333': __('You have exited this groupchat due to a technical problem')
        };
        const labels = {
            muc: {
                STATUS_CODE_MESSAGES
            }
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_10__["default"].labels, labels);
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_10__["default"], labels); // XXX DEPRECATED
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_14__.routeToRoom)();
        addEventListener('hashchange', _utils_js__WEBPACK_IMPORTED_MODULE_14__.routeToRoom);
        // TODO: DEPRECATED
        const legacy_exports = {
            ChatRoom: _muc_js__WEBPACK_IMPORTED_MODULE_5__["default"],
            ChatRoomMessage: _message_js__WEBPACK_IMPORTED_MODULE_3__["default"],
            ChatRoomMessages: _messages_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            ChatRoomOccupant: _occupant_js__WEBPACK_IMPORTED_MODULE_6__["default"],
            ChatRoomOccupants: _occupants_js__WEBPACK_IMPORTED_MODULE_7__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_10__["default"], legacy_exports);
        const exports = {
            MUC: _muc_js__WEBPACK_IMPORTED_MODULE_5__["default"],
            MUCMessage: _message_js__WEBPACK_IMPORTED_MODULE_3__["default"],
            MUCMessages: _messages_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            MUCOccupant: _occupant_js__WEBPACK_IMPORTED_MODULE_6__["default"],
            MUCOccupants: _occupants_js__WEBPACK_IMPORTED_MODULE_7__["default"],
            getDefaultMUCNickname: _utils_js__WEBPACK_IMPORTED_MODULE_14__.getDefaultMUCNickname,
            isInfoVisible: _utils_js__WEBPACK_IMPORTED_MODULE_14__.isInfoVisible,
            onDirectMUCInvitation: _utils_js__WEBPACK_IMPORTED_MODULE_14__.onDirectMUCInvitation
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_10__["default"].exports, exports);
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_10__["default"], exports); // XXX DEPRECATED
        /** @type {module:shared-api.APIEndpoint} */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].chatboxes.registry.add(_shared_constants_js__WEBPACK_IMPORTED_MODULE_13__.CHATROOMS_TYPE, _muc_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].settings.get('allow_muc_invitations')) {
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('connected', _utils_js__WEBPACK_IMPORTED_MODULE_14__.registerDirectInvitationHandler);
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('reconnected', _utils_js__WEBPACK_IMPORTED_MODULE_14__.registerDirectInvitationHandler);
        }
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('addClientFeatures', ()=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].disco.own.features.add(`${Strophe.NS.CONFINFO}+notify`));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('addClientFeatures', _utils_js__WEBPACK_IMPORTED_MODULE_14__.onAddClientFeatures);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('beforeResourceBinding', _utils_js__WEBPACK_IMPORTED_MODULE_14__.onBeforeResourceBinding);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('beforeTearDown', _utils_js__WEBPACK_IMPORTED_MODULE_14__.onBeforeTearDown);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('chatBoxesFetched', _utils_js__WEBPACK_IMPORTED_MODULE_14__.autoJoinRooms);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('disconnected', _utils_js__WEBPACK_IMPORTED_MODULE_14__.disconnectChatRooms);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_11__["default"].listen.on('statusInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_14__.onStatusInitialized);
        document.addEventListener('visibilitychange', _utils_js__WEBPACK_IMPORTED_MODULE_14__.onWindowStateChanged);
    }
});


/***/ }),

/***/ "./src/headless/plugins/muc/session.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/muc/session.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./src/headless/plugins/muc/constants.js");


class MUCSession extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            'connection_status': _constants__WEBPACK_IMPORTED_MODULE_1__.ROOMSTATUS.DISCONNECTED
        };
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCSession);


/***/ }),

/***/ "./src/headless/plugins/muc/utils.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/muc/utils.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   autoJoinRooms: () => (/* binding */ autoJoinRooms),
/* harmony export */   disconnectChatRooms: () => (/* binding */ disconnectChatRooms),
/* harmony export */   getDefaultMUCNickname: () => (/* binding */ getDefaultMUCNickname),
/* harmony export */   getDefaultMUCService: () => (/* binding */ getDefaultMUCService),
/* harmony export */   isChatRoom: () => (/* binding */ isChatRoom),
/* harmony export */   isInfoVisible: () => (/* binding */ isInfoVisible),
/* harmony export */   occupantsComparator: () => (/* binding */ occupantsComparator),
/* harmony export */   onAddClientFeatures: () => (/* binding */ onAddClientFeatures),
/* harmony export */   onBeforeResourceBinding: () => (/* binding */ onBeforeResourceBinding),
/* harmony export */   onBeforeTearDown: () => (/* binding */ onBeforeTearDown),
/* harmony export */   onDirectMUCInvitation: () => (/* binding */ onDirectMUCInvitation),
/* harmony export */   onStatusInitialized: () => (/* binding */ onStatusInitialized),
/* harmony export */   onWindowStateChanged: () => (/* binding */ onWindowStateChanged),
/* harmony export */   openChatRoom: () => (/* binding */ openChatRoom),
/* harmony export */   registerDirectInvitationHandler: () => (/* binding */ registerDirectInvitationHandler),
/* harmony export */   routeToRoom: () => (/* binding */ routeToRoom),
/* harmony export */   shouldCreateGroupchatMessage: () => (/* binding */ shouldCreateGroupchatMessage)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants.js */ "./src/headless/plugins/muc/constants.js");
/* harmony import */ var _utils_init_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/init.js */ "./src/headless/utils/init.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}








const { Strophe, sizzle, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/**
 * @returns {Promise<string|undefined>}
 */ function getDefaultMUCService() {
    return _async_to_generator(function*() {
        let muc_service = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('muc_domain') || _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('default_muc_service');
        if (!muc_service) {
            const domain = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('domain');
            const items = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.entities.items(domain);
            for (const item of items){
                if (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.features.has(Strophe.NS.MUC, item.get('jid'))) {
                    muc_service = item.get('jid');
                    _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.save({
                        default_muc_service: muc_service
                    });
                    break;
                }
            }
        }
        return muc_service;
    })();
}
/**
 * @param {import('@converse/skeletor').Model} model
 */ function isChatRoom(model) {
    return (model === null || model === void 0 ? void 0 : model.get('type')) === 'chatroom';
}
function shouldCreateGroupchatMessage(attrs) {
    return attrs.nick && (u.shouldCreateMessage(attrs) || attrs.is_tombstone);
}
/**
 * @param {import('./occupant').default} occupant1
 * @param {import('./occupant').default} occupant2
 */ function occupantsComparator(occupant1, occupant2) {
    const role1 = occupant1.get('role') || 'none';
    const role2 = occupant2.get('role') || 'none';
    if (_constants_js__WEBPACK_IMPORTED_MODULE_4__.MUC_ROLE_WEIGHTS[role1] === _constants_js__WEBPACK_IMPORTED_MODULE_4__.MUC_ROLE_WEIGHTS[role2]) {
        const nick1 = occupant1.getDisplayName().toLowerCase();
        const nick2 = occupant2.getDisplayName().toLowerCase();
        return nick1 < nick2 ? -1 : nick1 > nick2 ? 1 : 0;
    } else {
        return _constants_js__WEBPACK_IMPORTED_MODULE_4__.MUC_ROLE_WEIGHTS[role1] < _constants_js__WEBPACK_IMPORTED_MODULE_4__.MUC_ROLE_WEIGHTS[role2] ? -1 : 1;
    }
}
function registerDirectInvitationHandler() {
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get().addHandler(/** @param {Element} message */ (message)=>{
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.onDirectMUCInvitation(message);
        return true;
    }, 'jabber:x:conference', 'message');
}
function disconnectChatRooms() {
    /* When disconnecting, mark all groupchats as
     * disconnected, so that they will be properly entered again
     * when fetched from session storage.
     */ return _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.filter((m)=>m.get('type') === _shared_constants_js__WEBPACK_IMPORTED_MODULE_6__.CHATROOMS_TYPE).forEach((m)=>m.session.save({
            'connection_status': _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].ROOMSTATUS.DISCONNECTED
        }));
}
function onWindowStateChanged() {
    return _async_to_generator(function*() {
        if (!document.hidden && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.connected()) {
            const rooms = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].rooms.get();
            rooms.forEach((room)=>room.rejoinIfNecessary());
        }
    })();
}
/**
 * @param {Event} [event]
 */ function routeToRoom(event) {
    return _async_to_generator(function*() {
        if (!location.hash.startsWith('#converse/room?jid=')) {
            return;
        }
        event === null || event === void 0 ? void 0 : event.preventDefault();
        const jid = location.hash.split('=').pop();
        if (!u.isValidMUCJID(jid)) {
            return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`invalid jid "${jid}" provided in url fragment`);
        }
        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('roomsAutoJoined');
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('allow_bookmarks')) {
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('bookmarksInitialized');
        }
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].rooms.open(jid, {}, true);
    })();
}
/**
 * Opens a groupchat, making sure that certain attributes
 * are correct, for example that the "type" is set to
 * "chatroom".
 * @param {string} jid
 * @param {Object} settings
 */ function openChatRoom(jid, settings) {
    return _async_to_generator(function*() {
        settings.type = _shared_constants_js__WEBPACK_IMPORTED_MODULE_6__.CHATROOMS_TYPE;
        settings.id = jid;
        const chatbox = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].rooms.get(jid, settings, true);
        chatbox.maybeShow(true);
        return chatbox;
    })();
}
/**
 * A direct MUC invitation to join a groupchat has been received
 * See XEP-0249: Direct MUC invitations.
 * @method _converse.ChatRoom#onDirectMUCInvitation
 * @param {Element} message - The message stanza containing the invitation.
 */ function onDirectMUCInvitation(message) {
    return _async_to_generator(function*() {
        const x_el = sizzle('x[xmlns="jabber:x:conference"]', message).pop(), from = Strophe.getBareJidFromJid(message.getAttribute('from')), room_jid = x_el.getAttribute('jid'), reason = x_el.getAttribute('reason');
        let result;
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_join_on_invite')) {
            result = true;
        } else {
            var _converse_state_roster_get;
            var _converse_state_roster_get_getDisplayName;
            // Invite request might come from someone not your roster list
            const contact = (_converse_state_roster_get_getDisplayName = (_converse_state_roster_get = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster.get(from)) === null || _converse_state_roster_get === void 0 ? void 0 : _converse_state_roster_get.getDisplayName()) !== null && _converse_state_roster_get_getDisplayName !== void 0 ? _converse_state_roster_get_getDisplayName : from;
            /**
         * *Hook* which is used to gather confirmation whether a direct MUC
         * invitation should be accepted or not.
         *
         * It's meant for consumers of `@converse/headless` to subscribe to
         * this hook and then ask the user to confirm.
         *
         * @event _converse#confirmDirectMUCInvitation
         */ result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hook('confirmDirectMUCInvitation', {
                contact,
                reason,
                jid: room_jid
            }, false);
        }
        if (result) {
            const chatroom = yield openChatRoom(room_jid, {
                password: x_el.getAttribute('password')
            });
            if (chatroom.session.get('connection_status') === _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].ROOMSTATUS.DISCONNECTED) {
                _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.get(room_jid).rejoin();
            }
        }
    })();
}
function getDefaultMUCNickname() {
    // XXX: if anything changes here, update the docs for the
    // locked_muc_nickname setting.
    const { profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
    if (!profile) {
        _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error('Called getDefaultMUCNickname before statusInitialized has been fired.');
        return '';
    }
    const nick = profile.getNickname();
    if (nick) {
        return nick;
    } else if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('muc_nickname_from_jid')) {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        return Strophe.unescapeNode(Strophe.getNodeFromJid(bare_jid));
    }
}
/**
 * Determines info message visibility based on
 * muc_show_info_messages configuration setting
 * @param {import('./types').MUCStatusCode} code
 * @memberOf _converse
 */ function isInfoVisible(code) {
    const info_messages = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('muc_show_info_messages');
    if (info_messages.includes(code)) {
        return true;
    }
    return false;
}
/**
 * Automatically join groupchats, based on the
 * "auto_join_rooms" configuration setting, which is an array
 * of strings (groupchat JIDs) or objects (with groupchat JID and other settings).
 */ function autoJoinRooms() {
    return _async_to_generator(function*() {
        yield Promise.all(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_join_rooms').map((muc)=>{
            if (typeof muc === 'string') {
                if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.where({
                    'jid': muc
                }).length) {
                    return Promise.resolve();
                }
                return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].rooms.open(muc);
            } else if (muc instanceof Object) {
                return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].rooms.open(muc.jid, _object_spread({}, muc));
            } else {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error('Invalid muc criteria specified for "auto_join_rooms"');
                return Promise.resolve();
            }
        }));
        /**
     * Triggered once any rooms that have been configured to be automatically joined,
     * specified via the _`auto_join_rooms` setting, have been entered.
     * @event _converse#roomsAutoJoined
     * @example _converse.api.listen.on('roomsAutoJoined', () => { ... });
     * @example _converse.api.waitUntil('roomsAutoJoined').then(() => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('roomsAutoJoined');
    })();
}
function onAddClientFeatures() {
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.features.add(Strophe.NS.MUC);
    if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('allow_muc_invitations')) {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].disco.own.features.add('jabber:x:conference'); // Invites
    }
}
function onBeforeTearDown() {
    _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.where({
        'type': _shared_constants_js__WEBPACK_IMPORTED_MODULE_6__.CHATROOMS_TYPE
    }).forEach((muc)=>(0,_utils_init_js__WEBPACK_IMPORTED_MODULE_5__.safeSave)(muc.session, {
            'connection_status': _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].ROOMSTATUS.DISCONNECTED
        }));
}
function onStatusInitialized() {
    window.addEventListener((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_7__.getUnloadEvent)(), ()=>{
        const using_websocket = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.isType('websocket');
        if (using_websocket && (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('enable_smacks') || !_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('smacks_stream_id'))) {
            // For non-SMACKS websocket connections, or non-resumeable
            // connections, we disconnect all chatrooms when the page unloads.
            // See issue #1111
            disconnectChatRooms();
        }
    });
}
function onBeforeResourceBinding() {
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get().addHandler(/** @param {Element} stanza */ (stanza)=>{
        const muc_jid = Strophe.getBareJidFromJid(stanza.getAttribute('from'));
        if (!_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.get(muc_jid)) {
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('chatBoxesFetched').then(()=>_async_to_generator(function*() {
                    const muc = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.get(muc_jid);
                    if (muc) {
                        yield muc.initialized;
                        muc.message_handler.run(stanza);
                    }
                })());
        }
        return true;
    }, null, 'message', 'groupchat');
}


/***/ }),

/***/ "./src/headless/plugins/ping/api.js":
/*!******************************************!*\
  !*** ./src/headless/plugins/ping/api.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/ping/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, $iq, u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * Pings the entity represented by the passed in JID by sending an IQ stanza to it.
     * @method api.ping
     * @param {string} [jid] - The JID of the service to ping
     *  If the ping is sent out to the user's bare JID and no response is received it will attempt to reconnect.
     * @param {number} [timeout] - The amount of time in
     *  milliseconds to wait for a response. The default is 10000;
     * @returns {Promise<boolean|null>}
     *  Whether the pinged entity responded with a non-error IQ stanza.
     *  If we already know we're not connected, no ping is sent out and `null` is returned.
     */ ping (jid, timeout) {
        return _async_to_generator(function*() {
            if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.authenticated()) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].debug("Not pinging when we know we're not authenticated");
                return null;
            }
            // XXX: We could first check here if the server advertised that it supports PING.
            // However, some servers don't advertise while still responding to pings
            // const feature = _converse.disco_entities[_converse.domain].features.findWhere({'var': Strophe.NS.PING});
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.setLastStanzaDate)(new Date());
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
            jid = jid || Strophe.getDomainFromJid(bare_jid);
            const iq = $iq({
                'type': 'get',
                'to': jid,
                'id': u.getUniqueId('ping')
            }).c('ping', {
                'xmlns': Strophe.NS.PING
            });
            const result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(iq, timeout || 10000, false);
            if (result === null) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`Timeout while pinging ${jid}`);
                if (jid === Strophe.getDomainFromJid(bare_jid)) {
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.reconnect();
                }
                return false;
            } else if (u.isErrorStanza(result)) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(`Error while pinging ${jid}`);
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(result);
                return false;
            }
            return true;
        })();
    }
});


/***/ }),

/***/ "./src/headless/plugins/ping/index.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/ping/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/ping/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/ping/utils.js");
/**
 * @description
 * Converse.js plugin which add support for application-level pings
 * as specified in XEP-0199 XMPP Ping.
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 



const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
Strophe.addNamespace('PING', "urn:xmpp:ping");
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-ping', {
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].settings.extend({
            ping_interval: 60 //in seconds
        });
        Object.assign(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"], _api_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('connected', _utils_js__WEBPACK_IMPORTED_MODULE_3__.registerHandlers);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('reconnected', _utils_js__WEBPACK_IMPORTED_MODULE_3__.registerHandlers);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('disconnected', _utils_js__WEBPACK_IMPORTED_MODULE_3__.unregisterIntervalHandler);
        document.addEventListener('visibilitychange', _utils_js__WEBPACK_IMPORTED_MODULE_3__.onWindowStateChanged);
    }
});


/***/ }),

/***/ "./src/headless/plugins/ping/utils.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/ping/utils.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   onEverySecond: () => (/* binding */ onEverySecond),
/* harmony export */   onWindowStateChanged: () => (/* binding */ onWindowStateChanged),
/* harmony export */   registerHandlers: () => (/* binding */ registerHandlers),
/* harmony export */   registerPingHandler: () => (/* binding */ registerPingHandler),
/* harmony export */   registerPongHandler: () => (/* binding */ registerPongHandler),
/* harmony export */   setLastStanzaDate: () => (/* binding */ setLastStanzaDate),
/* harmony export */   unregisterIntervalHandler: () => (/* binding */ unregisterIntervalHandler)
/* harmony export */ });
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");



const { Strophe, $iq } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
let lastStanzaDate;
function onWindowStateChanged() {
    if (!document.hidden) _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].ping(null, 5000);
}
function setLastStanzaDate(date) {
    lastStanzaDate = date;
}
function pong(ping) {
    lastStanzaDate = new Date();
    const from = ping.getAttribute('from');
    const id = ping.getAttribute('id');
    const iq = $iq({
        type: 'result',
        to: from,
        id: id
    });
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].sendIQ(iq);
    return true;
}
function registerPongHandler() {
    const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].connection.get();
    if (connection.disco) {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].disco.own.features.add(Strophe.NS.PING);
    }
    return connection.addHandler(pong, Strophe.NS.PING, "iq", "get");
}
function registerPingHandler() {
    var _api_connection_get;
    (_api_connection_get = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.addHandler(()=>{
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].settings.get('ping_interval') > 0) {
            // Handler on each stanza, saves the received date
            // in order to ping only when needed.
            lastStanzaDate = new Date();
            return true;
        }
    });
}
let intervalId;
function registerHandlers() {
    // Wrapper so that we can spy on registerPingHandler in tests
    registerPongHandler();
    registerPingHandler();
    clearInterval(intervalId);
    intervalId = setInterval(onEverySecond, 1000);
}
function unregisterIntervalHandler() {
    clearInterval(intervalId);
}
function onEverySecond() {
    if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_2__.isTestEnv)() || !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].connection.authenticated()) {
        return;
    }
    const ping_interval = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].settings.get('ping_interval');
    if (ping_interval > 0) {
        const now = new Date();
        lastStanzaDate = lastStanzaDate !== null && lastStanzaDate !== void 0 ? lastStanzaDate : now;
        if ((now.valueOf() - lastStanzaDate.valueOf()) / 1000 > ping_interval) {
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].ping();
        }
    }
}


/***/ }),

/***/ "./src/headless/plugins/pubsub/api.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/pubsub/api.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/plugins/pubsub/parsers.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}






const { Strophe, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @typedef {import('strophe.js').Builder} Builder
     * @typedef {import('strophe.js').Stanza} Stanza
     * @typedef {import('./types').PubSubConfigOptions} PubSubConfigOptions
     *
     * The "pubsub" namespace groups methods relevant to PubSub
     * @namespace _converse.api.pubsub
     * @memberOf _converse.api
     */ pubsub: {
        config: {
            /**
             * Fetches the configuration for a PubSub node
             * @method _converse.api.pubsub.config.get
             * @param {string} jid - The JID of the pubsub service where the node resides
             * @param {string} node - The node to configure
             * @returns {Promise<import('./types').PubSubConfigOptions>}
             */ get (jid, node) {
                return _async_to_generator(function*() {
                    if (!node) throw new Error('api.pubsub.config.get: Node value required');
                    const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
                    const full_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('jid');
                    const entity_jid = jid || bare_jid;
                    const stanza = stx`
                    <iq xmlns="jabber:client"
                        from="${full_jid}"
                        type="get"
                        to="${entity_jid}">
                    <pubsub xmlns="${Strophe.NS.PUBSUB}"><configure node="${node}"/></pubsub>
                    </iq>`;
                    let response;
                    try {
                        response = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(stanza);
                    } catch (error) {
                        throw yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__.parseErrorStanza)(error);
                    }
                    return (0,_parsers_js__WEBPACK_IMPORTED_MODULE_5__.parseStanzaForPubSubConfig)(response);
                })();
            },
            /**
             * Configures a PubSub node
             * @method _converse.api.pubsub.config.set
             * @param {string} jid The JID of the pubsub service where the node resides
             * @param {string} node The node to configure
             * @param {PubSubConfigOptions} config The configuration options
             * @returns {Promise<import('./types').PubSubConfigOptions>}
             */ set (jid, node, config) {
                return _async_to_generator(function*() {
                    if (!node) throw new Error('api.pubsub.config.set: Node value required');
                    const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
                    const entity_jid = jid || bare_jid;
                    const new_config = _object_spread({}, (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].pubsub.config.get(entity_jid, node)), config);
                    const stanza = stx`
                    <iq xmlns="jabber:client"
                        from="${bare_jid}"
                        type="set"
                        to="${entity_jid}">
                    <pubsub xmlns="${Strophe.NS.PUBSUB}#owner">
                        <configure node="${node}">
                            <x xmlns="${Strophe.NS.XFORM}" type="submit">
                                <field var="FORM_TYPE" type="hidden">
                                    <value>${Strophe.NS.PUBSUB}#nodeconfig</value>
                                </field>
                                ${Object.entries(new_config).map(([k, v])=>stx`<field var="${k}"><value>${v}</value></field>`)}
                            </x>
                        </configure>
                    </pubsub>
                    </iq>`;
                    try {
                        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(stanza);
                    } catch (error) {
                        throw yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__.parseErrorStanza)(error);
                    }
                    return new_config;
                })();
            }
        },
        /**
         * Publishes an item to a PubSub node
         * @method _converse.api.pubsub.publish
         * @param {string} jid The JID of the pubsub service where the node resides.
         * @param {string} node The node being published to
         * @param {Builder|Stanza|(Builder|Stanza)[]} item The XML element(s) being published
         * @param {PubSubConfigOptions} options The publisher options
         *      (see https://xmpp.org/extensions/xep-0060.html#publisher-publish-options)
         * @param {boolean} strict_options Indicates whether the publisher
         *      options are a strict requirement or not. If they're NOT
         *      strict, then Converse will publish to the node even if
         *      the publish options precondition cannot be met.
         * @returns {Promise<void|Element>}
         */ publish (jid, node, item, options, strict_options = true) {
            return _async_to_generator(function*() {
                if (!node) throw new Error('api.pubsub.publish: node value required');
                if (!item) throw new Error('api.pubsub.publish: item value required');
                const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
                const entity_jid = jid || bare_jid;
                const stanza = stx`
                <iq xmlns="jabber:client"
                    from="${bare_jid}"
                    type="set"
                    to="${entity_jid}">
                <pubsub xmlns="${Strophe.NS.PUBSUB}">
                    <publish node="${node}">${item}</publish>
                    ${options ? stx`<publish-options>
                    <x xmlns="${Strophe.NS.XFORM}" type="submit">
                        <field var="FORM_TYPE" type="hidden">
                            <value>${Strophe.NS.PUBSUB}#publish-options</value>
                        </field>
                        ${Object.entries(options).map(([k, v])=>stx`<field var="pubsub#${k}"><value>${v}</value></field>`)}
                    </x></publish-options>` : ''}
                </pubsub>
                </iq>`;
                if (entity_jid === bare_jid) {
                    // This is PEP, check for support
                    const supports_pep = (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.getIdentity('pubsub', 'pep', bare_jid)) || (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.getIdentity('pubsub', 'pep', Strophe.getDomainFromJid(bare_jid)));
                    if (!supports_pep) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`api.pubsub.publish: Not publishing via PEP because it's not supported!`);
                        _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(stanza);
                        return;
                    }
                }
                // Check for #publish-options support.
                const supports_publish_options = (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.supports(Strophe.NS.PUBSUB + '#publish-options', entity_jid)) || entity_jid === bare_jid && // XEP-0223 says we need to check the server for support
                // (although Prosody returns it on the bare jid)
                (yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.supports(Strophe.NS.PUBSUB + '#publish-options', Strophe.getDomainFromJid(entity_jid)));
                if (!supports_publish_options && strict_options) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`api.pubsub.publish: #publish-options not supported, refusing to publish item.`);
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(stanza);
                    return;
                }
                try {
                    yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(stanza);
                } catch (iq) {
                    const e = yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_4__.parseErrorStanza)(iq);
                    if (e.name === 'conflict' && /** @type {import('shared/errors').StanzaError} */ e.extra[Strophe.NS.PUBSUB_ERROR] === 'precondition-not-met') {
                        // Manually configure the node if we can't set it via publish-options
                        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].pubsub.config.set(entity_jid, node, options);
                        try {
                            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(stanza);
                        } catch (e) {
                            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                            if (!strict_options) {
                                // The publish-options precondition couldn't be met.
                                // We re-publish but without publish-options.
                                const el = stanza.tree();
                                el.querySelector('publish-options').outerHTML = '';
                                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`api.pubsub.publish: #publish-options precondition-not-met, publishing anyway.`);
                                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ(el);
                            }
                        }
                    } else {
                        throw iq;
                    }
                }
            })();
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/pubsub/index.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/pubsub/index.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/pubsub/api.js");
/* harmony import */ var _disco_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../disco/index.js */ "./src/headless/plugins/disco/index.js");
/**
 * @module converse-pubsub
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}




const { Strophe, sizzle } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
Strophe.addNamespace('PUBSUB_ERROR', Strophe.NS.PUBSUB + '#errors');
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-pubsub', {
    dependencies: [
        'converse-disco'
    ],
    initialize () {
        const { api } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].api, _api_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
        api.listen.on('parseErrorStanza', /**
             * @param {Element} stanza
             * @param {import('shared/types.js').ErrorExtra} extra
             */ (stanza, extra)=>{
            const pubsub_err = sizzle(`error [xmlns="${Strophe.NS.PUBSUB_ERROR}"]`, stanza).pop();
            if (pubsub_err) {
                return _object_spread_props(_object_spread({}, extra), {
                    [Strophe.NS.PUBSUB_ERROR]: pubsub_err.nodeName
                });
            }
            return extra;
        });
    }
});


/***/ }),

/***/ "./src/headless/plugins/pubsub/parsers.js":
/*!************************************************!*\
  !*** ./src/headless/plugins/pubsub/parsers.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseStanzaForPubSubConfig: () => (/* binding */ parseStanzaForPubSubConfig)
/* harmony export */ });
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");

/**
 * @param {Element} iq - An IQ result stanza
 * @returns {import('./types').PubSubConfigOptions}
 */ function parseStanzaForPubSubConfig(iq) {
    return (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_0__.parseXForm)(iq).fields.reduce((acc, f)=>{
        if (f.var.startsWith('pubsub#')) {
            const key = f.var.replace(/^pubsub#/, '');
            var _f_value;
            const value = f.type === 'boolean' ? f.checked : (_f_value = f.value) !== null && _f_value !== void 0 ? _f_value : null;
            acc[key] = value;
        }
        return acc;
    }, {});
}


/***/ }),

/***/ "./src/headless/plugins/roster/api.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/roster/api.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _utils_jid_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/jid.js */ "./src/headless/utils/jid.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @namespace _converse.api.contacts
     * @memberOf _converse.api
     *
     * @typedef {import('./contact').default} RosterContact
     */ contacts: {
        /**
         * This method is used to retrieve roster contacts.
         *
         * @method _converse.api.contacts.get
         * @param {(string[]|string)} jids The JID or JIDs of the contacts to be returned.
         * @returns {promise} Promise which resolves with the
         *  {@link RosterContact} (or an array of them) representing the contact.
         *
         * @example
         * // Fetch a single contact
         * _converse.api.listen.on('rosterContactsFetched', function () {
         *     const contact = await _converse.api.contacts.get('buddy@example.com')
         *     // ...
         * });
         *
         * @example
         * // To get multiple contacts, pass in an array of JIDs:
         * _converse.api.listen.on('rosterContactsFetched', function () {
         *     const contacts = await _converse.api.contacts.get(
         *         ['buddy1@example.com', 'buddy2@example.com']
         *     )
         *     // ...
         * });
         *
         * @example
         * // To return all contacts, simply call ``get`` without any parameters:
         * _converse.api.listen.on('rosterContactsFetched', function () {
         *     const contacts = await _converse.api.contacts.get();
         *     // ...
         * });
         */ get (jids) {
            return _async_to_generator(function*() {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('rosterContactsFetched');
                const { roster } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state;
                const _getter = /** @param {string} jid */ (jid)=>roster.get(Strophe.getBareJidFromJid(jid));
                if (jids === undefined) {
                    jids = roster.pluck('jid');
                } else if (typeof jids === 'string') {
                    return _getter(jids);
                }
                return /** @type {string[]} */ jids.map(_getter);
            })();
        },
        /**
         * Remove a contact from the roster
         * @param {string} jid
         * @param {boolean} [unsubscribe] - Whether we should unsubscribe
         * from the contact's presence updates.
         */ remove (jid, unsubscribe) {
            return _async_to_generator(function*() {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('rosterContactsFetched');
                const contact = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].contacts.get(jid);
                contact.remove(unsubscribe);
            })();
        },
        /**
         * Add a contact.
         * @param {import('./types').RosterContactAttributes} attributes
         * @param {boolean} [persist=true] - Whether the contact should be persisted to the user's roster.
         * @param {boolean} [subscribe=true] - Whether we should subscribe to the contacts presence updates.
         * @param {string} [message=''] - An optional message to include with the presence subscription
         * @param {boolean} subscribe - Whether a presense subscription should
         *      be sent out to the contact being added.
         * @returns {Promise<RosterContact>}
         * @example
         *      api.contacts.add({ jid: 'buddy@example.com', groups: ['Buddies'] })
         */ add (attributes, persist = true, subscribe = true, message = '') {
            return _async_to_generator(function*() {
                if (!(0,_utils_jid_js__WEBPACK_IMPORTED_MODULE_0__.isValidJID)(attributes === null || attributes === void 0 ? void 0 : attributes.jid)) throw new Error('api.contacts.add: Valid JID required');
                const { roster } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state;
                return roster.addContact(attributes, persist, subscribe, message);
            })();
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/roster/contact.js":
/*!************************************************!*\
  !*** ./src/headless/plugins/roster/contact.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _plugins_status_api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../plugins/status/api.js */ "./src/headless/plugins/status/api.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_color_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/color.js */ "./src/headless/shared/color.js");
/* harmony import */ var _shared_model_with_vcard_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../shared/model-with-vcard.js */ "./src/headless/shared/model-with-vcard.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/roster/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}









const { Strophe, $pres, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__["default"].env;
class RosterContact extends (0,_shared_model_with_vcard_js__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_shared_color_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Model)) {
    get idAttribute() {
        return 'jid';
    }
    defaults() {
        return {
            groups: [],
            num_unread: 0
        };
    }
    initialize(attrs) {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            this.lazy_load_vcard = true;
            _superprop_get_initialize().call(_this);
            this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
            yield this.setPresence();
            const { jid } = attrs;
            this.set(_object_spread({}, attrs, {
                jid: Strophe.getBareJidFromJid(jid).toLowerCase(),
                user_id: Strophe.getNodeFromJid(jid)
            }));
            /**
         * When a contact's presence status has changed.
         * The presence status is either `online`, `offline`, `dnd`, `away` or `xa`.
         * @event _converse#contactPresenceChanged
         * @type {RosterContact}
         * @example _converse.api.listen.on('contactPresenceChanged', contact => { ... });
         */ this.listenTo(this.presence, 'change:show', ()=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].trigger('contactPresenceChanged', this));
            this.listenTo(this.presence, 'change:show', ()=>this.trigger('presence:change'));
            this.listenTo(this.presence, 'change:presence', ()=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].trigger('contactPresenceChanged', this));
            this.listenTo(this.presence, 'change:presence', ()=>this.trigger('presence:change'));
            /**
         * Synchronous event which provides a hook for further initializing a RosterContact
         * @event _converse#rosterContactInitialized
         * @param {RosterContact} contact
         */ yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].trigger('rosterContactInitialized', this, {
                synchronous: true
            });
            this.initialized.resolve();
        }).call(this);
    }
    setPresence() {
        return _async_to_generator(function*() {
            const jid = this.get('jid');
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].waitUntil('presencesInitialized');
            const { presences } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].state;
            this.presence = presences.get(jid) || presences.create({
                jid
            });
        }).call(this);
    }
    getStatus() {
        var _this_presence;
        return ((_this_presence = this.presence) === null || _this_presence === void 0 ? void 0 : _this_presence.getStatus()) || 'offline';
    }
    openChat() {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].chats.open(this.get('jid'), {}, true);
    }
    /**
     * @param {import('./types').ContactDisplayNameOptions} [options]
     * @returns {string}
     */ getDisplayName(options) {
        var _this_vcard;
        return this.get('nickname') || ((_this_vcard = this.vcard) === null || _this_vcard === void 0 ? void 0 : _this_vcard.getDisplayName()) || ((options === null || options === void 0 ? void 0 : options.no_jid) ? null : this.get('jid'));
    }
    /**
     * Send a presence subscription request to this roster contact
     * @param {string} message - An optional message to explain the
     *      reason for the subscription request.
     */ subscribe(message) {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].user.presence.send({
            type: 'subscribe',
            to: this.get('jid'),
            status: message
        });
        this.save('ask', "subscribe"); // ask === 'subscribe' Means we have asked to subscribe to them.
        return this;
    }
    /**
     * Upon receiving the presence stanza of type "subscribed",
     * the user SHOULD acknowledge receipt of that subscription
     * state notification by sending a presence stanza of type
     * "subscribe" to the contact
     */ ackSubscribe() {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].send($pres({
            'type': 'subscribe',
            'to': this.get('jid')
        }));
    }
    /**
     * Upon receiving the presence stanza of type "unsubscribed",
     * the user SHOULD acknowledge receipt of that subscription state
     * notification by sending a presence stanza of type "unsubscribe"
     * this step lets the user's server know that it MUST no longer
     * send notification of the subscription state change to the user.
     */ ackUnsubscribe() {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].send($pres({
            'type': 'unsubscribe',
            'to': this.get('jid')
        }));
        this.sendRosterRemoveStanza();
        this.destroy();
    }
    /**
     * Unauthorize this contact's presence subscription
     * @param {string} [message] - Optional message to send to the person being unauthorized
     */ unauthorize(message) {
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_8__.rejectPresenceSubscription)(this.get('jid'), message);
        this.save({
            requesting: false
        });
        return this;
    }
    /**
     * Authorize presence subscription
     * @param {string} message - Optional message to send to the person being authorized
     */ authorize(message) {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].send(stx`
            <presence
                to="${this.get('jid')}"
                type="subscribed"
                xmlns="jabber:client">
                    ${message && message !== "" ? stx`<status>${message}</status>` : ''}
            </presence>`);
        this.save({
            requesting: false,
            subscription: 'from'
        });
        return this;
    }
    /**
     * Remove this contact from the roster
     * @async
     * @param {boolean} [unauthorize] - Whether to also unauthorize the
     * @returns {Promise<Error|Element>}
     */ remove(unauthorize) {
        const subscription = this.get('subscription');
        if (subscription === 'none' && this.get('ask') !== 'subscribe') {
            this.destroy();
            return;
        }
        if (this.get('ask') === 'subscribe' || subscription === 'to') {
            // See: https://datatracker.ietf.org/doc/html/rfc6121#section-3.3.1
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].send($pres({
                type: 'unsubscribe',
                to: this.get('jid')
            }));
        }
        if (unauthorize && [
            'from',
            'both'
        ].includes(subscription)) {
            // See: https://datatracker.ietf.org/doc/html/rfc6121#section-3.2.1
            this.unauthorize();
        }
        const promise = this.sendRosterRemoveStanza();
        if (this.collection) this.destroy();
        return promise;
    }
    /**
     * @param {import('./types').RosterContactUpdateAttrs} attrs
     * @returns {Promise}
     */ update(attrs) {
        return _async_to_generator(function*() {
            var _this_get;
            this.save(attrs);
            return yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].sendIQ(stx`<iq xmlns="jabber:client" type="set">
                <query xmlns="${Strophe.NS.ROSTER}">
                    <item jid="${this.get("jid")}" name="${this.get("nickname")}">
                        ${(_this_get = this.get("groups")) === null || _this_get === void 0 ? void 0 : _this_get.map(/** @param {string} group */ (group)=>stx`<group>${group}</group>`)}
                    </item>
                </query>
            </iq>`);
        }).call(this);
    }
    /**
     * Instruct the XMPP server to remove this contact from our roster
     * @returns {Promise}
     */ sendRosterRemoveStanza() {
        return _async_to_generator(function*() {
            const iq = stx`<iq type="set" xmlns="jabber:client">
            <query xmlns="${Strophe.NS.ROSTER}">
                <item jid="${this.get('jid')}" subscription="remove"/>
            </query>
        </iq>`;
            return yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].sendIQ(iq);
        }).call(this);
    }
    isUnsaved() {
        return this.get('subscription') === undefined;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RosterContact);


/***/ }),

/***/ "./src/headless/plugins/roster/contacts.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/roster/contacts.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _contact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contact.js */ "./src/headless/plugins/roster/contact.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/roster/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}








const { Strophe, sizzle, stx, u, Stanza } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
class RosterContacts extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection {
    initialize() {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
        const id = `roster.state-${bare_jid}-${this.get('jid')}`;
        this.state = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model({
            id,
            'collapsed_groups': []
        });
        (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_6__.initStorage)(this.state, id);
        this.state.fetch();
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('chatBoxClosed', /** @param {import('../../shared/chatbox').default} model */ (model)=>this.removeUnsavedContact(model));
    }
    /**
     * @param {import('../../shared/chatbox').default} model
     */ removeUnsavedContact(model) {
        const contact = this.get(model.get('jid'));
        if (contact && contact.get('subscription') === undefined) {
            contact.destroy();
        }
    }
    onConnected() {
        // Called as soon as the connection has been established
        // (either after initial login, or after reconnection).
        // Use the opportunity to register stanza handlers.
        this.registerRosterHandler();
        this.registerRosterXHandler();
    }
    /**
     * Register a handler for roster IQ "set" stanzas, which update
     * roster contacts.
     */ registerRosterHandler() {
        // Register a handler for roster IQ "set" stanzas, which update
        // roster contacts.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().addHandler(/** @param {Element} iq */ (iq)=>{
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.roster.onRosterPush(iq);
            return true;
        }, Strophe.NS.ROSTER, 'iq', 'set');
    }
    /**
     * Register a handler for RosterX message stanzas, which are
     * used to suggest roster contacts to a user.
     */ registerRosterXHandler() {
        let t = 0;
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
        connection.addHandler(/** @param {Element} msg */ (msg)=>{
            setTimeout(()=>{
                const { roster } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state;
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().flush();
                roster.subscribeToSuggestedItems(msg);
            }, t);
            t += msg.querySelectorAll('item').length * 250;
            return true;
        }, Strophe.NS.ROSTERX, 'message', null);
    }
    /**
     * Fetches the roster contacts, first by trying the browser cache,
     * and if that's empty, then by querying the XMPP server.
     * @returns {promise} Promise which resolves once the contacts have been fetched.
     */ fetchRosterContacts() {
        return _async_to_generator(function*() {
            const result = yield new Promise((resolve, reject)=>{
                this.fetch({
                    add: true,
                    silent: true,
                    success: resolve,
                    error: (_, e)=>reject(e)
                });
            });
            if (u.isErrorObject(result)) {
                _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(result);
                // Force a full roster refresh
                _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save('roster_cached', false);
                this.data.save('version', undefined);
            }
            if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('roster_cached')) {
                /**
             * The contacts roster has been retrieved from the local cache (`sessionStorage`).
             * @event _converse#cachedRoster
             * @type {RosterContacts}
             * @example _converse.api.listen.on('cachedRoster', (items) => { ... });
             * @example _converse.api.waitUntil('cachedRoster').then(items => { ... });
             */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('cachedRoster', result);
            } else {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().send_initial_presence = true;
                return _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.roster.fetchFromServer();
            }
        }).call(this);
    }
    /**
     * @param {Element} msg
     */ subscribeToSuggestedItems(msg) {
        Array.from(msg.querySelectorAll('item')).forEach((item)=>{
            if (item.getAttribute('action') === 'add') {
                this.addContact({
                    jid: item.getAttribute('jid'),
                    name: item.getAttribute('name'),
                    subscription: 'to'
                });
            }
        });
        return true;
    }
    /**
     * @param {string} jid
     */ isSelf(jid) {
        return u.isSameBareJID(jid, _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().jid);
    }
    /**
     * Send an IQ stanza to the XMPP server to add a new roster contact.
     * @param {import('./types').RosterContactAttributes} attributes
     */ sendContactAddIQ(attributes) {
        const { jid, groups } = attributes;
        const name = attributes.name ? attributes.name : null;
        const iq = stx`
            <iq type="set" xmlns="jabber:client">
                <query xmlns="${Strophe.NS.ROSTER}">
                    <item jid="${jid}" ${name ? Stanza.unsafeXML(`name="${Strophe.xmlescape(name)}"`) : ''}>
                        ${groups === null || groups === void 0 ? void 0 : groups.map(/** @param {string} g */ (g)=>stx`<group>${g}</group>`)}
                    </item>
                </query>
            </iq>`;
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].sendIQ(iq);
    }
    /**
     * Adds a {@link RosterContact} instance to {@link RosterContacts} and
     * optionally (if subscribe=true) subscribe to the contact's presence
     * updates which also adds the contact to the roster on the XMPP server.
     * @param {import('./types').RosterContactAttributes} attributes
     * @param {boolean} [persist=true] - Whether the contact should be persisted to the user's roster.
     * @param {boolean} [subscribe=true] - Whether we should subscribe to the contacts presence updates.
     * @param {string} [message=''] - An optional message to include with the presence subscription
     * @returns {Promise<RosterContact>}
     */ addContact(attributes, persist = true, subscribe = true, message = '') {
        return _async_to_generator(function*() {
            const { jid, name } = attributes !== null && attributes !== void 0 ? attributes : {};
            if (!jid || !u.isValidJID(jid)) throw new Error('Invalid JID provided to addContact');
            yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].waitUntil('rosterContactsFetched');
            if (persist) {
                try {
                    yield this.sendContactAddIQ(attributes);
                } catch (e) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(e);
                    const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
                    alert(__('Sorry, an error occurred while trying to add %1$s as a contact.', name || jid));
                    throw e;
                }
            }
            const contact = yield this.create(_object_spread({}, {
                ask: undefined,
                nickname: name,
                groups: [],
                requesting: false,
                subscription: persist ? 'none' : undefined
            }, attributes), {
                sort: false
            });
            if (subscribe) contact.subscribe(message);
            return contact;
        }).call(this);
    }
    /**
     * @param {string} bare_jid
     * @param {Element} presence
     * @param {string} [auth_msg=''] - Optional message to be included in the
     *   authorization of the contacts subscription request.
     * @param {string} [sub_msg=''] - Optional message to be included in our
     *   reciprocal subscription request.
     */ subscribeBack(bare_jid, presence, auth_msg = '', sub_msg = '') {
        return _async_to_generator(function*() {
            const contact = this.get(bare_jid);
            const { RosterContact } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports;
            if (contact instanceof RosterContact) {
                contact.authorize().subscribe();
            } else {
                var _sizzle_pop;
                // Can happen when a subscription is retried or roster was deleted
                const nickname = ((_sizzle_pop = sizzle(`nick[xmlns="${Strophe.NS.NICK}"]`, presence).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.textContent) || undefined;
                const contact = yield this.addContact({
                    jid: bare_jid,
                    name: nickname,
                    groups: [],
                    subscription: 'from'
                });
                if (contact instanceof RosterContact) {
                    contact.authorize(auth_msg).subscribe(sub_msg);
                }
            }
        }).call(this);
    }
    /**
     * Handle roster updates from the XMPP server.
     * See: https://xmpp.org/rfcs/rfc6121.html#roster-syntax-actions-push
     * @param {Element} iq - The IQ stanza received from the XMPP server.
     */ onRosterPush(iq) {
        const id = iq.getAttribute('id');
        const from = iq.getAttribute('from');
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
        if (from && from !== bare_jid) {
            // https://tools.ietf.org/html/rfc6121#page-15
            //
            // A receiving client MUST ignore the stanza unless it has no 'from'
            // attribute (i.e., implicitly from the bare JID of the user's
            // account) or it has a 'from' attribute whose value matches the
            // user's bare JID <user@domainpart>.
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(`Ignoring roster illegitimate roster push message from ${iq.getAttribute('from')}`);
            return;
        }
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].send(stx`<iq type="result" id="${id}" from="${_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().jid}" xmlns="jabber:client" />`);
        const query = sizzle(`query[xmlns="${Strophe.NS.ROSTER}"]`, iq).pop();
        this.data.save('version', query.getAttribute('ver'));
        const items = sizzle(`item`, query);
        if (items.length > 1) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(iq);
            throw new Error('Roster push query may not contain more than one "item" element.');
        }
        if (items.length === 0) {
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(iq);
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn('Received a roster push stanza without an "item" element.');
            return;
        }
        this.updateContact(items.pop());
        /**
         * When the roster receives a push event from server (i.e. new entry in your contacts roster).
         * @event _converse#rosterPush
         * @type {Element}
         * @example _converse.api.listen.on('rosterPush', iq => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('rosterPush', iq);
        return;
    }
    shouldUseRosterVersioning() {
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('enable_roster_versioning') && this.data.get('version') && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.stream.getFeature('ver', 'urn:xmpp:features:rosterver');
    }
    /**
     * Fetches the roster from the XMPP server and updates the local state
     * @emits _converse#roster
     * @returns {Promise}
     */ fetchFromServer() {
        return _async_to_generator(function*() {
            const stanza = stx`
            <iq type="get" id="${u.getUniqueId('roster')}" xmlns="jabber:client">
                <query xmlns="${Strophe.NS.ROSTER}"
                    ${this.shouldUseRosterVersioning() ? Stanza.unsafeXML(`ver="${this.data.get('version')}"`) : ''}>
                </query>
            </iq>`;
            const iq = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].sendIQ(stanza, null, false);
            if (iq.getAttribute('type') === 'result') {
                const query = sizzle(`query[xmlns="${Strophe.NS.ROSTER}"]`, iq).pop();
                if (query) {
                    const items = sizzle(`item`, query);
                    if (!this.data.get('version') && this.models.length) {
                        // We're getting the full roster, so remove all cached
                        // contacts that aren't included in it.
                        const jids = items.map(/** @param {Element} item */ (item)=>item.getAttribute('jid'));
                        this.forEach((m)=>!m.get('requesting') && !jids.includes(m.get('jid')) && m.destroy());
                    }
                    items.forEach((item)=>this.updateContact(item));
                    this.data.save('version', query.getAttribute('ver'));
                }
            } else if (!u.isServiceUnavailableError(iq)) {
                // Some unknown error happened, so we will try to fetch again if the page reloads.
                _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error(iq);
                _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].error('Error while trying to fetch roster from the server');
                return;
            }
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save('roster_cached', true);
            /**
         * When the roster has been received from the XMPP server.
         * See also the `cachedRoster` event further up, which gets called instead of
         * `roster` if its already in `sessionStorage`.
         * @event _converse#roster
         * @type {Element}
         * @example _converse.api.listen.on('roster', iq => { ... });
         * @example _converse.api.waitUntil('roster').then(iq => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('roster', iq);
        }).call(this);
    }
    /**
     * Update or create RosterContact models based on the given `item` XML
     * node received in the resulting IQ stanza from the server.
     * @param {Element} item
     */ updateContact(item) {
        const jid = item.getAttribute('jid');
        const contact = this.get(jid);
        const subscription = item.getAttribute('subscription');
        if (subscription === 'remove') {
            return contact === null || contact === void 0 ? void 0 : contact.destroy();
        }
        const ask = item.getAttribute('ask');
        const nickname = item.getAttribute('name');
        const groups = [
            ...new Set(sizzle('group', item).map((e)=>e.textContent))
        ];
        if (contact) {
            // We only find out about requesting contacts via the
            // presence handler, so if we receive a contact
            // here, we know they aren't requesting anymore.
            contact.save({
                subscription,
                ask,
                nickname,
                groups,
                'requesting': null
            });
        } else {
            this.create({
                nickname,
                ask,
                groups,
                jid,
                subscription
            }, {
                sort: false
            });
        }
    }
    /**
     * @param {Element} presence
     */ createRequestingContact(presence) {
        var _sizzle_pop;
        const jid = Strophe.getBareJidFromJid(presence.getAttribute('from'));
        const nickname = ((_sizzle_pop = sizzle(`nick[xmlns="${Strophe.NS.NICK}"]`, presence).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.textContent) || null;
        const user_data = {
            jid,
            subscription: 'none',
            ask: null,
            requesting: true,
            nickname: nickname
        };
        /**
         * Triggered when someone has requested to subscribe to your presence (i.e. to be your contact).
         * @event _converse#contactRequest
         * @type {RosterContact}
         * @example _converse.api.listen.on('contactRequest', contact => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger('contactRequest', this.create(user_data));
    }
    /**
     * @param {Element} presence
     */ handleIncomingSubscription(presence) {
        const jid = presence.getAttribute('from'), bare_jid = Strophe.getBareJidFromJid(jid), contact = this.get(bare_jid);
        if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('allow_contact_requests')) {
            const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.rejectPresenceSubscription)(jid, __('This client does not allow presence subscriptions'));
        }
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('auto_subscribe')) {
            if (!contact || contact.get('subscription') !== 'to') {
                this.subscribeBack(bare_jid, presence);
            } else {
                contact.authorize();
            }
        } else {
            if (contact) {
                if (contact.get('subscription') !== 'none') {
                    contact.authorize();
                } else if (contact.get('ask') === 'subscribe') {
                    contact.authorize();
                }
            } else {
                this.createRequestingContact(presence);
            }
        }
    }
    /**
     * @param {Element} stanza
     */ handleOwnPresence(stanza) {
        const jid = stanza.getAttribute('from');
        const resource = Strophe.getResourceFromJid(jid);
        const presence_type = stanza.getAttribute('type');
        const { profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state;
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get().jid !== jid && presence_type !== 'unavailable' && (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('synchronize_availability') === true || _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('synchronize_availability') === resource)) {
            var _stanza_querySelector, _stanza_querySelector1;
            // Another resource has changed its status and
            // synchronize_availability option set to update,
            // we'll update ours as well.
            const show = (_stanza_querySelector = stanza.querySelector('show')) === null || _stanza_querySelector === void 0 ? void 0 : _stanza_querySelector.textContent;
            profile.save({
                show,
                presence: 'online'
            }, {
                silent: true
            });
            const status_message = (_stanza_querySelector1 = stanza.querySelector('status')) === null || _stanza_querySelector1 === void 0 ? void 0 : _stanza_querySelector1.textContent;
            if (status_message) profile.save({
                status_message
            });
        }
        if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('jid') === jid && presence_type === 'unavailable') {
            // XXX: We've received an "unavailable" presence from our
            // own resource. Apparently this happens due to a
            // Prosody bug, whereby we send an IQ stanza to remove
            // a roster contact, and Prosody then sends
            // "unavailable" globally, instead of directed to the
            // particular user that's removed.
            //
            // Here is the bug report: https://prosody.im/issues/1121
            //
            // I'm not sure whether this might legitimately happen
            // in other cases.
            //
            // As a workaround for now we simply send our presence again,
            // otherwise we're treated as offline.
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].user.presence.send();
        }
    }
    /**
     * @param {Element} presence
     */ presenceHandler(presence) {
        const presence_type = presence.getAttribute('type');
        if (presence_type === 'error') return true;
        const jid = presence.getAttribute('from');
        const bare_jid = Strophe.getBareJidFromJid(jid);
        if (this.isSelf(bare_jid)) {
            return this.handleOwnPresence(presence);
        } else if (sizzle(`query[xmlns="${Strophe.NS.MUC}"]`, presence).length) {
            return; // Ignore MUC
        }
        const contact = this.get(bare_jid);
        if (contact) {
            var _presence_querySelector;
            const status = (_presence_querySelector = presence.querySelector('status')) === null || _presence_querySelector === void 0 ? void 0 : _presence_querySelector.textContent;
            if (contact.get('status') !== status) contact.save({
                status
            });
        }
        if (presence_type === 'subscribed' && contact) {
            contact.ackSubscribe();
        } else if (presence_type === 'unsubscribed' && contact) {
            contact.ackUnsubscribe();
        } else if (presence_type === 'unsubscribe') {
            return;
        } else if (presence_type === 'subscribe') {
            this.handleIncomingSubscription(presence);
        } else if (presence_type === 'unavailable' && contact) {
            const resource = Strophe.getResourceFromJid(jid);
            contact.presence.removeResource(resource);
        } else if (contact) {
            // presence_type is undefined
            contact.presence.addResource(presence);
        }
    }
    constructor(){
        super();
        this.model = _contact_js__WEBPACK_IMPORTED_MODULE_1__["default"];
        this.data = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RosterContacts);


/***/ }),

/***/ "./src/headless/plugins/roster/filter.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/roster/filter.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RosterFilter: () => (/* binding */ RosterFilter)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);

class RosterFilter extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    initialize() {
        super.initialize();
        this.set({
            text: '',
            type: 'items',
            state: 'online'
        });
    }
}



/***/ }),

/***/ "./src/headless/plugins/roster/index.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/roster/index.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Presence: () => (/* reexport safe */ _presence_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   Presences: () => (/* reexport safe */ _presences_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   RosterContact: () => (/* reexport safe */ _contact_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   RosterContacts: () => (/* reexport safe */ _contacts_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   RosterFilter: () => (/* reexport safe */ _filter_js__WEBPACK_IMPORTED_MODULE_4__.RosterFilter)
/* harmony export */ });
/* harmony import */ var _contact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contact.js */ "./src/headless/plugins/roster/contact.js");
/* harmony import */ var _contacts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contacts.js */ "./src/headless/plugins/roster/contacts.js");
/* harmony import */ var _presence_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./presence.js */ "./src/headless/plugins/roster/presence.js");
/* harmony import */ var _presences_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./presences.js */ "./src/headless/plugins/roster/presences.js");
/* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./src/headless/plugins/roster/filter.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/roster/plugin.js");









/***/ }),

/***/ "./src/headless/plugins/roster/parsers.js":
/*!************************************************!*\
  !*** ./src/headless/plugins/roster/parsers.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parsePresence: () => (/* binding */ parsePresence)
/* harmony export */ });
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");

const { Strophe, sizzle, dayjs } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__["default"].env;
/**
 * @param {Element} stanza
 * @returns {import('./types').Presence}
 */ function parsePresence(stanza) {
    var _stanza_querySelector, /** @type {import('./types').PresenceShowValues|undefined} */ _stanza_querySelector1;
    const jid = stanza.getAttribute('from');
    const type = /** @type {import('./types').PresenceTypes} */ stanza.getAttribute('type');
    const resource = Strophe.getResourceFromJid(jid);
    const delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, stanza).pop();
    const priority = (_stanza_querySelector = stanza.querySelector('priority')) === null || _stanza_querySelector === void 0 ? void 0 : _stanza_querySelector.textContent;
    const show = (_stanza_querySelector1 = stanza.querySelector('show')) === null || _stanza_querySelector1 === void 0 ? void 0 : _stanza_querySelector1.textContent;
    const timestamp = delay ? dayjs(delay.getAttribute('stamp')).toISOString() : new Date().toISOString();
    return {
        resource,
        show,
        timestamp,
        type,
        priority: Number.isNaN(parseInt(priority, 10)) ? 0 : parseInt(priority, 10)
    };
}


/***/ }),

/***/ "./src/headless/plugins/roster/plugin.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/roster/plugin.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _plugins_status_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../plugins/status/index.js */ "./src/headless/plugins/status/index.js");
/* harmony import */ var _contact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contact.js */ "./src/headless/plugins/roster/contact.js");
/* harmony import */ var _contacts_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contacts.js */ "./src/headless/plugins/roster/contacts.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/roster/api.js");
/* harmony import */ var _presence_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./presence.js */ "./src/headless/plugins/roster/presence.js");
/* harmony import */ var _presences_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./presences.js */ "./src/headless/plugins/roster/presences.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/roster/utils.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 









_shared_api_public_js__WEBPACK_IMPORTED_MODULE_5__["default"].plugins.add('converse-roster', {
    dependencies: [
        'converse-status'
    ],
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].settings.extend({
            allow_contact_requests: true,
            auto_subscribe: false,
            enable_roster_versioning: true,
            show_self_in_roster: true,
            synchronize_availability: true
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].promises.add([
            'cachedRoster',
            'roster',
            'rosterContactsFetched',
            'rosterInitialized',
            'presencesInitialized'
        ]);
        // API methods only available to plugins
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].api, _api_js__WEBPACK_IMPORTED_MODULE_6__["default"]);
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"];
        const labels = {
            HEADER_UNSAVED_CONTACTS: __('Unsaved contacts'),
            HEADER_CURRENT_CONTACTS: __('My contacts'),
            HEADER_PENDING_CONTACTS: __('Pending contacts'),
            HEADER_REQUESTING_CONTACTS: __('Contact requests'),
            HEADER_UNGROUPED: __('Ungrouped'),
            HEADER_UNREAD: __('New messages')
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"], labels); // XXX DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].labels, labels);
        const exports = {
            Presence: _presence_js__WEBPACK_IMPORTED_MODULE_7__["default"],
            Presences: _presences_js__WEBPACK_IMPORTED_MODULE_8__["default"],
            RosterContact: _contact_js__WEBPACK_IMPORTED_MODULE_1__["default"],
            RosterContacts: _contacts_js__WEBPACK_IMPORTED_MODULE_2__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"], exports); // XXX DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].exports, exports);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('beforeTearDown', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_9__.unregisterPresenceHandler)());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('chatBoxesInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_9__.onChatBoxesInitialized);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('clearSession', _utils_js__WEBPACK_IMPORTED_MODULE_9__.onClearSession);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('presencesInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_9__.onPresencesInitialized);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('statusInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_9__.onStatusInitialized);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].listen.on('streamResumptionFailed', ()=>_shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].session.set('roster_cached', false));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].waitUntil('rosterContactsFetched').then(_utils_js__WEBPACK_IMPORTED_MODULE_9__.onRosterContactsFetched);
    }
});


/***/ }),

/***/ "./src/headless/plugins/roster/presence.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/roster/presence.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _resources_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./resources.js */ "./src/headless/plugins/roster/resources.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/plugins/roster/parsers.js");




class Presence extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Model {
    get idAttribute() {
        return 'jid';
    }
    defaults() {
        return {
            presence: 'offline',
            show: null
        };
    }
    initialize() {
        super.initialize();
        this.resources = new _resources_js__WEBPACK_IMPORTED_MODULE_0__["default"]();
        const id = `converse.identities-${this.get('jid')}`;
        (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_2__.initStorage)(this.resources, id, 'session');
        this.listenTo(this.resources, 'update', this.onResourcesChanged);
        this.listenTo(this.resources, 'change', this.onResourcesChanged);
    }
    onResourcesChanged() {
        const hpr = this.getHighestPriorityResource();
        var _hpr_attributes;
        const { presence, show } = (_hpr_attributes = hpr === null || hpr === void 0 ? void 0 : hpr.attributes) !== null && _hpr_attributes !== void 0 ? _hpr_attributes : {};
        this.save({
            presence,
            show
        });
    }
    getStatus() {
        const presence = this.get('presence');
        if (presence === 'offline') {
            return 'offline';
        }
        return this.get('show') || presence || 'offline';
    }
    /**
     * Return the resource with the highest priority.
     * If multiple resources have the same priority, take the latest one.
     */ getHighestPriorityResource() {
        return this.resources.sortBy((r)=>`${r.get('priority')}-${r.get('timestamp')}`).reverse()[0];
    }
    /**
     * Adds a new resource and it's associated attributes as taken
     * from the passed in presence stanza.
     * Also updates the presence if the resource has higher priority (and is newer).
     * @param {Element} presence: The presence stanza
     */ addResource(presence) {
        const attrs = (0,_parsers_js__WEBPACK_IMPORTED_MODULE_3__.parsePresence)(presence);
        const settings = {
            name: attrs.resource,
            presence: attrs.type === 'unavailable' ? 'offline' : 'online',
            priority: attrs.priority,
            show: attrs.show,
            timestamp: attrs.timestamp
        };
        const resource = this.resources.get(settings.name);
        if (resource) {
            resource.save(settings);
        } else {
            this.resources.create(settings);
        }
    }
    /**
     * Remove the passed in resource from the resources map.
     * Also redetermines the presence given that there's one less
     * resource.
     * @param {string} name: The resource name
     */ removeResource(name) {
        const resource = this.resources.get(name);
        resource === null || resource === void 0 ? void 0 : resource.destroy();
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Presence);


/***/ }),

/***/ "./src/headless/plugins/roster/presences.js":
/*!**************************************************!*\
  !*** ./src/headless/plugins/roster/presences.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _presence_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./presence.js */ "./src/headless/plugins/roster/presence.js");


class Presences extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection {
    constructor(){
        super();
        this.model = _presence_js__WEBPACK_IMPORTED_MODULE_1__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Presences);


/***/ }),

/***/ "./src/headless/plugins/roster/resource.js":
/*!*************************************************!*\
  !*** ./src/headless/plugins/roster/resource.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);

class Resource extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    get idAttribute() {
        return 'name';
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Resource);


/***/ }),

/***/ "./src/headless/plugins/roster/resources.js":
/*!**************************************************!*\
  !*** ./src/headless/plugins/roster/resources.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resource */ "./src/headless/plugins/roster/resource.js");


class Resources extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection {
    constructor(){
        super();
        this.model = _resource__WEBPACK_IMPORTED_MODULE_1__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Resources);


/***/ }),

/***/ "./src/headless/plugins/roster/utils.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/roster/utils.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isUnsavedContact: () => (/* binding */ isUnsavedContact),
/* harmony export */   onChatBoxesInitialized: () => (/* binding */ onChatBoxesInitialized),
/* harmony export */   onClearSession: () => (/* binding */ onClearSession),
/* harmony export */   onPresencesInitialized: () => (/* binding */ onPresencesInitialized),
/* harmony export */   onRosterContactsFetched: () => (/* binding */ onRosterContactsFetched),
/* harmony export */   onStatusInitialized: () => (/* binding */ onStatusInitialized),
/* harmony export */   rejectPresenceSubscription: () => (/* binding */ rejectPresenceSubscription),
/* harmony export */   unregisterPresenceHandler: () => (/* binding */ unregisterPresenceHandler)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _plugins_roster_filter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../plugins/roster/filter.js */ "./src/headless/plugins/roster/filter.js");
/* harmony import */ var _shared_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/constants */ "./src/headless/shared/constants.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/**
 * @typedef {import('./contacts').default} RosterContacts
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









const { $pres } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
function initRoster() {
    // Initialize the collections that represent the roster contacts and groups
    const roster = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.RosterContacts();
    Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
        roster
    }); // XXX Deprecated
    Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state, {
        roster
    });
    const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
    let id = `converse.contacts-${bare_jid}`;
    (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_7__.initStorage)(roster, id);
    const roster_filter = new _plugins_roster_filter_js__WEBPACK_IMPORTED_MODULE_5__.RosterFilter();
    Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
        roster_filter
    }); // XXX Deprecated
    Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state, {
        roster_filter
    });
    roster_filter.id = `_converse.rosterfilter-${bare_jid}`;
    (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_7__.initStorage)(roster_filter, roster_filter.id);
    roster_filter.fetch();
    id = `converse-roster-model-${bare_jid}`;
    roster.data = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__.Model();
    roster.data.id = id;
    (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_7__.initStorage)(roster.data, id);
    roster.data.fetch();
    /**
     * Triggered once the `RosterContacts`
     * been created, but not yet populated with data.
     * This event is useful when you want to create views for these collections.
     * @event _converse#chatBoxMaximized
     * @example _converse.api.listen.on('rosterInitialized', () => { ... });
     * @example _converse.api.waitUntil('rosterInitialized').then(() => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('rosterInitialized', roster);
}
/**
 * Fetch all the roster groups, and then the roster contacts.
 * Emit an event after fetching is done in each case.
 * @param {boolean} ignore_cache - If set to to true, the local cache
 *      will be ignored it's guaranteed that the XMPP server
 *      will be queried for the roster.
 */ function populateRoster(ignore_cache = false) {
    return _async_to_generator(function*() {
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
        if (ignore_cache) {
            connection.send_initial_presence = true;
        }
        const roster = /** @type {RosterContacts} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
        try {
            yield roster.fetchRosterContacts();
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('rosterContactsFetched', roster);
        } catch (reason) {
            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(reason);
        } finally{
            if (connection.send_initial_presence) {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].user.presence.send();
                _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile.save({
                    presence: 'online'
                });
            }
        }
    })();
}
function updateUnreadCounter(chatbox) {
    const roster = /** @type {RosterContacts} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
    const contact = roster === null || roster === void 0 ? void 0 : roster.get(chatbox.get('jid'));
    contact === null || contact === void 0 ? void 0 : contact.save({
        num_unread: chatbox.get('num_unread')
    });
}
let presence_ref;
function registerPresenceHandler() {
    unregisterPresenceHandler();
    const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
    presence_ref = connection.addHandler(/** @param {Element} presence */ (presence)=>{
        const roster = /** @type {RosterContacts} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
        roster.presenceHandler(presence);
        return true;
    }, null, 'presence', null);
}
function unregisterPresenceHandler() {
    if (presence_ref) {
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
        connection.deleteHandler(presence_ref);
        presence_ref = null;
    }
}
function clearPresences() {
    return _async_to_generator(function*() {
        var _converse_state_presences;
        yield (_converse_state_presences = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.presences) === null || _converse_state_presences === void 0 ? void 0 : _converse_state_presences.clearStore();
    })();
}
/**
 * Roster specific event handler for the clearSession event
 */ function onClearSession() {
    return _async_to_generator(function*() {
        yield clearPresences();
        if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_8__.shouldClearCache)(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"])) {
            const roster = /** @type {RosterContacts} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
            if (roster) {
                var _roster_data;
                (_roster_data = roster.data) === null || _roster_data === void 0 ? void 0 : _roster_data.destroy();
                yield roster.clearStore();
                delete _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
                Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
                    roster: undefined
                }); // XXX DEPRECATED
            }
        }
    })();
}
/**
 * Roster specific event handler for the presencesInitialized event
 * @param {Boolean} reconnecting
 */ function onPresencesInitialized(reconnecting) {
    if (reconnecting) {
        /**
         * Similar to `rosterInitialized`, but instead pertaining to reconnection.
         * This event indicates that the roster and its groups are now again
         * available after Converse.js has reconnected.
         * @event _converse#rosterReadyAfterReconnection
         * @example _converse.api.listen.on('rosterReadyAfterReconnection', () => { ... });
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('rosterReadyAfterReconnection');
    } else {
        initRoster();
    }
    const roster = /** @type {RosterContacts} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
    roster.onConnected();
    registerPresenceHandler();
    populateRoster(!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get().restored);
}
/**
 * Roster specific event handler for the statusInitialized event
 * @param { Boolean } reconnecting
 */ function onStatusInitialized(reconnecting) {
    return _async_to_generator(function*() {
        if (reconnecting) {
            // When reconnecting and not resuming a previous session,
            // we clear all cached presence data, since it might be stale
            // and we'll receive new presence updates
            !_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get().hasResumed() && (yield clearPresences());
        } else {
            const presences = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.Presences();
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
                presences
            });
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state, {
                presences
            });
            const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
            const id = `converse.presences-${bare_jid}`;
            (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_7__.initStorage)(presences, id, 'session');
            // We might be continuing an existing session, so we fetch cached presence data.
            yield new Promise((r)=>presences.fetch({
                    success: r,
                    error: r
                }));
        }
        /**
     * Triggered once the _converse.Presences collection has been
     * initialized and its cached data fetched.
     * Returns a boolean indicating whether this event has fired due to
     * Converse having reconnected.
     * @event _converse#presencesInitialized
     * @type {boolean}
     * @example _converse.api.listen.on('presencesInitialized', (reconnecting) => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('presencesInitialized', reconnecting);
    })();
}
/**
 * Roster specific event handler for the chatBoxesInitialized event
 */ function onChatBoxesInitialized() {
    const { chatboxes } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
    chatboxes.on('change:num_unread', updateUnreadCounter);
    chatboxes.on('add', (chatbox)=>{
        if (chatbox.get('type') === _shared_constants__WEBPACK_IMPORTED_MODULE_6__.PRIVATE_CHAT_TYPE) {
            chatbox.setModelContact(chatbox.get('jid'));
        }
    });
}
/**
 * Roster specific handler for the rosterContactsFetched promise
 */ function onRosterContactsFetched() {
    const roster = /** @type {RosterContacts} */ _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.roster;
    roster.on('add', (contact)=>{
        // When a new contact is added, check if we already have a
        // chatbox open for it, and if so attach it to the chatbox.
        const chatbox = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.chatboxes.findWhere({
            'jid': contact.get('jid')
        });
        chatbox === null || chatbox === void 0 ? void 0 : chatbox.setModelContact(contact.get('jid'));
    });
}
/**
 * Reject or cancel another user's subscription to our presence updates.
 * @function rejectPresenceSubscription
 * @param {String} jid - The Jabber ID of the user whose subscription is being canceled
 * @param {String} [message] - An optional message to the user
 */ function rejectPresenceSubscription(jid, message) {
    const pres = $pres({
        to: jid,
        type: 'unsubscribed'
    });
    if (message && message !== '') {
        pres.c('status').t(message);
    }
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].send(pres);
}
/**
 * @param {import('./contact.js').default} contact
 * @return {boolean}
 */ function isUnsavedContact(contact) {
    const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
    const is_self = bare_jid !== contact.get('jid');
    return !is_self && !contact.get('subscription');
}


/***/ }),

/***/ "./src/headless/plugins/smacks/index.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/smacks/index.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/smacks/utils.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description Converse.js plugin which adds support for XEP-0198: Stream Management
 */ 


const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
Strophe.addNamespace('SM', 'urn:xmpp:sm:3');
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-smacks', {
    initialize () {
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].settings.extend({
            'enable_smacks': true,
            'smacks_max_unacked_stanzas': 5
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('afterResourceBinding', _utils_js__WEBPACK_IMPORTED_MODULE_2__.sendEnableStanza);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('beforeResourceBinding', _utils_js__WEBPACK_IMPORTED_MODULE_2__.enableStreamManagement);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('send', _utils_js__WEBPACK_IMPORTED_MODULE_2__.onStanzaSent);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].listen.on('userSessionInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_2__.initSessionData);
    }
});


/***/ }),

/***/ "./src/headless/plugins/smacks/utils.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/smacks/utils.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   enableStreamManagement: () => (/* binding */ enableStreamManagement),
/* harmony export */   initSessionData: () => (/* binding */ initSessionData),
/* harmony export */   onStanzaSent: () => (/* binding */ onStanzaSent),
/* harmony export */   sendEnableStanza: () => (/* binding */ sendEnableStanza)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { Strophe, u, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
function isStreamManagementSupported() {
    if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.isType("bosh") && !(0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.isTestEnv)()) {
        return false;
    }
    return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.stream.getFeature("sm", Strophe.NS.SM);
}
/**
 * @param {Element} el
 */ function handleAck(el) {
    if (!_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_enabled")) {
        return true;
    }
    const handled = parseInt(el.getAttribute("h"), 10);
    const last_known_handled = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_handled_by_server");
    const delta = handled - last_known_handled;
    if (delta < 0) {
        const err_msg = `New reported stanza count lower than previous. ` + `New: ${handled} - Previous: ${last_known_handled}`;
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(err_msg);
    }
    const unacked_stanzas = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("unacked_stanzas");
    if (delta > unacked_stanzas.length) {
        const err_msg = `Higher reported acknowledge count than unacknowledged stanzas. ` + `Reported Acknowledged Count: ${delta} -` + `Unacknowledged Stanza Count: ${unacked_stanzas.length} -` + `New: ${handled} - Previous: ${last_known_handled}`;
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(err_msg);
    }
    _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save({
        "num_stanzas_handled_by_server": handled,
        "num_stanzas_since_last_ack": 0,
        "unacked_stanzas": unacked_stanzas.slice(delta)
    });
    return true;
}
function sendAck() {
    if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_enabled")) {
        const h = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_handled");
        const stanza = stx`<a xmlns="${Strophe.NS.SM}" h="${h}"/>`;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].send(stanza);
    }
    return true;
}
/**
 * @param {Element} el
 */ function stanzaHandler(el) {
    if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_enabled")) {
        if (u.isTagEqual(el, "iq") || u.isTagEqual(el, "presence") || u.isTagEqual(el, "message")) {
            const h = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_handled");
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save("num_stanzas_handled", h + 1);
        }
    }
    return true;
}
function initSessionData() {
    const { session } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
    session.save({
        smacks_enabled: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_enabled") || false,
        num_stanzas_handled: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_handled") || 0,
        num_stanzas_handled_by_server: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_handled_by_server") || 0,
        num_stanzas_since_last_ack: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_since_last_ack") || 0,
        unacked_stanzas: _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("unacked_stanzas") || []
    });
}
function resetSessionData() {
    const { session } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
    u.safeSave(session, {
        smacks_enabled: false,
        num_stanzas_handled: 0,
        num_stanzas_handled_by_server: 0,
        num_stanzas_since_last_ack: 0,
        unacked_stanzas: []
    });
}
/**
 * @param {Element} el
 */ function saveSessionData(el) {
    const data = {
        "smacks_enabled": true
    };
    if ([
        "1",
        "true"
    ].includes(el.getAttribute("resume"))) {
        data["smacks_stream_id"] = el.getAttribute("id");
    }
    _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save(data);
    return true;
}
/**
 * @param {Element} el
 */ function onFailedStanza(el) {
    resetSessionData();
    /**
     * Triggered when the XEP-0198 stream could not be resumed.
     * @event _converse#streamResumptionFailed
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].trigger("streamResumptionFailed");
    if (el.querySelector("item-not-found")) {
        // Stream resumption must happen before resource binding but
        // enabling a new stream must happen after resource binding.
        // Since resumption failed, we simply continue.
        //
        // After resource binding, sendEnableStanza will be called
        // based on the afterResourceBinding event.
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn("Could not resume previous SMACKS session, session id not found. A new session will be established.");
    } else {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error("Failed to enable stream management");
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(el.outerHTML);
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
        connection._changeConnectStatus(Strophe.Status.DISCONNECTED, null);
    }
    return true;
}
function resendUnackedStanzas() {
    const stanzas = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("unacked_stanzas");
    // We clear the unacked_stanzas array because it'll get populated
    // again in `onStanzaSent`
    _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save("unacked_stanzas", []);
    // XXX: Currently we're resending *all* unacked stanzas, including
    // IQ[type="get"] stanzas that longer have handlers (because the
    // page reloaded or we reconnected, causing removal of handlers).
    //
    // *Side-note:* Is it necessary to clear handlers upon reconnection?
    //
    // I've considered not resending those stanzas, but then keeping
    // track of what's been sent and ack'd and their order gets
    // prohibitively complex.
    //
    // It's unclear how much of a problem this poses.
    //
    // Two possible solutions are running @converse/headless as a
    // service worker or handling IQ[type="result"] stanzas
    // differently, more like push stanzas, so that they don't need
    // explicit handlers.
    stanzas.forEach((s)=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].send(u.toStanza(s)));
}
/**
 * @param {Element} el
 */ function onResumedStanza(el) {
    saveSessionData(el);
    handleAck(el);
    resendUnackedStanzas();
    const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
    connection.do_bind = false; // No need to bind our resource anymore
    connection.authenticated = true;
    connection.restored = true;
    connection._changeConnectStatus(Strophe.Status.CONNECTED, null);
}
function sendResumeStanza() {
    return _async_to_generator(function*() {
        const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
        connection._addSysHandler((el)=>promise.resolve(onResumedStanza(el)), Strophe.NS.SM, "resumed");
        connection._addSysHandler((el)=>promise.resolve(onFailedStanza(el)), Strophe.NS.SM, "failed");
        const previous_id = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_stream_id");
        const h = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_handled");
        const stanza = stx`<resume xmlns="${Strophe.NS.SM}" h="${h}" previd="${previous_id}"/>`;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].send(stanza);
        connection.flush();
        yield promise;
    })();
}
function sendEnableStanza() {
    return _async_to_generator(function*() {
        if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("enable_smacks") || _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_enabled")) {
            return;
        }
        if (yield isStreamManagementSupported()) {
            const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
            const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
            connection._addSysHandler((el)=>promise.resolve(saveSessionData(el)), Strophe.NS.SM, "enabled");
            connection._addSysHandler((el)=>promise.resolve(onFailedStanza(el)), Strophe.NS.SM, "failed");
            const resume = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.isType("websocket") || (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.isTestEnv)();
            const stanza = stx`<enable xmlns="${Strophe.NS.SM}" resume="${resume}"/>`;
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].send(stanza);
            connection.flush();
            yield promise;
        }
    })();
}
const smacks_handlers = [];
function enableStreamManagement() {
    return _async_to_generator(function*() {
        if (!_shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("enable_smacks")) {
            return;
        }
        if (!(yield isStreamManagementSupported())) {
            return;
        }
        const conn = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].connection.get();
        while(smacks_handlers.length){
            conn.deleteHandler(smacks_handlers.pop());
        }
        smacks_handlers.push(conn.addHandler(stanzaHandler));
        smacks_handlers.push(conn.addHandler(sendAck, Strophe.NS.SM, "r"));
        smacks_handlers.push(conn.addHandler(handleAck, Strophe.NS.SM, "a"));
        const { session } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
        if (session === null || session === void 0 ? void 0 : session.get("smacks_stream_id")) {
            yield sendResumeStanza();
        } else {
            resetSessionData();
        }
    })();
}
function onStanzaSent(stanza) {
    if (!_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session) {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn("No _converse.session!");
        return;
    }
    if (!_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("smacks_enabled")) {
        return;
    }
    if (u.isTagEqual(stanza, "iq") || u.isTagEqual(stanza, "presence") || u.isTagEqual(stanza, "message")) {
        const stanza_string = Strophe.serialize(stanza);
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save("unacked_stanzas", (_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("unacked_stanzas") || []).concat([
            stanza_string
        ]));
        const max_unacked = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get("smacks_max_unacked_stanzas");
        if (max_unacked > 0) {
            const num = _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get("num_stanzas_since_last_ack") + 1;
            if (num % max_unacked === 0) {
                // Request confirmation of sent stanzas
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].send(stx`<r xmlns="${Strophe.NS.SM}"/>`);
            }
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.save({
                "num_stanzas_since_last_ack": num
            });
        }
    }
}


/***/ }),

/***/ "./src/headless/plugins/status/api.js":
/*!********************************************!*\
  !*** ./src/headless/plugins/status/api.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/constants */ "./src/headless/shared/constants.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * Set and get the user's chat status, also called their *availability*.
     * @namespace _converse.api.user.status
     * @memberOf _converse.api.user
     */ status: {
        /**
         * Return the current user's availability status.
         * @async
         * @method _converse.api.user.status.get
         * @example _converse.api.user.status.get();
         */ get () {
            return _async_to_generator(function*() {
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].waitUntil('statusInitialized');
                const show = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile.get('show');
                if (show) {
                    return show;
                }
                const status = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile.get('status');
                if (!status) {
                    return 'online';
                }
                return status;
            })();
        },
        /**
         * The user's status can be set to one of the following values:
         *
         * @async
         * @method _converse.api.user.status.set
         * @param { string } value The user's chat status (e.g. 'away', 'dnd', 'offline', 'online', 'unavailable' or 'xa')
         * @param { string } [message] A custom status message
         *
         * @example _converse.api.user.status.set('dnd');
         * @example _converse.api.user.status.set('dnd', 'In a meeting');
         */ set (value, message) {
            return _async_to_generator(function*() {
                if (!Object.keys(_shared_constants__WEBPACK_IMPORTED_MODULE_2__.STATUS_WEIGHTS).includes(value)) {
                    throw new Error('Invalid availability value. See https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.1');
                }
                let show = _shared_constants__WEBPACK_IMPORTED_MODULE_2__.PRES_SHOW_VALUES.includes(value) ? value : undefined;
                if (value === 'away') {
                    show = 'dnd';
                }
                const type = _shared_constants__WEBPACK_IMPORTED_MODULE_2__.PRES_TYPE_VALUES.includes(value) ? value : undefined;
                const data = {
                    show,
                    type
                };
                if (typeof message === 'string') {
                    data.status_message = message;
                }
                yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].waitUntil('statusInitialized');
                _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile.save(data);
            })();
        },
        /**
         * Set and retrieve the user's custom status message.
         *
         * @namespace _converse.api.user.status.message
         * @memberOf _converse.api.user.status
         */ message: {
            /**
             * @async
             * @method _converse.api.user.status.message.get
             * @returns { Promise<string> } The status message
             * @example const message = _converse.api.user.status.message.get()
             */ get () {
                return _async_to_generator(function*() {
                    yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].waitUntil('statusInitialized');
                    return _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile.get('status_message');
                })();
            },
            /**
             * @async
             * @method _converse.api.user.status.message.set
             * @param { string } status The status message
             * @example _converse.api.user.status.message.set('In a meeting');
             */ set (status) {
                return _async_to_generator(function*() {
                    yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_0__["default"].waitUntil('statusInitialized');
                    _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile.save({
                        status_message: status
                    });
                })();
            }
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/status/index.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/status/index.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Profile: () => (/* reexport safe */ _profile_js__WEBPACK_IMPORTED_MODULE_0__["default"])
/* harmony export */ });
/* harmony import */ var _profile_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./profile.js */ "./src/headless/plugins/status/profile.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/status/plugin.js");





/***/ }),

/***/ "./src/headless/plugins/status/plugin.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/status/plugin.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _profile_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./profile.js */ "./src/headless/plugins/status/profile.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/status/api.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/status/utils.js");







const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
Strophe.addNamespace('IDLE', 'urn:xmpp:idle:1');
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-status', {
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.extend({
            auto_away: 0,
            auto_xa: 0,
            csi_waiting_time: 0,
            idle_presence_timeout: 300,
            priority: 0
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].promises.add([
            'statusInitialized'
        ]);
        const exports = {
            XMPPStatus: _profile_js__WEBPACK_IMPORTED_MODULE_0__["default"],
            Profile: _profile_js__WEBPACK_IMPORTED_MODULE_0__["default"],
            onUserActivity: _utils_js__WEBPACK_IMPORTED_MODULE_6__.onUserActivity,
            onEverySecond: _utils_js__WEBPACK_IMPORTED_MODULE_6__.onEverySecond,
            sendCSI: _utils_js__WEBPACK_IMPORTED_MODULE_6__.sendCSI,
            registerIntervalHandler: _utils_js__WEBPACK_IMPORTED_MODULE_6__.registerIntervalHandler
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], exports); // Deprecated
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].exports, exports);
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].api.user, _api_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
        if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get("idle_presence_timeout") > 0) {
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('addClientFeatures', ()=>_shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].disco.own.features.add(Strophe.NS.IDLE));
        }
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('presencesInitialized', (reconnecting)=>!reconnecting && (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.registerIntervalHandler)());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('beforeTearDown', _utils_js__WEBPACK_IMPORTED_MODULE_6__.tearDown);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('clearSession', ()=>{
            if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.shouldClearCache)(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"]) && _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile) {
                _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile.destroy();
                delete _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.profile;
                Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], {
                    profile: undefined
                }); // XXX DEPRECATED
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].promises.add([
                    'statusInitialized'
                ]);
            }
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('connected', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.initStatus)(false));
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].listen.on('reconnected', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.initStatus)(true));
    }
});


/***/ }),

/***/ "./src/headless/plugins/status/profile.js":
/*!************************************************!*\
  !*** ./src/headless/plugins/status/profile.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Profile)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/model-with-vcard */ "./src/headless/shared/model-with-vcard.js");
/* harmony import */ var _shared_color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/color.js */ "./src/headless/shared/color.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/status/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}







const { Stanza, Strophe, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
class Profile extends (0,_shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_4__["default"])((0,_shared_color_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model)) {
    defaults() {
        return {
            presence: 'online',
            status: null,
            show: null,
            groups: []
        };
    }
    /**
     * @return {import('./types').connection_status}
     */ getStatus() {
        const presence = this.get('presence');
        if (presence === 'offline' || presence === 'unavailable') {
            return 'offline';
        }
        return this.get('show') || presence || 'offline';
    }
    /**
     * @param {string} attr
     */ get(attr) {
        if (attr === 'jid') {
            return _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
        } else if (attr === 'nickname') {
            return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('nickname');
        }
        return super.get(attr);
    }
    /**
     * @param {string|Object} key
     * @param {string|Object} [val]
     * @param {Object} [options]
     */ set(key, val, options) {
        if (key === 'jid' || key === 'nickname') {
            throw new Error('Readonly property');
        }
        return super.set(key, val, options);
    }
    initialize() {
        super.initialize();
        this.on('change', (item)=>{
            var _item_changed, _item_changed1, _item_changed2;
            if (((_item_changed = item.changed) === null || _item_changed === void 0 ? void 0 : _item_changed.status) || ((_item_changed1 = item.changed) === null || _item_changed1 === void 0 ? void 0 : _item_changed1.status_message) || ((_item_changed2 = item.changed) === null || _item_changed2 === void 0 ? void 0 : _item_changed2.show)) {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].user.presence.send({
                    show: this.get('show'),
                    status: this.get('status_message')
                });
            }
        });
    }
    /**
     * @param {import('../roster/types.js').ContactDisplayNameOptions} [options]
     */ getDisplayName(options) {
        var _this_vcard;
        const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
        const name = ((_this_vcard = this.vcard) === null || _this_vcard === void 0 ? void 0 : _this_vcard.get('fullname')) || this.getNickname() || this.get('jid');
        return (options === null || options === void 0 ? void 0 : options.context) === 'roster' ? `${name} (${__('me')})` : name;
    }
    getNickname() {
        var _this_vcard;
        return ((_this_vcard = this.vcard) === null || _this_vcard === void 0 ? void 0 : _this_vcard.get('nickname')) || _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('nickname');
    }
    /**
     * Constructs a presence stanza
     * @param {import('./types').presence_attrs} [attrs={}]
     * @returns {Promise<Stanza>}
     */ constructPresence() {
        return _async_to_generator(function*(attrs = {}) {
            const { type, to } = attrs;
            const { profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state;
            const status = typeof attrs.status === 'string' ? attrs.status : this.get('status_message');
            const show = attrs.show || this.get('status');
            const include_nick = type === 'subscribe';
            const nick = include_nick ? profile.getNickname() : null;
            const priority = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('priority');
            let idle_since;
            if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.isIdle)()) {
                idle_since = new Date();
                idle_since.setSeconds(idle_since.getSeconds() - (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.getIdleSeconds)());
            }
            const presence = stx`
            <presence ${to ? Stanza.unsafeXML(`to="${Strophe.xmlescape(to)}"`) : ''}
                    ${type ? Stanza.unsafeXML(`type="${Strophe.xmlescape(type)}"`) : ''}
                    xmlns="jabber:client">
                ${nick ? stx`<nick xmlns="${Strophe.NS.NICK}">${nick}</nick>` : ''}
                ${show ? stx`<show>${show}</show>` : ''}
                ${status ? stx`<status>${status}</status>` : ''}
                <priority>${Number.isNaN(Number(priority)) ? 0 : priority}</priority>
                ${idle_since ? stx`<idle xmlns="${Strophe.NS.IDLE}" since="${idle_since.toISOString()}"></idle>` : ''}
            </presence>`;
            /**
         * *Hook* which allows plugins to modify a presence stanza
         * @event _converse#constructedPresence
         */ return yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].hook('constructedPresence', null, presence);
        }).apply(this, arguments);
    }
}



/***/ }),

/***/ "./src/headless/plugins/status/utils.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/status/utils.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getIdleSeconds: () => (/* binding */ getIdleSeconds),
/* harmony export */   initStatus: () => (/* binding */ initStatus),
/* harmony export */   isIdle: () => (/* binding */ isIdle),
/* harmony export */   onEverySecond: () => (/* binding */ onEverySecond),
/* harmony export */   onUserActivity: () => (/* binding */ onUserActivity),
/* harmony export */   registerIntervalHandler: () => (/* binding */ registerIntervalHandler),
/* harmony export */   sendCSI: () => (/* binding */ sendCSI),
/* harmony export */   tearDown: () => (/* binding */ tearDown)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../shared/constants.js */ "./src/headless/shared/constants.js");






const { Strophe, $build } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
/**
 * @param {boolean} reconnecting
 */ function onStatusInitialized(reconnecting) {
    /**
     * Triggered when the user's own chat status has been initialized.
     * @event _converse#statusInitialized
     * @example _converse.api.listen.on('statusInitialized', status => { ... });
     * @example _converse.api.waitUntil('statusInitialized').then(() => { ... });
     */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('statusInitialized', reconnecting);
}
/**
 * @param {boolean} reconnecting
 */ function initStatus(reconnecting) {
    // If there's no profile obj, then we were never connected to
    // begin with, so we set reconnecting to false.
    reconnecting = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile === undefined ? false : reconnecting;
    if (reconnecting) {
        onStatusInitialized(reconnecting);
    } else {
        const id = `converse.xmppstatus-${_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid')}`;
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.Profile({
            id
        });
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.xmppstatus = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile; // Deprecated
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
            xmppstatus: _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile
        }); // Deprecated
        (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_3__.initStorage)(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile, id, 'session');
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile.fetch({
            success: ()=>onStatusInitialized(reconnecting),
            error: ()=>onStatusInitialized(reconnecting),
            silent: true
        });
    }
}
let idle_seconds = 0;
let idle = false;
let auto_changed_status = false;
let inactive = false;
function isIdle() {
    return idle;
}
function getIdleSeconds() {
    return idle_seconds;
}
/**
 * Resets counters and flags relating to CSI and auto_away/auto_xa
 */ function onUserActivity() {
    var _api_connection_get;
    if (idle_seconds > 0) {
        idle_seconds = 0;
    }
    if (!((_api_connection_get = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.authenticated)) {
        // We can't send out any stanzas when there's no authenticated connection.
        // This can happen when the connection reconnects.
        return;
    }
    if (inactive) sendCSI(_shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.ACTIVE);
    if (idle) {
        idle = false;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].user.presence.send();
    }
    if (auto_changed_status === true) {
        auto_changed_status = false;
        // XXX: we should really remember the original state here, and
        // then set it back to that...
        _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile.set('show', undefined);
    }
}
/**
 * An interval handler running every second.
 * Used for CSI and the auto_away and auto_xa features.
 */ function onEverySecond() {
    var _api_connection_get;
    if (!((_api_connection_get = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.authenticated)) {
        // We can't send out any stanzas when there's no authenticated connection.
        // This can happen when the connection reconnects.
        return;
    }
    const { profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
    const show = profile.get('show');
    idle_seconds++;
    if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('csi_waiting_time') > 0 && idle_seconds > _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('csi_waiting_time') && !inactive) {
        sendCSI(_shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.INACTIVE);
    }
    if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('idle_presence_timeout') > 0 && idle_seconds > _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('idle_presence_timeout') && !idle) {
        idle = true;
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].user.presence.send();
    }
    if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_away') > 0 && idle_seconds > _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_away') && show !== 'away' && show !== 'xa' && show !== 'dnd') {
        auto_changed_status = true;
        profile.set('show', 'away');
    } else if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_xa') > 0 && idle_seconds > _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_xa') && show !== 'xa' && show !== 'dnd') {
        auto_changed_status = true;
        profile.set('show', 'xa');
    }
}
/**
 * Send out a Client State Indication (XEP-0352)
 * @function sendCSI
 * @param { String } stat - The user's chat status
 */ function sendCSI(stat) {
    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].send($build(stat, {
        xmlns: Strophe.NS.CSI
    }));
    inactive = stat === _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.INACTIVE ? true : false;
}
let everySecondTrigger;
/**
 * Set an interval of one second and register a handler for it.
 * Required for the auto_away, auto_xa and csi_waiting_time features.
 */ function registerIntervalHandler() {
    if (_shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_away') < 1 && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_xa') < 1 && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('csi_waiting_time') < 1 && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('idle_presence_timeout') < 1) {
        // Waiting time of less then one second means features aren't used.
        return;
    }
    idle_seconds = 0;
    auto_changed_status = false; // Was the user's status changed by Converse?
    const { onUserActivity, onEverySecond } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports;
    window.addEventListener('click', onUserActivity);
    window.addEventListener('focus', onUserActivity);
    window.addEventListener('keypress', onUserActivity);
    window.addEventListener('mousemove', onUserActivity);
    window.addEventListener((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_4__.getUnloadEvent)(), onUserActivity, {
        'once': true,
        'passive': true
    });
    everySecondTrigger = setInterval(onEverySecond, 1000);
}
function tearDown() {
    const { onUserActivity } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports;
    window.removeEventListener('click', onUserActivity);
    window.removeEventListener('focus', onUserActivity);
    window.removeEventListener('keypress', onUserActivity);
    window.removeEventListener('mousemove', onUserActivity);
    window.removeEventListener((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_4__.getUnloadEvent)(), onUserActivity);
    if (everySecondTrigger) {
        clearInterval(everySecondTrigger);
        everySecondTrigger = null;
    }
}


/***/ }),

/***/ "./src/headless/plugins/vcard/api.js":
/*!*******************************************!*\
  !*** ./src/headless/plugins/vcard/api.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/vcard/utils.js");
/**
 * @typedef {import('@converse/skeletor').Model} Model
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, dayjs, u, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The XEP-0054 VCard API
     *
     * This API lets you access and update user VCards
     *
     * @namespace _converse.api.vcard
     * @memberOf _converse.api
     */ vcard: {
        /**
         * Enables setting new values for a VCard.
         *
         * Sends out an IQ stanza to set the user's VCard and if
         * successful, it updates the {@link _converse.VCard}
         * for the passed in JID.
         *
         * @method _converse.api.vcard.set
         * @param {string} jid The JID for which the VCard should be set
         * @param {import("./types").VCardData} data A map of VCard keys and values
         * @example
         * let jid = _converse.bare_jid;
         * _converse.api.vcard.set( jid, {
         *     'fn': 'John Doe',
         *     'nickname': 'jdoe'
         * }).then(() => {
         *     // Succes
         * }).catch((e) => {
         *     // Failure, e is your error object
         * }).
         */ set (jid, data) {
            return _async_to_generator(function*() {
                if (!jid) throw Error("No jid provided for the VCard data");
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('VCardsInitialized');
                let vcard = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.vcards.get(jid);
                var _vcard_attributes;
                const old_vcard_attrs = (_vcard_attributes = vcard === null || vcard === void 0 ? void 0 : vcard.attributes) !== null && _vcard_attributes !== void 0 ? _vcard_attributes : null;
                if (vcard && old_vcard_attrs.image !== data.image) {
                    // Optimistically update the vcard with image data. Otherwise some servers (e.g. Ejabberd)
                    // could send a XEP-0153 vcard:update presence which would cause us to refetch the vcard again.
                    const buffer = u.base64ToArrayBuffer(data.image);
                    const hash_ab = yield crypto.subtle.digest('SHA-1', buffer);
                    vcard.save({
                        image: data.image,
                        image_type: data.image_type,
                        image_hash: u.arrayBufferToHex(hash_ab)
                    });
                }
                let result;
                var _data_fn, _data_nickname, _data_url, _data_role, _data_email, _data_image_type, _data_image;
                const vcard_el = stx`
                <vCard xmlns="vcard-temp">
                    <FN>${(_data_fn = data.fn) !== null && _data_fn !== void 0 ? _data_fn : ''}</FN>
                    <NICKNAME>${(_data_nickname = data.nickname) !== null && _data_nickname !== void 0 ? _data_nickname : ''}</NICKNAME>
                    <URL>${(_data_url = data.url) !== null && _data_url !== void 0 ? _data_url : ''}</URL>
                    <ROLE>${(_data_role = data.role) !== null && _data_role !== void 0 ? _data_role : ''}</ROLE>
                    <EMAIL><INTERNET/><PREF/><USERID>${(_data_email = data.email) !== null && _data_email !== void 0 ? _data_email : ''}</USERID></EMAIL>
                    <PHOTO>
                        <TYPE>${(_data_image_type = data.image_type) !== null && _data_image_type !== void 0 ? _data_image_type : ''}</TYPE>
                        <BINVAL>${(_data_image = data.image) !== null && _data_image !== void 0 ? _data_image : ''}</BINVAL>
                    </PHOTO>
                </vCard>`;
                try {
                    result = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].sendIQ((0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.createStanza)("set", jid, vcard_el));
                } catch (e) {
                    if (old_vcard_attrs) vcard.save(old_vcard_attrs);
                    throw e;
                }
                vcard = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].vcard.update(jid, true);
                if (u.isOwnJID(jid)) {
                    var _vcard_get;
                    // Send out a XEP-0153 presence with the image hash
                    const node = stx`<x xmlns="${Strophe.NS.VCARD_UPDATE}">
                    <photo>${(_vcard_get = vcard.get('image_hash')) !== null && _vcard_get !== void 0 ? _vcard_get : ''}</photo>
                </x>`;
                    _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].user.presence.send({}, node);
                }
                return result;
            })();
        },
        /**
         * @method _converse.api.vcard.get
         * @param {Model|string} model Either a `Model` instance, or a string JID.
         *     If a `Model` instance is passed in, then it must have either a `jid`
         *     attribute or a `muc_jid` attribute.
         * @param {boolean} [force] A boolean indicating whether the vcard should be
         *     fetched from the server even if it's been fetched before.
         * @returns {Promise<import("./types").VCardResult|null>} A Promise which resolves
         *     with the VCard data for a particular JID or for a `Model` instance which
         *     represents an entity with a JID (such as a roster contact, chat or chatroom occupant).
         *
         * @example
         * const { api } = _converse;
         * api.waitUntil('rosterContactsFetched').then(() => {
         *     api.vcard.get('someone@example.org').then(
         *         (vcard) => {
         *             // Do something with the vcard...
         *         }
         *     );
         * });
         */ get (model, force) {
            return _async_to_generator(function*() {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil("VCardsInitialized");
                if (typeof model === "string") return (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.fetchVCard)(model);
                const error_date = model.get("vcard_error");
                if (error_date) {
                    // For a VCard fetch that returned an error, we check how long ago
                    // it was fetched. If it was longer ago than the last 21 days plus
                    // some jitter (to prevent an IQ fetch flood), we try again.
                    const { random, round } = Math;
                    const subtract_flag = round(random());
                    const recent_date = dayjs().subtract(21, "days").subtract(round(random() * 24) * subtract_flag, "hours").add(round(random() * 24) * (!subtract_flag ? 1 : 0), "hours");
                    const tried_recently = dayjs(error_date).isAfter(recent_date);
                    if (!force && tried_recently) return null;
                }
                const vcard_updated = model.get("vcard_updated");
                if (vcard_updated) {
                    // For a successful VCard fetch, we check how long ago it was fetched.
                    // If it was longer ago than the last 7 days plus some jitter
                    // (to prevent an IQ fetch flood), we try again.
                    const { random, round } = Math;
                    const subtract_flag = round(random());
                    const recent_date = dayjs().subtract(7, "days").subtract(round(random() * 24) * subtract_flag, "hours").add(round(random() * 24) * (!subtract_flag ? 1 : 0), "hours");
                    const updated_recently = dayjs(vcard_updated).isAfter(recent_date);
                    if (!force && updated_recently) return null;
                }
                const jid = model.get("jid");
                if (!jid) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error("No JID to get vcard for");
                    return null;
                }
                return (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.fetchVCard)(jid);
            })();
        },
        /**
         * Fetches the VCard associated with a particular `Model` instance
         * (by using its `jid` or `muc_jid` attribute) and then updates the model with the
         * returned VCard data.
         *
         * @method _converse.api.vcard.update
         * @param {Model} model A `Model` instance
         * @param {boolean} [force] A boolean indicating whether the vcard should be
         *     fetched again even if it's been fetched before.
         * @returns {promise} A promise which resolves once the update has completed.
         * @example
         * const { api } = _converse;
         * api.waitUntil('rosterContactsFetched').then(async () => {
         *     const chatbox = await api.chats.get('someone@example.org');
         *     api.vcard.update(chatbox);
         * });
         */ update (model, force) {
            return _async_to_generator(function*() {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].waitUntil('VCardsInitialized');
                const data = yield this.get(model, force);
                if (data === null) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug('api.vcard.update: null data returned, not updating the vcard');
                    return;
                }
                model = typeof model === 'string' ? _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.vcards.get(model) : model;
                if (!model) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(`Could not find a VCard model for ${model}`);
                    return;
                }
                if (Object.keys(data).length) {
                    delete data['stanza'];
                    u.safeSave(model, data);
                }
                return model;
            }).call(this);
        }
    }
});


/***/ }),

/***/ "./src/headless/plugins/vcard/index.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/vcard/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VCard: () => (/* reexport safe */ _vcard_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   VCards: () => (/* reexport safe */ _vcards__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _vcard_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vcard.js */ "./src/headless/plugins/vcard/vcard.js");
/* harmony import */ var _vcards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vcards */ "./src/headless/plugins/vcard/vcards.js");
/* harmony import */ var _plugin_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugin.js */ "./src/headless/plugins/vcard/plugin.js");






/***/ }),

/***/ "./src/headless/plugins/vcard/parsers.js":
/*!***********************************************!*\
  !*** ./src/headless/plugins/vcard/parsers.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseVCardResultStanza: () => (/* binding */ parseVCardResultStanza)
/* harmony export */ });
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

const { u } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_0__["default"].env;
/**
 * @param {Element} iq
 * @returns {Promise<import("./types").VCardResult>}
 */ function parseVCardResultStanza(iq) {
    return _async_to_generator(function*() {
        var _iq_querySelector, _iq_querySelector1, _iq_querySelector2, _iq_querySelector3, _iq_querySelector4, _iq_querySelector5, _iq_querySelector6;
        const result = {
            email: (_iq_querySelector = iq.querySelector(':scope > vCard EMAIL USERID')) === null || _iq_querySelector === void 0 ? void 0 : _iq_querySelector.textContent,
            fullname: (_iq_querySelector1 = iq.querySelector(':scope > vCard FN')) === null || _iq_querySelector1 === void 0 ? void 0 : _iq_querySelector1.textContent,
            image: (_iq_querySelector2 = iq.querySelector(':scope > vCard PHOTO BINVAL')) === null || _iq_querySelector2 === void 0 ? void 0 : _iq_querySelector2.textContent,
            image_type: (_iq_querySelector3 = iq.querySelector(':scope > vCard PHOTO TYPE')) === null || _iq_querySelector3 === void 0 ? void 0 : _iq_querySelector3.textContent,
            nickname: (_iq_querySelector4 = iq.querySelector(':scope > vCard NICKNAME')) === null || _iq_querySelector4 === void 0 ? void 0 : _iq_querySelector4.textContent,
            role: (_iq_querySelector5 = iq.querySelector(':scope > vCard ROLE')) === null || _iq_querySelector5 === void 0 ? void 0 : _iq_querySelector5.textContent,
            stanza: iq,
            url: (_iq_querySelector6 = iq.querySelector(':scope > vCard URL')) === null || _iq_querySelector6 === void 0 ? void 0 : _iq_querySelector6.textContent,
            vcard_updated: new Date().toISOString(),
            error: undefined,
            vcard_error: undefined,
            image_hash: undefined
        };
        if (result.image) {
            const buffer = u.base64ToArrayBuffer(result.image);
            const ab = yield crypto.subtle.digest('SHA-1', buffer);
            result['image_hash'] = u.arrayBufferToHex(ab);
        }
        return result;
    })();
}


/***/ }),

/***/ "./src/headless/plugins/vcard/plugin.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/vcard/plugin.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _status_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../status/index.js */ "./src/headless/plugins/status/index.js");
/* harmony import */ var _vcard_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vcard.js */ "./src/headless/plugins/vcard/vcard.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./api.js */ "./src/headless/plugins/vcard/api.js");
/* harmony import */ var _vcards__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vcards */ "./src/headless/plugins/vcard/vcards.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils.js */ "./src/headless/plugins/vcard/utils.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 







const { Strophe } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
_shared_api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].plugins.add('converse-vcard', {
    dependencies: [
        'converse-status',
        'converse-roster'
    ],
    enabled () {
        var _api_settings_get;
        return !((_api_settings_get = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.get('blacklisted_plugins')) === null || _api_settings_get === void 0 ? void 0 : _api_settings_get.includes('converse-vcard'));
    },
    initialize () {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].settings.extend({
            lazy_load_vcards: true
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].promises.add('VCardsInitialized');
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].api, _api_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
        const exports = {
            VCard: _vcard_js__WEBPACK_IMPORTED_MODULE_1__["default"],
            VCards: _vcards__WEBPACK_IMPORTED_MODULE_6__["default"]
        };
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"], exports); // XXX DEPRECATED
        Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports, exports);
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('chatRoomInitialized', /** @param {import('../muc/muc').default} m */ (m)=>{
            m.listenTo(m.occupants, 'change:image_hash', (o)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.onOccupantAvatarChanged)(o));
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('addClientFeatures', ()=>{
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.own.features.add(Strophe.NS.VCARD);
            _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].disco.own.features.add(Strophe.NS.VCARD_UPDATE);
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('clearSession', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.clearVCardsSession)());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('visibilityChanged', ({ el })=>{
            const { model } = el;
            if (model === null || model === void 0 ? void 0 : model.vcard) model.vcard.trigger('visibilityChanged');
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('connected', ()=>{
            const vcards = new _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].exports.VCards();
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.vcards = vcards;
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"], {
                vcards
            }); // XXX DEPRECATED
        });
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('presencesInitialized', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.registerPresenceHandler)());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('beforeTearDown', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.unregisterPresenceHandler)());
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].listen.on('constructedPresence', (_, p)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.updatePresence)(p));
    }
});


/***/ }),

/***/ "./src/headless/plugins/vcard/utils.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/vcard/utils.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clearVCardsSession: () => (/* binding */ clearVCardsSession),
/* harmony export */   createStanza: () => (/* binding */ createStanza),
/* harmony export */   fetchVCard: () => (/* binding */ fetchVCard),
/* harmony export */   getVCardForModel: () => (/* binding */ getVCardForModel),
/* harmony export */   getVCardForOccupant: () => (/* binding */ getVCardForOccupant),
/* harmony export */   onOccupantAvatarChanged: () => (/* binding */ onOccupantAvatarChanged),
/* harmony export */   registerPresenceHandler: () => (/* binding */ registerPresenceHandler),
/* harmony export */   unregisterPresenceHandler: () => (/* binding */ unregisterPresenceHandler),
/* harmony export */   updatePresence: () => (/* binding */ updatePresence)
/* harmony export */ });
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _utils_html_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/html.js */ "./src/headless/utils/html.js");
/* harmony import */ var _shared_parsers_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shared/parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/plugins/vcard/parsers.js");
/**
 * @typedef {import('../../plugins/muc/message').default} MUCMessage
 * @typedef {import('../../plugins/status/profile').default} Profile
 * @typedef {import('../../plugins/vcard/vcards').default} VCards
 * @typedef {import('../../plugins/vcard/vcard').default} VCard
 * @typedef {import('../../shared/model-with-contact.js').default} ModelWithContact
 * @typedef {import('../muc/occupant.js').default} MUCOccupant
 * @typedef {import('@converse/skeletor/src/types/helpers.js').Model} Model
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}








const { Strophe, $iq, sizzle, stx } = _shared_api_public_js__WEBPACK_IMPORTED_MODULE_2__["default"].env;
Strophe.addNamespace('VCARD_UPDATE', 'vcard-temp:x:update');
/**
 * @param {"get"|"set"|"result"} type
 * @param {string} jid
 * @param {Element} [vcard_el]
 */ function createStanza(type, jid, vcard_el) {
    const iq = $iq(jid ? {
        'type': type,
        'to': jid
    } : {
        'type': type
    });
    if (!vcard_el) {
        iq.c('vCard', {
            'xmlns': Strophe.NS.VCARD
        });
    } else {
        iq.cnode(vcard_el);
    }
    return iq;
}
/**
 * @param {MUCOccupant} occupant
 */ function onOccupantAvatarChanged(occupant) {
    const hash = occupant.get('image_hash');
    const vcards = [];
    if (occupant.get('jid')) {
        vcards.push(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.vcards.get(occupant.get('jid')));
    }
    vcards.push(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.vcards.get(occupant.get('from')));
    vcards.forEach((v)=>hash && v && (v === null || v === void 0 ? void 0 : v.get('image_hash')) !== hash && _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].vcard.update(v, true));
}
/**
 * @param {Model|MUCOccupant|MUCMessage} model
 * @param {boolean} [lazy_load=false]
 * @returns {Promise<VCard|null>}
 */ function getVCardForModel(model, lazy_load = false) {
    return _async_to_generator(function*() {
        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('VCardsInitialized');
        let vcard;
        if (model instanceof _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.MUCOccupant) {
            vcard = yield getVCardForOccupant(/** @type {MUCOccupant} */ model, lazy_load);
        } else if (model instanceof _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.MUCMessage) {
            vcard = yield getVCardForMUCMessage(/** @type {MUCMessage} */ model, lazy_load);
        } else {
            let jid;
            if (model instanceof _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].exports.Message) {
                if ([
                    'error',
                    'info'
                ].includes(model.get('type'))) {
                    return;
                }
                jid = Strophe.getBareJidFromJid(model.get('from'));
            } else {
                jid = model.get('jid');
            }
            if (!jid) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`Could not set VCard on model because no JID found!`);
                return null;
            }
            const { vcards } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
            vcard = vcards.get(jid) || vcards.create({
                jid
            }, {
                lazy_load
            });
        }
        if (vcard) {
            vcard.on('change', ()=>model.trigger('vcard:change'));
        }
        return vcard;
    })();
}
/**
 * @param {MUCOccupant} occupant
 * @param {boolean} [lazy_load=false]
 * @returns {Promise<VCard|null>}
 */ function getVCardForOccupant(occupant, lazy_load = true) {
    return _async_to_generator(function*() {
        var _occupant_collection;
        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('VCardsInitialized');
        const { vcards, profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
        const muc = occupant === null || occupant === void 0 ? void 0 : (_occupant_collection = occupant.collection) === null || _occupant_collection === void 0 ? void 0 : _occupant_collection.chatroom;
        const nick = occupant.get('nick');
        if (nick && (muc === null || muc === void 0 ? void 0 : muc.get('nick')) === nick) {
            return profile.vcard;
        } else {
            const jid = occupant.get('jid') || occupant.get('from');
            if (jid) {
                return vcards.get(jid) || vcards.create({
                    jid
                }, {
                    lazy_load
                });
            } else {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].debug(`Could not get VCard for occupant because no JID found!`);
                return null;
            }
        }
    })();
}
/**
 * @param {MUCMessage} message
 * @param {boolean} [lazy_load=true]
 * @returns {Promise<VCard|null>}
 */ function getVCardForMUCMessage(message, lazy_load = true) {
    return _async_to_generator(function*() {
        var _message_collection;
        if ([
            'error',
            'info'
        ].includes(message.get('type'))) return;
        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('VCardsInitialized');
        const { vcards, profile } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state;
        const muc = message === null || message === void 0 ? void 0 : (_message_collection = message.collection) === null || _message_collection === void 0 ? void 0 : _message_collection.chatbox;
        const nick = Strophe.getResourceFromJid(message.get('from'));
        if (nick && (muc === null || muc === void 0 ? void 0 : muc.get('nick')) === nick) {
            return profile.vcard;
        } else {
            var _message_occupant;
            const jid = ((_message_occupant = message.occupant) === null || _message_occupant === void 0 ? void 0 : _message_occupant.get('jid')) || message.get('from');
            if (jid) {
                return vcards.get(jid) || vcards.create({
                    jid
                }, {
                    lazy_load
                });
            } else {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn(`Could not get VCard for message because no JID found! msgid: ${message.get('msgid')}`);
                return null;
            }
        }
    })();
}
function clearVCardsSession() {
    if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_4__.shouldClearCache)(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"])) {
        _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].promises.add('VCardsInitialized');
        if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.vcards) {
            _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.vcards.clearStore();
            Object.assign(_shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], {
                vcards: undefined
            }); // XXX DEPRECATED
            delete _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.vcards;
        }
    }
}
/**
 * @param {string} jid
 */ function fetchVCard(jid) {
    return _async_to_generator(function*() {
        const bare_jid = _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        const to = Strophe.getBareJidFromJid(jid) === bare_jid ? null : jid;
        let iq;
        try {
            iq = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].sendIQ(createStanza('get', to));
        } catch (error) {
            var _ref;
            const { message: error_msg } = (_ref = (0,_utils_html_js__WEBPACK_IMPORTED_MODULE_5__.isElement)(error) ? yield (0,_shared_parsers_js__WEBPACK_IMPORTED_MODULE_6__.parseErrorStanza)(error) : error) !== null && _ref !== void 0 ? _ref : {};
            return {
                jid,
                stanza: (0,_utils_html_js__WEBPACK_IMPORTED_MODULE_5__.isElement)(error) ? error : null,
                error: error_msg,
                vcard_error: new Date().toISOString()
            };
        }
        return (0,_parsers_js__WEBPACK_IMPORTED_MODULE_7__.parseVCardResultStanza)(iq);
    })();
}
/**
 * @param {Element} pres
 */ function handleVCardUpdatePresence(pres) {
    return _async_to_generator(function*() {
        yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].waitUntil('VCardsInitialized');
        const photo = sizzle(`x[xmlns="${Strophe.NS.VCARD_UPDATE}"] photo`, pres).pop();
        if (photo) {
            const avatar_hash = photo.textContent;
            const from_jid = Strophe.getBareJidFromJid(pres.getAttribute('from'));
            const vcard = yield _shared_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.vcards.get(from_jid);
            if ((vcard === null || vcard === void 0 ? void 0 : vcard.get('image_hash')) !== avatar_hash) {
                _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].vcard.update(from_jid, true).catch((e)=>_converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e));
            }
        }
    })();
}
let presence_ref;
function unregisterPresenceHandler() {
    if (presence_ref) {
        const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
        connection.deleteHandler(presence_ref);
        presence_ref = null;
    }
}
function registerPresenceHandler() {
    // unregisterPresenceHandler();
    const connection = _shared_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].connection.get();
    presence_ref = connection.addHandler(/** @param {Element} pres */ (pres)=>{
        try {
            handleVCardUpdatePresence(pres);
        } catch (e) {
            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
        }
        return true;
    }, null, 'presence', null);
}
/**
 * @param {import('strophe.js').Builder} stanza
 */ function updatePresence(stanza) {
    if (sizzle(`x[xmlns=${Strophe.NS.VCARD_UPDATE}"]`, stanza.root()).length === 0) {
        const node = stx`<x xmlns="${Strophe.NS.VCARD_UPDATE}"></x>`;
        stanza.root().cnode(node).up();
    }
    return stanza;
}


/***/ }),

/***/ "./src/headless/plugins/vcard/vcard.js":
/*!*********************************************!*\
  !*** ./src/headless/plugins/vcard/vcard.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_converse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/_converse */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index */ "./src/headless/shared/api/index.js");



class VCard extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    /**
     * @param {import("../../shared/types").ModelAttributes} [_attrs]
     * @param {import("./types").VCardModelOptions} [options]
     */ initialize(_attrs, options) {
        this.lazy_load = _shared_api_index__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('lazy_load_vcards') && !!(options === null || options === void 0 ? void 0 : options.lazy_load);
        if (this.lazy_load) {
            this.once("visibilityChanged", ()=>_shared_api_index__WEBPACK_IMPORTED_MODULE_2__["default"].vcard.update(this));
        } else {
            _shared_api_index__WEBPACK_IMPORTED_MODULE_2__["default"].vcard.update(this);
        }
    }
    get idAttribute() {
        return "jid";
    }
    getDisplayName() {
        return this.get("nickname") || this.get("fullname") || this.get("jid");
    }
    /**
     * @param {import("../../shared/types").ModelAttributes} attrs
     * @param {import("./types").VCardModelOptions} options
     */ constructor(attrs, options){
        super(attrs, options);
        this._vcard = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VCard);


/***/ }),

/***/ "./src/headless/plugins/vcard/vcards.js":
/*!**********************************************!*\
  !*** ./src/headless/plugins/vcard/vcards.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _vcard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vcard */ "./src/headless/plugins/vcard/vcard.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class VCards extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection {
    initialize() {
        return _async_to_generator(function*() {
            const { session } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_3__["default"];
            const bare_jid = session.get("bare_jid");
            const cache_key = `${bare_jid}-converse.vcards`;
            (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_4__.initStorage)(this, cache_key);
            yield this.fetchVCards();
            /**
         * Triggered as soon as the `_converse.state.vcards` collection has
         * been initialized and populated from cache.
         * @event _converse#VCardsInitialized
         */ _shared_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].trigger("VCardsInitialized");
        }).call(this);
    }
    fetchVCards() {
        const deferred = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        this.fetch({
            success: ()=>deferred.resolve(),
            error: ()=>deferred.resolve()
        });
        return deferred;
    }
    constructor(){
        super();
        this.model = _vcard__WEBPACK_IMPORTED_MODULE_5__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VCards);


/***/ }),

/***/ "./src/headless/shared/_converse.js":
/*!******************************************!*\
  !*** ./src/headless/shared/_converse.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./i18n.js */ "./src/headless/shared/i18n.js");
/* harmony import */ var pluggable_js_src_pluggable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! pluggable.js/src/pluggable.js */ "./node_modules/pluggable.js/src/pluggable.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "./src/headless/shared/constants.js");
/**
 * @module:shared.converse
 * @typedef {import('@converse/skeletor').Storage} Storage
 * @typedef {import('@converse/skeletor').Collection} Collection
 * @typedef {import('../plugins/disco/index').DiscoState} DiscoState
 * @typedef {import('../plugins/status/profile').default} Profile
 * @typedef {import('../plugins/vcard/vcard').default} VCards
 */ 






const DEPRECATED_ATTRS = {
    chatboxes: null,
    bookmarks: null,
    ANONYMOUS: _constants__WEBPACK_IMPORTED_MODULE_6__.ANONYMOUS,
    CLOSED: _constants__WEBPACK_IMPORTED_MODULE_6__.CLOSED,
    EXTERNAL: _constants__WEBPACK_IMPORTED_MODULE_6__.EXTERNAL,
    LOGIN: _constants__WEBPACK_IMPORTED_MODULE_6__.LOGIN,
    LOGOUT: _constants__WEBPACK_IMPORTED_MODULE_6__.LOGOUT,
    OPENED: _constants__WEBPACK_IMPORTED_MODULE_6__.OPENED,
    PREBIND: _constants__WEBPACK_IMPORTED_MODULE_6__.PREBIND,
    SUCCESS: _constants__WEBPACK_IMPORTED_MODULE_6__.SUCCESS,
    FAILURE: _constants__WEBPACK_IMPORTED_MODULE_6__.FAILURE,
    INACTIVE: _constants__WEBPACK_IMPORTED_MODULE_6__.INACTIVE,
    ACTIVE: _constants__WEBPACK_IMPORTED_MODULE_6__.ACTIVE,
    COMPOSING: _constants__WEBPACK_IMPORTED_MODULE_6__.COMPOSING,
    PAUSED: _constants__WEBPACK_IMPORTED_MODULE_6__.PAUSED,
    GONE: _constants__WEBPACK_IMPORTED_MODULE_6__.GONE
};
/**
 * A private, closured namespace containing the private api (via {@link _converse.api})
 * as well as private methods and internal data-structures.
 * @global
 * @namespace _converse
 */ class ConversePrivateGlobal extends (0,_converse_skeletor__WEBPACK_IMPORTED_MODULE_3__.EventEmitter)(Object) {
    initialize() {
        this.VERSION_NAME = _constants__WEBPACK_IMPORTED_MODULE_6__.VERSION_NAME;
        this.strict_plugin_dependencies = false;
        this.pluggable = null;
        this.templates = {};
        this.storage = /** @type {Record<string, Storage.LocalForage>} */ {};
        this.promises = {
            initialized: (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_4__.getOpenPromise)()
        };
        this.NUM_PREKEYS = 100; // DEPRECATED. Set here so that tests can override
        // Set as module attr so that we can override in tests.
        // TODO: replace with config settings
        this.TIMEOUTS = {
            PAUSED: 10000,
            INACTIVE: 90000
        };
        Object.assign(this, DEPRECATED_ATTRS);
        this.api = /** @type {module:shared-api.APIEndpoint} */ null;
        /**
         * Namespace for storing translated strings.
         *
         * @typedef {Record<string, string>} UserMessage
         * @typedef {Record<string, string|UserMessage>} UserMessages
         */ this.labels = /** @type {UserMessages} */ {};
        /**
         * Namespace for storing code that might be useful to 3rd party
         * plugins. We want to make it possible for 3rd party plugins to have
         * access to code (e.g. classes) from converse.js without having to add
         * converse.js as a dependency.
         */ this.exports = /** @type {Record<string, Object>} */ {};
        /**
         * Provides a way for 3rd party plugins to access constants used by
         * Converse.
         */ this.constants = /** @type {Record<string, string|Object>} */ {};
        /**
         * Utility methods and globals from bundled 3rd party libraries.
         */ this.env = /** @type {import("./api/types.js").ConverseEnv} */ {};
        /**
         * Namespace for storing the state, as represented by instances of
         * Models and Collections.
         *
         * @typedef {Object & Record<string, Collection|Model|VCards|Profile|DiscoState>} ConverseState
         * @property {VCards} [vcards]
         * @property {Profile} profile
         * @property {DiscoState} disco
         */ this.state = /** @type {ConverseState} */ {};
        this.initSession();
    }
    initSession() {
        var _this_session;
        (_this_session = this.session) === null || _this_session === void 0 ? void 0 : _this_session.destroy();
        this.session = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__.Model();
        // XXX DEPRECATED
        Object.assign(this, {
            jid: undefined,
            bare_jid: undefined,
            domain: undefined,
            resource: undefined
        });
    }
    /**
     * Translate the given string based on the current locale.
     * @method __
     * @memberOf _converse
     * @param {...String} args
     */ __(...args) {
        return _i18n_js__WEBPACK_IMPORTED_MODULE_1__["default"].__(...args);
    }
    /**
     * A no-op method which is used to signal to gettext that the passed in string
     * should be included in the pot translation file.
     *
     * In contrast to the double-underscore method, the triple underscore method
     * doesn't actually translate the strings.
     *
     * One reason for this method might be because we're using strings we cannot
     * send to the translation function because they require variable interpolation
     * and we don't yet have the variables at scan time.
     *
     * @method ___
     * @memberOf _converse
     * @param {String} str
     */ ___(str) {
        return str;
    }
    constructor(){
        super();
        const proxy = new Proxy(this, {
            get: (target, key)=>{
                if (!(0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.isTestEnv)() && typeof key === 'string') {
                    if (Object.keys(DEPRECATED_ATTRS).includes(key)) {
                        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn(`Accessing ${key} on _converse is DEPRECATED`);
                    }
                }
                return Reflect.get(target, key);
            }
        });
        proxy.initialize();
        return proxy;
    }
}
const _converse = new ConversePrivateGlobal();
// Make _converse pluggable
pluggable_js_src_pluggable_js__WEBPACK_IMPORTED_MODULE_2__["default"].enable(_converse, '_converse', 'pluggable');
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_converse);


/***/ }),

/***/ "./src/headless/shared/actions.js":
/*!****************************************!*\
  !*** ./src/headless/shared/actions.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   rejectMessage: () => (/* binding */ rejectMessage),
/* harmony export */   sendChatState: () => (/* binding */ sendChatState),
/* harmony export */   sendMarker: () => (/* binding */ sendMarker),
/* harmony export */   sendReceiptStanza: () => (/* binding */ sendReceiptStanza),
/* harmony export */   sendRetractionMessage: () => (/* binding */ sendRetractionMessage)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _api_public_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants.js */ "./src/headless/shared/constants.js");





const { u, stx, Stanza } = _api_public_js__WEBPACK_IMPORTED_MODULE_3__["default"].env;
/**
 * Reject an incoming message by replying with an error message of type "cancel".
 * @param {Element} stanza
 * @param {string} text
 * @return void
 */ function rejectMessage(stanza, text) {
    _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].send(stx`<message to="${stanza.getAttribute('from')}"
                    type="error"
                    id="${stanza.getAttribute('id')}"
                    xmlns="jabber:client">
                <error type="cancel">
                    <not-allowed xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.STANZAS}"/>
                    <text xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.STANZAS}">${text}</text>
                </error>
            </message>`);
    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn(`Rejecting message stanza with the following reason: ${text}`);
    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].warn(stanza);
}
/**
 * Send out a XEP-0333 chat marker
 * @param {string} to_jid
 * @param {string} id - The id of the message being marked
 * @param {import("./types").MessageMarkerType} type - The marker type
 * @param {string} [msg_type]
 * @return void
 */ function sendMarker(to_jid, id, type, msg_type) {
    if (!_constants_js__WEBPACK_IMPORTED_MODULE_4__.MARKER_TYPES.includes(type)) {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(`Invalid marker type: ${type}`);
        return;
    }
    const stanza = stx`
        <message from="${_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.get().jid}"
                id="${u.getUniqueId()}"
                to="${to_jid}"
                type="${msg_type ? msg_type : 'chat'}"
                xmlns="jabber:client">
            <${Stanza.unsafeXML(type)} xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.MARKERS}" id="${id}"/>
        </message>`;
    _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].send(stanza);
}
/**
 * @param {string} to_jid
 * @param {string} id
 * @return void
 */ function sendReceiptStanza(to_jid, id) {
    const receipt_stanza = stx`
        <message from="${_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.get().jid}"
                id="${u.getUniqueId()}"
                to="${to_jid}"
                type="chat"
                xmlns="jabber:client">
            <received xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.RECEIPTS}" id="${id}"/>
            <store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.HINTS}"/>
        </message>`;
    _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].send(receipt_stanza);
}
/**
 * Sends a message with the given XEP-0085 chat state.
 * @param {string} jid
 * @param {import("./types").ChatStateType} chat_state
 */ function sendChatState(jid, chat_state) {
    if (!jid) {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(`sendChatState called with no JID`);
        return;
    } else if (!_constants_js__WEBPACK_IMPORTED_MODULE_4__.CHAT_STATES.includes(chat_state)) {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(`Invalid chat state: ${chat_state}`);
        return;
    }
    if (_api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('send_chat_state_notifications') && chat_state) {
        const allowed = _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('send_chat_state_notifications');
        if (Array.isArray(allowed) && !allowed.includes(chat_state)) {
            return;
        }
        _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].send(stx`<message id="${u.getUniqueId()}" to="${jid}" type="chat" xmlns="jabber:client">
                <${Stanza.unsafeXML(chat_state)} xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.CHATSTATES}"/>
                <no-store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.HINTS}"/>
                <no-permanent-store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.HINTS}"/>
            </message>`);
    }
}
/**
 * Sends a message stanza to retract a message in this chat
 * @param {string} jid
 * @param {import('../shared/message').default} message - The message which we're retracting.
 * @param {string} retraction_id - Unique ID for the retraction message
 */ function sendRetractionMessage(jid, message, retraction_id) {
    const origin_id = message.get('origin_id');
    if (!origin_id) {
        throw new Error("Can't retract message without a XEP-0359 Origin ID");
    }
    const stanza = stx`
        <message id="${retraction_id}"
                 to="${jid}"
                 type="chat"
                 xmlns="jabber:client">
            <retract id="${origin_id}" xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.RETRACT}"/>
            <body>/me retracted a message</body>
            <store xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.HINTS}"/>
            <fallback xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.FALLBACK}" for="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.RETRACT}" />
        </message>`;
    return _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].connection.get().send(stanza);
}


/***/ }),

/***/ "./src/headless/shared/api/events.js":
/*!*******************************************!*\
  !*** ./src/headless/shared/api/events.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _utils_object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/object.js */ "./src/headless/utils/object.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * Lets you trigger events, which can be listened to via
     * {@link _converse.api.listen.on} or {@link _converse.api.listen.once}
     * (see [_converse.api.listen](http://localhost:8000/docs/html/api/-_converse.api.listen.html)).
     *
     * Some events also double as promises and can be waited on via {@link _converse.api.waitUntil}.
     *
     * @typedef {object} Options
     * @property {boolean} [Options.synchronous] - Whether the event is synchronous or not.
     *  When a synchronous event is fired, a promise will be returned
     *  by {@link _converse.api.trigger} which resolves once all the
     *  event handlers' promises have been resolved.
     *
     * @method _converse.api.trigger
     * @param {string} name - The event name
     */ trigger (_0) {
        return _async_to_generator(function*(name) {
            if (!_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"]._events) {
                return;
            }
            const args = Array.from(arguments);
            const options = /** @type {Options} */ args.pop();
            if (options && options.synchronous) {
                const events = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"]._events[name] || [];
                const event_args = args.splice(1);
                yield Promise.all(events.map((e)=>e.callback.apply(e.ctx, event_args)));
            } else {
                _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].trigger.apply(_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], arguments);
            }
            const promise = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].promises[name];
            if (promise !== undefined) {
                promise.resolve(arguments[1]);
            }
        }).apply(this, arguments);
    },
    /**
     * Triggers a hook which can be intercepted by registered listeners via
     * {@link _converse.api.listen.on} or {@link _converse.api.listen.once}.
     * (see [_converse.api.listen](http://localhost:8000/docs/html/api/-_converse.api.listen.html)).
     * A hook is a special kind of event which allows you to intercept a data
     * structure in order to modify it, before passing it back.
     * @async
     * @param {string} name - The hook name
     * @param {...any} context - The context to which the hook applies
     *  (could be for example, a {@link _converse.ChatBox}).
     * @param {...any} data - The data structure to be intercepted and modified by the hook listeners.
     * @returns {Promise<any>} - A promise that resolves with the modified data structure.
     */ hook (name, context, data) {
        const events = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"]._events[name] || [];
        if (events.length) {
            // Create a chain of promises, with each one feeding its output to
            // the next. The first input is a promise with the original data
            // sent to this hook.
            return events.reduce((o, e)=>o.then((d)=>e.callback(context, d)), Promise.resolve(data));
        } else {
            return data;
        }
    },
    /**
     * Converse emits events to which you can subscribe to.
     *
     * The `listen` namespace exposes methods for creating event listeners
     * (aka handlers) for these events.
     *
     * @namespace _converse.api.listen
     * @memberOf _converse
     */ listen: {
        /**
         * Lets you listen to an event exactly once.
         * @method _converse.api.listen.once
         * @param {string} name The event's name
         * @param {function} callback The callback method to be called when the event is emitted.
         * @param {object} [context] The value of the `this` parameter for the callback.
         * @example _converse.api.listen.once('message', function (messageXML) { ... });
         */ once: _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].once.bind(_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
        /**
         * Lets you subscribe to an event.
         * Every time the event fires, the callback method specified by `callback` will be called.
         * @method _converse.api.listen.on
         * @param {string} name The event's name
         * @param {function} callback The callback method to be called when the event is emitted.
         * @param {object} [context] The value of the `this` parameter for the callback.
         * @example _converse.api.listen.on('message', function (messageXML) { ... });
         */ on: _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].on.bind(_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
        /**
         * To stop listening to an event, you can use the `not` method.
         * @method _converse.api.listen.not
         * @param {string} name The event's name
         * @param {function} callback The callback method that is to no longer be called when the event fires
         * @example _converse.api.listen.not('message', function (messageXML);
         */ not: _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].off.bind(_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
        /**
         * An options object which lets you set filter criteria for matching
         * against stanzas.
         * @typedef {object} MatchingOptions
         * @property {string} [ns] - The namespace to match against
         * @property {string} [type] - The stanza type to match against
         * @property {string} [id] - The stanza id to match against
         * @property {string} [from] - The stanza sender to match against
         */ /**
         * Subscribe to an incoming stanza
         * Every a matched stanza is received, the callback method specified by
         * `callback` will be called.
         * @method _converse.api.listen.stanza
         * @param {string} name The stanza's name
         * @param {MatchingOptions|Function} options Matching options or callback
         * @param {function} handler The callback method to be called when the stanza appears
         */ stanza (name, options, handler) {
            if ((0,_utils_object_js__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options)) {
                handler = /** @type {Function} */ options;
                options = {};
            } else {
                options = options || {};
            }
            _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].api.connection.get().addHandler(handler, options.ns, name, options.type, options.id, options.from, options);
        }
    }
});


/***/ }),

/***/ "./src/headless/shared/api/index.js":
/*!******************************************!*\
  !*** ./src/headless/shared/api/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _connection_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../connection/api.js */ "./src/headless/shared/connection/api.js");
/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events.js */ "./src/headless/shared/api/events.js");
/* harmony import */ var _promise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./promise.js */ "./src/headless/shared/api/promise.js");
/* harmony import */ var _send_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./send.js */ "./src/headless/shared/api/send.js");
/* harmony import */ var _user_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./user.js */ "./src/headless/shared/api/user.js");
/* harmony import */ var _settings_api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../settings/api.js */ "./src/headless/shared/settings/api.js");
/**
 * @typedef {import('../_converse.js').default} _converse
 * @typedef {module:shared-api.APIEndpoint} APIEndpoint
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}






/**
 * ### The private API
 *
 * The private API methods are only accessible via the closured {@link _converse}
 * object, which is only available to plugins.
 *
 * These methods are kept private (i.e. not global) because they may return
 * sensitive data which should be kept off-limits to other 3rd-party scripts
 * that might be running in the page.
 *
 * @memberOf _converse
 * @namespace api
 * @typedef {Record<string, Function>} module:shared-api.APIEndpoint
 * @typedef {Record<string, APIEndpoint|Function>} APINamespace
 * @typedef {Record<string, APINamespace|APIEndpoint|Function>} API
 * @type {API}
 */ const api = _object_spread_props(_object_spread({
    connection: _connection_api_js__WEBPACK_IMPORTED_MODULE_0__["default"],
    settings: _settings_api_js__WEBPACK_IMPORTED_MODULE_5__.settings_api
}, _send_js__WEBPACK_IMPORTED_MODULE_3__["default"], _user_js__WEBPACK_IMPORTED_MODULE_4__["default"], _events_js__WEBPACK_IMPORTED_MODULE_1__["default"], _promise_js__WEBPACK_IMPORTED_MODULE_2__["default"]), {
    disco: null,
    elements: null,
    contacts: null
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (api);


/***/ }),

/***/ "./src/headless/shared/api/presence.js":
/*!*********************************************!*\
  !*** ./src/headless/shared/api/presence.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _promise_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./promise.js */ "./src/headless/shared/api/promise.js");
/* harmony import */ var _send_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./send.js */ "./src/headless/shared/api/send.js");
/* harmony import */ var _plugins_muc_api_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../plugins/muc/api.js */ "./src/headless/plugins/muc/api.js");
/**
 * @typedef {import('strophe.js').Builder} Builder
 * @typedef {import('../../plugins/status/profile').default} Profile
 * @typedef {import('../../plugins/muc/muc.js').default} MUC
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




const { waitUntil } = _promise_js__WEBPACK_IMPORTED_MODULE_1__["default"];
const { send } = _send_js__WEBPACK_IMPORTED_MODULE_2__["default"];
const { rooms } = _plugins_muc_api_js__WEBPACK_IMPORTED_MODULE_3__["default"];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @namespace _converse.api.user.presence
     * @memberOf _converse.api.user
     */ presence: {
        /**
         * Send out a presence stanza
         * @method _converse.api.user.presence.send
         * @param {import('../../plugins/status/types').presence_attrs} [attrs]
         * @param {Array<Element>|Array<Builder>|Element|Builder} [nodes]
         *  Nodes(s) to be added as child nodes of the `presence` XML element.
         */ send (attrs, nodes) {
            return _async_to_generator(function*() {
                yield waitUntil('statusInitialized');
                let children = [];
                if (nodes) {
                    children = Array.isArray(nodes) ? nodes : [
                        nodes
                    ];
                }
                const model = /** @type {Profile} */ _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].state.profile;
                const presence = yield model.constructPresence(attrs);
                children.map((c)=>{
                    var _c_tree;
                    return (_c_tree = c === null || c === void 0 ? void 0 : c.tree()) !== null && _c_tree !== void 0 ? _c_tree : c;
                }).forEach((c)=>presence.cnode(c).up());
                send(presence);
                const { show, type } = attrs || {};
                if (show || !type) {
                    const mucs = /** @type {MUC[]} */ yield rooms.get();
                    mucs.forEach((muc)=>muc.sendStatusPresence(attrs, children));
                }
            })();
        }
    }
});


/***/ }),

/***/ "./src/headless/shared/api/promise.js":
/*!********************************************!*\
  !*** ./src/headless/shared/api/promise.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _utils_promise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/promise.js */ "./src/headless/utils/promise.js");
/* harmony import */ var _utils_object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/object.js */ "./src/headless/utils/object.js");




/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * Converse and its plugins trigger various events which you can listen to via the
     * {@link _converse.api.listen} namespace.
     *
     * Some of these events are also available as [ES2015 Promises](http://es6-features.org/#PromiseUsage)
     * although not all of them could logically act as promises, since some events
     * might be fired multpile times whereas promises are to be resolved (or
     * rejected) only once.
     *
     * Events which are also promises include:
     *
     * * [cachedRoster](/docs/html/events.html#cachedroster)
     * * [chatBoxesFetched](/docs/html/events.html#chatBoxesFetched)
     * * [pluginsInitialized](/docs/html/events.html#pluginsInitialized)
     * * [roster](/docs/html/events.html#roster)
     * * [rosterContactsFetched](/docs/html/events.html#rosterContactsFetched)
     * * [rosterGroupsFetched](/docs/html/events.html#rosterGroupsFetched)
     * * [rosterInitialized](/docs/html/events.html#rosterInitialized)
     *
     * The various plugins might also provide promises, and they do this by using the
     * `promises.add` api method.
     *
     * @namespace _converse.api.promises
     * @memberOf _converse.api
     */ promises: {
        /**
         * By calling `promises.add`, a new [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
         * is made available for other code or plugins to depend on via the
         * {@link _converse.api.waitUntil} method.
         *
         * Generally, it's the responsibility of the plugin which adds the promise to
         * also resolve it.
         *
         * This is done by calling {@link _converse.api.trigger}, which not only resolves the
         * promise, but also emits an event with the same name (which can be listened to
         * via {@link _converse.api.listen}).
         *
         * @method _converse.api.promises.add
         * @param {string|array} [promises] The name or an array of names for the promise(s) to be added
         * @param {boolean} [replace=true] Whether this promise should be replaced with a new one when the user logs out.
         * @example _converse.api.promises.add('foo-completed');
         */ add (promises, replace = true) {
            promises = Array.isArray(promises) ? promises : [
                promises
            ];
            promises.forEach((name)=>{
                /** @type {import('../types').ReplaceableOpenPromise} */ const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
                promise.replace = replace;
                _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].promises[name] = promise;
            });
        }
    },
    /**
     * Wait until a promise is resolved or until the passed in function returns
     * a truthy value.
     * @method _converse.api.waitUntil
     * @param {string|function} condition - The name of the promise to wait for,
     * or a function which should eventually return a truthy value.
     * @returns {Promise}
     */ waitUntil (condition) {
        if ((0,_utils_object_js__WEBPACK_IMPORTED_MODULE_3__.isFunction)(condition)) {
            return (0,_utils_promise_js__WEBPACK_IMPORTED_MODULE_2__.waitUntil)(/** @type {Function} */ condition);
        } else {
            const promise = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].promises[condition];
            if (promise === undefined) {
                return null;
            }
            return promise;
        }
    }
});


/***/ }),

/***/ "./src/headless/shared/api/public.js":
/*!*******************************************!*\
  !*** ./src/headless/shared/api/public.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var sprintf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sprintf-js */ "./node_modules/sprintf-js/src/sprintf.js");
/* harmony import */ var sprintf_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sprintf_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! filesize */ "./node_modules/filesize/dist/filesize.esm.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../i18n */ "./src/headless/shared/i18n.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _connection_feedback_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../connection/feedback.js */ "./src/headless/shared/connection/feedback.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _settings_utils_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../settings/utils.js */ "./src/headless/shared/settings/utils.js");
/* harmony import */ var _utils_init_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utils/init.js */ "./src/headless/utils/init.js");
/**
 * @typedef {module:shared-api-public.ConversePrivateGlobal} ConversePrivateGlobal
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


















_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].api = _index_js__WEBPACK_IMPORTED_MODULE_7__["default"];

const env = /** @type {import('./types').ConverseEnv} */ {
    $build: strophe_js__WEBPACK_IMPORTED_MODULE_3__.$build,
    $iq: strophe_js__WEBPACK_IMPORTED_MODULE_3__.$iq,
    $msg: strophe_js__WEBPACK_IMPORTED_MODULE_3__.$msg,
    $pres: strophe_js__WEBPACK_IMPORTED_MODULE_3__.$pres,
    Collection: _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__.Collection,
    Model: _converse_skeletor__WEBPACK_IMPORTED_MODULE_4__.Model,
    Stanza: strophe_js__WEBPACK_IMPORTED_MODULE_3__.Stanza,
    Strophe: strophe_js__WEBPACK_IMPORTED_MODULE_3__.Strophe,
    TimeoutError: _errors_js__WEBPACK_IMPORTED_MODULE_15__.TimeoutError,
    VERSION_NAME: _constants_js__WEBPACK_IMPORTED_MODULE_13__.VERSION_NAME,
    css: lit__WEBPACK_IMPORTED_MODULE_6__.css,
    dayjs: (dayjs__WEBPACK_IMPORTED_MODULE_1___default()),
    errors: _errors_js__WEBPACK_IMPORTED_MODULE_15__,
    filesize: filesize__WEBPACK_IMPORTED_MODULE_5__.filesize,
    html: lit__WEBPACK_IMPORTED_MODULE_6__.html,
    log: _converse_log__WEBPACK_IMPORTED_MODULE_10__["default"],
    nothing: lit__WEBPACK_IMPORTED_MODULE_6__.nothing,
    render: lit__WEBPACK_IMPORTED_MODULE_6__.render,
    sizzle: (sizzle__WEBPACK_IMPORTED_MODULE_2___default()),
    sprintf: sprintf_js__WEBPACK_IMPORTED_MODULE_0__.sprintf,
    stx: strophe_js__WEBPACK_IMPORTED_MODULE_3__.stx,
    u: _utils_index_js__WEBPACK_IMPORTED_MODULE_12__["default"],
    utils: _utils_index_js__WEBPACK_IMPORTED_MODULE_12__["default"]
};
/**
 * @typedef {Window & {converse: ConversePrivateGlobal} } window
 *
 * ### The Public API
 *
 * This namespace contains public API methods which are are
 * accessible on the global `converse` object.
 * They are public, because any JavaScript in the
 * page can call them. Public methods therefore don’t expose any sensitive
 * or closured data. To do that, you’ll need to create a plugin, which has
 * access to the private API method.
 *
 * @global
 * @namespace converse
 */ const converse = Object.assign(/** @type {ConversePrivateGlobal} */ window.converse || {}, {
    CHAT_STATES: _constants_js__WEBPACK_IMPORTED_MODULE_13__.CHAT_STATES,
    keycodes: _constants_js__WEBPACK_IMPORTED_MODULE_13__.KEYCODES,
    /**
     * Public API method which initializes Converse.
     * This method must always be called when using Converse.
     * @async
     * @memberOf converse
     * @method initialize
     * @param { object } settings A map of [configuration-settings](https://conversejs.org/docs/html/configuration.html#configuration-settings).
     * @example
     * converse.initialize({
     *     auto_list_rooms: false,
     *     auto_subscribe: false,
     *     bosh_service_url: 'https://bind.example.com',
     *     hide_muc_server: false,
     *     i18n: 'en',
     *     play_sounds: true,
     *     show_controlbox_by_default: true,
     *     debug: false,
     *     roster_groups: true
     * });
     */ initialize (settings) {
        return _async_to_generator(function*() {
            var // Register all custom elements
            // XXX: api.elements is defined in the UI part of Converse, outside of @converse/headless.
            // This line should probably be moved to the UI code as part of a larger refactoring.
            _api_elements, _plugins_conversebosh;
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_8__["default"];
            yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_17__.cleanup)(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
            (0,_settings_utils_js__WEBPACK_IMPORTED_MODULE_16__.initAppSettings)(settings);
            _converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].strict_plugin_dependencies = settings.strict_plugin_dependencies; // Needed by pluggable.js
            _converse_log__WEBPACK_IMPORTED_MODULE_10__["default"].setLogLevel(api.settings.get("loglevel"));
            if (api.settings.get("authentication") === _constants_js__WEBPACK_IMPORTED_MODULE_13__.ANONYMOUS) {
                if (api.settings.get("auto_login") && !api.settings.get('jid')) {
                    throw new Error("Config Error: you need to provide the server's " + "domain via the 'jid' option when using anonymous " + "authentication with auto_login.");
                }
            }
            (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_12__.setLogLevelFromRoute)();
            addEventListener('hashchange', _utils_index_js__WEBPACK_IMPORTED_MODULE_12__.setLogLevelFromRoute);
            const connfeedback = new _connection_feedback_js__WEBPACK_IMPORTED_MODULE_11__["default"]();
            Object.assign(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"], {
                connfeedback
            }); // XXX: DEPRECATED
            Object.assign(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].state, {
                connfeedback
            });
            _converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].env = env;
            yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_17__.initSessionStorage)(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
            yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_17__.initClientConfig)(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
            yield _i18n__WEBPACK_IMPORTED_MODULE_9__["default"].initialize();
            (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_17__.initPlugins)(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
            (_api_elements = api.elements) === null || _api_elements === void 0 ? void 0 : _api_elements.register();
            (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_17__.registerGlobalEventHandlers)(_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"]);
            const plugins = _converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].pluggable.plugins;
            if (api.settings.get("auto_login") || api.settings.get("keepalive") && ((_plugins_conversebosh = plugins['converse-bosh']) === null || _plugins_conversebosh === void 0 ? void 0 : _plugins_conversebosh.enabled())) {
                yield api.user.login(null, null, true);
            }
            /**
         * Triggered once converse.initialize has finished.
         * @event _converse#initialized
         */ api.trigger('initialized');
            if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_14__.isTestEnv)()) {
                return _converse_js__WEBPACK_IMPORTED_MODULE_8__["default"];
            }
        })();
    },
    /**
     * Exposes methods for adding and removing plugins. You'll need to write a plugin
     * if you want to have access to the private API methods defined further down below.
     *
     * For more information on plugins, read the documentation on [writing a plugin](/docs/html/plugin_development.html).
     * @namespace plugins
     * @memberOf converse
     */ plugins: {
        /**
         * Registers a new plugin.
         * @method converse.plugins.add
         * @param { string } name The name of the plugin
         * @param { object } plugin The plugin object
         * @example
         *  const plugin = {
         *      initialize: function () {
         *          // Gets called as soon as the plugin has been loaded.
         *
         *          // Inside this method, you have access to the private
         *          // API via `_covnerse.api`.
         *
         *          // The private _converse object contains the core logic
         *          // and data-structures of Converse.
         *      }
         *  }
         *  converse.plugins.add('myplugin', plugin);
         */ add (name, plugin) {
            plugin.__name__ = name;
            if (_converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].pluggable.plugins[name] !== undefined) {
                throw new TypeError(`Error: plugin with name "${name}" has already been ` + 'registered!');
            } else {
                _converse_js__WEBPACK_IMPORTED_MODULE_8__["default"].pluggable.plugins[name] = plugin;
            }
        }
    },
    env
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (converse);


/***/ }),

/***/ "./src/headless/shared/api/send.js":
/*!*****************************************!*\
  !*** ./src/headless/shared/api/send.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../errors.js */ "./src/headless/shared/errors.js");




/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @typedef {import('strophe.js').Builder} Builder
     *
     * Allows you to send XML stanzas.
     * @method _converse.api.send
     * @param {Element|Builder} stanza
     * @returns {void}
     * @example
     *     const { stx } = _converse.env;
     *     const msg = stx`<message from="juliet@example.com/balcony" to="romeo@example.net" type="chat"/>`;
     *     _converse.api.send(msg);
     */ send (stanza) {
        const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
        if (!api.connection.connected()) {
            _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].warn("Not sending stanza because we're not connected!");
            _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].warn(strophe_js__WEBPACK_IMPORTED_MODULE_2__.Strophe.serialize(stanza));
            return;
        }
        const el = stanza instanceof Element ? stanza : stanza.tree();
        if (el.tagName === 'iq') {
            return api.sendIQ(el);
        } else {
            api.connection.get().send(el);
            api.trigger('send', el);
        }
    },
    /**
     * Send an IQ stanza
     * @method _converse.api.sendIQ
     * @param {Element|Builder} stanza
     * @param {number} [timeout] - The default timeout value is taken from
     *  the `stanza_timeout` configuration setting.
     * @param {boolean} [reject=true] - Whether an error IQ should cause the promise
     *  to be rejected. If `false`, the promise will resolve instead of being rejected.
     * @returns {Promise} A promise which resolves (or potentially rejected) once we
     *  receive a `result` or `error` stanza or once a timeout is reached.
     *  If the IQ stanza being sent is of type `result` or `error`, there's
     *  nothing to wait for, so an already resolved promise is returned.
     */ sendIQ (stanza, timeout, reject = true) {
        const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
        if (!api.connection.connected()) {
            throw new Error("Not sending IQ stanza because we're not connected!");
        }
        const connection = api.connection.get();
        let promise;
        const el = stanza instanceof Element ? stanza : stanza.tree();
        if ([
            'get',
            'set'
        ].includes(el.getAttribute('type'))) {
            timeout = timeout || api.settings.get('stanza_timeout');
            if (reject) {
                promise = new Promise((resolve, reject)=>connection.sendIQ(el, resolve, reject, timeout));
                promise.catch((e)=>{
                    if (e === null) {
                        throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.TimeoutError(`Timeout error after ${timeout}ms for the following IQ stanza: ${strophe_js__WEBPACK_IMPORTED_MODULE_2__.Strophe.serialize(el)}`);
                    }
                });
            } else {
                promise = new Promise((resolve)=>connection.sendIQ(el, resolve, resolve, timeout));
            }
        } else {
            connection.sendIQ(el);
            promise = Promise.resolve();
        }
        api.trigger('send', el);
        return promise;
    }
});


/***/ }),

/***/ "./src/headless/shared/api/user.js":
/*!*****************************************!*\
  !*** ./src/headless/shared/api/user.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _presence_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./presence.js */ "./src/headless/shared/api/presence.js");
/* harmony import */ var _connection_api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../connection/api.js */ "./src/headless/shared/connection/api.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _utils_init_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/init.js */ "./src/headless/utils/init.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _settings_user_api_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../settings/user/api.js */ "./src/headless/shared/settings/user/api.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants.js */ "./src/headless/shared/constants.js");
/**
 * @module:shared.api.user
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}








const api = {
    /**
     * This grouping collects API functions related to the current logged in user.
     *
     * @namespace _converse.api.user
     * @memberOf _converse.api
     */ user: _object_spread_props(_object_spread({
        settings: _settings_user_api_js__WEBPACK_IMPORTED_MODULE_6__.user_settings_api
    }, _presence_js__WEBPACK_IMPORTED_MODULE_1__["default"]), {
        /**
         * @method _converse.api.user.jid
         * @returns {string} The current user's full JID (Jabber ID)
         * @example _converse.api.user.jid())
         */ jid () {
            var _connection_api_get;
            return (_connection_api_get = _connection_api_js__WEBPACK_IMPORTED_MODULE_2__["default"].get()) === null || _connection_api_get === void 0 ? void 0 : _connection_api_get.jid;
        },
        /**
         * Logs the user in.
         *
         * If called without any parameters, Converse will try
         * to log the user in by calling the `prebind_url` or `credentials_url` depending
         * on whether prebinding is used or not.
         *
         * @method _converse.api.user.login
         * @param { string } [jid]
         * @param { string } [password]
         * @param { boolean } [automatic=false] - An internally used flag that indicates whether
         *  this method was called automatically once the connection has been
         *  initialized. It's used together with the `auto_login` configuration flag
         *  to determine whether Converse should try to log the user in if it
         *  fails to restore a previous auth'd session.
         *  @returns  { Promise<void> }
         */ login (jid, password, automatic = false) {
            return _async_to_generator(function*() {
                var _api_settings_get;
                const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
                jid = jid || api.settings.get('jid');
                const connection = _connection_api_js__WEBPACK_IMPORTED_MODULE_2__["default"].init(jid);
                if (((_api_settings_get = api.settings.get('connection_options')) === null || _api_settings_get === void 0 ? void 0 : _api_settings_get.worker) && (yield connection.restoreWorkerSession())) {
                    return;
                }
                if (jid) {
                    jid = yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_4__.setUserJID)(jid);
                }
                /**
             * *Hook* which allows 3rd party code to attempt logging in before
             * the core code attempts it.
             *
             * Note: If the hook handler has logged the user in, it should set the
             * `success` flag on the payload to `true`.
             *
             * @typedef {Object} LoginHookPayload
             * @property {string} jid
             * @property {string} password
             * @property {boolean} [automatic] - An internally used flag that indicates whether
             *  this method was called automatically once the connection has been initialized.
             * @property {boolean} [success] - A flag which indicates whether
             * login has succeeded. If a hook handler receives a payload with
             * this flag, it should NOT attempt to log in.
             * If a handler has successfully logged in, it should return the
             * payload with this flag set to true.
             *
             * @event _converse#login
             * @param {typeof api.user} context
             * @param {LoginHookPayload} payload
             */ const { success } = yield _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].api.hook('login', this, {
                    jid,
                    password,
                    automatic
                });
                if (success) return;
                password = password || api.settings.get('password');
                const credentials = jid && password ? {
                    jid,
                    password
                } : null;
                yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_4__.attemptNonPreboundSession)(credentials, automatic);
            }).call(this);
        },
        /**
         * Logs the user out of the current XMPP session.
         * @method _converse.api.user.logout
         * @example _converse.api.user.logout();
         */ logout () {
            return _async_to_generator(function*() {
                const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"];
                /**
             * Triggered before the user is logged out
             * @event _converse#beforeLogout
             */ yield api.trigger('beforeLogout', {
                    'synchronous': true
                });
                const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_5__.getOpenPromise)();
                const complete = ()=>{
                    // Recreate all the promises
                    Object.keys(_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].promises).forEach((p)=>(0,_utils_session_js__WEBPACK_IMPORTED_MODULE_3__.replacePromise)(_converse_js__WEBPACK_IMPORTED_MODULE_0__["default"], p));
                    // Remove the session JID, otherwise the user would just be logged
                    // in again upon reload. See #2759
                    localStorage.removeItem('conversejs-session-jid');
                    /**
                 * Triggered once the user has logged out.
                 * @event _converse#logout
                 */ api.trigger('logout');
                    promise.resolve();
                };
                const connection = _connection_api_js__WEBPACK_IMPORTED_MODULE_2__["default"].get();
                if (connection) {
                    connection.setDisconnectionCause(_constants_js__WEBPACK_IMPORTED_MODULE_7__.LOGOUT, undefined, true);
                    api.listen.once('disconnected', ()=>complete());
                    connection.disconnect();
                } else {
                    complete();
                }
                return promise;
            })();
        }
    })
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (api);


/***/ }),

/***/ "./src/headless/shared/chatbox.js":
/*!****************************************!*\
  !*** ./src/headless/shared/chatbox.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChatBoxBase)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _api_public_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _model_with_messages_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./model-with-messages.js */ "./src/headless/shared/model-with-messages.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}







const { u } = _api_public_js__WEBPACK_IMPORTED_MODULE_4__["default"].env;
class ChatBoxBase extends (0,_model_with_messages_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model) {
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            yield _superprop_get_initialize().call(_this);
            const jid = this.get('jid');
            if (!jid) {
                // XXX: The `validate` method will prevent this model
                // from being persisted if there's no jid, but that gets
                // called after model instantiation, so we have to deal
                // with invalid models here also.
                // This happens when the controlbox is in browser storage,
                // but we're in embedded mode.
                return;
            }
            this.set({
                'box_id': `box-${jid}`
            });
        }).call(this);
    }
    validate(attrs) {
        if (!attrs.jid) {
            return 'Ignored ChatBox without JID';
        }
        const room_jids = _api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_join_rooms').map((s)=>s instanceof Object ? s.jid : s);
        const auto_join = _api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_join_private_chats').concat(room_jids);
        if (_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('singleton') && !auto_join.includes(attrs.jid) && !_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('auto_join_on_invite')) {
            const msg = `${attrs.jid} is not allowed because singleton is true and it's not being auto_joined`;
            _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].warn(msg);
            return msg;
        }
    }
    /**
     * @param {boolean} force
     */ maybeShow(force) {
        if ((0,_utils_session_js__WEBPACK_IMPORTED_MODULE_2__.isUniView)()) {
            const filter = (c)=>!c.get('hidden') && c.get('jid') !== this.get('jid') && c.get('id') !== 'controlbox';
            const other_chats = _converse_js__WEBPACK_IMPORTED_MODULE_3__["default"].state.chatboxes.filter(filter);
            if (force || other_chats.length === 0) {
                // We only have one chat visible at any one time.
                // So before opening a chat, we make sure all other chats are hidden.
                other_chats.forEach((c)=>u.safeSave(c, {
                        hidden: true
                    }));
                u.safeSave(this, {
                    hidden: false
                });
                this.trigger('show');
            }
            return this;
        }
        // Overlayed view mode
        u.safeSave(this, {
            hidden: false,
            closed: false
        });
        this.trigger('show');
        return this;
    }
    shouldDestroyOnClose() {
        return _async_to_generator(function*() {
            /**
         * *Hook* which allows plugins to determine whether a chat should be destroyed when it's closed.
         * For example, used by the converse-dragresize plugin to prevent resized chats
         * from being destroyed, thereby losing the resize dimensions.
         * @event _converse#shouldDestroyOnClose
         * @param {ChatBoxBase} chatbox
         * @param {boolean} should_destroy
         */ return yield _api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hook('shouldDestroyOnClose', this, true);
        }).call(this);
    }
    /**
     * @param {Object} [_ev]
     */ close(_ev) {
        return _async_to_generator(function*() {
            if (yield this.shouldDestroyOnClose()) {
                try {
                    yield new Promise((success, reject)=>{
                        return this.destroy({
                            success,
                            error: (_m, e)=>reject(e)
                        });
                    });
                } catch (e) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_5__["default"].debug(e);
                }
            } else {
                u.safeSave(this, {
                    closed: true
                });
            }
            if (_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('clear_messages_on_reconnection')) {
                yield this.clearMessages();
            }
            /**
         * Triggered once a chatbox has been closed.
         * @event _converse#chatBoxClosed
         * @type {ChatBoxBase}
         * @example _converse.api.listen.on('chatBoxClosed', chat => { ... });
         */ _api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('chatBoxClosed', this);
        }).call(this);
    }
    announceReconnection() {
        /**
         * Triggered whenever a `ChatBox` instance has reconnected after an outage
         * @event _converse#onChatReconnected
         * @type {ChatBoxBase}
         * @example _converse.api.listen.on('onChatReconnected', chat => { ... });
         */ _api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].trigger('chatReconnected', this);
    }
    onReconnection() {
        return _async_to_generator(function*() {
            if (_api_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].settings.get('clear_messages_on_reconnection')) {
                yield this.clearMessages();
            }
            this.announceReconnection();
        }).call(this);
    }
}
/**
 * Base class for all chat boxes. Provides common methods.
 */ 


/***/ }),

/***/ "./src/headless/shared/color.js":
/*!**************************************!*\
  !*** ./src/headless/shared/color.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ColorAwareModel)
/* harmony export */ });
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/index.js */ "./src/headless/utils/index.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ "./src/headless/shared/constants.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { safeSave, colorize } = _utils_index_js__WEBPACK_IMPORTED_MODULE_0__["default"];
/**
 * @template {import('./types').ModelExtender} T
 * @param {T} BaseModel
 */ function ColorAwareModel(BaseModel) {
    return class ColorAwareModel extends BaseModel {
        setColor() {
            return _async_to_generator(function*() {
                const color = yield colorize(this.getIdentifier());
                safeSave(this, {
                    color
                });
            }).call(this);
        }
        getIdentifier() {
            if (this.get('type') === _constants_js__WEBPACK_IMPORTED_MODULE_1__.CHATROOMS_TYPE) {
                return this.get('jid');
            } else if (this.get('type') === 'groupchat') {
                return this.get('from_real_jid') || this.get('from');
            } else {
                return this.get('occupant_id') || this.get('jid') || this.get('from') || this.get('nick');
            }
        }
        /**
        * @returns {Promise<string>}
        */ getColor() {
            return _async_to_generator(function*() {
                if (!this.get('color')) {
                    yield this.setColor();
                }
                return this.get('color');
            }).call(this);
        }
        /**
        * @param {string} append_style
        * @returns {Promise<string>}
        */ getAvatarStyle(append_style = '') {
            return _async_to_generator(function*() {
                try {
                    const color = yield this.getColor();
                    return `background-color: ${color} !important; ${append_style}`;
                } catch (e) {
                    return `background-color: gray !important; ${append_style}`;
                }
            }).call(this);
        }
    };
}


/***/ }),

/***/ "./src/headless/shared/connection/api.js":
/*!***********************************************!*\
  !*** ./src/headless/shared/connection/api.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _api_events_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api/events.js */ "./src/headless/shared/api/events.js");
/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.js */ "./src/headless/shared/connection/index.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/headless/shared/connection/utils.js");
/* harmony import */ var _utils_jid_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/jid.js */ "./src/headless/utils/jid.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _settings_api_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../settings/api.js */ "./src/headless/shared/settings/api.js");








let connection;
const default_connection_options = {
    'explicitResourceBinding': true
};
/**
 * This grouping collects API functions related to the XMPP connection.
 *
 * @namespace api.connection
 * @memberOf api
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * @method api.connection.init
     * @memberOf api.connection
     * @param {string} [jid]
     * @return {Connection|MockConnection}
     */ init (jid) {
        if (jid && (connection === null || connection === void 0 ? void 0 : connection.jid) && (0,_utils_jid_js__WEBPACK_IMPORTED_MODULE_5__.isSameDomain)(connection.jid, jid)) return connection;
        if (!_settings_api_js__WEBPACK_IMPORTED_MODULE_7__.settings_api.get('bosh_service_url') && _settings_api_js__WEBPACK_IMPORTED_MODULE_7__.settings_api.get('authentication') === _constants_js__WEBPACK_IMPORTED_MODULE_2__.PREBIND) {
            throw new Error("authentication is set to 'prebind' but we don't have a BOSH connection");
        }
        const XMPPConnection = (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_6__.isTestEnv)() ? _index_js__WEBPACK_IMPORTED_MODULE_1__.MockConnection : _index_js__WEBPACK_IMPORTED_MODULE_1__.Connection;
        connection = new XMPPConnection((0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getConnectionServiceURL)(), Object.assign(default_connection_options, _settings_api_js__WEBPACK_IMPORTED_MODULE_7__.settings_api.get('connection_options'), {
            'keepalive': _settings_api_js__WEBPACK_IMPORTED_MODULE_7__.settings_api.get('keepalive')
        }));
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.setStropheLogLevel)();
        /**
         * Triggered once the `Connection` constructor has been initialized, which
         * will be responsible for managing the connection to the XMPP server.
         *
         * @event connectionInitialized
         */ _api_events_js__WEBPACK_IMPORTED_MODULE_0__["default"].trigger('connectionInitialized');
        return connection;
    },
    get () {
        return connection;
    },
    destroy () {
        this.disconnect();
        connection === null || connection === void 0 ? void 0 : connection.disconnect();
        connection = undefined;
    },
    /**
     * @method api.connection.authenticated
     * @memberOf api.connection
     * @returns {boolean} Whether we're authenticated to the XMPP server or not
     */ authenticated () {
        return (connection === null || connection === void 0 ? void 0 : connection.authenticated) && true;
    },
    /**
     * @method api.connection.connected
     * @memberOf api.connection
     * @returns {boolean} Whether there is an established connection or not.
     */ connected () {
        return (connection === null || connection === void 0 ? void 0 : connection.connected) && true;
    },
    /**
     * Terminates the connection.
     *
     * @method api.connection.disconnect
     * @memberOf api.connection
     */ disconnect () {
        connection === null || connection === void 0 ? void 0 : connection.disconnect();
    },
    /**
     * Can be called once the XMPP connection has dropped and we want
     * to attempt reconnection.
     * Only needs to be called once, if reconnect fails Converse will
     * attempt to reconnect every two seconds, alternating between BOSH and
     * Websocket if URLs for both were provided.
     * @method reconnect
     * @memberOf api.connection
     */ reconnect () {
        connection.setConnectionStatus(strophe_js__WEBPACK_IMPORTED_MODULE_3__.Strophe.Status.RECONNECTING, 'The connection has dropped, attempting to reconnect.');
        if (connection === null || connection === void 0 ? void 0 : connection.reconnecting) {
            return connection.debouncedReconnect();
        } else {
            return connection.reconnect();
        }
    },
    /**
     * Utility method to determine the type of connection we have
     * @method isType
     * @memberOf api.connection
     * @returns {boolean}
     */ isType (type) {
        return connection.isType(type);
    }
});


/***/ }),

/***/ "./src/headless/shared/connection/feedback.js":
/*!****************************************************!*\
  !*** ./src/headless/shared/connection/feedback.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_converse */ "./src/headless/shared/_converse.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");



class Feedback extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Model {
    defaults() {
        return {
            'connection_status': strophe_js__WEBPACK_IMPORTED_MODULE_2__.Strophe.Status.DISCONNECTED,
            'message': ''
        };
    }
    initialize() {
        super.initialize();
        const { api } = _converse__WEBPACK_IMPORTED_MODULE_0__["default"];
        this.on('change', ()=>api.trigger('connfeedback', _converse__WEBPACK_IMPORTED_MODULE_0__["default"].state.connfeedback));
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Feedback);


/***/ }),

/***/ "./src/headless/shared/connection/index.js":
/*!*************************************************!*\
  !*** ./src/headless/shared/connection/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Connection: () => (/* binding */ Connection),
/* harmony export */   MockConnection: () => (/* binding */ MockConnection)
/* harmony export */ });
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants */ "./src/headless/shared/constants.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _utils_session_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _utils_init_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/init.js */ "./src/headless/utils/init.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}










const i = Object.keys(strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status).reduce((max, k)=>Math.max(max, strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status[k]), 0);
strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.RECONNECTING = i + 1;
/**
 * The Connection class manages the connection to the XMPP server. It's
 * agnostic concerning the underlying protocol (i.e. websocket, long-polling
 * via BOSH or websocket inside a shared worker).
 */ class Connection extends strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Connection {
    /** @param {Element} body */ xmlInput(body) {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(body.outerHTML, 'color: darkgoldenrod');
    }
    /** @param {Element} body */ xmlOutput(body) {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(body.outerHTML, 'color: darkcyan');
    }
    bind() {
        var _this = this, _superprop_get_bind = ()=>super.bind;
        return _async_to_generator(function*() {
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            /**
         * Synchronous event triggered before we send an IQ to bind the user's
         * JID resource for this session.
         * @event _converse#beforeResourceBinding
         */ yield api.trigger('beforeResourceBinding', {
                'synchronous': true
            });
            _superprop_get_bind().call(_this);
        })();
    }
    onDomainDiscovered(response) {
        return _async_to_generator(function*() {
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            const text = yield response.text();
            const xrd = new DOMParser().parseFromString(text, "text/xml").firstElementChild;
            if (xrd.nodeName != "XRD" || xrd.namespaceURI != "http://docs.oasis-open.org/ns/xri/xrd-1.0") {
                return _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].info("Could not discover XEP-0156 connection methods");
            }
            const bosh_links = sizzle__WEBPACK_IMPORTED_MODULE_1___default()(`Link[rel="urn:xmpp:alt-connections:xbosh"]`, xrd);
            const ws_links = sizzle__WEBPACK_IMPORTED_MODULE_1___default()(`Link[rel="urn:xmpp:alt-connections:websocket"]`, xrd);
            const bosh_methods = bosh_links.map((el)=>el.getAttribute('href')).filter((uri)=>uri.startsWith('https:'));
            const ws_methods = ws_links.map((el)=>el.getAttribute('href')).filter((uri)=>uri.startsWith('wss:'));
            if (bosh_methods.length === 0 && ws_methods.length === 0) {
                _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].info("Neither BOSH nor WebSocket connection methods have been specified with XEP-0156.");
            } else {
                // TODO: support multiple endpoints
                api.settings.set("websocket_url", ws_methods.pop());
                api.settings.set('bosh_service_url', bosh_methods.pop());
                this.service = api.settings.get("websocket_url") || api.settings.get('bosh_service_url');
                this.setProtocol();
            }
        }).call(this);
    }
    /**
     * Adds support for XEP-0156 by quering the XMPP server for alternate
     * connection methods. This allows users to use the websocket or BOSH
     * connection of their own XMPP server instead of a proxy provided by the
     * host of Converse.js.
     * @method Connnection.discoverConnectionMethods
     * @param {string} domain
     */ discoverConnectionMethods(domain) {
        return _async_to_generator(function*() {
            // Use XEP-0156 to check whether this host advertises websocket or BOSH connection methods.
            const options = {
                mode: /** @type {RequestMode} */ 'cors',
                headers: {
                    Accept: 'application/xrd+xml, text/xml'
                }
            };
            const url = `https://${domain}/.well-known/host-meta`;
            let response;
            try {
                response = yield fetch(url, options);
            } catch (e) {
                _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].info(`Failed to discover alternative connection methods at ${url}`);
                _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(e);
                return;
            }
            if (response.status >= 200 && response.status < 400) {
                yield this.onDomainDiscovered(response);
            } else {
                _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].info("Could not discover XEP-0156 connection methods");
            }
        }).call(this);
    }
    /**
     * Establish a new XMPP session by logging in with the supplied JID and
     * password.
     * @param {String} jid
     * @param {String} password
     * @param {Function} callback
     */ connect(jid, password, callback) {
        var _this = this, _superprop_get_connect = ()=>super.connect;
        return _async_to_generator(function*() {
            const { __, api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            if (api.settings.get("discover_connection_methods")) {
                const domain = strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.getDomainFromJid(jid);
                yield this.discoverConnectionMethods(domain);
            }
            if (!api.settings.get('bosh_service_url') && !api.settings.get("websocket_url")) {
                // If we don't have a connection URL, we show an input for the user
                // to manually provide it.
                api.settings.set('show_connection_url_input', true);
                (callback || this.onConnectStatusChanged.bind(this))(strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.DISCONNECTED, __('Could not automatically determine a connection URL'));
                return;
            }
            _superprop_get_connect().call(_this, jid, password, callback || this.onConnectStatusChanged, _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.BOSH_WAIT);
        }).call(this);
    }
    /**
     * @param {string} reason
     */ disconnect(reason) {
        super.disconnect(reason);
        this.send_initial_presence = true;
    }
    /**
     * Switch to a different transport if a service URL is available for it.
     *
     * When reconnecting with a new transport, we call setUserJID
     * so that a new resource is generated, to avoid multiple
     * server-side sessions with the same resource.
     *
     * We also call `_proto._doDisconnect` so that connection event handlers
     * for the old transport are removed.
     */ switchTransport() {
        return _async_to_generator(function*() {
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            const bare_jid = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
            if (api.connection.isType('websocket') && api.settings.get('bosh_service_url')) {
                yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(bare_jid);
                this._proto._doDisconnect();
                this._proto = new strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Bosh(this);
                this.service = api.settings.get('bosh_service_url');
            } else if (api.connection.isType('bosh') && api.settings.get("websocket_url")) {
                if (api.settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.ANONYMOUS) {
                    // When reconnecting anonymously, we need to connect with only
                    // the domain, not the full JID that we had in our previous
                    // (now failed) session.
                    yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(api.settings.get("jid"));
                } else {
                    yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(bare_jid);
                }
                this._proto._doDisconnect();
                this._proto = new strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Websocket(this);
                this.service = api.settings.get("websocket_url");
            }
        }).call(this);
    }
    reconnect() {
        return _async_to_generator(function*() {
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug('RECONNECTING: the connection has dropped, attempting to reconnect.');
            this.reconnecting = true;
            yield (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.tearDown)(_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
            const conn_status = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.connfeedback.get('connection_status');
            if (conn_status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNFAIL) {
                this.switchTransport();
            } else if (conn_status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.AUTHFAIL && api.settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.ANONYMOUS) {
                // When reconnecting anonymously, we need to connect with only
                // the domain, not the full JID that we had in our previous
                // (now failed) session.
                yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(api.settings.get("jid"));
            }
            /**
         * Triggered when the connection has dropped, but Converse will attempt
         * to reconnect again.
         * @event _converse#will-reconnect
         */ api.trigger('will-reconnect');
            if (api.settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.ANONYMOUS) {
                yield (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.clearSession)(_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
            }
            const jid = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('jid');
            return api.user.login(jid);
        }).call(this);
    }
    /**
     * Called as soon as a new connection has been established, either
     * by logging in or by attaching to an existing BOSH session.
     * @method Connection.onConnected
     * @param {Boolean} [reconnecting] - Whether Converse.js reconnected from an earlier dropped session.
     */ onConnected(reconnecting) {
        return _async_to_generator(function*() {
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            delete this.reconnecting;
            this.flush(); // Solves problem of returned PubSub BOSH response not received by browser
            yield (0,_utils_init_js__WEBPACK_IMPORTED_MODULE_7__.setUserJID)(this.jid);
            // Save the current JID in persistent storage so that we can attempt to
            // recreate the session from SCRAM keys
            if (_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.config.get('trusted')) {
                const bare_jid = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].session.get('bare_jid');
                localStorage.setItem('conversejs-session-jid', bare_jid);
            }
            /**
         * Synchronous event triggered after we've sent an IQ to bind the
         * user's JID resource for this session.
         * @event _converse#afterResourceBinding
         */ yield api.trigger('afterResourceBinding', reconnecting, {
                'synchronous': true
            });
            if (reconnecting) {
                /**
             * After the connection has dropped and converse.js has reconnected.
             * Any Strophe stanza handlers (as registered via `converse.listen.stanza`) will
             * have to be registered anew.
             * @event _converse#reconnected
             * @example _converse.api.listen.on('reconnected', () => { ... });
             */ api.trigger('reconnected');
            } else {
                /**
             * Triggered after the connection has been established and Converse
             * has got all its ducks in a row.
             * @event _converse#initialized
             */ api.trigger('connected');
            }
        }).call(this);
    }
    /**
     * Used to keep track of why we got disconnected, so that we can
     * decide on what the next appropriate action is (in onDisconnected)
     * @param {Number|'logout'} [cause] - The status number as received from Strophe.
     * @param {String} [reason] - An optional user-facing message as to why
     *  there was a disconnection.
     * @param {Boolean} [override] - An optional flag to replace any previous
     *  disconnection cause and reason.
     */ setDisconnectionCause(cause, reason, override) {
        if (cause === undefined) {
            delete this.disconnection_cause;
            delete this.disconnection_reason;
        } else if (this.disconnection_cause === undefined || override) {
            this.disconnection_cause = cause;
            this.disconnection_reason = reason;
        }
    }
    /**
     * @param {Number} [status] - The status number as received from Strophe.
     * @param {String} [message] - An optional user-facing message
     */ setConnectionStatus(status, message) {
        this.status = status;
        _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.connfeedback.set({
            connection_status: status,
            message
        });
    }
    finishDisconnection() {
        return _async_to_generator(function*() {
            this.setConnectionStatus(strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.DISCONNECTED, this.disconnection_reason);
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            // Properly tear down the session so that it's possible to manually connect again.
            _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug('DISCONNECTED');
            delete this.reconnecting;
            this.reset();
            (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.tearDown)(_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
            yield (0,_utils_session_js__WEBPACK_IMPORTED_MODULE_5__.clearSession)(_converse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
            api.connection.destroy();
            /**
        * Triggered after converse.js has disconnected from the XMPP server.
        * @event _converse#disconnected
        * @memberOf _converse
        * @example _converse.api.listen.on('disconnected', () => { ... });
        */ api.trigger('disconnected');
        }).call(this);
    }
    /**
     * Gets called once strophe's status reaches Strophe.Status.DISCONNECTED.
     * Will either start a teardown process for converse.js or attempt
     * to reconnect.
     * @method onDisconnected
     */ onDisconnected() {
        const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
        if (api.settings.get("auto_reconnect")) {
            const reason = this.disconnection_reason;
            if (this.disconnection_cause === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.AUTHFAIL) {
                if (api.settings.get("credentials_url") || api.settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.ANONYMOUS) {
                    // If `credentials_url` is set, we reconnect, because we might
                    // be receiving expirable tokens from the credentials_url.
                    //
                    // If `authentication` is anonymous, we reconnect because we
                    // might have tried to attach with stale BOSH session tokens
                    // or with a cached JID and password
                    return api.connection.reconnect();
                } else {
                    return this.finishDisconnection();
                }
            } else if (this.status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNECTING) {
                // Don't try to reconnect if we were never connected to begin
                // with, otherwise an infinite loop can occur (e.g. when the
                // BOSH service URL returns a 404).
                const { __ } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
                this.setConnectionStatus(strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNFAIL, __('An error occurred while connecting to the chat server.'));
                return this.finishDisconnection();
            } else if (this.disconnection_cause === _shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.LOGOUT || reason === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.ErrorCondition.NO_AUTH_MECH || reason === "host-unknown" || reason === "remote-connection-failed") {
                return this.finishDisconnection();
            }
            api.connection.reconnect();
        } else {
            return this.finishDisconnection();
        }
    }
    /**
     * Callback method called by Strophe as the Connection goes
     * through various states while establishing or tearing down a
     * connection.
     * @param {Number} status
     * @param {String} [condition]
     */ onConnectStatusChanged(status, condition) {
        const { __ } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(`Status changed to: ${_shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.CONNECTION_STATUS[status]}`);
        if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.ATTACHFAIL) {
            var _this_worker_attach_promise;
            this.setConnectionStatus(status);
            (_this_worker_attach_promise = this.worker_attach_promise) === null || _this_worker_attach_promise === void 0 ? void 0 : _this_worker_attach_promise.resolve(false);
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNECTED || status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.ATTACHED) {
            var _this_worker_attach_promise1, _this_worker_attach_promise2;
            if (((_this_worker_attach_promise1 = this.worker_attach_promise) === null || _this_worker_attach_promise1 === void 0 ? void 0 : _this_worker_attach_promise1.isResolved) && this.status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.ATTACHED) {
                // A different tab must have attached, so nothing to do for us here.
                return;
            }
            this.setConnectionStatus(status);
            (_this_worker_attach_promise2 = this.worker_attach_promise) === null || _this_worker_attach_promise2 === void 0 ? void 0 : _this_worker_attach_promise2.resolve(true);
            this.setDisconnectionCause();
            if (this.reconnecting) {
                _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNECTED ? 'Reconnected' : 'Reattached');
                this.onConnected(true);
            } else {
                _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNECTED ? 'Connected' : 'Attached');
                if (this.restored) {
                    // No need to send an initial presence stanza when
                    // we're restoring an existing session.
                    this.send_initial_presence = false;
                }
                this.onConnected();
            }
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.DISCONNECTED) {
            this.setDisconnectionCause(status, condition);
            this.onDisconnected();
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.BINDREQUIRED) {
            this.bind();
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.ERROR) {
            this.setConnectionStatus(status, __('An error occurred while connecting to the chat server.'));
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNECTING) {
            this.setConnectionStatus(status);
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.AUTHENTICATING) {
            this.setConnectionStatus(status);
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.AUTHFAIL) {
            if (!condition) {
                condition = __('Your XMPP address and/or password is incorrect. Please try again.');
            }
            this.setConnectionStatus(status, condition);
            this.setDisconnectionCause(status, condition, true);
            this.onDisconnected();
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNFAIL) {
            var _Strophe_ErrorCondition;
            let feedback = condition;
            if (condition === "host-unknown" || condition == "remote-connection-failed") {
                feedback = __("We could not connect to %1$s, is your XMPP address correct?", strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.getDomainFromJid(this.jid));
            } else if (condition === 'policy-violation') {
                feedback = __("The XMPP server rejected the connection because of a policy violation");
            } else if (condition !== undefined && condition === (strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe === null || strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe === void 0 ? void 0 : (_Strophe_ErrorCondition = strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.ErrorCondition) === null || _Strophe_ErrorCondition === void 0 ? void 0 : _Strophe_ErrorCondition.NO_AUTH_MECH)) {
                feedback = __("The XMPP server did not offer a supported authentication mechanism");
            }
            this.setConnectionStatus(status, feedback);
            this.setDisconnectionCause(status, condition);
        } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.DISCONNECTING) {
            this.setConnectionStatus(status);
            this.setDisconnectionCause(status, condition);
        }
    }
    /**
     * @param {string} type
     */ isType(type) {
        if (type.toLowerCase() === 'websocket') {
            return this._proto instanceof strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Websocket;
        } else if (type.toLowerCase() === 'bosh') {
            return strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Bosh && this._proto instanceof strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Bosh;
        }
    }
    hasResumed() {
        var _api_settings_get;
        const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
        if (((_api_settings_get = api.settings.get("connection_options")) === null || _api_settings_get === void 0 ? void 0 : _api_settings_get.worker) || this.isType('bosh')) {
            return _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"].state.connfeedback.get('connection_status') === strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.ATTACHED;
        } else {
            // Not binding means that the session was resumed.
            return !this.do_bind;
        }
    }
    restoreWorkerSession() {
        this.attach(this.onConnectStatusChanged);
        this.worker_attach_promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_6__.getOpenPromise)();
        return this.worker_attach_promise;
    }
    constructor(service, options){
        super(service, options);
        // For new sessions, we need to send out a presence stanza to notify
        // the server/network that we're online.
        // When re-attaching to an existing session we don't need to again send out a presence stanza,
        // because it's as if "we never left" (see onConnectStatusChanged).
        this.send_initial_presence = true;
        this.debouncedReconnect = (0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_8__["default"])(this.reconnect, 3000);
    }
}
/**
 * The MockConnection class is used during testing, to mock an XMPP connection.
 */ class MockConnection extends Connection {
    // @ts-ignore
    get _sasl_mechanism() {
        return new strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.SASLSHA256();
    }
    _processRequest() {
    // Don't attempt to send out stanzas
    }
    sendIQ(iq, callback, errback) {
        var _iq_tree;
        var _iq_tree1;
        iq = (_iq_tree1 = (_iq_tree = iq.tree) === null || _iq_tree === void 0 ? void 0 : _iq_tree.call(iq)) !== null && _iq_tree1 !== void 0 ? _iq_tree1 : iq;
        this.IQ_stanzas.push(iq);
        const id = super.sendIQ(iq, callback, errback);
        this.IQ_ids.push(id);
        return id;
    }
    send(stanza) {
        var _stanza_tree;
        var _stanza_tree1;
        stanza = (_stanza_tree1 = (_stanza_tree = stanza.tree) === null || _stanza_tree === void 0 ? void 0 : _stanza_tree.call(stanza)) !== null && _stanza_tree1 !== void 0 ? _stanza_tree1 : stanza;
        this.sent_stanzas.push(stanza);
        return super.send(stanza);
    }
    bind() {
        return _async_to_generator(function*() {
            const { api } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
            yield api.trigger('beforeResourceBinding', {
                'synchronous': true
            });
            this.authenticated = true;
            this._changeConnectStatus(strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.CONNECTED);
        }).call(this);
    }
    /**
     * @param {string} service - The BOSH or WebSocket service URL.
     * @param {import('strophe.js/src/types/connection').ConnectionOptions} options - The configuration options
     */ constructor(service, options){
        super(service, options);
        this.sent_stanzas = [];
        this.IQ_stanzas = [];
        this.IQ_ids = [];
        this.features = strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.xmlHtmlNode('<stream:features xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">' + '<ver xmlns="urn:xmpp:features:rosterver"/>' + '<csi xmlns="urn:xmpp:csi:0"/>' + '<this xmlns="http://jabber.org/protocol/caps" ver="UwBpfJpEt3IoLYfWma/o/p3FFRo=" hash="sha-1" node="http://prosody.im"/>' + '<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">' + '<required/>' + '</bind>' + `<sm xmlns='urn:xmpp:sm:3'/>` + '<session xmlns="urn:ietf:params:xml:ns:xmpp-session">' + '<optional/>' + '</session>' + '</stream:features>').firstElementChild;
        // @ts-ignore
        this._proto._processRequest = ()=>{};
        this._proto._disconnect = ()=>this._onDisconnectTimeout();
        // eslint-disable-next-line @typescript-eslint/no-empty-function
        this._proto._onDisconnectTimeout = ()=>{};
        this._proto._connect = ()=>{
            this.connected = true;
            this.mock = true;
            this.jid = 'romeo@montague.lit/orchard';
            this._changeConnectStatus(strophe_js__WEBPACK_IMPORTED_MODULE_4__.Strophe.Status.BINDREQUIRED);
        };
    }
}


/***/ }),

/***/ "./src/headless/shared/connection/utils.js":
/*!*************************************************!*\
  !*** ./src/headless/shared/connection/utils.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   generateResource: () => (/* binding */ generateResource),
/* harmony export */   getConnectionServiceURL: () => (/* binding */ getConnectionServiceURL),
/* harmony export */   setStropheLogLevel: () => (/* binding */ setStropheLogLevel)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _settings_api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../settings/api.js */ "./src/headless/shared/settings/api.js");



function generateResource() {
    return `/converse.js-${Math.floor(Math.random() * 139749528).toString()}`;
}
function setStropheLogLevel() {
    const level = _settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api.get('loglevel');
    strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.setLogLevel(strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.LogLevel[level.toUpperCase()]);
    const lmap = {};
    lmap[strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.LogLevel.DEBUG] = 'debug';
    lmap[strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.LogLevel.INFO] = 'info';
    lmap[strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.LogLevel.WARN] = 'warn';
    lmap[strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.LogLevel.ERROR] = 'error';
    lmap[strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.LogLevel.FATAL] = 'fatal';
    strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.log = (l, msg)=>_converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].log(msg, lmap[l]);
    strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.error = (msg)=>_converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(msg);
}
function getConnectionServiceURL() {
    if (('WebSocket' in window || 'MozWebSocket' in window) && _settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api.get('websocket_url')) {
        return _settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api.get('websocket_url');
    } else if (_settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api.get('bosh_service_url')) {
        return _settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api.get('bosh_service_url');
    }
    return '';
}


/***/ }),

/***/ "./src/headless/shared/constants.js":
/*!******************************************!*\
  !*** ./src/headless/shared/constants.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACTIVE: () => (/* binding */ ACTIVE),
/* harmony export */   ANONYMOUS: () => (/* binding */ ANONYMOUS),
/* harmony export */   BOSH_WAIT: () => (/* binding */ BOSH_WAIT),
/* harmony export */   CHATROOMS_TYPE: () => (/* binding */ CHATROOMS_TYPE),
/* harmony export */   CHAT_STATES: () => (/* binding */ CHAT_STATES),
/* harmony export */   CLOSED: () => (/* binding */ CLOSED),
/* harmony export */   COMPOSING: () => (/* binding */ COMPOSING),
/* harmony export */   CONNECTION_STATUS: () => (/* binding */ CONNECTION_STATUS),
/* harmony export */   CONTROLBOX_TYPE: () => (/* binding */ CONTROLBOX_TYPE),
/* harmony export */   CORE_PLUGINS: () => (/* binding */ CORE_PLUGINS),
/* harmony export */   EXTERNAL: () => (/* binding */ EXTERNAL),
/* harmony export */   FAILURE: () => (/* binding */ FAILURE),
/* harmony export */   GONE: () => (/* binding */ GONE),
/* harmony export */   HEADLINES_TYPE: () => (/* binding */ HEADLINES_TYPE),
/* harmony export */   INACTIVE: () => (/* binding */ INACTIVE),
/* harmony export */   KEYCODES: () => (/* binding */ KEYCODES),
/* harmony export */   LOGIN: () => (/* binding */ LOGIN),
/* harmony export */   LOGOUT: () => (/* binding */ LOGOUT),
/* harmony export */   MARKER_TYPES: () => (/* binding */ MARKER_TYPES),
/* harmony export */   METADATA_ATTRIBUTES: () => (/* binding */ METADATA_ATTRIBUTES),
/* harmony export */   OPENED: () => (/* binding */ OPENED),
/* harmony export */   PAUSED: () => (/* binding */ PAUSED),
/* harmony export */   PREBIND: () => (/* binding */ PREBIND),
/* harmony export */   PRES_SHOW_VALUES: () => (/* binding */ PRES_SHOW_VALUES),
/* harmony export */   PRES_TYPE_VALUES: () => (/* binding */ PRES_TYPE_VALUES),
/* harmony export */   PRIVATE_CHAT_TYPE: () => (/* binding */ PRIVATE_CHAT_TYPE),
/* harmony export */   STATUS_WEIGHTS: () => (/* binding */ STATUS_WEIGHTS),
/* harmony export */   SUCCESS: () => (/* binding */ SUCCESS),
/* harmony export */   VERSION_NAME: () => (/* binding */ VERSION_NAME),
/* harmony export */   XFORM_TYPE_MAP: () => (/* binding */ XFORM_TYPE_MAP),
/* harmony export */   XFORM_VALIDATE_TYPE_MAP: () => (/* binding */ XFORM_VALIDATE_TYPE_MAP)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");

const BOSH_WAIT = 59;
const VERSION_NAME = "v11.0.1";
const PRES_SHOW_VALUES = [
    'chat',
    'dnd',
    'away',
    'xa'
];
const PRES_TYPE_VALUES = [
    'available',
    'unavailable',
    'error',
    'probe',
    'subscribe',
    'subscribed',
    'unsubscribe',
    'unsubscribed'
];
const STATUS_WEIGHTS = {
    offline: 6,
    unavailable: 5,
    xa: 4,
    away: 3,
    dnd: 2,
    chat: 1,
    online: 1
};
const METADATA_ATTRIBUTES = [
    "og:article:author",
    "og:article:published_time",
    "og:description",
    "og:image",
    "og:image:height",
    "og:image:width",
    "og:site_name",
    "og:title",
    "og:type",
    "og:url",
    "og:video:height",
    "og:video:secure_url",
    "og:video:tag",
    "og:video:type",
    "og:video:url",
    "og:video:width"
];
const ANONYMOUS = 'anonymous';
const CLOSED = 'closed';
const EXTERNAL = 'external';
const LOGIN = 'login';
const LOGOUT = 'logout';
const OPENED = 'opened';
const PREBIND = 'prebind';
const SUCCESS = 'success';
const FAILURE = 'failure';
// XEP-0085 Chat states
// https =//xmpp.org/extensions/xep-0085.html
const INACTIVE = 'inactive';
const ACTIVE = 'active';
const COMPOSING = 'composing';
const PAUSED = 'paused';
const GONE = 'gone';
// Chat types
const PRIVATE_CHAT_TYPE = 'chatbox';
const CHATROOMS_TYPE = 'chatroom';
const HEADLINES_TYPE = 'headline';
const CONTROLBOX_TYPE = 'controlbox';
const CONNECTION_STATUS = {};
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.ATTACHED] = 'ATTACHED';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.AUTHENTICATING] = 'AUTHENTICATING';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.AUTHFAIL] = 'AUTHFAIL';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.CONNECTED] = 'CONNECTED';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.CONNECTING] = 'CONNECTING';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.CONNFAIL] = 'CONNFAIL';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.DISCONNECTED] = 'DISCONNECTED';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.DISCONNECTING] = 'DISCONNECTING';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.ERROR] = 'ERROR';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.RECONNECTING] = 'RECONNECTING';
CONNECTION_STATUS[strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.Status.REDIRECT] = 'REDIRECT';
// Add Strophe Namespaces
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('ACTIVITY', 'http://jabber.org/protocol/activity');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('CARBONS', 'urn:xmpp:carbons:2');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('CHATSTATES', 'http://jabber.org/protocol/chatstates');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('CSI', 'urn:xmpp:csi:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('DELAY', 'urn:xmpp:delay');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('EME', 'urn:xmpp:eme:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('FALLBACK', 'urn:xmpp:fallback:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('FASTEN', 'urn:xmpp:fasten:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('FORWARD', 'urn:xmpp:forward:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('HINTS', 'urn:xmpp:hints');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('HTTPUPLOAD', 'urn:xmpp:http:upload:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('MAM', 'urn:xmpp:mam:2');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('MARKERS', 'urn:xmpp:chat-markers:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('MENTIONS', 'urn:xmpp:mmn:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('MESSAGE_CORRECT', 'urn:xmpp:message-correct:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('MODERATE', 'urn:xmpp:message-moderate:1');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('MODERATE0', 'urn:xmpp:message-moderate:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('NICK', 'http://jabber.org/protocol/nick');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('OCCUPANTID', 'urn:xmpp:occupant-id:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('OMEMO', 'eu.siacs.conversations.axolotl');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('OUTOFBAND', 'jabber:x:oob');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('PUBSUB', 'http://jabber.org/protocol/pubsub');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('RAI', 'urn:xmpp:rai:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('RECEIPTS', 'urn:xmpp:receipts');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('REFERENCE', 'urn:xmpp:reference:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('REGISTER', 'jabber:iq:register');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('RETRACT', 'urn:xmpp:message-retract:1');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('RETRACT0', 'urn:xmpp:message-retract:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('ROSTERX', 'http://jabber.org/protocol/rosterx');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('RSM', 'http://jabber.org/protocol/rsm');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('SID', 'urn:xmpp:sid:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('SPOILER', 'urn:xmpp:spoiler:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('STANZAS', 'urn:ietf:params:xml:ns:xmpp-stanzas');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('STYLING', 'urn:xmpp:styling:0');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('VCARD', 'vcard-temp');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('VCARDUPDATE', 'vcard-temp:x:update');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('XFORM', 'jabber:x:data');
strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.addNamespace('XHTML', 'http://www.w3.org/1999/xhtml');
// Core plugins are whitelisted automatically
// These are just the @converse/headless plugins, for the full converse,
// the other plugins are whitelisted in src/consts.js
const CORE_PLUGINS = [
    'converse-adhoc',
    'converse-bookmarks',
    'converse-blocklist',
    'converse-bosh',
    'converse-caps',
    'converse-chat',
    'converse-chatboxes',
    'converse-disco',
    'converse-emoji',
    'converse-headlines',
    'converse-mam',
    'converse-muc',
    'converse-ping',
    'converse-pubsub',
    'converse-roster',
    'converse-smacks',
    'converse-status',
    'converse-vcard'
];
const CHAT_STATES = [
    'active',
    'composing',
    'gone',
    'inactive',
    'paused'
];
const MARKER_TYPES = [
    'displayed',
    'received',
    'acknowledged'
];
const KEYCODES = {
    TAB: "Tab",
    ENTER: "Enter",
    SHIFT: "Shift",
    CTRL: "Control",
    ALT: "Alt",
    ESCAPE: "Escape",
    LEFT_ARROW: "ArrowLeft",
    UP_ARROW: "ArrowUp",
    RIGHT_ARROW: "ArrowRight",
    DOWN_ARROW: "ArrowDown",
    FORWARD_SLASH: "Divide",
    AT: "Alt",
    META: "Meta"
};
const XFORM_TYPE_MAP = {
    'text-private': 'password',
    'text-single': 'text',
    'fixed': 'label',
    'boolean': 'checkbox',
    'hidden': 'hidden',
    'jid-multi': 'textarea',
    'list-single': 'dropdown',
    'list-multi': 'dropdown'
};
const XFORM_VALIDATE_TYPE_MAP = {
    'xs:anyURI': 'url',
    'xs:byte': 'number',
    'xs:date': 'date',
    'xs:dateTime': 'datetime',
    'xs:int': 'number',
    'xs:integer': 'number',
    'xs:time': 'time'
};


/***/ }),

/***/ "./src/headless/shared/errors.js":
/*!***************************************!*\
  !*** ./src/headless/shared/errors.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BadRequestError: () => (/* binding */ BadRequestError),
/* harmony export */   ConflictError: () => (/* binding */ ConflictError),
/* harmony export */   FeatureNotImplementedError: () => (/* binding */ FeatureNotImplementedError),
/* harmony export */   ForbiddenError: () => (/* binding */ ForbiddenError),
/* harmony export */   GoneError: () => (/* binding */ GoneError),
/* harmony export */   InternalServerError: () => (/* binding */ InternalServerError),
/* harmony export */   ItemNotFoundError: () => (/* binding */ ItemNotFoundError),
/* harmony export */   JIDMalformedError: () => (/* binding */ JIDMalformedError),
/* harmony export */   MethodNotImplementedError: () => (/* binding */ MethodNotImplementedError),
/* harmony export */   NotAcceptableError: () => (/* binding */ NotAcceptableError),
/* harmony export */   NotAllowedError: () => (/* binding */ NotAllowedError),
/* harmony export */   NotAuthorizedError: () => (/* binding */ NotAuthorizedError),
/* harmony export */   PaymentRequiredError: () => (/* binding */ PaymentRequiredError),
/* harmony export */   RecipientUnavailableError: () => (/* binding */ RecipientUnavailableError),
/* harmony export */   RedirectError: () => (/* binding */ RedirectError),
/* harmony export */   RegistrationRequiredError: () => (/* binding */ RegistrationRequiredError),
/* harmony export */   RemoteServerNotFoundError: () => (/* binding */ RemoteServerNotFoundError),
/* harmony export */   RemoteServerTimeoutError: () => (/* binding */ RemoteServerTimeoutError),
/* harmony export */   ResourceConstraintError: () => (/* binding */ ResourceConstraintError),
/* harmony export */   ServiceUnavailableError: () => (/* binding */ ServiceUnavailableError),
/* harmony export */   StanzaError: () => (/* binding */ StanzaError),
/* harmony export */   StanzaParseError: () => (/* binding */ StanzaParseError),
/* harmony export */   SubscriptionRequiredError: () => (/* binding */ SubscriptionRequiredError),
/* harmony export */   TimeoutError: () => (/* binding */ TimeoutError),
/* harmony export */   UndefinedConditionError: () => (/* binding */ UndefinedConditionError),
/* harmony export */   UnexpectedRequestError: () => (/* binding */ UnexpectedRequestError)
/* harmony export */ });
class MethodNotImplementedError extends Error {
}
/**
 * Custom error for indicating timeouts
 * @namespace converse.env
 */ class TimeoutError extends Error {
    /**
     * @param  {string} message
     */ constructor(message){
        super(message);
        this.retry_event_id = null;
    }
}
class StanzaError extends Error {
    /**
     * @typedef {import("./types").ErrorName} ErrorName
     * @typedef {import("./types").ErrorType} ErrorType
     * @typedef {import("./types").ErrorExtra} ErrorExtra
     */ /**
     * @param {ErrorName|'unknown'} name
     * @param {Element} e - The <error> element from a stanza
     * @param {Object} extra - Extra properties from plugin parsers
     */ constructor(name, e, extra){
        var _e_querySelector;
        var _e_querySelector_textContent;
        super((_e_querySelector_textContent = (_e_querySelector = e.querySelector('text')) === null || _e_querySelector === void 0 ? void 0 : _e_querySelector.textContent) !== null && _e_querySelector_textContent !== void 0 ? _e_querySelector_textContent : '');
        /** @type {ErrorName} */ this.name = name;
        /** @type {string} */ this.message = name;
        /** @type {ErrorType} */ this.type = /** @type {ErrorType} */ e.getAttribute('type');
        /** @type {Element} */ this.el = e;
        /** @type {ErrorExtra} */ this.extra = extra;
    }
}
class StanzaParseError extends Error {
    /**
     * @param {Element} stanza
     * @param {string} [message]
     */ constructor(stanza, message){
        super(message);
        this.name = 'StanzaParseError';
        this.stanza = stanza;
    }
}
class BadRequestError extends StanzaError {
}
class ConflictError extends StanzaError {
}
class FeatureNotImplementedError extends StanzaError {
}
class ForbiddenError extends StanzaError {
}
class GoneError extends StanzaError {
}
class InternalServerError extends StanzaError {
}
class ItemNotFoundError extends StanzaError {
}
class JIDMalformedError extends StanzaError {
}
class NotAcceptableError extends StanzaError {
}
class NotAllowedError extends StanzaError {
}
class NotAuthorizedError extends StanzaError {
}
class PaymentRequiredError extends StanzaError {
}
class RecipientUnavailableError extends StanzaError {
}
class RedirectError extends StanzaError {
}
class RegistrationRequiredError extends StanzaError {
}
class RemoteServerNotFoundError extends StanzaError {
}
class RemoteServerTimeoutError extends StanzaError {
}
class ResourceConstraintError extends StanzaError {
}
class ServiceUnavailableError extends StanzaError {
}
class SubscriptionRequiredError extends StanzaError {
}
class UndefinedConditionError extends StanzaError {
}
class UnexpectedRequestError extends StanzaError {
}


/***/ }),

/***/ "./src/headless/shared/i18n.js":
/*!*************************************!*\
  !*** ./src/headless/shared/i18n.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var sprintf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sprintf-js */ "./node_modules/sprintf-js/src/sprintf.js");
/* harmony import */ var sprintf_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sprintf_js__WEBPACK_IMPORTED_MODULE_0__);
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

/**
 * @namespace i18n
 */ const i18nStub = {
    // eslint-disable-next-line @typescript-eslint/no-empty-function
    initialize () {
        return _async_to_generator(function*() {})();
    },
    /**
     * Overridable string wrapper method which can be used to provide i18n
     * support.
     *
     * The default implementation in @converse/headless simply calls sprintf
     * with the passed in arguments.
     *
     * If you install the full version of Converse, then this method gets
     * overwritten in src/i18n/index.js to return a translated string.
     * @method __
     * @private
     * @memberOf i18n
     */ __ (...args) {
        return (0,sprintf_js__WEBPACK_IMPORTED_MODULE_0__.sprintf)(...args);
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (i18nStub);


/***/ }),

/***/ "./src/headless/shared/index.js":
/*!**************************************!*\
  !*** ./src/headless/shared/index.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   _converse: () => (/* reexport safe */ _converse__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   api: () => (/* reexport safe */ _api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   constants: () => (/* reexport module object */ _constants_js__WEBPACK_IMPORTED_MODULE_1__),
/* harmony export */   errors: () => (/* reexport module object */ _errors_js__WEBPACK_IMPORTED_MODULE_2__),
/* harmony export */   i18n: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   parsers: () => (/* reexport module object */ _parsers_js__WEBPACK_IMPORTED_MODULE_0__)
/* harmony export */ });
/* harmony import */ var _parsers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parsers.js */ "./src/headless/shared/parsers.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _converse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_converse */ "./src/headless/shared/_converse.js");
/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./i18n */ "./src/headless/shared/i18n.js");









/***/ }),

/***/ "./src/headless/shared/message.js":
/*!****************************************!*\
  !*** ./src/headless/shared/message.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shared/api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _shared_color_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/color.js */ "./src/headless/shared/color.js");
/* harmony import */ var _shared_model_with_contact_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/model-with-contact.js */ "./src/headless/shared/model-with-contact.js");
/* harmony import */ var _shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../shared/model-with-vcard */ "./src/headless/shared/model-with-vcard.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/index.js */ "./src/headless/utils/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}












/**
 * @template {import('./types').ModelExtender} T
 * @param {T} BaseModel
 */ class BaseMessage extends (0,_shared_model_with_vcard__WEBPACK_IMPORTED_MODULE_10__["default"])((0,_shared_model_with_contact_js__WEBPACK_IMPORTED_MODULE_9__["default"])((0,_shared_color_js__WEBPACK_IMPORTED_MODULE_8__["default"])(_converse_skeletor__WEBPACK_IMPORTED_MODULE_3__.Model))) {
    defaults() {
        return {
            msgid: (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_11__.getUniqueId)(),
            time: new Date().toISOString(),
            is_ephemeral: false
        };
    }
    initialize() {
        var _this_collection;
        this.lazy_load_vcard = true;
        super.initialize();
        this.chatbox = (_this_collection = this.collection) === null || _this_collection === void 0 ? void 0 : _this_collection.chatbox;
        if (!this.checkValidity()) return;
        if (this.get('file')) {
            this.on('change:put', ()=>this.uploadFile());
        }
        this.on('change:is_ephemeral', ()=>this.setTimerForEphemeralMessage());
        this.setTimerForEphemeralMessage();
    }
    checkValidity() {
        if (Object.keys(this.attributes).length === 3) {
            // XXX: This is an empty message with only the 3 default values.
            // This seems to happen when saving a newly created message
            // fails for some reason.
            // TODO: This is likely fixable by setting `wait` when
            // creating messages. See the wait-for-messages branch.
            this.validationError = "Empty message";
            this.safeDestroy();
            return false;
        }
        return true;
    }
    safeDestroy() {
        try {
            this.destroy();
        } catch (e) {
            _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`safeDestroy: ${e}`);
        }
    }
    /**
     * Sets an auto-destruct timer for this message, if it's is_ephemeral.
     */ setTimerForEphemeralMessage() {
        if (this.ephemeral_timer) {
            clearTimeout(this.ephemeral_timer);
        }
        const is_ephemeral = this.isEphemeral();
        if (is_ephemeral) {
            const timeout = typeof is_ephemeral === "number" ? is_ephemeral : 10000;
            this.ephemeral_timer = setTimeout(()=>this.safeDestroy(), timeout);
        }
    }
    /**
     * Returns a boolean indicating whether this message is ephemeral,
     * meaning it will get automatically removed after ten seconds.
     * @returns {boolean}
     */ isEphemeral() {
        return this.get("is_ephemeral");
    }
    /**
     * Returns a boolean indicating whether this message is a XEP-0245 /me command.
     * @returns {boolean}
     */ isMeCommand() {
        const text = this.getMessageText();
        if (!text) {
            return false;
        }
        return text.startsWith("/me ");
    }
    /**
     * @returns {boolean}
     */ isRetracted() {
        return this.get("retracted") || this.get("moderated") === "retracted";
    }
    /**
     * Returns a boolean indicating whether this message is considered a followup
     * message from the previous one. Followup messages are shown grouped together
     * under one author heading.
     * A message is considered a followup of it's predecessor when it's a chat
     * message from the same author, within 10 minutes.
     * @returns {boolean}
     */ isFollowup() {
        var _this_collection;
        const messages = (_this_collection = this.collection) === null || _this_collection === void 0 ? void 0 : _this_collection.models;
        if (!messages) {
            // Happens during tests
            return false;
        }
        const idx = messages.indexOf(this);
        const prev_model = idx ? messages[idx - 1] : null;
        if (prev_model === null) {
            return false;
        }
        const date = dayjs__WEBPACK_IMPORTED_MODULE_0___default()(this.get("time"));
        return this.get("from") === prev_model.get("from") && !this.isRetracted() && !prev_model.isRetracted() && !this.isMeCommand() && !prev_model.isMeCommand() && !!this.get("is_encrypted") === !!prev_model.get("is_encrypted") && this.get("type") === prev_model.get("type") && this.get("type") !== "info" && date.isBefore(dayjs__WEBPACK_IMPORTED_MODULE_0___default()(prev_model.get("time")).add(10, "minutes")) && (this.get("type") === "groupchat" ? this.get("occupant_id") === prev_model.get("occupant_id") : true);
    }
    /**
     * Determines whether this messsage may be retracted by the current user.
     * @returns { Boolean }
     */ mayBeRetracted() {
        const is_own_message = this.get("sender") === "me";
        const not_canceled = this.get("error_type") !== "cancel";
        return is_own_message && not_canceled && [
            "all",
            "own"
        ].includes(_shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].settings.get("allow_message_retraction"));
    }
    getMessageText() {
        if (this.get("is_encrypted")) {
            const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
            return this.get("plaintext") || this.get("body") || __("Undecryptable OMEMO message");
        } else if ([
            "groupchat",
            "chat",
            "normal"
        ].includes(this.get("type"))) {
            return this.get("body");
        } else {
            return this.get("message");
        }
    }
    /**
     * Send out an IQ stanza to request a file upload slot.
     * https://xmpp.org/extensions/xep-0363.html#request
     */ sendSlotRequestStanza() {
        if (!this.file) return Promise.reject(new Error("file is undefined"));
        const iq = (0,strophe_js__WEBPACK_IMPORTED_MODULE_2__.$iq)({
            "from": _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"].session.get("jid"),
            "to": this.get("slot_request_url"),
            "type": "get"
        }).c("request", {
            "xmlns": strophe_js__WEBPACK_IMPORTED_MODULE_2__.Strophe.NS.HTTPUPLOAD,
            "filename": this.file.name,
            "size": this.file.size,
            "content-type": this.file.type
        });
        return _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].sendIQ(iq);
    }
    /**
     * @param {Element} stanza
     */ getUploadRequestMetadata(stanza) {
        const headers = sizzle__WEBPACK_IMPORTED_MODULE_1___default()(`slot[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_2__.Strophe.NS.HTTPUPLOAD}"] put header`, stanza);
        // https://xmpp.org/extensions/xep-0363.html#request
        // TODO: Can't set the Cookie header in JavaScipt, instead cookies need
        // to be manually set via document.cookie, so we're leaving it out here.
        return {
            headers: headers.map((h)=>({
                    "name": h.getAttribute("name"),
                    "value": h.textContent
                })).filter((h)=>[
                    "Authorization",
                    "Expires"
                ].includes(h.name))
        };
    }
    getRequestSlotURL() {
        return _async_to_generator(function*() {
            const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
            let stanza;
            try {
                stanza = yield this.sendSlotRequestStanza();
            } catch (e) {
                _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(e);
                return this.save({
                    is_ephemeral: true,
                    message: __("Sorry, could not determine upload URL."),
                    type: "error"
                });
            }
            const slot = sizzle__WEBPACK_IMPORTED_MODULE_1___default()(`slot[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_2__.Strophe.NS.HTTPUPLOAD}"]`, stanza).pop();
            if (slot) {
                this.upload_metadata = this.getUploadRequestMetadata(stanza);
                this.save({
                    get: slot.querySelector("get").getAttribute("url"),
                    put: slot.querySelector("put").getAttribute("url")
                });
            } else {
                return this.save({
                    is_ephemeral: true,
                    message: __("Sorry, could not determine file upload URL."),
                    type: "error"
                });
            }
        }).call(this);
    }
    uploadFile() {
        var _this_upload_metadata_headers;
        const xhr = new XMLHttpRequest();
        xhr.onreadystatechange = (event)=>_async_to_generator(function*() {
                if (xhr.readyState === XMLHttpRequest.DONE) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].info("Status: " + xhr.status);
                    if (xhr.status === 200 || xhr.status === 201) {
                        let attrs = {
                            body: this.get("get"),
                            message: this.get("get"),
                            oob_url: this.get("get"),
                            upload: _shared_constants_js__WEBPACK_IMPORTED_MODULE_7__.SUCCESS
                        };
                        /**
                     * *Hook* which allows plugins to change the attributes
                     * saved on the message once a file has been uploaded.
                     * @event _converse#afterFileUploaded
                     */ attrs = yield _shared_api_index_js__WEBPACK_IMPORTED_MODULE_6__["default"].hook("afterFileUploaded", this, attrs);
                        this.save(attrs);
                    } else {
                        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(event);
                        xhr.onerror(new ProgressEvent(`Response status: ${xhr.status}`));
                    }
                }
            }).call(this);
        xhr.upload.addEventListener("progress", (evt)=>{
            if (evt.lengthComputable) {
                this.set("progress", evt.loaded / evt.total);
            }
        }, false);
        xhr.onerror = ()=>{
            const { __ } = _shared_converse_js__WEBPACK_IMPORTED_MODULE_5__["default"];
            let message;
            if (xhr.responseText) {
                message = __('Sorry, could not succesfully upload your file. Your server’s response: "%1$s"', xhr.responseText);
            } else {
                message = __("Sorry, could not succesfully upload your file.");
            }
            this.save({
                is_ephemeral: true,
                message,
                type: "error",
                upload: _shared_constants_js__WEBPACK_IMPORTED_MODULE_7__.FAILURE
            });
        };
        xhr.open("PUT", this.get("put"), true);
        xhr.setRequestHeader("Content-type", this.file.type);
        (_this_upload_metadata_headers = this.upload_metadata.headers) === null || _this_upload_metadata_headers === void 0 ? void 0 : _this_upload_metadata_headers.forEach((h)=>xhr.setRequestHeader(h.name, h.value));
        xhr.send(this.file);
    }
    /**
     * @param {Model[]} [models]
     * @param {object} [options]
     */ constructor(models, options){
        super(models, options);
        this.file = null;
        /** @type {import('./types').MessageAttributes} */ this.attributes;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseMessage);


/***/ }),

/***/ "./src/headless/shared/model-with-contact.js":
/*!***************************************************!*\
  !*** ./src/headless/shared/model-with-contact.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ModelWithContact)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./api/index.js */ "./src/headless/shared/api/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




/**
 * @template {import('./types').ModelExtender} T
 * @param {T} BaseModel
 */ function ModelWithContact(BaseModel) {
    return class ModelWithContact extends BaseModel {
        /**
         * @typedef {import('../plugins/roster/contact').default} RosterContact
         * @typedef {import('./_converse.js').Profile} Profile
         */ initialize() {
            super.initialize();
            this.rosterContactAdded = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
            this.onClosedChanged = ()=>this.setModelContact(this.get('jid'));
            /**
             * @public
             * @type {RosterContact|Profile}
             */ this.contact = null;
        }
        /**
         * @param {string} jid
         */ setModelContact(jid) {
            return _async_to_generator(function*() {
                var _this_contact;
                if (((_this_contact = this.contact) === null || _this_contact === void 0 ? void 0 : _this_contact.get('jid')) === jid) return;
                if (this.get('closed')) {
                    this.off('change:closed', this.onClosedChanged);
                    this.on('change:closed', this.onClosedChanged);
                    return;
                }
                const { session, state } = _converse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
                let contact;
                if (strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.getBareJidFromJid(jid) === session.get('bare_jid')) {
                    contact = state.profile;
                } else {
                    contact = yield _api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].contacts.get(jid);
                    if (!contact && !(yield _api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].blocklist.get()).get(jid)) {
                        contact = yield _api_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].contacts.add({
                            jid
                        }, false, false);
                    }
                }
                if (contact) {
                    this.contact = contact;
                    this.set('nickname', contact.get('nickname'));
                    this.listenTo(this.contact, 'vcard:add', (changed)=>{
                        this.trigger('contact:change', changed);
                    });
                    this.listenTo(this.contact, 'vcard:change', (changed)=>{
                        this.trigger('contact:change', changed);
                    });
                    this.listenTo(this.contact, 'change', (changed)=>{
                        if (changed.nickname) {
                            this.set('nickname', changed.nickname);
                        }
                        this.trigger('contact:change', changed);
                    });
                    this.listenTo(this.contact, 'destroy', ()=>{
                        delete this.contact;
                        this.trigger('contact:destroy');
                    });
                    this.rosterContactAdded.resolve();
                    this.trigger('contact:add', this.contact);
                }
            }).call(this);
        }
    };
}


/***/ }),

/***/ "./src/headless/shared/model-with-messages.js":
/*!****************************************************!*\
  !*** ./src/headless/shared/model-with-messages.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ModelWithMessages)
/* harmony export */ });
/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! filesize */ "./node_modules/filesize/dist/filesize.esm.js");
/* harmony import */ var lodash_es_pick__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es/pick */ "./node_modules/lodash-es/pick.js");
/* harmony import */ var lodash_es_debounce_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! lodash-es/debounce.js */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _api_public_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./api/public.js */ "./src/headless/shared/api/public.js");
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var _plugins_chat_utils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../plugins/chat/utils.js */ "./src/headless/plugins/chat/utils.js");
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./errors.js */ "./src/headless/shared/errors.js");
/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./actions.js */ "./src/headless/shared/actions.js");
/* harmony import */ var _plugins_chat_parsers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../plugins/chat/parsers */ "./src/headless/plugins/chat/parsers.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}















const { Strophe, stx, u } = _api_public_js__WEBPACK_IMPORTED_MODULE_6__["default"].env;
/**
 * Adds a messages collection to a model and various methods related to sending
 * and receiving chat messages.
 *
 * This model should be UX-agnostic, except when it comes to the rendering of
 * messages. So there's no assumption of uniformity with regards to UI elements
 * represented by this object.
 *
 * @template {import('./types').ModelExtender} T
 * @param {T} BaseModel
 */ function ModelWithMessages(BaseModel) {
    /**
     * @typedef {import('../plugins/chat/model').default} ChatBox
     * @typedef {import('../plugins/muc/muc').default} MUC
     * @typedef {import('../plugins/muc/parsers').MUCMessageAttributes} MUCMessageAttributes
     * @typedef {import('../shared/types').MessageAttributes} MessageAttributes
     * @typedef {import('./message').default} BaseMessage
     * @typedef {import('strophe.js').Builder} Builder
     */ return class ModelWithMessages extends BaseModel {
        initialize() {
            var _this = this, _superprop_get_initialize = ()=>super.initialize;
            return _async_to_generator(function*() {
                _superprop_get_initialize().call(_this);
                this.initUI();
                this.initMessages();
                this.initNotifications();
                this.ui.on('change:scrolled', ()=>this.onScrolledChanged());
            }).call(this);
        }
        initNotifications() {
            this.notifications = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model();
        }
        initUI() {
            this.ui = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model();
        }
        /**
         * @returns {string}
         */ getDisplayName() {
            return this.get('jid');
        }
        canPostMessages() {
            // Can be overridden in subclasses.
            return true;
        }
        /**
         * Queue the creation of a message, to make sure that we don't run
         * into a race condition whereby we're creating a new message
         * before the collection has been fetched.
         * @param {Object} attrs
         * @param {Object} options
         */ createMessage(attrs, options) {
            return _async_to_generator(function*() {
                attrs.time = attrs.time || new Date().toISOString();
                yield this.messages.fetched;
                return this.messages.create(attrs, options);
            }).call(this);
        }
        getMessagesCacheKey() {
            return `converse.messages-${this.get('jid')}-${_converse_js__WEBPACK_IMPORTED_MODULE_9__["default"].session.get('bare_jid')}`;
        }
        getMessagesCollection() {
            return new _converse_js__WEBPACK_IMPORTED_MODULE_9__["default"].exports.Messages();
        }
        getNotificationsText() {
            var _this_notifications, _this_notifications1, _this_notifications2;
            const { __ } = _converse_js__WEBPACK_IMPORTED_MODULE_9__["default"];
            if (((_this_notifications = this.notifications) === null || _this_notifications === void 0 ? void 0 : _this_notifications.get('chat_state')) === _constants_js__WEBPACK_IMPORTED_MODULE_5__.COMPOSING) {
                return __('%1$s is typing', this.getDisplayName());
            } else if (((_this_notifications1 = this.notifications) === null || _this_notifications1 === void 0 ? void 0 : _this_notifications1.get('chat_state')) === _constants_js__WEBPACK_IMPORTED_MODULE_5__.PAUSED) {
                return __('%1$s has stopped typing', this.getDisplayName());
            } else if (((_this_notifications2 = this.notifications) === null || _this_notifications2 === void 0 ? void 0 : _this_notifications2.get('chat_state')) === _constants_js__WEBPACK_IMPORTED_MODULE_5__.GONE) {
                return __('%1$s has gone away', this.getDisplayName());
            } else {
                return '';
            }
        }
        initMessages() {
            this.messages = this.getMessagesCollection();
            this.messages.fetched = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
            this.messages.chatbox = this;
            (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_4__.initStorage)(this.messages, this.getMessagesCacheKey());
            this.listenTo(this.messages, 'add', (m)=>this.onMessageAdded(m));
            this.listenTo(this.messages, 'change:upload', (m)=>this.onMessageUploadChanged(m));
            this.listenTo(this.messages, 'change:correcting', (m)=>this.onMessageCorrecting(m));
        }
        fetchMessages() {
            if (this.messages.fetched_flag) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].info(`Not re-fetching messages for ${this.get('jid')}`);
                return;
            }
            this.messages.fetched_flag = true;
            const resolve = this.messages.fetched.resolve;
            this.messages.fetch({
                add: true,
                success: ()=>{
                    this.afterMessagesFetched();
                    resolve();
                },
                error: ()=>{
                    this.afterMessagesFetched();
                    resolve();
                }
            });
            return this.messages.fetched;
        }
        afterMessagesFetched() {
            this.pruneHistoryWhenScrolledDown();
            /**
             * Triggered whenever a {@link ModelWithMessages}
             * has fetched its messages from the local cache.
             * @event _converse#afterMessagesFetched
             * @type {ModelWithMessages}
             * @example _converse.api.listen.on('afterMessagesFetched', (model) => { ... });
             */ _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].trigger('afterMessagesFetched', this);
        }
        /**
         * @param {MessageAttributes|Error} _attrs_or_error
         */ onMessage(_attrs_or_error) {
            return _async_to_generator(function*() {
                throw new _errors_js__WEBPACK_IMPORTED_MODULE_10__.MethodNotImplementedError('onMessage is not implemented');
            })();
        }
        /**
         * @param {BaseMessage} message
         * @param {MessageAttributes} attrs
         * @returns {object}
         */ getUpdatedMessageAttributes(message, attrs) {
            if (!attrs.error_type && message.get('error_type') === 'Decryption') {
                // Looks like we have a failed decrypted message stored, and now
                // we have a properly decrypted version of the same message.
                // See issue: https://github.com/conversejs/converse.js/issues/2733#issuecomment-1035493594
                return Object.assign({}, attrs, {
                    error_condition: undefined,
                    error_message: undefined,
                    error_text: undefined,
                    error_type: undefined,
                    is_archived: attrs.is_archived,
                    is_ephemeral: false,
                    is_error: false
                });
            } else {
                return {
                    is_archived: attrs.is_archived,
                    time: attrs.time ? attrs.time : message.get('time')
                };
            }
        }
        /**
         * @param {BaseMessage} message
         * @param {MessageAttributes} attrs
         */ updateMessage(message, attrs) {
            const new_attrs = this.getUpdatedMessageAttributes(message, attrs);
            new_attrs && message.save(new_attrs);
        }
        /**
         * Determines whether the given attributes of an incoming message
         * represent a XEP-0308 correction and, if so, handles it appropriately.
         * @param {MessageAttributes|MUCMessageAttributes} attrs - Attributes representing a received
         *  message, as returned by {@link parseMessage}
         * @returns {Promise<BaseMessage|void>} Returns the corrected
         *  message or `undefined` if not applicable.
         */ handleCorrection(attrs) {
            return _async_to_generator(function*() {
                if (!attrs.replace_id || !attrs.from) {
                    return;
                }
                let query;
                if (attrs.type === 'groupchat') {
                    const { occupant_id, replace_id } = /** @type {MUCMessageAttributes} */ attrs;
                    query = occupant_id ? ({ attributes: m })=>m.msgid === replace_id && m.occupant_id == occupant_id : ({ attributes: m })=>m.msgid === attrs.replace_id && m.from === attrs.from && m.occupant_id == null;
                } else {
                    query = ({ attributes: m })=>m.msgid === attrs.replace_id && m.from === attrs.from && m.occupant_id == null;
                }
                const message = this.messages.models.find(query);
                if (!message) {
                    attrs['older_versions'] = {};
                    return yield this.createMessage(attrs); // eslint-disable-line no-return-await
                }
                const older_versions = message.get('older_versions') || {};
                if (attrs.time < message.get('time') && message.get('edited')) {
                    // This is an older message which has been corrected afterwards
                    older_versions[attrs.time] = attrs['message'];
                    message.save({
                        'older_versions': older_versions
                    });
                } else {
                    // This is a correction of an earlier message we already received
                    if (Object.keys(older_versions).length) {
                        older_versions[message.get('edited')] = message.getMessageText();
                    } else {
                        older_versions[message.get('time')] = message.getMessageText();
                    }
                    attrs = Object.assign(attrs, {
                        older_versions
                    });
                    delete attrs['msgid']; // We want to keep the msgid of the original message
                    delete attrs['id']; // Delete id, otherwise a new cache entry gets created
                    attrs['time'] = message.get('time');
                    message.save(attrs);
                }
                return message;
            }).call(this);
        }
        /**
         * Queue an incoming `chat` message stanza for processing.
         * @param {MessageAttributes} attrs - A promise which resolves to the message attributes
         */ queueMessage(attrs) {
            this.msg_chain = (this.msg_chain || this.messages.fetched).then(()=>this.onMessage(attrs)).catch((e)=>_converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e));
            return this.msg_chain;
        }
        /**
         * @param {MessageAttributes} [_attrs]
         * @return {Promise<MessageAttributes>}
         */ getOutgoingMessageAttributes(_attrs) {
            return _async_to_generator(function*() {
                throw new _errors_js__WEBPACK_IMPORTED_MODULE_10__.MethodNotImplementedError('getOutgoingMessageAttributes is not implemented');
            })();
        }
        /**
         * Responsible for sending off a text message inside an ongoing chat conversation.
         * @param {Object} [attrs] - A map of attributes to be saved on the message
         * @returns {Promise<BaseMessage>}
         * @example
         *  const chat = api.chats.get('buddy1@example.org');
         *  chat.sendMessage({'body': 'hello world'});
         */ sendMessage(attrs) {
            return _async_to_generator(function*() {
                var _converse_emojis;
                yield (_converse_emojis = _api_public_js__WEBPACK_IMPORTED_MODULE_6__["default"].emojis) === null || _converse_emojis === void 0 ? void 0 : _converse_emojis.initialized_promise;
                if (!this.canPostMessages()) {
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].warn('sendMessage was called but canPostMessages is false');
                    return;
                }
                attrs = yield this.getOutgoingMessageAttributes(attrs);
                let message = this.messages.findWhere('correcting');
                if (message) {
                    const older_versions = message.get('older_versions') || {};
                    const edited_time = message.get('edited') || message.get('time');
                    older_versions[edited_time] = message.getMessageText();
                    message.save(_object_spread({}, [
                        'body',
                        'is_only_emojis',
                        'media_urls',
                        'references',
                        'is_encrypted'
                    ].reduce((obj, k)=>{
                        if (attrs.hasOwnProperty(k)) obj[k] = attrs[k];
                        return obj;
                    }, {}), {
                        correcting: false,
                        edited: new Date().toISOString(),
                        message: attrs.body,
                        ogp_metadata: [],
                        older_versions,
                        origin_id: u.getUniqueId(),
                        plaintext: attrs.is_encrypted ? attrs.message : undefined,
                        received: undefined
                    }));
                } else {
                    this.setEditable(attrs, new Date().toISOString());
                    message = yield this.createMessage(attrs);
                }
                try {
                    const stanza = yield this.createMessageStanza(message);
                    _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].send(stanza);
                } catch (e) {
                    message.destroy();
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                    return;
                }
                /**
             * Triggered when a message is being sent out
             * @event _converse#sendMessage
             * @type {Object}
             * @param {Object} data
             * @property {(ChatBox|MUC)} data.chatbox
             * @property {(BaseMessage)} data.message
             */ _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].trigger('sendMessage', {
                    'chatbox': this,
                    message
                });
                return message;
            }).call(this);
        }
        /**
         * Retract one of your messages in this chat
         * @param {BaseMessage} message - The message which we're retracting.
         */ retractOwnMessage(message) {
            const retraction_id = u.getUniqueId();
            (0,_actions_js__WEBPACK_IMPORTED_MODULE_11__.sendRetractionMessage)(this.get('jid'), message, retraction_id);
            message.save({
                'retracted': new Date().toISOString(),
                'retracted_id': message.get('origin_id'),
                'retraction_id': retraction_id,
                'is_ephemeral': true,
                'editable': false
            });
        }
        /**
         * @param {File[]} files'
         */ sendFiles(files) {
            return _async_to_generator(function*() {
                var _maxfilesize;
                const { __, session } = _converse_js__WEBPACK_IMPORTED_MODULE_9__["default"];
                const result = yield _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].disco.features.get(Strophe.NS.HTTPUPLOAD, session.get('domain'));
                const item = result.pop();
                if (!item) {
                    this.createMessage({
                        'message': __('Sorry, looks like file upload is not supported by your server.'),
                        'type': 'error',
                        'is_ephemeral': true
                    });
                    return;
                }
                const data = item.dataforms.where({
                    'FORM_TYPE': {
                        'value': Strophe.NS.HTTPUPLOAD,
                        'type': 'hidden'
                    }
                }).pop();
                const max_file_size = parseInt((_maxfilesize = ((data === null || data === void 0 ? void 0 : data.attributes) || {})['max-file-size']) === null || _maxfilesize === void 0 ? void 0 : _maxfilesize.value, 10);
                const slot_request_url = item === null || item === void 0 ? void 0 : item.id;
                if (!slot_request_url) {
                    this.createMessage({
                        'message': __('Sorry, looks like file upload is not supported by your server.'),
                        'type': 'error',
                        'is_ephemeral': true
                    });
                    return;
                }
                Array.from(files).forEach((file)=>_async_to_generator(function*() {
                        /**
                 * *Hook* which allows plugins to transform files before they'll be
                 * uploaded. The main use-case is to encrypt the files.
                 * @event _converse#beforeFileUpload
                 * @param {ChatBox|MUC} chat - The chat from which this file will be uploaded.
                 * @param {File} file - The file that will be uploaded
                 */ file = yield _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].hook('beforeFileUpload', this, file);
                        if (!isNaN(max_file_size) && file.size > max_file_size) {
                            const size = (0,filesize__WEBPACK_IMPORTED_MODULE_0__.filesize)(max_file_size);
                            const message = Array.isArray(size) ? __('The size of your file, %1$s, exceeds the maximum allowed by your server.', file.name) : __('The size of your file, %1$s, exceeds the maximum allowed by your server, which is %2$s.', file.name, size);
                            return this.createMessage({
                                message,
                                type: 'error',
                                is_ephemeral: true
                            });
                        } else {
                            const initial_attrs = yield this.getOutgoingMessageAttributes();
                            const attrs = Object.assign(initial_attrs, {
                                'file': true,
                                'progress': 0,
                                'slot_request_url': slot_request_url
                            });
                            this.setEditable(attrs, new Date().toISOString());
                            const message = yield this.createMessage(attrs, {
                                'silent': true
                            });
                            message.file = file;
                            this.messages.trigger('add', message);
                            message.getRequestSlotURL();
                        }
                    }).call(this));
            }).call(this);
        }
        /**
         * Responsible for setting the editable attribute of messages.
         * If api.settings.get('allow_message_corrections') is "last", then only the last
         * message sent from me will be editable. If set to "all" all messages
         * will be editable. Otherwise no messages will be editable.
         * @param {Object} attrs An object containing message attributes.
         * @param {String} send_time - time when the message was sent
         */ setEditable(attrs, send_time) {
            if (attrs.is_headline || u.isEmptyMessage(attrs) || attrs.sender !== 'me') {
                return;
            }
            if (_api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('allow_message_corrections') === 'all') {
                attrs.editable = !(attrs.file || attrs.retracted || 'oob_url' in attrs);
            } else if (_api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('allow_message_corrections') === 'last' && send_time > this.get('time_sent')) {
                var _this_messages_findWhere;
                this.set({
                    'time_sent': send_time
                });
                (_this_messages_findWhere = this.messages.findWhere({
                    'editable': true
                })) === null || _this_messages_findWhere === void 0 ? void 0 : _this_messages_findWhere.save({
                    'editable': false
                });
                attrs.editable = !(attrs.file || attrs.retracted || 'oob_url' in attrs);
            }
        }
        /**
         * Mutator for setting the chat state of this chat session.
         * Handles clearing of any chat state notification timeouts and
         * setting new ones if necessary.
         * Timeouts are set when the  state being set is COMPOSING or PAUSED.
         * After the timeout, COMPOSING will become PAUSED and PAUSED will become INACTIVE.
         * See XEP-0085 Chat State Notifications.
         * @param {string} state - The chat state (consts ACTIVE, COMPOSING, PAUSED, INACTIVE, GONE)
         * @param {object} [options]
         */ setChatState(state, options) {
            if (this.chat_state_timeout !== undefined) {
                clearTimeout(this.chat_state_timeout);
                delete this.chat_state_timeout;
            }
            if (state === _constants_js__WEBPACK_IMPORTED_MODULE_5__.COMPOSING) {
                this.chat_state_timeout = setTimeout(this.setChatState.bind(this), _converse_js__WEBPACK_IMPORTED_MODULE_9__["default"].TIMEOUTS.PAUSED, _constants_js__WEBPACK_IMPORTED_MODULE_5__.PAUSED);
            } else if (state === _constants_js__WEBPACK_IMPORTED_MODULE_5__.PAUSED) {
                this.chat_state_timeout = setTimeout(this.setChatState.bind(this), _converse_js__WEBPACK_IMPORTED_MODULE_9__["default"].TIMEOUTS.INACTIVE, _constants_js__WEBPACK_IMPORTED_MODULE_5__.INACTIVE);
            }
            this.set('chat_state', state, options);
            return this;
        }
        /**
         * @param {BaseMessage} message
         */ onMessageAdded(message) {
            if (_api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('prune_messages_above') && (_api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('pruning_behavior') === 'scrolled' || !this.ui.get('scrolled')) && !u.isEmptyMessage(message)) {
                this.debouncedPruneHistory();
            }
        }
        /**
         * @param {BaseMessage} message
         */ onMessageUploadChanged(message) {
            return _async_to_generator(function*() {
                if (message.get('upload') === _constants_js__WEBPACK_IMPORTED_MODULE_5__.SUCCESS) {
                    const attrs = {
                        'body': message.get('body'),
                        'spoiler_hint': message.get('spoiler_hint'),
                        'oob_url': message.get('oob_url')
                    };
                    yield this.sendMessage(attrs);
                    message.destroy();
                }
            }).call(this);
        }
        /**
         * @param {BaseMessage} message
         */ onMessageCorrecting(message) {
            if (message.get('correcting')) {
                this.save({
                    correcting: message.get('id'),
                    draft: u.prefixMentions(message)
                });
            } else {
                this.save({
                    correcting: undefined,
                    draft: undefined
                });
            }
        }
        onScrolledChanged() {
            if (!this.ui.get('scrolled')) {
                this.clearUnreadMsgCounter();
                this.pruneHistoryWhenScrolledDown();
            }
        }
        pruneHistoryWhenScrolledDown() {
            if (_api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('prune_messages_above') && _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('pruning_behavior') === 'unscrolled' && !this.ui.get('scrolled')) {
                this.debouncedPruneHistory();
            }
        }
        /**
         * @param {MessageAttributes} attrs
         * @returns {Promise<boolean>}
         */ shouldShowErrorMessage(attrs) {
            const msg = this.getMessageReferencedByError(attrs);
            if (!msg && attrs.chat_state) {
                // If the error refers to a message not included in our store,
                // and it has a chat state tag, we assume that this was a
                // CSI message (which we don't store).
                // See https://github.com/conversejs/converse.js/issues/1317
                return;
            }
            // Gets overridden
            // Return promise because subclasses need to return promises
            return Promise.resolve(true);
        }
        clearMessages() {
            return _async_to_generator(function*() {
                try {
                    yield this.messages.clearStore();
                } catch (e) {
                    this.messages.trigger('reset');
                    _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
                } finally{
                    // No point in fetching messages from the cache if it's been cleared.
                    // Make sure to resolve the fetched promise to avoid freezes.
                    this.messages.fetched.resolve();
                }
            }).call(this);
        }
        editEarlierMessage() {
            let message;
            let idx = this.messages.findLastIndex('correcting');
            if (idx >= 0) {
                this.messages.at(idx).save('correcting', false);
                while(idx > 0){
                    idx -= 1;
                    const candidate = this.messages.at(idx);
                    if (candidate.get('editable')) {
                        message = candidate;
                        break;
                    }
                }
            }
            message = message || this.messages.filter({
                sender: 'me'
            }).reverse().find((m)=>m.get('editable'));
            message === null || message === void 0 ? void 0 : message.save('correcting', true);
        }
        editLaterMessage() {
            let message;
            let idx = this.messages.findLastIndex('correcting');
            if (idx >= 0) {
                this.messages.at(idx).save('correcting', false);
                while(idx < this.messages.length - 1){
                    idx += 1;
                    const candidate = this.messages.at(idx);
                    if (candidate.get('editable')) {
                        message = candidate;
                        message.save('correcting', true);
                        break;
                    }
                }
            }
            return message;
        }
        /**
         * Used by sub-classes to indicate wether a message is a chat
         * message, as opposed to error or info messages.
         * @param {BaseMessage} _message
         * @returns {boolean}
         */ isChatMessage(_message) {
            throw new _errors_js__WEBPACK_IMPORTED_MODULE_10__.MethodNotImplementedError();
        }
        /** @returns {BaseMessage} */ getOldestMessage() {
            for(let i = 0; i < this.messages.length; i++){
                const message = this.messages.at(i);
                if (this.isChatMessage(message)) {
                    return message;
                }
            }
        }
        /** @returns {BaseMessage} */ getMostRecentMessage() {
            for(let i = this.messages.length - 1; i >= 0; i--){
                const message = this.messages.at(i);
                if (this.isChatMessage(message)) {
                    return message;
                }
            }
        }
        /**
         * Given an error `<message>` stanza's attributes, find the saved message model which is
         * referenced by that error.
         * @param {object} attrs
         */ getMessageReferencedByError(attrs) {
            const id = attrs.msgid;
            return id && this.messages.models.find((m)=>[
                    m.get('msgid'),
                    m.get('retraction_id')
                ].includes(id));
        }
        /**
         * Looks whether we already have a retraction for this
         * incoming message. If so, it's considered "dangling" because it
         * probably hasn't been applied to anything yet, given that the
         * relevant message is only coming in now.
         * @param {object} attrs - Attributes representing a received
         *  message, as returned by {@link parseMessage}
         * @returns {BaseMessage|null}
         */ findDanglingRetraction(attrs) {
            if (!attrs.origin_id || !this.messages.length) {
                return null;
            }
            // Only look for dangling retractions if there are newer
            // messages than this one, since retractions come after.
            if (this.messages.last().get('time') > attrs.time) {
                // Search from latest backwards
                const messages = Array.from(this.messages.models);
                messages.reverse();
                return messages.find(({ attributes })=>attributes.retracted_id === attrs.origin_id && attributes.from === attrs.from && !attributes.moderated_by);
            }
            return null;
        }
        /**
         * Returns an already cached message (if it exists) based on the
         * passed in attributes map.
         * @param {object} attrs - Attributes representing a received
         *  message, as returned by {@link parseMessage}
         * @returns {BaseMessage}
         */ getDuplicateMessage(attrs) {
            const queries = [
                ...this.getStanzaIdQueryAttrs(attrs),
                this.getOriginIdQueryAttrs(attrs),
                this.getMessageBodyQueryAttrs(attrs)
            ].filter((s)=>s);
            return this.messages.models.find(/** @param {BaseMessage} m */ (m)=>queries.find((q)=>Object.keys(q).every((k)=>m.get(k) === q[k])));
        }
        /**
         * @param {object} attrs - Attributes representing a received
         */ getOriginIdQueryAttrs(attrs) {
            return attrs.origin_id && {
                origin_id: attrs.origin_id,
                from: attrs.from
            };
        }
        /**
         * @param {object} attrs - Attributes representing a received
         */ getStanzaIdQueryAttrs(attrs) {
            const keys = Object.keys(attrs).filter((k)=>k.startsWith('stanza_id '));
            return keys.map((key)=>{
                const by_jid = key.replace(/^stanza_id /, '');
                const query = {};
                query[`stanza_id ${by_jid}`] = attrs[key];
                return query;
            });
        }
        /**
         * @param {object} attrs - Attributes representing a received
         */ getMessageBodyQueryAttrs(attrs) {
            if (attrs.msgid) {
                const query = {
                    from: attrs.from,
                    msgid: attrs.msgid
                };
                // XXX: Need to take XEP-428 <fallback> into consideration
                if (!attrs.is_encrypted && attrs.body) {
                    // We can't match the message if it's a reflected
                    // encrypted message (e.g. via MAM or in a MUC)
                    query['body'] = attrs.body;
                }
                return query;
            }
        }
        /**
         * Given the passed in message object, send a XEP-0333 chat marker.
         * @param {BaseMessage} msg
         * @param {('received'|'displayed'|'acknowledged')} [type='displayed']
         * @param {boolean} [force=false] - Whether a marker should be sent for the
         *  message, even if it didn't include a `markable` element.
         */ sendMarkerForMessage(msg, type = 'displayed', force = false) {
            return _async_to_generator(function*() {
                if (!msg || (msg === null || msg === void 0 ? void 0 : msg.get('type')) === 'groupchat' || !_api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('send_chat_markers').includes(type)) {
                    return;
                }
                // Don't send chat markers to contacts that are not subscribed
                // to our presence.
                const contact = yield _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].contacts.get(this.get('jid'));
                const subscription = contact === null || contact === void 0 ? void 0 : contact.get('subscription');
                if (!contact || subscription === 'none' || subscription === 'to') {
                    return;
                }
                if ((msg === null || msg === void 0 ? void 0 : msg.get('is_markable')) || force) {
                    const from_jid = Strophe.getBareJidFromJid(msg.get('from'));
                    (0,_actions_js__WEBPACK_IMPORTED_MODULE_11__.sendMarker)(from_jid, msg.get('msgid'), type, msg.get('type'));
                }
            }).call(this);
        }
        /**
         * Given a newly received {@link BaseMessage} instance,
         * update the unread counter if necessary.
         * @param {BaseMessage} message
         */ handleUnreadMessage(message) {
            if (!(message === null || message === void 0 ? void 0 : message.get('body'))) {
                return;
            }
            if ((0,_plugins_chat_utils_js__WEBPACK_IMPORTED_MODULE_8__.isNewMessage)(message)) {
                if (message.get('sender') === 'me') {
                    // We remove the "scrolled" flag so that the chat area
                    // gets scrolled down. We always want to scroll down
                    // when the user writes a message as opposed to when a
                    // message is received.
                    this.ui.set('scrolled', false);
                } else if (this.isHidden()) {
                    this.incrementUnreadMsgsCounter(message);
                } else {
                    this.sendMarkerForMessage(message);
                }
            }
        }
        /**
         * @param {BaseMessage} message
         * @param {MessageAttributes} attrs
         */ getErrorAttributesForMessage(message, attrs) {
            return _async_to_generator(function*() {
                const { __ } = _converse_js__WEBPACK_IMPORTED_MODULE_9__["default"];
                const new_attrs = {
                    editable: false,
                    error: attrs.error,
                    error_condition: attrs.error_condition,
                    error_text: attrs.error_text,
                    error_type: attrs.error_type,
                    is_error: true
                };
                if (attrs.msgid === message.get('retraction_id')) {
                    // The error message refers to a retraction
                    new_attrs.retraction_id = undefined;
                    if (!attrs.error) {
                        if (attrs.error_condition === 'forbidden') {
                            new_attrs.error = __("You're not allowed to retract your message.");
                        } else {
                            new_attrs.error = __('Sorry, an error occurred while trying to retract your message.');
                        }
                    }
                } else if (!attrs.error) {
                    if (attrs.error_condition === 'forbidden') {
                        new_attrs.error = __("You're not allowed to send a message.");
                    } else {
                        new_attrs.error = __('Sorry, an error occurred while trying to send your message.');
                    }
                }
                /**
             * *Hook* which allows plugins to add application-specific attributes
             * @event _converse#getErrorAttributesForMessage
             */ return yield _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].hook('getErrorAttributesForMessage', attrs, new_attrs);
            })();
        }
        /**
         * @param {Element} stanza
         */ handleErrorMessageStanza(stanza) {
            return _async_to_generator(function*() {
                const attrs_or_error = yield (0,_plugins_chat_parsers__WEBPACK_IMPORTED_MODULE_12__.parseMessage)(stanza);
                if (u.isErrorObject(attrs_or_error)) {
                    const { stanza, message } = /** @type {errors.StanzaParseError} */ attrs_or_error;
                    if (stanza) _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(stanza);
                    return _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(message);
                }
                const attrs = /** @type {MessageAttributes} */ attrs_or_error;
                if (!(yield this.shouldShowErrorMessage(attrs))) {
                    return;
                }
                const message = this.getMessageReferencedByError(attrs);
                if (message) {
                    const new_attrs = yield this.getErrorAttributesForMessage(message, attrs);
                    message.save(new_attrs);
                } else {
                    this.createMessage(attrs);
                }
            }).call(this);
        }
        /**
         * @param {BaseMessage} message
         */ incrementUnreadMsgsCounter(message) {
            const settings = {
                'num_unread': this.get('num_unread') + 1
            };
            if (this.get('num_unread') === 0) {
                settings['first_unread_id'] = message.get('id');
            }
            this.save(settings);
        }
        clearUnreadMsgCounter() {
            if (this.get('num_unread') > 0) {
                this.sendMarkerForMessage(this.messages.last());
            }
            u.safeSave(this, {
                num_unread: 0
            });
        }
        /**
         * Handles message retraction based on the passed in attributes.
         * @param {MessageAttributes} attrs - Attributes representing a received
         *  message, as returned by {@link parseMessage}
         * @returns {Promise<Boolean>} Returns `true` or `false` depending on
         *  whether a message was retracted or not.
         */ handleRetraction(attrs) {
            return _async_to_generator(function*() {
                const RETRACTION_ATTRIBUTES = [
                    'retracted',
                    'retracted_id',
                    'editable'
                ];
                if (attrs.retracted) {
                    if (attrs.is_tombstone) return false;
                    for (const m of this.messages.models){
                        if (m.get('from') !== attrs.from) continue;
                        if (m.get('origin_id') === attrs.retracted_id || m.get('msgid') === attrs.retracted_id) {
                            m.save((0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_13__["default"])(attrs, RETRACTION_ATTRIBUTES));
                            return true;
                        }
                    }
                    attrs['dangling_retraction'] = true;
                    yield this.createMessage(attrs);
                    return true;
                } else {
                    // Check if we have dangling retraction
                    const message = this.findDanglingRetraction(attrs);
                    if (message) {
                        const retraction_attrs = (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_13__["default"])(message.attributes, RETRACTION_ATTRIBUTES);
                        const new_attrs = Object.assign({
                            dangling_retraction: false
                        }, attrs, retraction_attrs);
                        delete new_attrs['id']; // Delete id, otherwise a new cache entry gets created
                        message.save(new_attrs);
                        return true;
                    }
                }
                return false;
            }).call(this);
        }
        /**
         * @param {MessageAttributes} attrs
         */ handleReceipt(attrs) {
            if (attrs.sender === 'them') {
                if (attrs.is_valid_receipt_request) {
                    (0,_actions_js__WEBPACK_IMPORTED_MODULE_11__.sendReceiptStanza)(attrs.from, attrs.msgid);
                } else if (attrs.receipt_id) {
                    const message = this.messages.findWhere({
                        'msgid': attrs.receipt_id
                    });
                    if (message && !message.get('received')) {
                        message.save({
                            'received': new Date().toISOString()
                        });
                    }
                    return true;
                }
            }
            return false;
        }
        /**
         * Given a {@link BaseMessage} return the XML stanza that represents it.
         * @method ChatBox#createMessageStanza
         * @param {BaseMessage} message - The message object
         */ createMessageStanza(message) {
            return _async_to_generator(function*() {
                const { body, edited, is_encrypted, is_spoiler, msgid, oob_url, origin_id, references, spoiler_hint, type } = message.attributes;
                const stanza = stx`
                <message xmlns="jabber:client"
                        from="${message.get('type') === 'groupchat' ? _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].connection.get().jid : message.get('from')}"
                        to="${message.get('to') || this.get('jid')}"
                        type="${this.get('message_type')}"
                        id="${edited && u.getUniqueId() || msgid}">
                    ${body ? stx`<body>${body}</body>` : ''}
                    <active xmlns="${Strophe.NS.CHATSTATES}"/>
                    ${type === 'chat' ? stx`<request xmlns="${Strophe.NS.RECEIPTS}"></request>` : ''}
                    ${!is_encrypted && oob_url ? stx`<x xmlns="${Strophe.NS.OUTOFBAND}"><url>${oob_url}</url></x>` : ''}
                    ${!is_encrypted && is_spoiler ? stx`<spoiler xmlns="${Strophe.NS.SPOILER}">${spoiler_hint !== null && spoiler_hint !== void 0 ? spoiler_hint : ''}</spoiler>` : ''}
                    ${!is_encrypted ? references === null || references === void 0 ? void 0 : references.map((ref)=>stx`<reference xmlns="${Strophe.NS.REFERENCE}"
                                                begin="${ref.begin}"
                                                end="${ref.end}"
                                                type="${ref.type}"
                                                uri="${ref.uri}"></reference>`) : ''}
                    ${edited ? stx`<replace xmlns="${Strophe.NS.MESSAGE_CORRECT}" id="${msgid}"></replace>` : ''}
                    ${origin_id ? stx`<origin-id xmlns="${Strophe.NS.SID}" id="${origin_id}"></origin-id>` : ''}
                </message>`;
                /**
             * *Hook* which allows plugins to update an outgoing message stanza
             * @event _converse#createMessageStanza
             * @param {ChatBox|MUC} chat - The chat from
             *      which this message stanza is being sent.
             * @param {Object} data - BaseMessage data
             * @param {BaseMessage} data.message
             *      The message object from which the stanza is created and which gets persisted to storage.
             * @param {Builder} data.stanza
             *      The stanza that will be sent out, as a Strophe.Builder object.
             *      You can use the Strophe.Builder functions to extend the stanza.
             *      See http://strophe.im/strophejs/doc/1.4.3/files/strophe-umd-js.html#Strophe.Builder.Functions
             */ const data = yield _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].hook('createMessageStanza', this, {
                    message,
                    stanza
                });
                return data.stanza;
            }).call(this);
        }
        /**
         * Prunes the message history to ensure it does not exceed the maximum
         * number of messages specified in the settings.
         */ pruneHistory() {
            const max_history = _api_index_js__WEBPACK_IMPORTED_MODULE_7__["default"].settings.get('prune_messages_above');
            if (max_history && typeof max_history === 'number') {
                if (this.messages.length > max_history) {
                    const non_empty_messages = this.messages.filter((m)=>!u.isEmptyMessage(m));
                    if (non_empty_messages.length > max_history) {
                        while(non_empty_messages.length > max_history){
                            non_empty_messages.shift().destroy();
                        }
                        /**
                         * Triggered once the message history has been pruned, i.e.
                         * once older messages have been removed to keep the
                         * number of messages below the value set in `prune_messages_above`.
                         */ this.trigger('historyPruned');
                    }
                }
            }
        }
        isScrolledUp() {
            return this.ui.get('scrolled');
        }
        /**
         * Indicates whether the chat is hidden and therefore
         * whether a newly received message will be visible to the user or not.
         * @returns {boolean}
         */ isHidden() {
            return this.get('hidden') || this.isScrolledUp() || document.hidden;
        }
        /** @param {...any} args */ constructor(...args){
            super(args[0], args[1]), _define_property(this, "debouncedPruneHistory", (0,lodash_es_debounce_js__WEBPACK_IMPORTED_MODULE_14__["default"])(()=>this.pruneHistory(), 500, {
                maxWait: 2000
            }));
            this.disable_mam = false;
        }
    };
}


/***/ }),

/***/ "./src/headless/shared/model-with-vcard.js":
/*!*************************************************!*\
  !*** ./src/headless/shared/model-with-vcard.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ModelWithVCard)
/* harmony export */ });
/* harmony import */ var _plugins_vcard_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../plugins/vcard/utils.js */ "./src/headless/plugins/vcard/utils.js");
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_converse.js */ "./src/headless/shared/_converse.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


/**
 * @template {import('./types').ModelExtender} T
 * @param {T} BaseModel
 */ function ModelWithVCard(BaseModel) {
    /**
     * @typedef {import('../plugins/vcard/vcard').default} VCard
     */ return class ModelWithVCard extends BaseModel {
        initialize() {
            super.initialize();
            this.getVCard();
        }
        get vcard() {
            return this._vcard;
        }
        /**
         * @returns {Promise<VCard|null>}
         */ getVCard() {
            return _async_to_generator(function*() {
                var _pluggable_plugins_conversevcard;
                const { pluggable } = _converse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
                if (!((_pluggable_plugins_conversevcard = pluggable.plugins["converse-vcard"]) === null || _pluggable_plugins_conversevcard === void 0 ? void 0 : _pluggable_plugins_conversevcard.enabled(_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"]))) return null;
                if (this._vcard) return this._vcard;
                this._vcard = yield (0,_plugins_vcard_utils_js__WEBPACK_IMPORTED_MODULE_0__.getVCardForModel)(this, this.lazy_load_vcard);
                this.trigger("vcard:add", {
                    vcard: this._vcard
                });
                return this._vcard;
            }).call(this);
        }
        /**
         * @param {any[]} args
         */ constructor(...args){
            super(...args);
            this._vcard = null;
            this.lazy_load_vcard = false;
        }
    };
}


/***/ }),

/***/ "./src/headless/shared/parsers.js":
/*!****************************************!*\
  !*** ./src/headless/shared/parsers.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getChatMarker: () => (/* binding */ getChatMarker),
/* harmony export */   getChatState: () => (/* binding */ getChatState),
/* harmony export */   getCorrectionAttributes: () => (/* binding */ getCorrectionAttributes),
/* harmony export */   getDeprecatedRetractionAttributes: () => (/* binding */ getDeprecatedRetractionAttributes),
/* harmony export */   getEncryptionAttributes: () => (/* binding */ getEncryptionAttributes),
/* harmony export */   getErrorAttributes: () => (/* binding */ getErrorAttributes),
/* harmony export */   getInputType: () => (/* binding */ getInputType),
/* harmony export */   getOpenGraphMetadata: () => (/* binding */ getOpenGraphMetadata),
/* harmony export */   getOutOfBandAttributes: () => (/* binding */ getOutOfBandAttributes),
/* harmony export */   getReceiptId: () => (/* binding */ getReceiptId),
/* harmony export */   getReferences: () => (/* binding */ getReferences),
/* harmony export */   getRetractionAttributes: () => (/* binding */ getRetractionAttributes),
/* harmony export */   getSpoilerAttributes: () => (/* binding */ getSpoilerAttributes),
/* harmony export */   getStanzaIDs: () => (/* binding */ getStanzaIDs),
/* harmony export */   isArchived: () => (/* binding */ isArchived),
/* harmony export */   isCarbon: () => (/* binding */ isCarbon),
/* harmony export */   isHeadline: () => (/* binding */ isHeadline),
/* harmony export */   isMUCPrivateMessage: () => (/* binding */ isMUCPrivateMessage),
/* harmony export */   isServerMessage: () => (/* binding */ isServerMessage),
/* harmony export */   isValidReceiptRequest: () => (/* binding */ isValidReceiptRequest),
/* harmony export */   parseErrorStanza: () => (/* binding */ parseErrorStanza),
/* harmony export */   parseXForm: () => (/* binding */ parseXForm),
/* harmony export */   throwErrorIfInvalidForward: () => (/* binding */ throwErrorIfInvalidForward)
/* harmony export */ });
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api/index.js */ "./src/headless/shared/api/index.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _utils_html_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/html.js */ "./src/headless/utils/html.js");
/* harmony import */ var _utils_stanza_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/stanza.js */ "./src/headless/utils/stanza.js");
/* harmony import */ var _actions_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./actions.js */ "./src/headless/shared/actions.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./errors.js */ "./src/headless/shared/errors.js");
/**
 * @module:headless-shared-parsers
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}











const { NS } = strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe;
/**
 * @param {Element|Error|null} stanza - The stanza to be parsed. As a convenience,
 * an Error element can be passed in as well, so that this function can be
 * called in a catch block without first checking if a stanza or Error
 * element was received.
 * @returns {Promise<Error|errors.StanzaError|null>}
 */ function parseErrorStanza(stanza) {
    return _async_to_generator(function*() {
        var _els_filter_pop;
        if (stanza === null) return null;
        if (stanza instanceof Error) return stanza;
        if (stanza.getAttribute('type') !== 'error') return null;
        const error = stanza.querySelector('error');
        if (!error) return null;
        const els = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.STANZAS}"]`, error);
        const name = (_els_filter_pop = els.filter((el)=>el.nodeName && el.nodeName !== 'text').pop()) === null || _els_filter_pop === void 0 ? void 0 : _els_filter_pop.nodeName;
        /**
     * *Hook* which allows plugins to add application-specific error parsing
     * @event _converse#parseErrorStanza
     */ const extra = yield _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].hook('parseErrorStanza', stanza, {});
        if (name === 'bad-request') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.BadRequestError(name, error, extra);
        } else if (name === 'conflict') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.ConflictError(name, error, extra);
        } else if (name === 'feature-not-implemented') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.FeatureNotImplementedError(name, error, extra);
        } else if (name === 'forbidden') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.ForbiddenError(name, error, extra);
        } else if (name === 'gone') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.GoneError(name, error, extra);
        } else if (name === 'internal-server-error') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.InternalServerError(name, error, extra);
        } else if (name === 'item-not-found') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.ItemNotFoundError(name, error, extra);
        } else if (name === 'jid-malformed') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.JIDMalformedError(name, error, extra);
        } else if (name === 'not-acceptable') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.NotAcceptableError(name, error, extra);
        } else if (name === 'not-allowed') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.NotAllowedError(name, error, extra);
        } else if (name === 'not-authorized') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.NotAuthorizedError(name, error, extra);
        } else if (name === 'payment-required') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.PaymentRequiredError(name, error, extra);
        } else if (name === 'recipient-unavailable') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.RecipientUnavailableError(name, error, extra);
        } else if (name === 'redirect') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.RedirectError(name, error, extra);
        } else if (name === 'registration-required') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.RegistrationRequiredError(name, error, extra);
        } else if (name === 'remote-server-not-found') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.RemoteServerNotFoundError(name, error, extra);
        } else if (name === 'remote-server-timeout') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.RemoteServerTimeoutError(name, error, extra);
        } else if (name === 'resource-constraint') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.ResourceConstraintError(name, error, extra);
        } else if (name === 'service-unavailable') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.ServiceUnavailableError(name, error, extra);
        } else if (name === 'subscription-required') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.SubscriptionRequiredError(name, error, extra);
        } else if (name === 'undefined-condition') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.UndefinedConditionError(name, error, extra);
        } else if (name === 'unexpected-request') {
            return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.UnexpectedRequestError(name, error, extra);
        }
        return new _errors_js__WEBPACK_IMPORTED_MODULE_10__.StanzaError('unknown', error);
    })();
}
/**
 * Extract the XEP-0359 stanza IDs from the passed in stanza
 * and return a map containing them.
 * @param {Element} stanza - The message stanza
 * @param {Element} original_stanza - The encapsulating stanza which contains
 *      the message stanza.
 * @returns {Object}
 */ function getStanzaIDs(stanza, original_stanza) {
    var _sizzle_pop;
    // Generic stanza ids
    const sids = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`stanza-id[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.SID}"]`, stanza);
    const sid_attrs = sids.reduce((acc, s)=>{
        acc[`stanza_id ${s.getAttribute('by')}`] = s.getAttribute('id');
        return acc;
    }, {});
    // Origin id
    const origin_id = (_sizzle_pop = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`origin-id[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.SID}"]`, stanza).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.getAttribute('id');
    const attrs = _object_spread({
        origin_id,
        msgid: stanza.getAttribute('id') || original_stanza.getAttribute('id')
    }, sid_attrs);
    // Store the archive id
    const result = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`message > result[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MAM}"]`, original_stanza).pop();
    if (result) {
        const bare_jid = _converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
        const by_jid = original_stanza.getAttribute('from') || bare_jid;
        attrs[`stanza_id ${by_jid}`] = result.getAttribute('id');
    }
    return attrs;
}
/**
 * @param {Element} stanza
 * @returns {import('./types').EncryptionAttrs}
 */ function getEncryptionAttributes(stanza) {
    const eme_tag = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`encryption[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.EME}"]`, stanza).pop();
    const namespace = eme_tag === null || eme_tag === void 0 ? void 0 : eme_tag.getAttribute('namespace');
    const attrs = {};
    if (namespace) {
        attrs.is_encrypted = true;
        attrs.encryption_namespace = namespace;
    } else if (sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`encrypted[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.OMEMO}"]`, stanza).pop()) {
        attrs.is_encrypted = true;
        attrs.encryption_namespace = strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.OMEMO;
    }
    return attrs;
}
/**
 * @param {Element} stanza - The message stanza
 * @param {Element} original_stanza - The original stanza, that contains the
 *  message stanza, if it was contained, otherwise it's the message stanza itself.
 * @returns {import('./types').RetractionAttrs | {}}
 */ function getDeprecatedRetractionAttributes(stanza, original_stanza) {
    const fastening = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> apply-to[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.FASTEN}"]`, stanza).pop();
    if (fastening) {
        const applies_to_id = fastening.getAttribute('id');
        const retracted = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> retract[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.RETRACT0}"]`, fastening).pop();
        if (retracted) {
            const delay = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`delay[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.DELAY}"]`, original_stanza).pop();
            const time = delay ? dayjs__WEBPACK_IMPORTED_MODULE_3___default()(delay.getAttribute('stamp')).toISOString() : new Date().toISOString();
            return {
                editable: false,
                retracted: time,
                retracted_id: applies_to_id
            };
        }
    }
    return {};
}
/**
 * @param {Element} stanza - The message stanza
 * @param {Element} original_stanza - The original stanza, that contains the
 *  message stanza, if it was contained, otherwise it's the message stanza itself.
 * @returns {import('./types').RetractionAttrs | {}}
 */ function getRetractionAttributes(stanza, original_stanza) {
    const retraction = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> retract[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.RETRACT}"]`, stanza).pop();
    if (retraction) {
        const delay = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> delay[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.DELAY}"]`, original_stanza).pop();
        const time = delay ? dayjs__WEBPACK_IMPORTED_MODULE_3___default()(delay.getAttribute('stamp')).toISOString() : new Date().toISOString();
        return {
            editable: false,
            retracted: time,
            retracted_id: retraction.getAttribute('id')
        };
    } else {
        const tombstone = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> retracted[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.RETRACT}"]`, stanza).pop() || sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> retracted[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.RETRACT0}"]`, stanza).pop();
        if (tombstone) {
            return {
                editable: false,
                is_tombstone: true,
                retracted: tombstone.getAttribute('stamp'),
                retraction_id: tombstone.getAttribute('id')
            };
        }
    }
    return getDeprecatedRetractionAttributes(stanza, original_stanza);
}
/**
 * @param {Element} stanza
 * @param {Element} original_stanza
 */ function getCorrectionAttributes(stanza, original_stanza) {
    const el = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`replace[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MESSAGE_CORRECT}"]`, stanza).pop();
    if (el) {
        const replace_id = el.getAttribute('id');
        if (replace_id) {
            const delay = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`delay[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.DELAY}"]`, original_stanza).pop();
            const time = delay ? dayjs__WEBPACK_IMPORTED_MODULE_3___default()(delay.getAttribute('stamp')).toISOString() : new Date().toISOString();
            return {
                replace_id,
                'edited': time
            };
        }
    }
    return {};
}
/**
 * @param {Element} stanza
 */ function getOpenGraphMetadata(stanza) {
    const fastening = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> apply-to[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.FASTEN}"]`, stanza).pop();
    if (fastening) {
        const applies_to_id = fastening.getAttribute('id');
        const meta = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`> meta[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.XHTML}"]`, fastening);
        if (meta.length) {
            var _data_ogsite_name;
            const msg_limit = _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].settings.get('message_limit');
            const data = meta.reduce((acc, el)=>{
                const property = el.getAttribute('property');
                if (property) {
                    let value = (0,_utils_html_js__WEBPACK_IMPORTED_MODULE_6__.decodeHTMLEntities)(el.getAttribute('content') || '');
                    if (msg_limit && property === 'og:description' && value.length >= msg_limit) {
                        value = `${value.slice(0, msg_limit)}${(0,_utils_html_js__WEBPACK_IMPORTED_MODULE_6__.decodeHTMLEntities)('&#8230;')}`;
                    }
                    acc[property] = value;
                }
                return acc;
            }, {
                ogp_for_id: applies_to_id
            });
            const url = data['og:url'];
            if ((url === null || url === void 0 ? void 0 : url.startsWith('/')) && ((_data_ogsite_name = data['og:site_name']) === null || _data_ogsite_name === void 0 ? void 0 : _data_ogsite_name.toLowerCase()) === 'github') {
                data['og:url'] = `https://github.com${url}`;
            }
            if ("og:description" in data || "og:title" in data || "og:image" in data) {
                return data;
            }
        }
    }
    return {};
}
/**
 * @param {Element} stanza
 */ function getSpoilerAttributes(stanza) {
    const spoiler = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`spoiler[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.SPOILER}"]`, stanza).pop();
    return {
        'is_spoiler': !!spoiler,
        'spoiler_hint': spoiler === null || spoiler === void 0 ? void 0 : spoiler.textContent
    };
}
/**
 * @param {Element} stanza
 */ function getOutOfBandAttributes(stanza) {
    const xform = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`x[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.OUTOFBAND}"]`, stanza).pop();
    if (xform) {
        var _xform_querySelector, _xform_querySelector1;
        return {
            'oob_url': (_xform_querySelector = xform.querySelector('url')) === null || _xform_querySelector === void 0 ? void 0 : _xform_querySelector.textContent,
            'oob_desc': (_xform_querySelector1 = xform.querySelector('desc')) === null || _xform_querySelector1 === void 0 ? void 0 : _xform_querySelector1.textContent
        };
    }
    return {};
}
/**
 * Returns the human readable error message contained in a `groupchat` message stanza of type `error`.
 * @param {Element} stanza - The message stanza
 */ function getErrorAttributes(stanza) {
    if (stanza.getAttribute('type') === 'error') {
        const error = stanza.querySelector('error');
        const text = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`text[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.STANZAS}"]`, error).pop();
        return {
            is_error: true,
            error_text: text === null || text === void 0 ? void 0 : text.textContent,
            error_type: error.getAttribute('type'),
            error_condition: error.firstElementChild.nodeName,
            errors: Array.from(error.children).map((e)=>({
                    name: e.nodeName,
                    xmlns: e.getAttribute('xmlns')
                }))
        };
    }
    return {};
}
/**
 * Given a message stanza, find and return any XEP-0372 references
 * @param {Element} stanza - The message stanza
 * @returns {import('./types').XEP372Reference[]}
 */ function getReferences(stanza) {
    return sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`reference[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.REFERENCE}"]`, stanza).map((ref)=>{
        var _stanza_querySelector;
        const anchor = ref.getAttribute('anchor');
        const text = (_stanza_querySelector = stanza.querySelector(anchor ? `#${anchor}` : 'body')) === null || _stanza_querySelector === void 0 ? void 0 : _stanza_querySelector.textContent;
        if (!text) {
            _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].warn(`Could not find referenced text for ${ref}`);
            return null;
        }
        const begin = Number(ref.getAttribute('begin'));
        const end = Number(ref.getAttribute('end'));
        return {
            begin,
            end,
            type: ref.getAttribute('type'),
            value: text.slice(begin, end),
            uri: ref.getAttribute('uri')
        };
    }).filter((r)=>r);
}
/**
 * @param {Element} stanza
 */ function getReceiptId(stanza) {
    const receipt = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`received[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.RECEIPTS}"]`, stanza).pop();
    return receipt === null || receipt === void 0 ? void 0 : receipt.getAttribute('id');
}
/**
 * Determines whether the passed in stanza is a XEP-0280 Carbon
 * @param {Element} stanza - The message stanza
 * @returns {Boolean}
 */ function isCarbon(stanza) {
    const xmlns = strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.CARBONS;
    return sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`message > received[xmlns="${xmlns}"]`, stanza).length > 0 || sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`message > sent[xmlns="${xmlns}"]`, stanza).length > 0;
}
/**
 * Returns the XEP-0085 chat state contained in a message stanza
 * @param {Element} stanza - The message stanza
 */ function getChatState(stanza) {
    var _sizzle_pop;
    return (_sizzle_pop = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`
        composing[xmlns="${NS.CHATSTATES}"],
        paused[xmlns="${NS.CHATSTATES}"],
        inactive[xmlns="${NS.CHATSTATES}"],
        active[xmlns="${NS.CHATSTATES}"],
        gone[xmlns="${NS.CHATSTATES}"]`, stanza).pop()) === null || _sizzle_pop === void 0 ? void 0 : _sizzle_pop.nodeName;
}
/**
 * @param {Element} stanza
 * @param {Object} attrs
 */ function isValidReceiptRequest(stanza, attrs) {
    return attrs.sender !== 'me' && !attrs.is_carbon && !attrs.is_archived && sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`request[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.RECEIPTS}"]`, stanza).length;
}
/**
 * Check whether the passed-in stanza is a forwarded message that is "bare",
 * i.e. it's not forwarded as part of a larger protocol, like MAM.
 * @param { Element } stanza
 */ function throwErrorIfInvalidForward(stanza) {
    const bare_forward = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`message > forwarded[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.FORWARD}"]`, stanza).length;
    if (bare_forward) {
        (0,_actions_js__WEBPACK_IMPORTED_MODULE_8__.rejectMessage)(stanza, 'Forwarded messages not part of an encapsulating protocol are not supported');
        const from_jid = stanza.getAttribute('from');
        throw new _errors_js__WEBPACK_IMPORTED_MODULE_10__.StanzaParseError(stanza, `Ignoring unencapsulated forwarded message from ${from_jid}`);
    }
}
/**
 * Determines whether the passed in stanza is a XEP-0333 Chat Marker
 * @method getChatMarker
 * @param {Element} stanza - The message stanza
 * @returns {Element}
 */ function getChatMarker(stanza) {
    // If we receive more than one marker (which shouldn't happen), we take
    // the highest level of acknowledgement.
    return sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`
        acknowledged[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MARKERS}"],
        displayed[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MARKERS}"],
        received[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MARKERS}"]`, stanza).pop();
}
/**
 * @param {Element} stanza
 * @returns {boolean}
 */ function isHeadline(stanza) {
    return stanza.getAttribute('type') === 'headline';
}
/**
 * @param {Element} stanza
 * @returns {Promise<boolean>}
 */ function isMUCPrivateMessage(stanza) {
    return _async_to_generator(function*() {
        const bare_jid = strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.getBareJidFromJid(stanza.getAttribute('from'));
        return !!(yield _api_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].rooms.get(bare_jid));
    })();
}
/**
 * @param {Element} stanza
 * @returns {boolean}
 */ function isServerMessage(stanza) {
    if (sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`mentions[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MENTIONS}"]`, stanza).pop()) {
        return false;
    }
    const from_jid = stanza.getAttribute('from');
    if (stanza.getAttribute('type') !== 'error' && from_jid && !from_jid.includes('@')) {
        // Some servers (e.g. Prosody) don't set the stanza
        // type to "headline" when sending server messages.
        // For now we check if an @ signal is included, and if not,
        // we assume it's a headline stanza.
        return true;
    }
    return false;
}
/**
 * Determines whether the passed in stanza is a XEP-0313 MAM stanza
 * @method isArchived
 * @param {Element} original_stanza - The message stanza
 * @returns {boolean}
 */ function isArchived(original_stanza) {
    return !!sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`message > result[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.MAM}"]`, original_stanza).pop();
}
/**
 * @param {Element} field
 * @param {boolean} readonly
 * @param {Element} stanza
 * @return {import('./types').XFormField}
 */ function parseXFormField(field, readonly, stanza) {
    var _field_querySelector;
    const v = field.getAttribute('var');
    const label = field.getAttribute('label') || '';
    const type = field.getAttribute('type');
    const desc = (_field_querySelector = field.querySelector('desc')) === null || _field_querySelector === void 0 ? void 0 : _field_querySelector.textContent;
    const result = {
        readonly,
        desc
    };
    if (type === 'list-single' || type === 'list-multi') {
        const values = Array.from(field.querySelectorAll(':scope > value')).map((el)=>el === null || el === void 0 ? void 0 : el.textContent);
        const options = Array.from(field.querySelectorAll(':scope > option')).map((/** @type {HTMLElement} */ option)=>{
            var _option_querySelector;
            const value = (_option_querySelector = option.querySelector('value')) === null || _option_querySelector === void 0 ? void 0 : _option_querySelector.textContent;
            return _object_spread({
                value,
                label: option.getAttribute('label'),
                selected: values.includes(value),
                required: !!field.querySelector('required')
            }, result);
        });
        return _object_spread({
            type,
            options,
            label: field.getAttribute('label'),
            var: v,
            required: !!field.querySelector('required')
        }, result);
    } else if (type === 'fixed') {
        var _field_querySelector1;
        const text = (_field_querySelector1 = field.querySelector('value')) === null || _field_querySelector1 === void 0 ? void 0 : _field_querySelector1.textContent;
        return _object_spread({
            text,
            label,
            type,
            var: v
        }, result);
    } else if (type === 'jid-multi') {
        var _field_querySelector2;
        return _object_spread({
            type,
            var: v,
            label,
            value: (_field_querySelector2 = field.querySelector('value')) === null || _field_querySelector2 === void 0 ? void 0 : _field_querySelector2.textContent,
            required: !!field.querySelector('required')
        }, result);
    } else if (type === 'boolean') {
        var _field_querySelector3;
        const value = (_field_querySelector3 = field.querySelector('value')) === null || _field_querySelector3 === void 0 ? void 0 : _field_querySelector3.textContent;
        return _object_spread({
            type,
            var: v,
            label,
            checked: (value === '1' || value === 'true') && true || false
        }, result);
    } else if (v === 'url') {
        var _field_querySelector4;
        return _object_spread({
            var: v,
            label,
            value: (_field_querySelector4 = field.querySelector('value')) === null || _field_querySelector4 === void 0 ? void 0 : _field_querySelector4.textContent
        }, result);
    } else if (v === 'username') {
        var _field_querySelector5;
        return _object_spread({
            var: v,
            label,
            value: (_field_querySelector5 = field.querySelector('value')) === null || _field_querySelector5 === void 0 ? void 0 : _field_querySelector5.textContent,
            required: !!field.querySelector('required'),
            type: getInputType(field)
        }, result);
    } else if (v === 'password') {
        var _field_querySelector6;
        return _object_spread({
            var: v,
            label,
            value: (_field_querySelector6 = field.querySelector('value')) === null || _field_querySelector6 === void 0 ? void 0 : _field_querySelector6.textContent,
            required: !!field.querySelector('required')
        }, result);
    } else if (v === 'ocr') {
        const uri = field.querySelector('uri');
        const el = sizzle__WEBPACK_IMPORTED_MODULE_0___default()('data[cid="' + uri.textContent.replace(/^cid:/, '') + '"]', stanza)[0];
        return _object_spread({
            label: field.getAttribute('label'),
            var: v,
            uri: {
                type: uri.getAttribute('type'),
                data: el === null || el === void 0 ? void 0 : el.textContent
            },
            required: !!field.querySelector('required')
        }, result);
    } else {
        var _field_querySelector7;
        return _object_spread({
            label,
            var: v,
            required: !!field.querySelector('required'),
            value: (_field_querySelector7 = field.querySelector('value')) === null || _field_querySelector7 === void 0 ? void 0 : _field_querySelector7.textContent,
            type: getInputType(field)
        }, result);
    }
}
/**
 * @param {Element} field
 */ function getInputType(field) {
    const type = _constants_js__WEBPACK_IMPORTED_MODULE_9__.XFORM_TYPE_MAP[field.getAttribute('type')];
    if (type == 'text') {
        const datatypes = field.getElementsByTagNameNS("http://jabber.org/protocol/xdata-validate", "validate");
        if (datatypes.length === 1) {
            const datatype = datatypes[0].getAttribute("datatype");
            return _constants_js__WEBPACK_IMPORTED_MODULE_9__.XFORM_VALIDATE_TYPE_MAP[datatype] || type;
        }
    }
    return type;
}
/**
 * @param {Element} stanza
 * @returns {import('./types').XForm}
 */ function parseXForm(stanza) {
    var _x_querySelector;
    const xs = sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`x[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_5__.Strophe.NS.XFORM}"]`, stanza);
    if (xs.length > 1) {
        _converse_log__WEBPACK_IMPORTED_MODULE_4__["default"].error(stanza);
        throw new Error('Invalid stanza');
    } else if (xs.length === 0) {
        return null;
    }
    const x = xs[0];
    const type = /** @type {import('./types').XFormResponseType} */ x.getAttribute('type');
    const result = {
        type,
        title: (_x_querySelector = x.querySelector('title')) === null || _x_querySelector === void 0 ? void 0 : _x_querySelector.textContent
    };
    if (type === 'result') {
        const reported = x.querySelector(':scope > reported');
        if (reported) {
            const reported_fields = reported ? Array.from(reported.querySelectorAll(':scope > field')) : [];
            const items = Array.from(x.querySelectorAll(':scope > item'));
            return /** @type {import('./types').XForm} */ _object_spread_props(_object_spread({}, result), {
                reported: /** @type {import('./types').XFormReportedField[]} */ reported_fields.map(_utils_stanza_js__WEBPACK_IMPORTED_MODULE_7__.getAttributes),
                items: items.map((item)=>{
                    return Array.from(item.querySelectorAll('field')).map((field)=>{
                        var _field_querySelector;
                        var _field_querySelector_textContent;
                        return /** @type {import('./types').XFormResultItemField} */ _object_spread_props(_object_spread({}, (0,_utils_stanza_js__WEBPACK_IMPORTED_MODULE_7__.getAttributes)(field)), {
                            value: (_field_querySelector_textContent = (_field_querySelector = field.querySelector('value')) === null || _field_querySelector === void 0 ? void 0 : _field_querySelector.textContent) !== null && _field_querySelector_textContent !== void 0 ? _field_querySelector_textContent : ''
                        });
                    });
                })
            });
        }
        return _object_spread_props(_object_spread({}, result), {
            fields: Array.from(x.querySelectorAll('field')).map((field)=>parseXFormField(field, true, stanza))
        });
    } else if (type === 'form') {
        var _x_querySelector1;
        return _object_spread_props(_object_spread({}, result), {
            instructions: (_x_querySelector1 = x.querySelector('instructions')) === null || _x_querySelector1 === void 0 ? void 0 : _x_querySelector1.textContent,
            fields: Array.from(x.querySelectorAll('field')).map((field)=>parseXFormField(field, false, stanza))
        });
    } else {
        throw new Error(`Invalid type in XForm response stanza: ${type}`);
    }
}


/***/ }),

/***/ "./src/headless/shared/rsm.js":
/*!************************************!*\
  !*** ./src/headless/shared/rsm.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RSM: () => (/* binding */ RSM),
/* harmony export */   RSM_ATTRIBUTES: () => (/* binding */ RSM_ATTRIBUTES),
/* harmony export */   RSM_TYPES: () => (/* binding */ RSM_TYPES)
/* harmony export */ });
/* harmony import */ var _utils_object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/object.js */ "./src/headless/utils/object.js");
/* harmony import */ var _api_public_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api/public.js */ "./src/headless/shared/api/public.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description XEP-0059 Result Set Management
 *   Some code taken from the Strophe RSM plugin, licensed under the MIT License
 *   Copyright 2006-2017 Strophe (https://github.com/strophe/strophejs)
 */ 

const { Strophe, $build } = _api_public_js__WEBPACK_IMPORTED_MODULE_1__["default"].env;
Strophe.addNamespace("RSM", "http://jabber.org/protocol/rsm");
const RSM_QUERY_PARAMETERS = [
    "after",
    "before",
    "index",
    "max"
];
const toNumber = (v)=>Number(v);
const toString = (v)=>v.toString();
const RSM_TYPES = {
    after: toString,
    before: toString,
    count: toNumber,
    first: toString,
    index: toNumber,
    last: toString,
    max: toNumber
};
// This array contains both query attributes and response attributes
const RSM_ATTRIBUTES = Object.keys(RSM_TYPES);
/**
 * Instances of this class are used to page through query results according to XEP-0059 Result Set Management
 * @class RSM
 */ class RSM {
    static getQueryParameters(options = {}) {
        return RSM_QUERY_PARAMETERS.reduce((result, key)=>{
            if (options[key] !== undefined) {
                result[key] = options[key];
            }
            return result;
        }, {});
    }
    static parseXMLResult(set) {
        const result = {};
        for(var i = 0; i < RSM_ATTRIBUTES.length; i++){
            const attr = RSM_ATTRIBUTES[i];
            const elem = set.getElementsByTagName(attr)[0];
            if (!(0,_utils_object_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(elem) && elem !== null) {
                result[attr] = RSM_TYPES[attr](Strophe.getText(elem));
                if (attr == "first") {
                    result.index = RSM_TYPES["index"](elem.getAttribute("index"));
                }
            }
        }
        return result;
    }
    /**
     * Returns a `<set>` XML element that confirms to XEP-0059 Result Set Management.
     * The element is constructed based on the RSMQueryOptions
     * that are set on this RSM instance.
     * @returns {Element}
     */ toXML() {
        const xml = $build("set", {
            xmlns: Strophe.NS.RSM
        });
        const reducer = (xml, a)=>!(0,_utils_object_js__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(this.query[a]) ? xml.c(a).t((this.query[a] || "").toString()).up() : xml;
        return RSM_QUERY_PARAMETERS.reduce(reducer, xml).tree();
    }
    /**
     * Returns a string representation of the result-set XML
     * @returns {string}
     */ toString() {
        return Strophe.serialize(this.toXML());
    }
    /**
     * @param {string} max
     * @param {string} before
     */ next(max, before) {
        const options = Object.assign({}, this.query, {
            after: this.result.last,
            before,
            max
        });
        return new RSM(options);
    }
    /**
     * @param {string} max
     * @param {string} after
     */ previous(max, after) {
        const options = Object.assign({}, this.query, {
            after,
            before: this.result.first,
            max
        });
        return new RSM(options);
    }
    /**
     * Creates a new RSM instance
     * @param { Object } options - Configuration options
     */ constructor(options = {}){
        this.query = RSM.getQueryParameters(options);
        this.result = options.xml ? RSM.parseXMLResult(options.xml) : {};
    }
}


/***/ }),

/***/ "./src/headless/shared/settings/api.js":
/*!*********************************************!*\
  !*** ./src/headless/shared/settings/api.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   settings_api: () => (/* binding */ settings_api)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./src/headless/shared/settings/utils.js");
/**
 * @typedef {import('@converse/skeletor').Model} Model
 */ 
/**
 * This grouping allows access to the
 * [configuration settings](/docs/html/configuration.html#configuration-settings)
 * of Converse.
 *
 * @namespace _converse.api.settings
 * @memberOf _converse.api
 */ const settings_api = {
    /**
     * Allows new configuration settings to be specified, or new default values for
     * existing configuration settings to be specified.
     *
     * Note, calling this method *after* converse.initialize has been
     * called will *not* change the initialization settings provided via
     * `converse.initialize`.
     *
     * @method api.settings.extend
     * @param {object} settings The configuration settings
     * @example
     * api.settings.extend({
     *    'enable_foo': true
     * });
     *
     * // The user can then override the default value of the configuration setting when
     * // calling `converse.initialize`.
     * converse.initialize({
     *     'enable_foo': false
     * });
     */ extend (settings) {
        return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.extendAppSettings)(settings);
    },
    /**
     * @method _converse.api.settings.get
     * @param {string} [key]
     * @returns {*} Value of the particular configuration setting, or all
     *  settings if no key was specified.
     * @example api.settings.get("play_sounds");
     */ get (key) {
        return key ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getAppSetting)(key) : (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getAppSettings)();
    },
    /**
     * Set one or many configuration settings.
     *
     * Note, this is not an alternative to calling {@link converse.initialize}, which still needs
     * to be called. Generally, you'd use this method after Converse is already
     * running and you want to change the configuration on-the-fly.
     *
     * @method _converse.api.settings.set
     * @param { Object | string } [settings_or_key]
     *  An object containing configuration settings.
     *  Alternatively to passing in an object, you can pass in a key and a value.
     * @param { string } [value]
     * @example api.settings.set("play_sounds", true);
     * @example
     * api.settings.set({
     *     "play_sounds": true,
     *     "hide_offline_users": true
     * });
     */ set (settings_or_key, value) {
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.updateAppSettings)(settings_or_key, value);
    },
    /**
     * The `listen` namespace exposes methods for creating event listeners
     * (aka handlers) for events related to settings.
     *
     * @namespace _converse.api.settings.listen
     * @memberOf _converse.api.settings
     */ listen: {
        /**
         * Register an event listener for the passed in event.
         * @method _converse.api.settings.listen.on
         * @param { ('change') } name - The name of the event to listen for.
         *  Currently there is only the 'change' event.
         * @param { Function } handler - The event handler function
         * @param { Object } [context] - The context of the `this` attribute of the
         *  handler function.
         * @example api.settings.listen.on('change', callback);
         */ on (name, handler, context) {
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.registerListener)(name, handler, context);
        },
        /**
         * To stop listening to an event, you can use the `not` method.
         * @method _converse.api.settings.listen.not
         * @param { String } name The event's name
         * @param { Function } handler The callback method that is to no longer be called when the event fires
         * @example api.settings.listen.not('change', callback);
         */ not (name, handler) {
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.unregisterListener)(name, handler);
        }
    }
};


/***/ }),

/***/ "./src/headless/shared/settings/constants.js":
/*!***************************************************!*\
  !*** ./src/headless/shared/settings/constants.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DEFAULT_SETTINGS: () => (/* binding */ DEFAULT_SETTINGS)
/* harmony export */ });
/**
 * @typedef {Object } ConfigurationSettings
 * Converse's core configuration values
 * @property {Boolean} [allow_non_roster_messaging=false]
 * @property {Boolean} [allow_url_history_change=true]
 * @property {String} [assets_path='/dist']
 * @property {('login'|'prebind'|'anonymous'|'external')} [authentication='login']
 * @property {Boolean} [auto_login=false] - Currently only used in connection with anonymous login
 * @property {Boolean} [reuse_scram_keys=true] - Save SCRAM keys after login to allow for future auto login
 * @property {Boolean} [auto_reconnect=true]
 * @property {Array<String>} [blacklisted_plugins]
 * @property {Boolean} [clear_cache_on_logout=false]
 * @property {Object} [connection_options]
 * @property {String} [credentials_url] - URL from where login credentials can be fetched
 * @property {Boolean} [discover_connection_methods=true]
 * @property {RegExp} [geouri_regex]
 * @property {RegExp} [geouri_replacement='https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2']
 * @property {String} [i18n]
 * @property {String} [jid]
 * @property {Boolean} [keepalive=true]
 * @property {('debug'|'info'|'eror')} [loglevel='info']
 * @property {Array<String>} [locales]
 * @property {String} [nickname]
 * @property {String} [password]
 * @property {('IndexedDB'|'localStorage')} [persistent_store='IndexedDB']
 * @property {String} [rid]
 * @property {Element} [root=window.document]
 * @property {String} [sid]
 * @property {Boolean} [singleton=false]
 * @property {Boolean} [strict_plugin_dependencies=false]
 * @property {('fullscreen'|'embedded'|'overlayed')} [view_mode='fullscreen']
 * @property {String} [websocket_url]
 * @property {Array<String>} [whitelisted_plugins]
 */ const DEFAULT_SETTINGS = {
    allow_non_roster_messaging: true,
    allow_url_history_change: true,
    assets_path: '/dist',
    authentication: 'login',
    auto_login: false,
    auto_reconnect: true,
    blacklisted_plugins: [],
    clear_cache_on_logout: false,
    connection_options: {},
    credentials_url: null,
    disable_effects: false,
    discover_connection_methods: true,
    embed_3rd_party_media_players: true,
    geouri_regex: /https\:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,
    geouri_replacement: 'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2',
    i18n: undefined,
    jid: undefined,
    reuse_scram_keys: true,
    keepalive: true,
    loglevel: 'info',
    locales: [
        'af',
        'ar',
        'bg',
        'ca',
        'cs',
        'da',
        'de',
        'el',
        'en',
        'eo',
        'es',
        'eu',
        'fa',
        'fi',
        'fr',
        'gl',
        'he',
        'hi',
        'hu',
        'id',
        'it',
        'ja',
        'lt',
        'mr',
        'nb',
        'nl',
        'oc',
        'pl',
        'pt',
        'pt_BR',
        'ro',
        'ru',
        'sv',
        'ta',
        'th',
        'tr',
        'ug',
        'uk',
        'vi',
        'zh_CN',
        'zh_TW'
    ],
    nickname: undefined,
    password: undefined,
    persistent_store: 'IndexedDB',
    rid: undefined,
    root: window.document,
    sid: undefined,
    singleton: false,
    strict_plugin_dependencies: false,
    stanza_timeout: 60000,
    view_mode: 'fullscreen',
    websocket_url: undefined,
    whitelisted_plugins: []
};


/***/ }),

/***/ "./src/headless/shared/settings/user/api.js":
/*!**************************************************!*\
  !*** ./src/headless/shared/settings/user/api.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   user_settings_api: () => (/* binding */ user_settings_api)
/* harmony export */ });
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./src/headless/shared/settings/user/utils.js");
/**
 * @typedef {import('@converse/skeletor').Model} Model
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

/**
 * API for accessing and setting user settings. User settings are
 * different from the application settings from {@link _converse.api.settings}
 * because they are per-user and set via user action.
 * @namespace _converse.api.user.settings
 * @memberOf _converse.api.user
 */ const user_settings_api = {
    /**
     * Returns the user settings model. Useful when you want to listen for change events.
     * @async
     * @method _converse.api.user.settings.getModel
     * @returns {Promise<Model>}
     * @example const settings = await api.user.settings.getModel();
     */ getModel () {
        return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getUserSettings)();
    },
    /**
     * Get the value of a particular user setting.
     * @method _converse.api.user.settings.get
     * @param {string} key - The setting name
     * @param {*} [fallback] - An optional fallback value if the user setting is undefined
     * @returns {Promise} Promise which resolves with the value of the particular configuration setting.
     * @example api.user.settings.get("foo");
     */ get (key, fallback) {
        return _async_to_generator(function*() {
            const user_settings = yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.getUserSettings)();
            return user_settings.get(key) === undefined ? fallback : user_settings.get(key);
        })();
    },
    /**
     * Set one or many user settings.
     * @async
     * @method _converse.api.user.settings.set
     * @param {Object|string} key An object containing config settings or alternatively a string key
     * @param {string} [val] The value, if the previous parameter is a key
     * @example api.user.settings.set("foo", "bar");
     * @example
     * api.user.settings.set({
     *     "foo": "bar",
     *     "baz": "buz"
     * });
     */ set (key, val) {
        if (key instanceof Object) {
            return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.updateUserSettings)(key, {
                'promise': true
            });
        } else {
            const o = {};
            o[key] = val;
            return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.updateUserSettings)(o, {
                'promise': true
            });
        }
    },
    /**
     * Clears all the user settings
     * @async
     * @method api.user.settings.clear
     */ clear () {
        return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.clearUserSettings)();
    }
};


/***/ }),

/***/ "./src/headless/shared/settings/user/utils.js":
/*!****************************************************!*\
  !*** ./src/headless/shared/settings/user/utils.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clearUserSettings: () => (/* binding */ clearUserSettings),
/* harmony export */   getUserSettings: () => (/* binding */ getUserSettings),
/* harmony export */   updateUserSettings: () => (/* binding */ updateUserSettings)
/* harmony export */ });
/* harmony import */ var _converse_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _utils_storage_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/storage.js */ "./src/headless/utils/storage.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




let user_settings; // User settings, populated via api.users.settings
/**
 * @returns {Promise<void>|void} A promise when the user settings object
 *  is created anew and it's contents fetched from storage.
 */ function initUserSettings() {
    const bare_jid = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
    if (!bare_jid) {
        const msg = "No JID to fetch user settings for";
        _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error(msg);
        throw Error(msg);
    }
    const id = `converse.user-settings.${bare_jid}`;
    if ((user_settings === null || user_settings === void 0 ? void 0 : user_settings.get('id')) !== id) {
        user_settings = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model({
            id
        });
        (0,_utils_storage_js__WEBPACK_IMPORTED_MODULE_3__.initStorage)(user_settings, id);
        return user_settings.fetch({
            'promise': true
        });
    }
}
function getUserSettings() {
    return _async_to_generator(function*() {
        yield initUserSettings();
        return user_settings;
    })();
}
function updateUserSettings(data, options) {
    return _async_to_generator(function*() {
        yield initUserSettings();
        return user_settings.save(data, options);
    })();
}
function clearUserSettings() {
    return _async_to_generator(function*() {
        const bare_jid = _converse_js__WEBPACK_IMPORTED_MODULE_0__["default"].session.get('bare_jid');
        if (bare_jid) {
            yield initUserSettings();
            return user_settings.clear();
        }
        user_settings = undefined;
    })();
}


/***/ }),

/***/ "./src/headless/shared/settings/utils.js":
/*!***********************************************!*\
  !*** ./src/headless/shared/settings/utils.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extendAppSettings: () => (/* binding */ extendAppSettings),
/* harmony export */   getAppSetting: () => (/* binding */ getAppSetting),
/* harmony export */   getAppSettings: () => (/* binding */ getAppSettings),
/* harmony export */   getInitSettings: () => (/* binding */ getInitSettings),
/* harmony export */   initAppSettings: () => (/* binding */ initAppSettings),
/* harmony export */   registerListener: () => (/* binding */ registerListener),
/* harmony export */   unregisterListener: () => (/* binding */ unregisterListener),
/* harmony export */   updateAppSettings: () => (/* binding */ updateAppSettings)
/* harmony export */ });
/* harmony import */ var lodash_es_isEqual_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es/isEqual.js */ "./node_modules/lodash-es/isEqual.js");
/* harmony import */ var lodash_es_pick__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es/pick */ "./node_modules/lodash-es/pick.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ "./src/headless/shared/settings/constants.js");
/* harmony import */ var _utils_object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/object.js */ "./src/headless/utils/object.js");





let app_settings;
let init_settings = {}; // Container for settings passed in via converse.initialize
class AppSettings extends (0,_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.EventEmitter)(Object) {
}
function getAppSettings() {
    return app_settings;
}
function initAppSettings(settings) {
    init_settings = settings;
    app_settings = new AppSettings();
    // Allow only whitelisted settings to be overwritten via converse.initialize
    const allowed_settings = (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_3__["default"])(settings, Object.keys(_constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SETTINGS));
    Object.assign(app_settings, _constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SETTINGS, allowed_settings);
}
function getInitSettings() {
    return init_settings;
}
function getAppSetting(key) {
    if (Object.keys(_constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SETTINGS).includes(key)) {
        return app_settings[key];
    }
}
function extendAppSettings(settings) {
    (0,_utils_object_js__WEBPACK_IMPORTED_MODULE_2__.merge)(_constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SETTINGS, settings);
    // When updating the settings, we need to avoid overwriting the
    // initialization_settings (i.e. the settings passed in via converse.initialize).
    const allowed_keys = Object.keys(settings).filter((k)=>k in _constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SETTINGS);
    const allowed_site_settings = (0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_3__["default"])(init_settings, allowed_keys);
    const updated_settings = Object.assign((0,lodash_es_pick__WEBPACK_IMPORTED_MODULE_3__["default"])(settings, allowed_keys), allowed_site_settings);
    (0,_utils_object_js__WEBPACK_IMPORTED_MODULE_2__.merge)(app_settings, updated_settings);
}
/**
 * @param {string} name
 * @param {Function} func
 * @param {any} context
 */ function registerListener(name, func, context) {
    app_settings.on(name, func, context);
}
/**
 * @param {string} name
 * @param {Function} func
 */ function unregisterListener(name, func) {
    app_settings.off(name, func);
}
/**
 * @param {Object|string} key An object containing config settings or alternatively a string key
 * @param {string} [val] The value, if the previous parameter is a key
 */ function updateAppSettings(key, val) {
    if (key == null) return this; // eslint-disable-line no-eq-null
    let attrs;
    if (key instanceof Object) {
        attrs = key;
    } else if (typeof key === 'string') {
        attrs = {};
        attrs[key] = val;
    }
    const allowed_keys = Object.keys(attrs).filter((k)=>k in _constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SETTINGS);
    const changed = {};
    allowed_keys.forEach((k)=>{
        const val = attrs[k];
        if (!(0,lodash_es_isEqual_js__WEBPACK_IMPORTED_MODULE_4__["default"])(app_settings[k], val)) {
            changed[k] = val;
            app_settings[k] = val;
        }
    });
    Object.keys(changed).forEach((k)=>app_settings.trigger('change:' + k, changed[k]));
    app_settings.trigger('change', changed);
}


/***/ }),

/***/ "./src/headless/utils/array.js":
/*!*************************************!*\
  !*** ./src/headless/utils/array.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   unique: () => (/* binding */ unique)
/* harmony export */ });
/**
 * @template {any} T
 * @param {Array<T>} arr
 * @returns {Array<T>} A new array containing only unique elements from the input array.
 */ function unique(arr) {
    return [
        ...new Set(arr)
    ];
}


/***/ }),

/***/ "./src/headless/utils/arraybuffer.js":
/*!*******************************************!*\
  !*** ./src/headless/utils/arraybuffer.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   appendArrayBuffer: () => (/* binding */ appendArrayBuffer),
/* harmony export */   arrayBufferToBase64: () => (/* binding */ arrayBufferToBase64),
/* harmony export */   arrayBufferToHex: () => (/* binding */ arrayBufferToHex),
/* harmony export */   arrayBufferToString: () => (/* binding */ arrayBufferToString),
/* harmony export */   base64ToArrayBuffer: () => (/* binding */ base64ToArrayBuffer),
/* harmony export */   hexToArrayBuffer: () => (/* binding */ hexToArrayBuffer),
/* harmony export */   stringToArrayBuffer: () => (/* binding */ stringToArrayBuffer)
/* harmony export */ });
function appendArrayBuffer(buffer1, buffer2) {
    const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
    tmp.set(new Uint8Array(buffer1), 0);
    tmp.set(new Uint8Array(buffer2), buffer1.byteLength);
    return tmp.buffer;
}
function arrayBufferToHex(ab) {
    // https://stackoverflow.com/questions/40031688/javascript-arraybuffer-to-hex#40031979
    return Array.prototype.map.call(new Uint8Array(ab), (x)=>('00' + x.toString(16)).slice(-2)).join('');
}
function arrayBufferToString(ab) {
    return new TextDecoder("utf-8").decode(ab);
}
function stringToArrayBuffer(string) {
    const bytes = new TextEncoder().encode(string);
    return bytes.buffer;
}
function arrayBufferToBase64(ab) {
    return btoa(new Uint8Array(ab).reduce((data, byte)=>data + String.fromCharCode(byte), ''));
}
function base64ToArrayBuffer(b64) {
    const binary_string = atob(b64);
    const len = binary_string.length;
    const bytes = new Uint8Array(len);
    for(let i = 0; i < len; i++){
        bytes[i] = binary_string.charCodeAt(i);
    }
    return bytes.buffer;
}
function hexToArrayBuffer(hex) {
    const typedArray = new Uint8Array(hex.match(/[\da-f]{2}/gi).map((h)=>parseInt(h, 16)));
    return typedArray.buffer;
}


/***/ }),

/***/ "./src/headless/utils/color.js":
/*!*************************************!*\
  !*** ./src/headless/utils/color.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   colorize: () => (/* binding */ colorize)
/* harmony export */ });
/* harmony import */ var hsluv__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hsluv */ "./node_modules/hsluv/dist/hsluv.mjs");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

const cache = new Map();
/**
 * Computes an RGB color as specified in XEP-0392
 * https://xmpp.org/extensions/xep-0392.html
 *
 * @param {string} s JID or nickname to colorize
 * @returns {Promise<string>}
 */ function colorize(s) {
    return _async_to_generator(function*() {
        // We cache results in `cache`, to avoid unecessary computing (as it can be called very often)
        const v = cache.get(s);
        if (v) return v;
        // Run the input through SHA-1
        const digest = Array.from(new Uint8Array((yield crypto.subtle.digest('SHA-1', new TextEncoder().encode(s)))));
        // Treat the output as little endian and extract the least-significant 16 bits.
        // (These are the first two bytes of the output, with the second byte being the most significant one.)
        // Divide the value by 65536 (use float division) and multiply it by 360 (to map it to degrees in a full circle).
        const angle = (digest[0] + digest[1] * 256) / 65536.0 * 360;
        // Convert HSLuv angle to RGB Hex notation
        const hsluv = new hsluv__WEBPACK_IMPORTED_MODULE_0__.Hsluv();
        hsluv.hsluv_h = angle;
        hsluv.hsluv_s = 100;
        hsluv.hsluv_l = 50;
        hsluv.hsluvToHex();
        cache.set(s, hsluv.hex);
        return hsluv.hex;
    })();
}


/***/ }),

/***/ "./src/headless/utils/form.js":
/*!************************************!*\
  !*** ./src/headless/utils/form.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getCurrentWord: () => (/* binding */ getCurrentWord),
/* harmony export */   getSelectValues: () => (/* binding */ getSelectValues),
/* harmony export */   isMentionBoundary: () => (/* binding */ isMentionBoundary),
/* harmony export */   placeCaretAtEnd: () => (/* binding */ placeCaretAtEnd),
/* harmony export */   replaceCurrentWord: () => (/* binding */ replaceCurrentWord),
/* harmony export */   webForm2xForm: () => (/* binding */ webForm2xForm)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description This is the form utilities module.
 */ 
/**
 * @param {string} name
 * @param {string|string[]} value
 */ const tplXformField = (name, value)=>`<field var="${name}">${value}</field>`;
/** @param {string} value */ const tplXformValue = (value)=>`<value>${strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.xmlescape(value)}</value>`;
/**
 * @param {HTMLSelectElement} select
 * @return {string[]}
 */ function getSelectValues(select) {
    const result = [];
    const options = select === null || select === void 0 ? void 0 : select.options;
    for(let i = 0, iLen = options.length; i < iLen; i++){
        const opt = options[i];
        if (opt.selected) {
            result.push(opt.value || opt.text);
        }
    }
    return result;
}
/**
 * Takes an HTML DOM and turns it into an XForm field.
 * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} field - the field to convert
 * @return {Element}
 */ function webForm2xForm(field) {
    const name = field.getAttribute('name');
    if (!name) {
        return null; // See #1924
    }
    let value;
    if (field.getAttribute('type') === 'checkbox') {
        value = /** @type {HTMLInputElement} */ field.checked && '1' || '0';
    } else if (field.tagName == 'TEXTAREA') {
        value = field.value.split('\n').filter((s)=>s.trim());
    } else if (field.tagName == 'SELECT') {
        value = getSelectValues(/** @type {HTMLSelectElement} */ field);
    } else {
        value = field.value;
    }
    return (0,strophe_js__WEBPACK_IMPORTED_MODULE_0__.toStanza)(tplXformField(name, Array.isArray(value) ? value.map(tplXformValue) : tplXformValue(value)));
}
/**
 * Returns the current word being written in the input element
 * @method u#getCurrentWord
 * @param {HTMLInputElement|HTMLTextAreaElement} input - The HTMLElement in which text is being entered
 * @param {number} [index] - An optional rightmost boundary index. If given, the text
 *  value of the input element will only be considered up until this index.
 * @param {string|RegExp} [delineator] - An optional string delineator to
 *  differentiate between words.
 */ function getCurrentWord(input, index, delineator) {
    if (!index) {
        index = input.selectionEnd || undefined;
    }
    let [word] = input.value.slice(0, index).split(/\s/).slice(-1);
    if (delineator) {
        [word] = word.split(delineator).slice(-1);
    }
    return word;
}
/**
 * @param {string} s
 */ function isMentionBoundary(s) {
    return s !== '@' && RegExp(`(\\p{Z}|\\p{P})`, 'u').test(s);
}
/**
 * @param {HTMLInputElement} input - The HTMLElement in which text is being entered
 * @param {string} new_value
 */ function replaceCurrentWord(input, new_value) {
    const caret = input.selectionEnd || undefined;
    const current_word = input.value.slice(0, caret).split(/\s/).pop();
    const value = input.value;
    const mention_boundary = isMentionBoundary(current_word[0]) ? current_word[0] : '';
    input.value = value.slice(0, caret - current_word.length) + mention_boundary + `${new_value} ` + value.slice(caret);
    const selection_end = caret - current_word.length + new_value.length + 1;
    input.selectionEnd = mention_boundary ? selection_end + 1 : selection_end;
}
/**
 * @param {HTMLTextAreaElement} textarea
 */ function placeCaretAtEnd(textarea) {
    if (textarea !== document.activeElement) {
        textarea.focus();
    }
    // Double the length because Opera is inconsistent about whether a carriage return is one character or two.
    const len = textarea.value.length * 2;
    // Timeout seems to be required for Blink
    setTimeout(()=>textarea.setSelectionRange(len, len), 1);
    // Scroll to the bottom, in case we're in a tall textarea
    // (Necessary for Firefox and Chrome)
    textarea.scrollTop = 999999;
}


/***/ }),

/***/ "./src/headless/utils/html.js":
/*!************************************!*\
  !*** ./src/headless/utils/html.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   decodeHTMLEntities: () => (/* binding */ decodeHTMLEntities),
/* harmony export */   isElement: () => (/* binding */ isElement),
/* harmony export */   isTagEqual: () => (/* binding */ isTagEqual),
/* harmony export */   queryChildren: () => (/* binding */ queryChildren),
/* harmony export */   siblingIndex: () => (/* binding */ siblingIndex),
/* harmony export */   stringToElement: () => (/* binding */ stringToElement)
/* harmony export */ });
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.es.mjs");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");


/**
 * @param {unknown} el
 * @returns {boolean}
 */ function isElement(el) {
    return el instanceof Element || el instanceof HTMLDocument;
}
/**
 * @param {Element | typeof Strophe.Builder} stanza
 * @param {string} name
 * @returns {boolean}
 */ function isTagEqual(stanza, name) {
    if (stanza instanceof strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.Builder) {
        return isTagEqual(stanza.tree(), name);
    } else if (!(stanza instanceof Element)) {
        throw Error("isTagEqual called with value which isn't " + "an element or Strophe.Builder instance");
    } else {
        return strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.isTagEqual(stanza, name);
    }
}
/**
 * Converts an HTML string into a DOM element.
 * Expects that the HTML string has only one top-level element,
 * i.e. not multiple ones.
 * @method u#stringToElement
 * @param {string} s - The HTML string
 */ function stringToElement(s) {
    var div = document.createElement('div');
    div.innerHTML = s;
    return div.firstElementChild;
}
/**
 * Returns a list of children of the DOM element that match the selector.
 * @method u#queryChildren
 * @param {HTMLElement} el - the DOM element
 * @param {string} selector - the selector they should be matched against
 */ function queryChildren(el, selector) {
    return Array.from(el.childNodes).filter((el)=>el instanceof Element && el.matches(selector));
}
/**
 * @param {Element} el - the DOM element
 * @return {number}
 */ function siblingIndex(el) {
    /* eslint-disable no-cond-assign */ for(var i = 0; el = el.previousElementSibling; i++);
    return i;
}
const element = document.createElement('div');
/**
 * @param {string} str
 * @return {string}
 */ function decodeHTMLEntities(str) {
    if (str && typeof str === 'string') {
        element.innerHTML = dompurify__WEBPACK_IMPORTED_MODULE_0__["default"].sanitize(str);
        str = element.textContent;
        element.textContent = '';
    }
    return str;
}


/***/ }),

/***/ "./src/headless/utils/index.js":
/*!*************************************!*\
  !*** ./src/headless/utils/index.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   getRandomInt: () => (/* binding */ getRandomInt),
/* harmony export */   getUniqueId: () => (/* binding */ getUniqueId),
/* harmony export */   isEmptyMessage: () => (/* binding */ isEmptyMessage),
/* harmony export */   prefixMentions: () => (/* binding */ prefixMentions),
/* harmony export */   setLogLevelFromRoute: () => (/* binding */ setLogLevelFromRoute)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ "./src/headless/utils/array.js");
/* harmony import */ var _arraybuffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./arraybuffer.js */ "./src/headless/utils/arraybuffer.js");
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./color.js */ "./src/headless/utils/color.js");
/* harmony import */ var _form_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./form.js */ "./src/headless/utils/form.js");
/* harmony import */ var _html_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./html.js */ "./src/headless/utils/html.js");
/* harmony import */ var _init_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./init.js */ "./src/headless/utils/init.js");
/* harmony import */ var _jid__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./jid */ "./src/headless/utils/jid.js");
/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./object.js */ "./src/headless/utils/object.js");
/* harmony import */ var _promise_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./promise.js */ "./src/headless/utils/promise.js");
/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _stanza_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./stanza.js */ "./src/headless/utils/stanza.js");
/* harmony import */ var _storage_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./text.js */ "./src/headless/utils/text.js");
/* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./url.js */ "./src/headless/utils/url.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description This is the core utilities module.
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
















/**
 * @typedef {Record<string, Function>} CommonUtils
 * @typedef {Record<'muc'|'mam', CommonUtils>} PluginUtils
 *
 * The utils object
 * @namespace u
 * @type {CommonUtils & PluginUtils}
 */ const u = {
    muc: null,
    mam: null
};
/**
 * @param {Event} [event]
 */ function setLogLevelFromRoute(event) {
    if (location.hash.startsWith('#converse?loglevel=')) {
        event === null || event === void 0 ? void 0 : event.preventDefault();
        const level = location.hash.split('=').pop();
        if (Object.keys(_converse_log__WEBPACK_IMPORTED_MODULE_1__.LEVELS).includes(level)) {
            _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].setLogLevel(/** @type {keyof LEVELS} */ level);
        } else {
            _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error(`Could not set loglevel of ${level}`);
        }
    }
}
function isEmptyMessage(attrs) {
    if (attrs instanceof _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model) {
        attrs = attrs.attributes;
    }
    return !attrs['oob_url'] && !attrs['file'] && !(attrs['is_encrypted'] && attrs['plaintext']) && !attrs['message'] && !attrs['body'];
}
/**
 * Given a message object, return its text with @ chars
 * inserted before the mentioned nicknames.
 * @param {import('../shared/message').default} message
 */ function prefixMentions(message) {
    let text = message.getMessageText();
    (message.get('references') || []).sort((a, b)=>b.begin - a.begin).forEach((ref)=>{
        text = `${text.slice(0, ref.begin)}@${text.slice(ref.begin)}`;
    });
    return text;
}
function shouldCreateMessage(attrs) {
    return attrs['retracted'] || // Retraction received *before* the message
    !isEmptyMessage(attrs);
}
/**
 * Call the callback once all the events have been triggered
 * @param { Array } events: An array of objects, with keys `object` and
 *   `event`, representing the event name and the object it's triggered upon.
 * @param { Function } callback: The function to call once all events have
 *    been triggered.
 */ function onMultipleEvents(events = [], callback) {
    let triggered = [];
    function handler(result) {
        triggered.push(result);
        if (events.length === triggered.length) {
            callback(triggered);
            triggered = [];
        }
    }
    events.forEach((e)=>e.object.on(e.event, handler));
}
/**
 * @param {Element} el
 * @param {string} name
 * @param {string} [type]
 * @param {boolean} [bubbles]
 * @param {boolean} [cancelable]
 */ function triggerEvent(el, name, type = "Event", bubbles = true, cancelable = true) {
    const evt = document.createEvent(type);
    evt.initEvent(name, bubbles, cancelable);
    el.dispatchEvent(evt);
}
function getRandomInt(max) {
    return Math.random() * max | 0;
}
/**
 * @param {string} [suffix]
 * @return {string}
 */ function getUniqueId(suffix) {
    var _crypto_randomUUID, _crypto;
    var _crypto_randomUUID1;
    const uuid = (_crypto_randomUUID1 = (_crypto_randomUUID = (_crypto = crypto).randomUUID) === null || _crypto_randomUUID === void 0 ? void 0 : _crypto_randomUUID.call(_crypto)) !== null && _crypto_randomUUID1 !== void 0 ? _crypto_randomUUID1 : 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c)=>{
        const r = getRandomInt(16);
        const v = c === 'x' ? r : r & 0x3 | 0x8;
        return v.toString(16);
    });
    if (typeof suffix === "string" || typeof suffix === "number") {
        return uuid + ":" + suffix;
    } else {
        return uuid;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Object.assign(_object_spread_props(_object_spread({}, _array_js__WEBPACK_IMPORTED_MODULE_2__, _arraybuffer_js__WEBPACK_IMPORTED_MODULE_3__, _color_js__WEBPACK_IMPORTED_MODULE_4__, _form_js__WEBPACK_IMPORTED_MODULE_5__, _html_js__WEBPACK_IMPORTED_MODULE_6__, _init_js__WEBPACK_IMPORTED_MODULE_7__, _jid__WEBPACK_IMPORTED_MODULE_8__, _object_js__WEBPACK_IMPORTED_MODULE_9__, _promise_js__WEBPACK_IMPORTED_MODULE_10__, _session_js__WEBPACK_IMPORTED_MODULE_11__, _stanza_js__WEBPACK_IMPORTED_MODULE_12__, _storage_js__WEBPACK_IMPORTED_MODULE_13__, _text_js__WEBPACK_IMPORTED_MODULE_14__, _url_js__WEBPACK_IMPORTED_MODULE_15__), {
    getRandomInt,
    getUniqueId,
    isEmptyMessage,
    onMultipleEvents,
    prefixMentions,
    shouldCreateMessage,
    triggerEvent
}), u));


/***/ }),

/***/ "./src/headless/utils/init.js":
/*!************************************!*\
  !*** ./src/headless/utils/init.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   attemptNonPreboundSession: () => (/* binding */ attemptNonPreboundSession),
/* harmony export */   cleanup: () => (/* binding */ cleanup),
/* harmony export */   initClientConfig: () => (/* binding */ initClientConfig),
/* harmony export */   initPersistentStorage: () => (/* binding */ initPersistentStorage),
/* harmony export */   initPlugins: () => (/* binding */ initPlugins),
/* harmony export */   initSession: () => (/* binding */ initSession),
/* harmony export */   initSessionStorage: () => (/* binding */ initSessionStorage),
/* harmony export */   registerGlobalEventHandlers: () => (/* binding */ registerGlobalEventHandlers),
/* harmony export */   safeSave: () => (/* binding */ safeSave),
/* harmony export */   savedLoginInfo: () => (/* binding */ savedLoginInfo),
/* harmony export */   setUserJID: () => (/* binding */ setUserJID)
/* harmony export */ });
/* harmony import */ var _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor/src/storage.js */ "./node_modules/@converse/skeletor/src/storage.js");
/* harmony import */ var _shared_converse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/_converse */ "./src/headless/shared/_converse.js");
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var localforage_webextensionstorage_driver_local__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! localforage-webextensionstorage-driver/local */ "./node_modules/localforage-webextensionstorage-driver/local.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var localforage_webextensionstorage_driver_sync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! localforage-webextensionstorage-driver/sync */ "./node_modules/localforage-webextensionstorage-driver/sync.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/constants.js */ "./src/headless/shared/constants.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _storage_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./storage.js */ "./src/headless/utils/storage.js");
/* harmony import */ var _shared_connection_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/connection/utils */ "./src/headless/shared/connection/utils.js");
/* harmony import */ var _jid_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./jid.js */ "./src/headless/utils/jid.js");
/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./session.js */ "./src/headless/utils/session.js");
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./object */ "./src/headless/utils/object.js");
/**
 * @typedef {module:shared.converse.ConversePrivateGlobal} ConversePrivateGlobal
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}














/**
 * Initializes the plugins for the Converse instance.
 * @param {ConversePrivateGlobal} _converse
 * @fires _converse#pluginsInitialized - Triggered once all plugins have been initialized.
 * @memberOf _converse
 */ function initPlugins(_converse) {
    // If initialize gets called a second time (e.g. during tests), then we
    // need to re-apply all plugins (for a new converse instance), and we
    // therefore need to clear this array that prevents plugins from being
    // initialized twice.
    // If initialize is called for the first time, then this array is empty
    // in any case.
    _converse.pluggable.initialized_plugins = [];
    const whitelist = _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.CORE_PLUGINS.concat(_converse.api.settings.get("whitelisted_plugins"));
    if (_converse.api.settings.get("singleton")) {
        [
            "converse-bookmarks",
            "converse-controlbox",
            "converse-headline",
            "converse-register"
        ].forEach((name)=>_converse.api.settings.get("blacklisted_plugins").push(name));
    }
    _converse.pluggable.initializePlugins({
        _converse
    }, whitelist, _converse.api.settings.get("blacklisted_plugins"));
    /**
     * Triggered once all plugins have been initialized. This is a useful event if you want to
     * register event handlers but would like your own handlers to be overridable by
     * plugins. In that case, you need to first wait until all plugins have been
     * initialized, so that their overrides are active. One example where this is used
     * is in [converse-notifications.js](https://github.com/jcbrand/converse.js/blob/master/src/converse-notification.js)`.
     *
     * Also available as an [ES2015 Promise](http://es6-features.org/#PromiseUsage)
     * which can be listened to with `_converse.api.waitUntil`.
     *
     * @event _converse#pluginsInitialized
     * @memberOf _converse
     * @example _converse.api.listen.on('pluginsInitialized', () => { ... });
     */ _converse.api.trigger("pluginsInitialized");
}
/**
 * @param {ConversePrivateGlobal} _converse
 */ function initClientConfig(_converse) {
    return _async_to_generator(function*() {
        /* The client config refers to configuration of the client which is
     * independent of any particular user.
     * What this means is that config values need to persist across
     * user sessions.
     */ const id = "converse.client-config";
        const config = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_6__.Model({
            id,
            "trusted": true
        });
        config.browserStorage = (0,_storage_js__WEBPACK_IMPORTED_MODULE_8__.createStore)(id, "session");
        Object.assign(_converse, {
            config
        }); // XXX DEPRECATED
        Object.assign(_converse.state, {
            config
        });
        yield new Promise((r)=>config.fetch({
                "success": r,
                "error": r
            }));
        /**
     * Triggered once the XMPP-client configuration has been initialized.
     * The client configuration is independent of any particular and its values
     * persist across user sessions.
     *
     * @event _converse#clientConfigInitialized
     * @example
     * _converse.api.listen.on('clientConfigInitialized', () => { ... });
     */ _converse.api.trigger("clientConfigInitialized");
    })();
}
/**
 * @param {ConversePrivateGlobal} _converse
 */ function initSessionStorage(_converse) {
    return _async_to_generator(function*() {
        yield _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].sessionStorageInitialized;
        _converse.storage["session"] = _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.createInstance({
            name: (0,_session_js__WEBPACK_IMPORTED_MODULE_11__.isTestEnv)() ? "converse-test-session" : "converse-session",
            description: "sessionStorage instance",
            driver: [
                "sessionStorageWrapper"
            ]
        });
    })();
}
/**
 * Initializes persistent storage
 * @param {ConversePrivateGlobal} _converse
 * @param {string} store_name - The name of the store.
 * @param {string} [key="persistent"] - The key for `_converse.storage`.
 */ function initPersistentStorage(_converse, store_name, key = "persistent") {
    const { api } = _converse;
    if (api.settings.get("persistent_store") === "sessionStorage") {
        _converse.storage[key] = _converse.storage["session"];
        return;
    } else if (api.settings.get("persistent_store") === "BrowserExtLocal") {
        _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.defineDriver(localforage_webextensionstorage_driver_local__WEBPACK_IMPORTED_MODULE_2__["default"]).then(()=>_converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.setDriver("webExtensionLocalStorage"));
        _converse.storage[key] = _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage;
        return;
    } else if (api.settings.get("persistent_store") === "BrowserExtSync") {
        _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.defineDriver(localforage_webextensionstorage_driver_sync__WEBPACK_IMPORTED_MODULE_4__["default"]).then(()=>_converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.setDriver("webExtensionSyncStorage"));
        _converse.storage[key] = _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage;
        return;
    }
    const config = {
        name: (0,_session_js__WEBPACK_IMPORTED_MODULE_11__.isTestEnv)() ? "converse-test-persistent" : "converse-persistent",
        storeName: store_name
    };
    if (api.settings.get("persistent_store") === "localStorage") {
        config["description"] = "localStorage instance";
        config["driver"] = [
            _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.LOCALSTORAGE
        ];
    } else if (api.settings.get("persistent_store") === "IndexedDB") {
        config["description"] = "indexedDB instance";
        config["driver"] = [
            _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.INDEXEDDB
        ];
    }
    _converse.storage[key] = _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"].localForage.createInstance(config);
}
/**
 * @param {ConversePrivateGlobal} _converse
 * @param {string} jid
 */ function saveJIDtoSession(_converse, jid) {
    const { api, session } = _converse;
    if (api.settings.get("authentication") !== _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.ANONYMOUS && !strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.getResourceFromJid(jid)) {
        jid = jid.toLowerCase() + (0,_shared_connection_utils__WEBPACK_IMPORTED_MODULE_9__.generateResource)();
    }
    const bare_jid = strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.getBareJidFromJid(jid);
    const resource = strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.getResourceFromJid(jid);
    const domain = strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.getDomainFromJid(jid);
    // TODO: Storing directly on _converse is deprecated
    Object.assign(_converse, {
        jid,
        bare_jid,
        resource,
        domain
    });
    session.save({
        jid,
        bare_jid,
        resource,
        domain,
        // We use the `active` flag to determine whether we should use the values from sessionStorage.
        // When "cloning" a tab (e.g. via middle-click), the `active` flag will be set and we'll create
        // a new empty user session, otherwise it'll be false and we can re-use the user session.
        // When the tab is reloaded, the `active` flag is set to `false`.
        "active": true
    });
    // Set JID on the connection object so that when we call `connection.bind`
    // the new resource is found by Strophe.js and sent to the XMPP server.
    api.connection.get().jid = jid;
}
/**
 * Stores the passed in JID for the current user, potentially creating a
 * resource if the JID is bare.
 *
 * Given that we can only create an XMPP connection if we know the domain of
 * the server connect to and we only know this once we know the JID, we also
 * call {@link api.connection.init} (if necessary) to make sure that the
 * connection is set up.
 *
 * @emits _converse#setUserJID
 * @param {string} jid
 */ function setUserJID(jid) {
    return _async_to_generator(function*() {
        yield initSession(_shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"], jid);
        /**
     * Triggered whenever the user's JID has been updated
     * @event _converse#setUserJID
     */ _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].api.trigger("setUserJID");
        return jid;
    })();
}
/**
 * @param {ConversePrivateGlobal} _converse
 * @param {string} jid
 */ function initSession(_converse, jid) {
    return _async_to_generator(function*() {
        var _converse_session;
        const is_shared_session = _converse.api.settings.get("connection_options").worker;
        const bare_jid = strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.getBareJidFromJid(jid).toLowerCase();
        const id = `converse.session-${bare_jid}`;
        if (((_converse_session = _converse.session) === null || _converse_session === void 0 ? void 0 : _converse_session.get("id")) !== id) {
            initPersistentStorage(_converse, bare_jid);
            _converse.session.set({
                id
            });
            (0,_storage_js__WEBPACK_IMPORTED_MODULE_8__.initStorage)(_converse.session, id, is_shared_session ? "persistent" : "session");
            yield new Promise((r)=>_converse.session.fetch({
                    success: r,
                    error: r
                }));
            if (!is_shared_session && _converse.session.get("active")) {
                // If the `active` flag is set, it means this tab was cloned from
                // another (e.g. via middle-click), and its session data was copied over.
                _converse.session.clear();
                _converse.session.save({
                    id
                });
            }
            saveJIDtoSession(_converse, jid);
            // Set `active` flag to false when the tab gets reloaded
            window.addEventListener((0,_session_js__WEBPACK_IMPORTED_MODULE_11__.getUnloadEvent)(), ()=>safeSave(_converse.session, {
                    active: false
                }));
            /**
         * Triggered once the user's session has been initialized. The session is a
         * cache which stores information about the user's current session.
         * @event _converse#userSessionInitialized
         * @memberOf _converse
         */ _converse.api.trigger("userSessionInitialized");
        } else {
            saveJIDtoSession(_converse, jid);
        }
    })();
}
/**
 * @param {ConversePrivateGlobal} _converse
 */ function registerGlobalEventHandlers(_converse) {
    /**
     * Plugins can listen to this event as cue to register their
     * global event handlers.
     * @event _converse#registeredGlobalEventHandlers
     * @example _converse.api.listen.on('registeredGlobalEventHandlers', () => { ... });
     */ _converse.api.trigger("registeredGlobalEventHandlers");
}
/**
 * @param {ConversePrivateGlobal} _converse
 */ function unregisterGlobalEventHandlers(_converse) {
    _converse.api.trigger("unregisteredGlobalEventHandlers");
}
/**
 * Make sure everything is reset in case this is a subsequent call to
 * converse.initialize (happens during tests).
 * @param {ConversePrivateGlobal} _converse
 */ function cleanup(_converse) {
    return _async_to_generator(function*() {
        var _api_connection_get;
        const { api } = _converse;
        yield api.trigger("cleanup", {
            "synchronous": true
        });
        unregisterGlobalEventHandlers(_converse);
        (_api_connection_get = api.connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.reset();
        _converse.stopListening();
        _converse.off();
        if (_converse.promises["initialized"].isResolved) {
            api.promises.add("initialized");
        }
    })();
}
/**
 * Fetches login credentials from the server.
 * @param {number} [wait=0]
 *  The time to wait and debounce subsequent calls to this function before making the request.
 * @returns {Promise<import('./types').Credentials>}
 *  A promise that resolves with the provided login credentials (JID and password).
 * @throws {Error} If the request fails or returns an error status.
 */ function fetchLoginCredentials(wait = 0) {
    return new Promise((0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_13__["default"])((resolve, reject)=>_async_to_generator(function*() {
            let xhr = new XMLHttpRequest();
            xhr.open("GET", _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].api.settings.get("credentials_url"), true);
            xhr.setRequestHeader("Accept", "application/json, text/javascript");
            xhr.onload = ()=>{
                if (xhr.status >= 200 && xhr.status < 400) {
                    const data = JSON.parse(xhr.responseText);
                    setUserJID(data.jid).then(()=>{
                        resolve({
                            jid: data.jid,
                            password: data.password
                        });
                    });
                } else {
                    reject(new Error(`${xhr.status}: ${xhr.responseText}`));
                }
            };
            xhr.onerror = reject;
            /**
             * *Hook* which allows modifying the server request
             * @event _converse#beforeFetchLoginCredentials
             */ xhr = yield _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].api.hook("beforeFetchLoginCredentials", this, xhr);
            xhr.send();
        }).call(this), wait));
}
/**
 * @returns {Promise<import('./types').Credentials>}
 */ function getLoginCredentialsFromURL() {
    return _async_to_generator(function*() {
        let credentials;
        let wait = 0;
        while(!credentials){
            try {
                credentials = yield fetchLoginCredentials(wait); // eslint-disable-line no-await-in-loop
            } catch (e) {
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error("Could not fetch login credentials");
                _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
            }
            // If unsuccessful, we wait 2 seconds between subsequent attempts to
            // fetch the credentials.
            wait = 2000;
        }
        return credentials;
    })();
}
function getLoginCredentialsFromBrowser() {
    return _async_to_generator(function*() {
        const jid = localStorage.getItem("conversejs-session-jid");
        if (!jid) return null;
        try {
            const creds = yield navigator.credentials.get({
                password: true
            });
            if (creds && creds.type == "password" && (0,_jid_js__WEBPACK_IMPORTED_MODULE_10__.isValidJID)(creds.id)) {
                // XXX: We don't actually compare `creds.id` with `jid` because
                // the user might have been presented a list of credentials with
                // which to log in, and we want to respect their wish.
                yield setUserJID(creds.id);
                return {
                    "jid": creds.id,
                    "password": creds.password
                };
            }
        } catch (e) {
            _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].error(e);
            return null;
        }
    })();
}
function getLoginCredentialsFromSCRAMKeys() {
    return _async_to_generator(function*() {
        const jid = localStorage.getItem("conversejs-session-jid");
        if (!jid) return null;
        yield setUserJID(jid);
        const login_info = yield savedLoginInfo(jid);
        const scram_keys = login_info.get("scram_keys");
        return scram_keys ? {
            jid,
            password: scram_keys
        } : null;
    })();
}
/**
 * @param {import('./types').Credentials} [credentials]
 * @param {boolean} [automatic]
 */ function attemptNonPreboundSession(credentials, automatic) {
    return _async_to_generator(function*() {
        const { api } = _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"];
        /**
     * *Hook* to allow 3rd party plugins to provide their own login credentials.
     * @event _converse#beforeAttemptNonPreboundSession
     */ const { credentials: new_creds } = yield api.hook("beforeAttemptNonPreboundSession", this, {
            credentials,
            automatic
        });
        if (new_creds) return connect(new_creds);
        if (api.settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.LOGIN) {
            const jid = _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].session.get("jid");
            // XXX: If EITHER ``keepalive`` or ``auto_login`` is ``true`` and
            // ``authentication`` is set to ``login``, then Converse will try to log the user in,
            // since we don't have a way to distinguish between wether we're
            // restoring a previous session (``keepalive``) or whether we're
            // automatically setting up a new session (``auto_login``).
            // So we can't do the check (!automatic || _converse.api.settings.get("auto_login")) here.
            if (credentials) {
                return connect(credentials);
            } else if (api.settings.get("credentials_url")) {
                // We give credentials_url preference, because
                // connection.pass might be an expired token.
                return connect((yield getLoginCredentialsFromURL()));
            } else if (jid && (api.settings.get("password") || api.connection.get().pass)) {
                return connect();
            }
            if (api.settings.get("reuse_scram_keys")) {
                const credentials = yield getLoginCredentialsFromSCRAMKeys();
                if (credentials) return connect(credentials);
            }
            if (!(0,_session_js__WEBPACK_IMPORTED_MODULE_11__.isTestEnv)() && "credentials" in navigator) {
                const credentials = yield getLoginCredentialsFromBrowser();
                if (credentials) return connect(credentials);
            }
            if (!(0,_session_js__WEBPACK_IMPORTED_MODULE_11__.isTestEnv)()) _converse_log__WEBPACK_IMPORTED_MODULE_3__["default"].debug("attemptNonPreboundSession: Couldn't find credentials to log in with");
        } else if ([
            _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.ANONYMOUS,
            _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.EXTERNAL
        ].includes(api.settings.get("authentication")) && (!automatic || api.settings.get("auto_login"))) {
            connect();
        }
    }).call(this);
}
/**
 * Fetch the stored SCRAM keys for the given JID, if available.
 *
 * The user's plaintext password is not stored, nor any material from which
 * the user's plaintext password could be recovered.
 *
 * @param {String} jid - The XMPP address for which to fetch the SCRAM keys
 * @returns {Promise<Model>} A promise which resolves once we've fetched the previously
 *  used login keys.
 */ function savedLoginInfo(jid) {
    return _async_to_generator(function*() {
        var _converse_state_login_info;
        const id = `converse.scram-keys-${strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.getBareJidFromJid(jid)}`;
        if (((_converse_state_login_info = _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].state.login_info) === null || _converse_state_login_info === void 0 ? void 0 : _converse_state_login_info.get("id")) === id) {
            return _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].state.login_info;
        }
        const login_info = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_6__.Model({
            id
        });
        _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].state.login_info = login_info;
        (0,_storage_js__WEBPACK_IMPORTED_MODULE_8__.initStorage)(login_info, id, "persistent");
        yield new Promise((f)=>login_info.fetch({
                "success": f,
                "error": f
            }));
        return login_info;
    })();
}
/**
 * @param {Object} [credentials]
 * @param {string} credentials.password
 * @param {Object} credentials.password
 * @param {string} credentials.password.ck
 * @returns {Promise<void>}
 */ function connect(credentials) {
    return _async_to_generator(function*() {
        const { api } = _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"];
        const jid = _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].session.get("jid");
        const connection = api.connection.get();
        if ([
            _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.ANONYMOUS,
            _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.EXTERNAL
        ].includes(api.settings.get("authentication"))) {
            if (!jid) {
                throw new Error("Config Error: when using anonymous login " + "you need to provide the server's domain via the 'jid' option. " + "Either when calling converse.initialize, or when calling " + "_converse.api.user.login.");
            }
            if (!connection.reconnecting) {
                connection.reset();
            }
            connection.connect(jid.toLowerCase());
        } else if (api.settings.get("authentication") === _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.LOGIN) {
            var _credentials_password;
            const password = (_credentials_password = credentials === null || credentials === void 0 ? void 0 : credentials.password) !== null && _credentials_password !== void 0 ? _credentials_password : (connection === null || connection === void 0 ? void 0 : connection.pass) || api.settings.get("password");
            if (!password) {
                if (api.settings.get("auto_login")) {
                    throw new Error("autoLogin: If you use auto_login and " + "authentication='login' then you also need to provide a password.");
                }
                connection.setDisconnectionCause(strophe_js__WEBPACK_IMPORTED_MODULE_7__.Strophe.Status.AUTHFAIL, undefined, true);
                api.connection.disconnect();
                return;
            }
            if (!connection.reconnecting) {
                connection.reset();
                connection.service = (0,_shared_connection_utils__WEBPACK_IMPORTED_MODULE_9__.getConnectionServiceURL)();
            }
            let callback;
            // Save the SCRAM data if we're not already logged in with SCRAM
            if (_shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].state.config.get("trusted") && jid && api.settings.get("reuse_scram_keys") && !(password === null || password === void 0 ? void 0 : password.ck)) {
                // Store scram keys in scram storage
                const login_info = yield savedLoginInfo(jid);
                callback = /**
                 * @param {string} status
                 * @param {string} message
                 */ (status, message)=>{
                    const { scram_keys } = connection;
                    if (scram_keys) login_info.save({
                        scram_keys
                    });
                    connection.onConnectStatusChanged(status, message);
                };
            }
            connection.connect(jid, password, callback);
        }
    })();
}
/**
 * @param {Model} model
 * @param {Object} attributes
 * @param {Object} options
 */ function safeSave(model, attributes, options) {
    if ((0,_object__WEBPACK_IMPORTED_MODULE_12__.isPersistableModel)(model)) {
        model.save(attributes, options);
    } else {
        model.set(attributes, options);
    }
}


/***/ }),

/***/ "./src/headless/utils/jid.js":
/*!***********************************!*\
  !*** ./src/headless/utils/jid.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getJIDFromURI: () => (/* binding */ getJIDFromURI),
/* harmony export */   isOwnJID: () => (/* binding */ isOwnJID),
/* harmony export */   isSameBareJID: () => (/* binding */ isSameBareJID),
/* harmony export */   isSameDomain: () => (/* binding */ isSameDomain),
/* harmony export */   isValidJID: () => (/* binding */ isValidJID),
/* harmony export */   isValidMUCJID: () => (/* binding */ isValidMUCJID)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _shared_converse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/_converse */ "./src/headless/shared/_converse.js");


/**
 * @param {string|null} [jid]
 * @returns {boolean}
 */ function isValidJID(jid) {
    if (!(typeof jid === 'string')) {
        return false;
    }
    const num_slashes = jid.split('/').length - 1;
    if (num_slashes > 1) {
        return false;
    }
    return jid.split('@').filter((s)=>!!s).length === 2 && !jid.startsWith('@') && !jid.endsWith('@');
}
/**
 * @param {string} jid
 * @returns {boolean}
 */ function isValidMUCJID(jid) {
    return !jid.startsWith('@') && !jid.endsWith('@');
}
/**
 * @param {string} jid1
 * @param {string} jid2
 * @returns {boolean}
 */ function isSameBareJID(jid1, jid2) {
    if (typeof jid1 !== 'string' || typeof jid2 !== 'string') {
        return false;
    }
    return strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getBareJidFromJid(jid1).toLowerCase() === strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getBareJidFromJid(jid2).toLowerCase();
}
/**
 * @param {string} jid1
 * @param {string} jid2
 * @returns {boolean}
 */ function isSameDomain(jid1, jid2) {
    if (typeof jid1 !== 'string' || typeof jid2 !== 'string') {
        return false;
    }
    return strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getDomainFromJid(jid1).toLowerCase() === strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getDomainFromJid(jid2).toLowerCase();
}
/**
 * @param {string} jid
 */ function getJIDFromURI(jid) {
    return jid.startsWith('xmpp:') && jid.endsWith('?join') ? jid.replace(/^xmpp:/, '').replace(/\?join$/, '') : jid;
}
/**
 * @param {string} jid
 * @param {boolean} [include_resource=false]
 * @returns {boolean}
 */ function isOwnJID(jid, include_resource = false) {
    if (include_resource) {
        return jid === _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('full_jid');
    }
    return strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getBareJidFromJid(jid) === _shared_converse__WEBPACK_IMPORTED_MODULE_1__["default"].session.get('bare_jid');
}


/***/ }),

/***/ "./src/headless/utils/object.js":
/*!**************************************!*\
  !*** ./src/headless/utils/object.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isError: () => (/* binding */ isError),
/* harmony export */   isErrorObject: () => (/* binding */ isErrorObject),
/* harmony export */   isFunction: () => (/* binding */ isFunction),
/* harmony export */   isPersistableModel: () => (/* binding */ isPersistableModel),
/* harmony export */   isUndefined: () => (/* binding */ isUndefined),
/* harmony export */   merge: () => (/* binding */ merge)
/* harmony export */ });
/**
 * Merge the second object into the first one.
 * @param {Object} dst
 * @param {Object} src
 */ function merge(dst, src) {
    for(const k in src){
        if (!Object.prototype.hasOwnProperty.call(src, k)) continue;
        if (k === "__proto__" || k === "constructor") continue;
        if (dst[k] instanceof Object) {
            merge(dst[k], src[k]);
        } else {
            dst[k] = src[k];
        }
    }
}
/**
 * @param {unknown} obj - The object to check.
 * @returns {boolean} True if the object is an Error, false otherwise.
 */ function isError(obj) {
    return Object.prototype.toString.call(obj) === "[object Error]";
}
/**
 * @param {unknown} val - The value to check.
 * @returns {boolean} True if the value is a function, false otherwise.
 */ function isFunction(val) {
    return typeof val === "function";
}
/**
 * @param {unknown} x - The value to check.
 * @returns {boolean} True if the value is undefined, false otherwise.
 */ function isUndefined(x) {
    return typeof x === "undefined";
}
/**
 * @param {unknown} o - The value to check.
 * @returns {boolean} True if the value is an Error
 */ function isErrorObject(o) {
    return o instanceof Error;
}
/**
 * @param {import('@converse/skeletor').Model} model
 * @returns {boolean}
 */ function isPersistableModel(model) {
    var _model_collection;
    return model.browserStorage || ((_model_collection = model.collection) === null || _model_collection === void 0 ? void 0 : _model_collection.browserStorage);
}


/***/ }),

/***/ "./src/headless/utils/parse-helpers.js":
/*!*********************************************!*\
  !*** ./src/headless/utils/parse-helpers.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description Pure functions to help functionally parse messages.
 * @todo Other parsing helpers can be made more abstract and placed here.
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
const helpers = {};
const escapeRegexChars = (string, char)=>string.replace(RegExp('\\' + char, 'ig'), '\\' + char);
helpers.escapeCharacters = (characters)=>(string)=>characters.split('').reduce(escapeRegexChars, string);
helpers.escapeRegexString = helpers.escapeCharacters('[\\^$.?*+(){}|');
// `for` is ~25% faster than using `Array.find()`
helpers.findFirstMatchInArray = (array)=>(text)=>{
        for(let i = 0; i < array.length; i++){
            if (text.localeCompare(array[i], undefined, {
                sensitivity: 'base'
            }) === 0) {
                return array[i];
            }
        }
        return null;
    };
const reduceReferences = ([text, refs], ref, index)=>{
    let updated_text = text;
    let { begin, end } = ref;
    const { value } = ref;
    begin = begin - index;
    end = end - index - 1; // -1 to compensate for the removed @
    updated_text = `${updated_text.slice(0, begin)}${value}${updated_text.slice(end + 1)}`;
    return [
        updated_text,
        [
            ...refs,
            _object_spread_props(_object_spread({}, ref), {
                begin,
                end
            })
        ]
    ];
};
helpers.reduceTextFromReferences = (text, refs)=>refs.reduce(reduceReferences, [
        text,
        []
    ]);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (helpers);


/***/ }),

/***/ "./src/headless/utils/promise.js":
/*!***************************************!*\
  !*** ./src/headless/utils/promise.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   debounce: () => (/* binding */ debounce),
/* harmony export */   getOpenPromise: () => (/* reexport safe */ _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise),
/* harmony export */   waitUntil: () => (/* binding */ waitUntil)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");



/**
 * Debounces a function by waiting for the timeout period before calling it.
 * If the function gets called again, the timeout period resets.
 * @param {Function} func
 * @param {number} timeout
 */ function debounce(func, timeout) {
    let timer;
    return function(...args) {
        clearTimeout(timer);
        timer = setTimeout(()=>{
            func.apply(this, args);
        }, timeout);
    };
}
/**
 * Clears the specified timeout and interval.
 * @method u#clearTimers
 * @param {ReturnType<typeof setTimeout>} timeout - Id if the timeout to clear.
 * @param {ReturnType<typeof setInterval>} interval - Id of the interval to clear.
 * @copyright Simen Bekkhus 2016
 * @license MIT
 */ function clearTimers(timeout, interval) {
    clearTimeout(timeout);
    clearInterval(interval);
}
/**
 * Creates a {@link Promise} that resolves if the passed in function returns a truthy value.
 * Rejects if it throws or does not return truthy within the given max_wait.
 * @param { Function } func - The function called every check_delay,
 *  and the result of which is the resolved value of the promise.
 * @param { number } [max_wait=300] - The time to wait before rejecting the promise.
 * @param { number } [check_delay=3] - The time to wait before each invocation of {func}.
 * @returns {Promise} A promise resolved with the value of func,
 *  or rejected with the exception thrown by it or it times out.
 * @copyright Simen Bekkhus 2016
 * @license MIT
 */ function waitUntil(func, max_wait = 300, check_delay = 3) {
    // Run the function once without setting up any listeners in case it's already true
    try {
        const result = func();
        if (result) {
            return Promise.resolve(result);
        }
    } catch (e) {
        return Promise.reject(e);
    }
    const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
    const timeout_err = new Error();
    function checker() {
        try {
            const result = func();
            if (result) {
                clearTimers(max_wait_timeout, interval);
                promise.resolve(result);
            }
        } catch (e) {
            clearTimers(max_wait_timeout, interval);
            promise.reject(e);
        }
    }
    const interval = setInterval(checker, check_delay);
    function handler() {
        clearTimers(max_wait_timeout, interval);
        const err_msg = `Wait until promise timed out: \n\n${timeout_err.stack}`;
        console.trace();
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(err_msg);
        promise.reject(new Error(err_msg));
    }
    const max_wait_timeout = setTimeout(handler, max_wait);
    return promise;
}


/***/ }),

/***/ "./src/headless/utils/session.js":
/*!***************************************!*\
  !*** ./src/headless/utils/session.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clearSession: () => (/* binding */ clearSession),
/* harmony export */   getUnloadEvent: () => (/* binding */ getUnloadEvent),
/* harmony export */   isTestEnv: () => (/* binding */ isTestEnv),
/* harmony export */   isUniView: () => (/* binding */ isUniView),
/* harmony export */   replacePromise: () => (/* binding */ replacePromise),
/* harmony export */   shouldClearCache: () => (/* binding */ shouldClearCache),
/* harmony export */   tearDown: () => (/* binding */ tearDown)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/settings/api.js */ "./src/headless/shared/settings/api.js");
/* harmony import */ var _shared_settings_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/settings/utils.js */ "./src/headless/shared/settings/utils.js");
/**
 * @typedef {module:shared-api-public.ConversePrivateGlobal} ConversePrivateGlobal
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




const settings = _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api;
/**
 * We distinguish between UniView and MultiView instances.
 *
 * UniView means that only one chat is visible, even though there might be multiple ongoing chats.
 * MultiView means that multiple chats may be visible simultaneously.
 */ function isUniView() {
    return [
        'fullscreen',
        'embedded'
    ].includes(settings.get("view_mode"));
}
function isTestEnv() {
    return (0,_shared_settings_utils_js__WEBPACK_IMPORTED_MODULE_3__.getInitSettings)()['bosh_service_url'] === 'montague.lit/http-bind';
}
function getUnloadEvent() {
    if ('onpagehide' in window) {
        // Pagehide gets thrown in more cases than unload. Specifically it
        // gets thrown when the page is cached and not just
        // closed/destroyed. It's the only viable event on mobile Safari.
        // https://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/
        return 'pagehide';
    } else if ('onbeforeunload' in window) {
        return 'beforeunload';
    }
    return 'unload';
}
/**
 * @param {ConversePrivateGlobal} _converse
 * @param {string} name
 */ function replacePromise(_converse, name) {
    const existing_promise = _converse.promises[name];
    if (!existing_promise) {
        throw new Error(`Tried to replace non-existing promise: ${name}`);
    }
    if (existing_promise.replace) {
        /** @type {import('../shared/types').ReplaceableOpenPromise} */ const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        promise.replace = existing_promise.replace;
        _converse.promises[name] = promise;
    } else {
        _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(`Not replacing promise "${name}"`);
    }
}
/**
 * @param {ConversePrivateGlobal} _converse
 * @returns {boolean}
 */ function shouldClearCache(_converse) {
    const { api } = _converse;
    return !_converse.state.config.get('trusted') || api.settings.get('clear_cache_on_logout') || isTestEnv();
}
/**
 * @param {ConversePrivateGlobal} _converse
 */ function tearDown(_converse) {
    return _async_to_generator(function*() {
        const { api } = _converse;
        yield api.trigger('beforeTearDown', {
            'synchronous': true
        });
        api.trigger('afterTearDown');
        return _converse;
    })();
}
/**
 * @param {ConversePrivateGlobal} _converse
 */ function clearSession(_converse) {
    if (shouldClearCache(_converse)) {
        var _converse_state_login_info;
        _converse.api.user.settings.clear();
        (_converse_state_login_info = _converse.state.login_info) === null || _converse_state_login_info === void 0 ? void 0 : _converse_state_login_info.destroy();
    }
    _converse.initSession();
    /**
     * Synchronouse event triggered once the user session has been cleared,
     * for example when the user has logged out or when Converse has
     * disconnected for some other reason.
     * @event _converse#clearSession
     */ return _converse.api.trigger('clearSession', {
        'synchronous': true
    });
}


/***/ }),

/***/ "./src/headless/utils/stanza.js":
/*!**************************************!*\
  !*** ./src/headless/utils/stanza.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAttributes: () => (/* binding */ getAttributes),
/* harmony export */   isErrorStanza: () => (/* binding */ isErrorStanza),
/* harmony export */   isForbiddenError: () => (/* binding */ isForbiddenError),
/* harmony export */   isServiceUnavailableError: () => (/* binding */ isServiceUnavailableError),
/* harmony export */   toStanza: () => (/* reexport safe */ strophe_js__WEBPACK_IMPORTED_MODULE_1__.toStanza)
/* harmony export */ });
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
/* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _html_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./html.js */ "./src/headless/utils/html.js");





/**
 * @param {Element} stanza
 * @returns {boolean}
 */ function isErrorStanza(stanza) {
    if (!(0,_html_js__WEBPACK_IMPORTED_MODULE_2__.isElement)(stanza)) {
        return false;
    }
    return stanza.getAttribute('type') === 'error';
}
/**
 * @param {Element} stanza
 * @returns {boolean}
 */ function isForbiddenError(stanza) {
    if (!(0,_html_js__WEBPACK_IMPORTED_MODULE_2__.isElement)(stanza)) {
        return false;
    }
    return sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`error[type="auth"] forbidden[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.STANZAS}"]`, stanza).length > 0;
}
/**
 * @param {Element} stanza
 * @returns {boolean}
 */ function isServiceUnavailableError(stanza) {
    if (!(0,_html_js__WEBPACK_IMPORTED_MODULE_2__.isElement)(stanza)) {
        return false;
    }
    return sizzle__WEBPACK_IMPORTED_MODULE_0___default()(`error[type="cancel"] service-unavailable[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.NS.STANZAS}"]`, stanza).length > 0;
}
/**
 * Returns an object containing all attribute names and values for a particular element.
 * @param {Element} stanza
 * @returns {object}
 */ function getAttributes(stanza) {
    return stanza.getAttributeNames().reduce((acc, name)=>{
        acc[name] = strophe_js__WEBPACK_IMPORTED_MODULE_1__.Strophe.xmlunescape(stanza.getAttribute(name));
        return acc;
    }, {});
}


/***/ }),

/***/ "./src/headless/utils/storage.js":
/*!***************************************!*\
  !*** ./src/headless/utils/storage.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createStore: () => (/* binding */ createStore),
/* harmony export */   getDefaultStore: () => (/* binding */ getDefaultStore),
/* harmony export */   initStorage: () => (/* binding */ initStorage)
/* harmony export */ });
/* harmony import */ var _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor/src/storage.js */ "./node_modules/@converse/skeletor/src/storage.js");
/* harmony import */ var _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/_converse.js */ "./src/headless/shared/_converse.js");
/* harmony import */ var _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/settings/api.js */ "./src/headless/shared/settings/api.js");
/* harmony import */ var _session_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./session.js */ "./src/headless/utils/session.js");




const settings = _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_2__.settings_api;
function getDefaultStore() {
    if (_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].state.config.get('trusted')) {
        const is_non_persistent = settings.get('persistent_store') === 'sessionStorage';
        return is_non_persistent ? 'session' : 'persistent';
    } else {
        return 'session';
    }
}
function storeUsesIndexedDB(store) {
    return store === 'persistent' && settings.get('persistent_store') === 'IndexedDB';
}
function createStore(id, store) {
    const name = store || getDefaultStore();
    const s = _shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"].storage[name];
    if (typeof s === 'undefined') {
        throw new TypeError(`createStore: Could not find store for ${id}`);
    }
    return new _converse_skeletor_src_storage_js__WEBPACK_IMPORTED_MODULE_0__["default"](id, s, storeUsesIndexedDB(store));
}
function initStorage(model, id, type) {
    const store = type || getDefaultStore();
    model.browserStorage = createStore(id, store);
    if (storeUsesIndexedDB(store)) {
        const flush = ()=>model.browserStorage.flush();
        const unloadevent = (0,_session_js__WEBPACK_IMPORTED_MODULE_3__.getUnloadEvent)();
        window.addEventListener(unloadevent, flush);
        model.on('destroy', ()=>window.removeEventListener(unloadevent, flush));
        model.listenTo(_shared_converse_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'beforeLogout', flush);
    }
}


/***/ }),

/***/ "./src/headless/utils/text.js":
/*!************************************!*\
  !*** ./src/headless/utils/text.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   firstCharToUpperCase: () => (/* binding */ firstCharToUpperCase),
/* harmony export */   getLongestSubstring: () => (/* binding */ getLongestSubstring),
/* harmony export */   isString: () => (/* binding */ isString)
/* harmony export */ });
/**
 * @param {string} text
 * @returns {string}
 */ function firstCharToUpperCase(text) {
    if (!text) {
        return '';
    }
    if ('\uD83D\uDE00'.length === 1) {
        return text.charAt(0).toLocaleUpperCase() + text.substring(1);
    }
    const firstChar = text.codePointAt(0);
    const index = firstChar > 0xffff ? 2 : 1;
    return String.fromCodePoint(firstChar).toLocaleUpperCase() + text.substring(index);
}
/**
 * @param {string} string
 * @param {string[]} candidates
 * @returns {string}
 */ function getLongestSubstring(string, candidates) {
    /**
     * @param {string} accumulator
     * @param {string} current_value
     * @returns {string}
     */ function reducer(accumulator, current_value) {
        if (string.startsWith(current_value)) {
            if (current_value.length > accumulator.length) {
                return current_value;
            } else {
                return accumulator;
            }
        } else {
            return accumulator;
        }
    }
    return candidates.reduce(reducer, '');
}
/**
 * @param {any} s
 * @returns {boolean}
 */ function isString(s) {
    return typeof s === 'string' || s instanceof String;
}


/***/ }),

/***/ "./src/headless/utils/url.js":
/*!***********************************!*\
  !*** ./src/headless/utils/url.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addMediaURLsOffset: () => (/* binding */ addMediaURLsOffset),
/* harmony export */   checkFileTypes: () => (/* binding */ checkFileTypes),
/* harmony export */   getHeaders: () => (/* binding */ getHeaders),
/* harmony export */   getMediaURLs: () => (/* binding */ getMediaURLs),
/* harmony export */   getMediaURLsMetadata: () => (/* binding */ getMediaURLsMetadata),
/* harmony export */   getMetadataForURL: () => (/* binding */ getMetadataForURL),
/* harmony export */   getURL: () => (/* binding */ getURL),
/* harmony export */   isAudioURL: () => (/* binding */ isAudioURL),
/* harmony export */   isEncryptedFileURL: () => (/* binding */ isEncryptedFileURL),
/* harmony export */   isGIFURL: () => (/* binding */ isGIFURL),
/* harmony export */   isImageURL: () => (/* binding */ isImageURL),
/* harmony export */   isURLWithImageExtension: () => (/* binding */ isURLWithImageExtension),
/* harmony export */   isValidURL: () => (/* binding */ isValidURL),
/* harmony export */   isVideoURL: () => (/* binding */ isVideoURL),
/* harmony export */   withinString: () => (/* binding */ withinString)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/settings/api.js */ "./src/headless/shared/settings/api.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}


const settings = _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_1__.settings_api;
const URL_REGEXES = {
    // valid "scheme://" or "www."
    start: /(\b|_)(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi,
    // everything up to the next whitespace
    end: /[\s\r\n]|$/,
    // trim trailing punctuation captured by end RegExp
    trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,
    // balanced parens inclusion (), [], {}, <>
    parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g
};
/**
 * Will return false if URL is malformed or contains disallowed characters
 * @param {string} text
 * @returns {boolean}
 */ function isValidURL(text) {
    try {
        if (text.startsWith("www.")) {
            return !!getURL(`http://${text}`);
        }
        return !!getURL(text);
    } catch (e) {
        return false;
    }
}
/**
 * @param {string|URL} url
 * @returns {URL}
 */ function getURL(url) {
    if (url instanceof URL) {
        return url;
    }
    return url.toLowerCase().startsWith("www.") ? getURL(`http://${url}`) : new URL(url);
}
/**
 * Given the an array of file extensions, check whether a URL points to a file
 * ending in one of them.
 * @param {string[]} types - An array of file extensions
 * @param {string|URL} url
 * @returns {boolean}
 * @example
 *  checkFileTypes(['.gif'], 'https://conversejs.org/cat.gif?foo=bar');
 */ function checkFileTypes(types, url) {
    let parsed_url;
    try {
        parsed_url = getURL(url);
    } catch (error) {
        throw new Error(`checkFileTypes: could not parse url ${url}`);
    }
    const filename = parsed_url.pathname.split("/").pop().toLowerCase();
    return !!types.filter((ext)=>filename.endsWith(ext)).length;
}
/**
 * @param {string|URL} url
 * @returns {boolean}
 */ function isURLWithImageExtension(url) {
    return checkFileTypes([
        ".jpg",
        ".jpeg",
        ".png",
        ".gif",
        ".bmp",
        ".tiff",
        ".svg"
    ], url);
}
/**
 * @param {string|URL} url
 */ function isGIFURL(url) {
    return checkFileTypes([
        ".gif"
    ], url);
}
/**
 * @param {string|URL} url
 * @param {Headers} [headers]
 */ function isAudioURL(url, headers) {
    var _headers_get;
    if (headers === null || headers === void 0 ? void 0 : (_headers_get = headers.get("content-type")) === null || _headers_get === void 0 ? void 0 : _headers_get.startsWith("audio")) {
        return true;
    }
    return checkFileTypes([
        ".ogg",
        ".mp3",
        ".m4a"
    ], url);
}
/**
 * @param {string|URL} url
 * @param {Headers} [headers]
 */ function isVideoURL(url, headers) {
    var _headers_get;
    if (headers === null || headers === void 0 ? void 0 : (_headers_get = headers.get("content-type")) === null || _headers_get === void 0 ? void 0 : _headers_get.startsWith("video")) {
        return true;
    }
    return checkFileTypes([
        ".mp4",
        ".webm"
    ], url);
}
/**
 * @param {string|URL} url
 * @param {Headers} [headers]
 * @returns {boolean}
 */ function isImageURL(url, headers) {
    var _headers_get;
    if (headers === null || headers === void 0 ? void 0 : (_headers_get = headers.get("content-type")) === null || _headers_get === void 0 ? void 0 : _headers_get.startsWith("video")) {
        return true;
    }
    const regex = settings.get("image_urls_regex");
    return (regex === null || regex === void 0 ? void 0 : regex.test(url)) || isURLWithImageExtension(url);
}
/**
 * @param {string|URL} url
 */ function isEncryptedFileURL(url) {
    return getURL(url).href.startsWith("aesgcm://");
}
/**
 * Processes a string to find and manipulate substrings based on a callback function.
 * This function searches for patterns defined by the provided start and end regular expressions,
 * and applies the callback to each matched substring, allowing for modifications
 * @copyright Copyright (c) 2011 Rodney Rehm
 *
 * @param {string} string - The input string to be processed.
 * @param {function} callback - A function that takes the matched substring and its start and end indices,
 *                              and returns a modified substring or undefined to skip modification.
 * @param {import("./types").ProcessStringOptions} [options]
 * @returns {string} The modified string after processing all matches.
 */ function withinString(string, callback, options) {
    options = options || {};
    const _start = options.start || URL_REGEXES.start;
    const _end = options.end || URL_REGEXES.end;
    const _trim = options.trim || URL_REGEXES.trim;
    const _parens = options.parens || URL_REGEXES.parens;
    const _attributeOpen = /[a-z0-9-]=["']?$/i;
    _start.lastIndex = 0;
    while(true){
        const match = _start.exec(string);
        if (!match) break;
        let start = match.index;
        if (options.ignoreHtml) {
            const attributeOpen = string.slice(Math.max(start - 3, 0), start);
            if (attributeOpen && _attributeOpen.test(attributeOpen)) {
                continue;
            }
        }
        let end = start + string.slice(start).search(_end);
        let slice = string.slice(start, end);
        let parensEnd = -1;
        while(true){
            const parensMatch = _parens.exec(slice);
            if (!parensMatch) break;
            const parensMatchEnd = parensMatch.index + parensMatch[0].length;
            parensEnd = Math.max(parensEnd, parensMatchEnd);
        }
        if (parensEnd > -1) {
            slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, "");
        } else {
            slice = slice.replace(_trim, "");
        }
        if (slice.length <= match[0].length) continue;
        if (options.ignore && options.ignore.test(slice)) continue;
        end = start + slice.length;
        const result = callback(slice, start, end);
        if (result === undefined) {
            _start.lastIndex = end;
            continue;
        }
        string = string.slice(0, start) + String(result) + string.slice(end);
        _start.lastIndex = start + String(result).length;
    }
    _start.lastIndex = 0;
    return string;
}
/**
 * @param {string} url
 * @returns {Promise<Headers>}
 */ function getHeaders(url) {
    return _async_to_generator(function*() {
        try {
            const response = yield fetch(url, {
                method: "HEAD"
            });
            return response.headers;
        } catch (e) {
            console.debug(`Error calling HEAD on url ${url}: ${e}`);
            return null;
        }
    })();
}
/**
 * @param {import("./types").MediaURLIndexes} o
 * @returns {Promise<import("./types").MediaURLMetadata>}
 */ function getMetadataForURL(o) {
    return _async_to_generator(function*() {
        const fetch_headers = _shared_settings_api_js__WEBPACK_IMPORTED_MODULE_1__.settings_api.get("fetch_url_headers");
        const headers = fetch_headers ? yield getHeaders(o.url) : null;
        return _object_spread_props(_object_spread({}, o), {
            is_gif: isGIFURL(o.url),
            is_audio: isAudioURL(o.url, headers),
            is_image: isImageURL(o.url, headers),
            is_video: isVideoURL(o.url, headers),
            is_encrypted: isEncryptedFileURL(o.url)
        });
    })();
}
/**
 * @param {string} text
 * @param {number} offset
 * @returns {Promise<{media_urls?: import("./types").MediaURLMetadata[]}>}
 */ function getMediaURLsMetadata(text, offset = 0) {
    return _async_to_generator(function*() {
        const objs = [];
        if (!text) {
            return {};
        }
        try {
            withinString(text, /**
             * @param {string} url
             * @param {number} start
             * @param {number} end
             * @returns {string|undefined}
             */ (url, start, end)=>{
                if (url.startsWith("_")) {
                    url = url.slice(1);
                    start += 1;
                }
                if (url.endsWith("_")) {
                    url = url.slice(0, url.length - 1);
                    end -= 1;
                }
                if (isValidURL(url)) {
                    objs.push({
                        url,
                        start: start + offset,
                        end: end + offset
                    });
                }
                return url;
            });
        } catch (error) {
            _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(error);
        }
        const media_urls = yield Promise.all(objs.map(getMetadataForURL));
        return media_urls.length ? {
            media_urls
        } : {};
    })();
}
/**
 * @param {Array<import("./types").MediaURLMetadata>} arr
 * @param {string} text
 * @returns {import("./types").MediaURLMetadata[]}
 */ function getMediaURLs(arr, text) {
    return arr.map((o)=>{
        if (o.start < 0 || o.start >= text.length) {
            return null;
        }
        const url = text.substring(o.start, o.end);
        return _object_spread_props(_object_spread({}, o), {
            url
        });
    }).filter((o)=>o);
}
/**
 * @param {Array<import("./types").MediaURLMetadata>} arr
 * @param {string} text
 * @returns {import("./types").MediaURLMetadata[]}
 */ function addMediaURLsOffset(arr, text, offset = 0) {
    return arr.map((o)=>{
        const start = o.start - offset;
        const end = o.end - offset;
        if (start < 0 || start >= text.length) {
            return null;
        }
        return Object.assign({}, o, {
            start,
            end,
            url: text.substring(o.start - offset, o.end - offset)
        });
    }).filter((o)=>o);
}


/***/ }),

/***/ "./src/i18n lazy recursive ^\\.\\/.*\\/LC_MESSAGES\\/converse\\.po$":
/*!**********************************************************************************************************!*\
  !*** ./src/i18n/ lazy ^\.\/.*\/LC_MESSAGES\/converse\.po$ chunkName: locales/[request] namespace object ***!
  \**********************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var map = {
	"./af/LC_MESSAGES/converse.po": [
		"./src/i18n/af/LC_MESSAGES/converse.po",
		"locales/af-LC_MESSAGES-converse-po"
	],
	"./ar/LC_MESSAGES/converse.po": [
		"./src/i18n/ar/LC_MESSAGES/converse.po",
		"locales/ar-LC_MESSAGES-converse-po"
	],
	"./be/LC_MESSAGES/converse.po": [
		"./src/i18n/be/LC_MESSAGES/converse.po",
		"locales/be-LC_MESSAGES-converse-po"
	],
	"./bg/LC_MESSAGES/converse.po": [
		"./src/i18n/bg/LC_MESSAGES/converse.po",
		"locales/bg-LC_MESSAGES-converse-po"
	],
	"./ca/LC_MESSAGES/converse.po": [
		"./src/i18n/ca/LC_MESSAGES/converse.po",
		"locales/ca-LC_MESSAGES-converse-po"
	],
	"./cs/LC_MESSAGES/converse.po": [
		"./src/i18n/cs/LC_MESSAGES/converse.po",
		"locales/cs-LC_MESSAGES-converse-po"
	],
	"./da/LC_MESSAGES/converse.po": [
		"./src/i18n/da/LC_MESSAGES/converse.po",
		"locales/da-LC_MESSAGES-converse-po"
	],
	"./de/LC_MESSAGES/converse.po": [
		"./src/i18n/de/LC_MESSAGES/converse.po",
		"locales/de-LC_MESSAGES-converse-po"
	],
	"./el/LC_MESSAGES/converse.po": [
		"./src/i18n/el/LC_MESSAGES/converse.po",
		"locales/el-LC_MESSAGES-converse-po"
	],
	"./eo/LC_MESSAGES/converse.po": [
		"./src/i18n/eo/LC_MESSAGES/converse.po",
		"locales/eo-LC_MESSAGES-converse-po"
	],
	"./es/LC_MESSAGES/converse.po": [
		"./src/i18n/es/LC_MESSAGES/converse.po",
		"locales/es-LC_MESSAGES-converse-po"
	],
	"./eu/LC_MESSAGES/converse.po": [
		"./src/i18n/eu/LC_MESSAGES/converse.po",
		"locales/eu-LC_MESSAGES-converse-po"
	],
	"./fa/LC_MESSAGES/converse.po": [
		"./src/i18n/fa/LC_MESSAGES/converse.po",
		"locales/fa-LC_MESSAGES-converse-po"
	],
	"./fi/LC_MESSAGES/converse.po": [
		"./src/i18n/fi/LC_MESSAGES/converse.po",
		"locales/fi-LC_MESSAGES-converse-po"
	],
	"./fr/LC_MESSAGES/converse.po": [
		"./src/i18n/fr/LC_MESSAGES/converse.po",
		"locales/fr-LC_MESSAGES-converse-po"
	],
	"./gl/LC_MESSAGES/converse.po": [
		"./src/i18n/gl/LC_MESSAGES/converse.po",
		"locales/gl-LC_MESSAGES-converse-po"
	],
	"./he/LC_MESSAGES/converse.po": [
		"./src/i18n/he/LC_MESSAGES/converse.po",
		"locales/he-LC_MESSAGES-converse-po"
	],
	"./hi/LC_MESSAGES/converse.po": [
		"./src/i18n/hi/LC_MESSAGES/converse.po",
		"locales/hi-LC_MESSAGES-converse-po"
	],
	"./hu/LC_MESSAGES/converse.po": [
		"./src/i18n/hu/LC_MESSAGES/converse.po",
		"locales/hu-LC_MESSAGES-converse-po"
	],
	"./id/LC_MESSAGES/converse.po": [
		"./src/i18n/id/LC_MESSAGES/converse.po",
		"locales/id-LC_MESSAGES-converse-po"
	],
	"./it/LC_MESSAGES/converse.po": [
		"./src/i18n/it/LC_MESSAGES/converse.po",
		"locales/it-LC_MESSAGES-converse-po"
	],
	"./ja/LC_MESSAGES/converse.po": [
		"./src/i18n/ja/LC_MESSAGES/converse.po",
		"locales/ja-LC_MESSAGES-converse-po"
	],
	"./ko/LC_MESSAGES/converse.po": [
		"./src/i18n/ko/LC_MESSAGES/converse.po",
		"locales/ko-LC_MESSAGES-converse-po"
	],
	"./lt/LC_MESSAGES/converse.po": [
		"./src/i18n/lt/LC_MESSAGES/converse.po",
		"locales/lt-LC_MESSAGES-converse-po"
	],
	"./mr/LC_MESSAGES/converse.po": [
		"./src/i18n/mr/LC_MESSAGES/converse.po",
		"locales/mr-LC_MESSAGES-converse-po"
	],
	"./nb/LC_MESSAGES/converse.po": [
		"./src/i18n/nb/LC_MESSAGES/converse.po",
		"locales/nb-LC_MESSAGES-converse-po"
	],
	"./nl/LC_MESSAGES/converse.po": [
		"./src/i18n/nl/LC_MESSAGES/converse.po",
		"locales/nl-LC_MESSAGES-converse-po"
	],
	"./nl_BE/LC_MESSAGES/converse.po": [
		"./src/i18n/nl_BE/LC_MESSAGES/converse.po",
		"locales/nl_BE-LC_MESSAGES-converse-po"
	],
	"./oc/LC_MESSAGES/converse.po": [
		"./src/i18n/oc/LC_MESSAGES/converse.po",
		"locales/oc-LC_MESSAGES-converse-po"
	],
	"./pl/LC_MESSAGES/converse.po": [
		"./src/i18n/pl/LC_MESSAGES/converse.po",
		"locales/pl-LC_MESSAGES-converse-po"
	],
	"./pt/LC_MESSAGES/converse.po": [
		"./src/i18n/pt/LC_MESSAGES/converse.po",
		"locales/pt-LC_MESSAGES-converse-po"
	],
	"./pt_BR/LC_MESSAGES/converse.po": [
		"./src/i18n/pt_BR/LC_MESSAGES/converse.po",
		"locales/pt_BR-LC_MESSAGES-converse-po"
	],
	"./ro/LC_MESSAGES/converse.po": [
		"./src/i18n/ro/LC_MESSAGES/converse.po",
		"locales/ro-LC_MESSAGES-converse-po"
	],
	"./ru/LC_MESSAGES/converse.po": [
		"./src/i18n/ru/LC_MESSAGES/converse.po",
		"locales/ru-LC_MESSAGES-converse-po"
	],
	"./si/LC_MESSAGES/converse.po": [
		"./src/i18n/si/LC_MESSAGES/converse.po",
		"locales/si-LC_MESSAGES-converse-po"
	],
	"./sq/LC_MESSAGES/converse.po": [
		"./src/i18n/sq/LC_MESSAGES/converse.po",
		"locales/sq-LC_MESSAGES-converse-po"
	],
	"./sv/LC_MESSAGES/converse.po": [
		"./src/i18n/sv/LC_MESSAGES/converse.po",
		"locales/sv-LC_MESSAGES-converse-po"
	],
	"./ta/LC_MESSAGES/converse.po": [
		"./src/i18n/ta/LC_MESSAGES/converse.po",
		"locales/ta-LC_MESSAGES-converse-po"
	],
	"./th/LC_MESSAGES/converse.po": [
		"./src/i18n/th/LC_MESSAGES/converse.po",
		"locales/th-LC_MESSAGES-converse-po"
	],
	"./tr/LC_MESSAGES/converse.po": [
		"./src/i18n/tr/LC_MESSAGES/converse.po",
		"locales/tr-LC_MESSAGES-converse-po"
	],
	"./ug/LC_MESSAGES/converse.po": [
		"./src/i18n/ug/LC_MESSAGES/converse.po",
		"locales/ug-LC_MESSAGES-converse-po"
	],
	"./uk/LC_MESSAGES/converse.po": [
		"./src/i18n/uk/LC_MESSAGES/converse.po",
		"locales/uk-LC_MESSAGES-converse-po"
	],
	"./vi/LC_MESSAGES/converse.po": [
		"./src/i18n/vi/LC_MESSAGES/converse.po",
		"locales/vi-LC_MESSAGES-converse-po"
	],
	"./zh_CN/LC_MESSAGES/converse.po": [
		"./src/i18n/zh_CN/LC_MESSAGES/converse.po",
		"locales/zh_CN-LC_MESSAGES-converse-po"
	],
	"./zh_TW/LC_MESSAGES/converse.po": [
		"./src/i18n/zh_TW/LC_MESSAGES/converse.po",
		"locales/zh_TW-LC_MESSAGES-converse-po"
	]
};
function webpackAsyncContext(req) {
	if(!__webpack_require__.o(map, req)) {
		return Promise.resolve().then(() => {
			var e = new Error("Cannot find module '" + req + "'");
			e.code = 'MODULE_NOT_FOUND';
			throw e;
		});
	}

	var ids = map[req], id = ids[0];
	return __webpack_require__.e(ids[1]).then(() => {
		return __webpack_require__.t(id, 3 | 16);
	});
}
webpackAsyncContext.keys = () => (Object.keys(map));
webpackAsyncContext.id = "./src/i18n lazy recursive ^\\.\\/.*\\/LC_MESSAGES\\/converse\\.po$";
module.exports = webpackAsyncContext;

/***/ }),

/***/ "./src/i18n/index.js":
/*!***************************!*\
  !*** ./src/i18n/index.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   __: () => (/* binding */ __),
/* harmony export */   i18n: () => (/* binding */ i18n)
/* harmony export */ });
/* harmony import */ var jed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jed */ "./node_modules/jed/jed.js");
/* harmony import */ var jed__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jed__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @module i18n
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description This is the internationalization module
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
let jed_instance;
let locale = 'en';
/**
 * @param {string} preferred_locale
 * @param {string[]} supported_locales
 */ function isConverseLocale(preferred_locale, supported_locales) {
    return supported_locales.includes(preferred_locale);
}
/**
 * Determines which locale is supported by the user's system as well
 * as by the relevant library (e.g. converse.js or dayjs).
 * @param {string} preferred_locale
 * @param {Function} isSupportedByLibrary - Returns a boolean indicating whether
 *   the locale is supported.
 * @returns {string}
 */ function determineLocale(preferred_locale, isSupportedByLibrary) {
    if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
        return preferred_locale;
    }
    const { languages } = window.navigator;
    let locale;
    for(let i = 0; i < languages.length && !locale; i++){
        locale = isLocaleAvailable(languages[i], isSupportedByLibrary);
    }
    return locale || 'en';
}
/**
 * Check whether the locale or sub locale (e.g. en-US, en) is supported.
 * @param {string} locale - The locale to check for
 * @param {Function} available - Returns a boolean indicating whether the locale is supported
 */ function isLocaleAvailable(locale, available) {
    if (available(locale)) {
        return locale;
    } else {
        var sublocale = locale.split('-')[0];
        if (sublocale !== locale && available(sublocale)) {
            return sublocale;
        }
    }
}
/**
 * Given a locale, return the closest locale returned by dayJS
 * @param {string} locale
 */ function getDayJSLocale(locale) {
    const dayjs_locale = locale.toLowerCase().replace('_', '-');
    return dayjs_locale === 'ug' ? 'ug-cn' : dayjs_locale;
}
/**
 * Fetch the translations for the given local at the given URL.
 * @returns {Jed}
 */ function fetchTranslations() {
    return _async_to_generator(function*() {
        const dayjs_locale = getDayJSLocale(locale);
        if (!isConverseLocale(locale, _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('locales')) || locale === 'en') {
            return;
        }
        const { default: data } = yield __webpack_require__("./src/i18n lazy recursive ^\\.\\/.*\\/LC_MESSAGES\\/converse\\.po$")(`./${locale}/LC_MESSAGES/converse.po`);
        yield __webpack_require__("./node_modules/dayjs/locale lazy recursive ^\\.\\/.*\\.js$")(`./${dayjs_locale}.js`);
        dayjs.locale(determineLocale(dayjs_locale, (l)=>dayjs.locale(l)));
        return new (jed__WEBPACK_IMPORTED_MODULE_0___default())(data);
    })();
}
/**
 * @namespace i18n
 */ const i18n = Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_1__.i18n, {
    getLocale () {
        return locale;
    },
    /**
     * @param {string} str - The string to be translated
     * @param {Array<any>} args
     */ translate (str, args) {
        if (!jed_instance) {
            return jed__WEBPACK_IMPORTED_MODULE_0___default().sprintf.apply((jed__WEBPACK_IMPORTED_MODULE_0___default()), arguments);
        }
        const t = jed_instance.translate(str);
        if (arguments.length > 1) {
            return t.fetch.apply(t, args);
        } else {
            return t.fetch();
        }
    },
    initialize () {
        return _async_to_generator(function*() {
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isTestEnv()) {
                locale = 'en';
            } else {
                try {
                    const preferred_locale = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('i18n');
                    const available_locales = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('locales');
                    const isSupportedByLibrary = /** @param {string} pref */ (pref)=>isConverseLocale(pref, available_locales);
                    locale = determineLocale(preferred_locale, isSupportedByLibrary);
                    jed_instance = yield fetchTranslations();
                } catch (e) {
                    _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.fatal(e.message);
                    locale = 'en';
                }
            }
        })();
    },
    __ (str, ...args) {
        return i18n.translate(str, args);
    }
});

const __ = i18n.__;


/***/ }),

/***/ "./src/index.js":
/*!**********************!*\
  !*** ./src/index.js ***!
  \**********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var shared_styles_index_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/styles/index.scss */ "./src/shared/styles/index.scss");
/* harmony import */ var i18n_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n/index.js */ "./src/i18n/index.js");
/* harmony import */ var shared_registry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/registry.js */ "./src/shared/registry.js");
/* harmony import */ var shared_components_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/index.js */ "./src/shared/components/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shared/constants.js */ "./src/shared/constants.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/index.js */ "./src/utils/index.js");
/* harmony import */ var _plugins_modal_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./plugins/modal/index.js */ "./src/plugins/modal/index.js");
/* harmony import */ var _plugins_adhoc_views_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./plugins/adhoc-views/index.js */ "./src/plugins/adhoc-views/index.js");
/* harmony import */ var _plugins_bookmark_views_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./plugins/bookmark-views/index.js */ "./src/plugins/bookmark-views/index.js");
/* harmony import */ var _plugins_chatview_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./plugins/chatview/index.js */ "./src/plugins/chatview/index.js");
/* harmony import */ var _plugins_controlbox_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./plugins/controlbox/index.js */ "./src/plugins/controlbox/index.js");
/* harmony import */ var _plugins_disco_views_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./plugins/disco-views/index.js */ "./src/plugins/disco-views/index.js");
/* harmony import */ var _plugins_headlines_view_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./plugins/headlines-view/index.js */ "./src/plugins/headlines-view/index.js");
/* harmony import */ var _plugins_mam_views_index_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./plugins/mam-views/index.js */ "./src/plugins/mam-views/index.js");
/* harmony import */ var _plugins_minimize_index_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./plugins/minimize/index.js */ "./src/plugins/minimize/index.js");
/* harmony import */ var _plugins_muc_views_index_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./plugins/muc-views/index.js */ "./src/plugins/muc-views/index.js");
/* harmony import */ var _plugins_notifications_index_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./plugins/notifications/index.js */ "./src/plugins/notifications/index.js");
/* harmony import */ var _plugins_profile_index_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./plugins/profile/index.js */ "./src/plugins/profile/index.js");
/* harmony import */ var _plugins_omemo_index_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./plugins/omemo/index.js */ "./src/plugins/omemo/index.js");
/* harmony import */ var _plugins_push_index_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./plugins/push/index.js */ "./src/plugins/push/index.js");
/* harmony import */ var _plugins_register_index_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./plugins/register/index.js */ "./src/plugins/register/index.js");
/* harmony import */ var _plugins_roomslist_index_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./plugins/roomslist/index.js */ "./src/plugins/roomslist/index.js");
/* harmony import */ var _plugins_rootview_index_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./plugins/rootview/index.js */ "./src/plugins/rootview/index.js");
/* harmony import */ var _plugins_rosterview_index_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./plugins/rosterview/index.js */ "./src/plugins/rosterview/index.js");
/* harmony import */ var _plugins_singleton_index_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./plugins/singleton/index.js */ "./src/plugins/singleton/index.js");
/* harmony import */ var _plugins_dragresize_index_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./plugins/dragresize/index.js */ "./src/plugins/dragresize/index.js");
/* harmony import */ var _plugins_fullscreen_index_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./plugins/fullscreen/index.js */ "./src/plugins/fullscreen/index.js");
/**
 * @description Converse.js (A browser based XMPP chat client)
 * @copyright 2025, The Converse developers
 * @license Mozilla Public License (MPLv2)
 */ 







/* START: Removable plugins
 * ------------------------
 * Any of the following plugin imports may be removed if the plugin is not needed
 */ 
 // Views for XEP-0050 Ad-Hoc commands
 // Views for XEP-0048 Bookmarks
 // Renders standalone chat boxes for single user chat
 // The control box
 // Adds a service discovery browser component


 // Allows chat boxes to be minimized
 // Views related to MUC



 // XEP-0357 Push Notifications
 // XEP-0077 In-band registration
 // Show currently open chat rooms



 // Allows chat boxes to be resized by dragging them

/* END: Removable components */ _converse_headless__WEBPACK_IMPORTED_MODULE_6__._converse.exports.CustomElement = shared_components_element__WEBPACK_IMPORTED_MODULE_4__.CustomElement;
const initialize = _converse_headless__WEBPACK_IMPORTED_MODULE_6__.converse.initialize;
_converse_headless__WEBPACK_IMPORTED_MODULE_6__.converse.initialize = function(settings, callback) {
    if (Array.isArray(settings.whitelisted_plugins)) {
        settings.whitelisted_plugins = settings.whitelisted_plugins.concat(_shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.VIEW_PLUGINS);
    } else {
        settings.whitelisted_plugins = _shared_constants_js__WEBPACK_IMPORTED_MODULE_5__.VIEW_PLUGINS;
    }
    return initialize(settings, callback);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_converse_headless__WEBPACK_IMPORTED_MODULE_6__.converse);


/***/ }),

/***/ "./src/log/index.js":
/*!**************************!*\
  !*** ./src/log/index.js ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LEVELS: () => (/* binding */ LEVELS),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   isElement: () => (/* binding */ isElement)
/* harmony export */ });
/**
 * @type {Object.<string, number>}
 */ var _console, _console1, _console2, _console3;
const LEVELS = {
    debug: 0,
    info: 1,
    warn: 2,
    error: 3,
    fatal: 4
};
const logger = Object.assign({
    debug: ((_console = console) === null || _console === void 0 ? void 0 : _console.log) ? console.log.bind(console) : function noop() {},
    error: ((_console1 = console) === null || _console1 === void 0 ? void 0 : _console1.log) ? console.log.bind(console) : function noop() {},
    info: ((_console2 = console) === null || _console2 === void 0 ? void 0 : _console2.log) ? console.log.bind(console) : function noop() {},
    warn: ((_console3 = console) === null || _console3 === void 0 ? void 0 : _console3.log) ? console.log.bind(console) : function noop() {}
}, console);
/**
 * Logs messages to the console.
 * Available loglevels are:
 *      - 0: 'debug'
 *      - 1: 'info'
 *      - 2: 'warn',
 *      - 3: 'error'
 *      - 4: 'fatal'.
 * When using the 'error' or 'warn' loglevels, a full stacktrace will be logged as well.
 * @namespace log
 */ const log = {
    /** @type {keyof LEVELS} The current log level */ loglevel: "info",
    /**
     * Sets the current log level which determines which messages are logged
     * @param {keyof LEVELS} level - The log level to set
     * @throws {Error} If an invalid log level is provided
     */ setLogLevel (level) {
        if (![
            "debug",
            "info",
            "warn",
            "error",
            "fatal"
        ].includes(/** @type {string} */ level)) {
            throw new Error(`Invalid loglevel: ${level}`);
        }
        this.loglevel = level;
    },
    /**
     * Logs a message at the specified level with optional CSS styling
     * @param {any} message - The message to log
     * @param {keyof LEVELS} level - The log level to use
     * @param {string} [style=""] - Optional CSS styles to apply to the log message
     */ log (message, level, style = "") {
        if (LEVELS[level] < LEVELS[this.loglevel]) {
            return;
        }
        if (level === "error" || level === "fatal") {
            style = style || "color: maroon";
        } else if (level === "debug") {
            style = style || "color: green";
        }
        if (message instanceof Error) {
            message = message.stack;
        } else if (isElement(message)) {
            message = /** @type {Element} */ message.outerHTML;
        }
        const prefix = style ? "%c" : "";
        if (level === "error") {
            logger.error(`${prefix} ERROR: ${message}`, style);
        } else if (level === "warn") {
            logger.warn(`${prefix} ${new Date().toISOString()} WARNING: ${message}`, style);
        } else if (level === "fatal") {
            logger.error(`${prefix} FATAL: ${message}`, style);
        } else if (level === "debug") {
            logger.debug(`${prefix} ${new Date().toISOString()} DEBUG: ${message}`, style);
        } else {
            logger.info(`${prefix} ${new Date().toISOString()} INFO: ${message}`, style);
        }
    },
    /**
     * @param {any} message - The message to log
     * @param {string} [style=""] - Optional CSS styles to apply to the log message
     */ debug (message, style) {
        this.log(message, "debug", style);
    },
    /**
     * @param {any} message - The message to log
     * @param {string} [style=""] - Optional CSS styles to apply to the log message
     */ error (message, style) {
        this.log(message, "error", style);
    },
    /**
     * @param {any} message - The message to log
     * @param {string} [style=""] - Optional CSS styles to apply to the log message
     */ info (message, style) {
        this.log(message, "info", style);
    },
    /**
     * @param {any} message - The message to log
     * @param {string} [style=""] - Optional CSS styles to apply to the log message
     */ warn (message, style) {
        this.log(message, "warn", style);
    },
    /**
     * @param {any} message - The message to log
     * @param {string} [style=""] - Optional CSS styles to apply to the log message
     */ fatal (message, style) {
        this.log(message, "fatal", style);
    }
};
/**
 * @param {unknown} el - The value to check
 * @returns {boolean} True if the value is an Element or Document
 */ function isElement(el) {
    return el instanceof Element || el instanceof Document;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (log);


/***/ }),

/***/ "./src/plugins/adhoc-views/adhoc-commands.js":
/*!***************************************************!*\
  !*** ./src/plugins/adhoc-views/adhoc-commands.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdHocCommands)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var _templates_ad_hoc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/ad-hoc.js */ "./src/plugins/adhoc-views/templates/ad-hoc.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { Strophe, sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
class AdHocCommands extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    /**
    * @typedef {import('@converse/headless/types/plugins/adhoc/types').AdHocCommandAction} AdHocCommandAction
    * @typedef {import('./types').AdHocCommandUIProps} AdHocCommandUIProps
    */ static get properties() {
        return {
            alert: {
                type: String
            },
            alert_type: {
                type: String
            },
            commands: {
                type: Array
            },
            fetching: {
                type: Boolean
            },
            showform: {
                type: String
            },
            view: {
                type: String
            }
        };
    }
    render() {
        return (0,_templates_ad_hoc_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ fetchCommands(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            if (!(ev.target instanceof HTMLFormElement)) {
                this.alert_type = 'danger';
                this.alert = 'Form could not be submitted';
                return;
            }
            this.fetching = true;
            delete this.alert_type;
            delete this.alert;
            const form_data = new FormData(ev.target);
            const jid = /** @type {string} */ form_data.get('jid').trim();
            let supported;
            try {
                supported = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.supports(Strophe.NS.ADHOC, jid);
            } catch (e) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
            } finally{
                this.fetching = false;
            }
            if (supported) {
                try {
                    this.commands = /** @type {AdHocCommandUIProps[]} */ yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.adhoc.getCommands(jid);
                    this.view = 'list-commands';
                } catch (e) {
                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                    this.alert_type = 'danger';
                    this.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Sorry, an error occurred while looking for commands on that entity.');
                    this.commands = /** @type {AdHocCommandUIProps[]} */ [];
                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                    return;
                }
            } else {
                this.commands = [];
                this.alert_type = 'danger';
                this.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)("The specified entity doesn't support ad-hoc commands");
            }
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ toggleCommandForm(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const node = /** @type {Element} */ ev.target.getAttribute('data-command-node');
            const cmd = this.commands.filter((c)=>c.node === node)[0];
            const { jid } = cmd;
            if (this.showform === node) {
                this.showform = '';
                this.requestUpdate();
            } else {
                try {
                    const xform = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.adhoc.fetchCommandForm(jid, node);
                    Object.assign(cmd, xform);
                } catch (e) {
                    if (e === null) {
                        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(`Error: timeout while trying to execute command for ${jid}`);
                    } else {
                        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(`Error while trying to execute command for ${jid}`);
                        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                    }
                    cmd.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('An error occurred while trying to fetch the command form');
                    cmd.alert_type = 'danger';
                }
                this.showform = node;
            }
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ executeAction(ev) {
        ev.preventDefault();
        const form = /** @type {HTMLFormElement} */ ev.target;
        const action = form.getAttribute('data-action');
        if ([
            'execute',
            'next',
            'prev',
            'complete'
        ].includes(action)) {
            this.runCommand(form.form, /** @type {AdHocCommandAction} */ action);
        } else {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(`Unknown action: ${action}`);
        }
    }
    /**
     * @param {AdHocCommandUIProps} cmd
     */ clearCommand(cmd) {
        delete cmd.alert;
        delete cmd.instructions;
        delete cmd.sessionid;
        delete cmd.alert_type;
        delete cmd.status;
        cmd.fields = [];
        cmd.actions = [];
        this.showform = '';
    }
    /**
     * @param {HTMLFormElement} form
     * @param {AdHocCommandAction} action
     */ runCommand(form, action) {
        return _async_to_generator(function*() {
            const form_data = new FormData(form);
            const jid = /** @type {string} */ form_data.get('command_jid').trim();
            const node = /** @type {string} */ form_data.get('command_node').trim();
            const cmd = this.commands.filter((c)=>c.node === node)[0];
            delete cmd.alert;
            this.requestUpdate();
            const inputs = action === 'prev' ? [] : sizzle(':input:not([type=button]):not([type=submit])', form).filter(/** @param {HTMLInputElement} i */ (i)=>![
                    'command_jid',
                    'command_node'
                ].includes(i.getAttribute('name'))).map(utils_html_js__WEBPACK_IMPORTED_MODULE_5__.getNameAndValue).filter(/** @param {unknown} [n] */ (n)=>n);
            const response = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.adhoc.runCommand(jid, cmd.sessionid, cmd.node, action, inputs);
            const { fields, status, note, instructions, actions } = response;
            if (status === 'error') {
                cmd.status = status;
                cmd.alert_type = 'danger';
                cmd.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Sorry, an error occurred while trying to execute the command. See the developer console for details');
                return this.requestUpdate();
            }
            if (status === 'executing') {
                Object.assign(cmd, {
                    fields,
                    instructions,
                    actions,
                    status
                });
                cmd.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Executing');
                cmd.alert_type = 'primary';
            } else if (status === 'completed') {
                this.alert_type = 'primary';
                this.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Completed');
                this.note = note;
                this.clearCommand(cmd);
            } else {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(`Unexpected status for ad-hoc command: ${status}`);
                cmd.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Completed');
                cmd.alert_type = 'primary';
            }
            this.requestUpdate();
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ cancel(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            this.showform = '';
            this.requestUpdate();
            const form_data = new FormData(/** @type {HTMLFormElement} */ ev.target.form);
            const jid = /** @type {string} */ form_data.get('command_jid').trim();
            const node = /** @type {string} */ form_data.get('command_node').trim();
            const cmd = this.commands.filter((c)=>c.node === node)[0];
            delete cmd.alert;
            this.requestUpdate();
            const { status } = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.adhoc.runCommand(jid, cmd.sessionid, cmd.node, 'cancel', []);
            if (status === 'error') {
                cmd.alert_type = 'danger';
                cmd.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('An error occurred while trying to cancel the command. See the developer console for details');
            } else if (status === 'canceled') {
                this.alert_type = '';
                this.alert = '';
                this.clearCommand(cmd);
            } else {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(`Unexpected status for ad-hoc command: ${status}`);
                cmd.alert = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Error: unexpected result');
                cmd.alert_type = 'danger';
            }
            this.requestUpdate();
        }).call(this);
    }
    constructor(){
        super();
        this.view = 'choose-service';
        this.fetching = false;
        this.showform = '';
        this.commands = /** @type {AdHocCommandUIProps[]} */ [];
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-adhoc-commands', AdHocCommands);


/***/ }),

/***/ "./src/plugins/adhoc-views/index.js":
/*!******************************************!*\
  !*** ./src/plugins/adhoc-views/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _adhoc_commands_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adhoc-commands.js */ "./src/plugins/adhoc-views/adhoc-commands.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @description
 *  Converse.js plugin which provides the UI for XEP-0050 Ad-Hoc commands
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.plugins.add('converse-adhoc-views', {
    dependencies: [
        "converse-controlbox",
        "converse-muc"
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.extend({
            'allow_adhoc_commands': true
        });
    }
});


/***/ }),

/***/ "./src/plugins/adhoc-views/templates/ad-hoc-command-form.js":
/*!******************************************************************!*\
  !*** ./src/plugins/adhoc-views/templates/ad-hoc-command-form.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");
/**
 * @typedef {import('lit').TemplateResult} TemplateResult
 * @typedef {import('../adhoc-commands').default} AdHocCommands
 * @typedef {import('../types').AdHocCommandUIProps} AdHocCommandUIProps
 */ 


const ACTION_MAP = {
    execute: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Execute'),
    prev: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Previous'),
    next: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Next'),
    complete: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Complete')
};
const NOTE_ALERT_MAP = {
    'info': 'primary',
    'warn': 'secondary',
    'error': 'danger'
};
/**
 * @param {AdHocCommandUIProps} command
 */ function tplReportedTable(command) {
    var _command_reported, _command_items;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<table class="table"><thead class="thead-light">${(_command_reported = command.reported) === null || _command_reported === void 0 ? void 0 : _command_reported.map((r)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<th scope="col" data-var="${r.var}">${r.label}</th>`)}</thead><tbody>${(_command_items = command.items) === null || _command_items === void 0 ? void 0 : _command_items.map((fields)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<tr>${fields.map((f)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<td data-var="${f.var}">${f.value}</td>`)}</tr>`)}</tbody></table>`;
}
/**
 * @param {AdHocCommands} el
 * @param {AdHocCommandUIProps} command
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el, command)=>{
    var _command_fields, _command_actions, _command_actions1;
    const i18n_cancel = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel');
    var _command_fields_map;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span><form class="converse-form">${command.alert ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-${command.alert_type}" role="alert">${command.alert}</div>` : ''} ${command.note ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-${NOTE_ALERT_MAP[command.note.type || 'info']}" role="alert">${command.note.text}</div>` : ''} ${command.type === 'result' && command.title ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-info">${command.title}</div>` : ''} ${command.type === 'form' && command.title ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<h6>${command.title}</h6>` : ''}<fieldset><input type="hidden" name="command_node" value="${command.node}"> <input type="hidden" name="command_jid" value="${command.jid}"> ${command.instructions ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="form-instructions">${command.instructions}</p>` : ''} ${command.type === 'result' ? tplReportedTable(command) : ''} ${(_command_fields_map = (_command_fields = command.fields) === null || _command_fields === void 0 ? void 0 : _command_fields.map((f)=>(0,utils_html_js__WEBPACK_IMPORTED_MODULE_2__.xFormField2TemplateResult)(f), {
        domain: command.jid
    })) !== null && _command_fields_map !== void 0 ? _command_fields_map : ''}</fieldset>${((_command_actions = command.actions) === null || _command_actions === void 0 ? void 0 : _command_actions.length) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<fieldset>${(_command_actions1 = command.actions) === null || _command_actions1 === void 0 ? void 0 : _command_actions1.map((action)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input data-action="${action}" @click="${(ev)=>el.executeAction(ev)}" type="button" class="btn btn-primary" value="${ACTION_MAP[action]}">`)} <input type="button" class="btn btn-secondary button-cancel" value="${i18n_cancel}" @click="${(ev)=>el.cancel(ev)}"></fieldset>` : ''}</form></span>`;
});


/***/ }),

/***/ "./src/plugins/adhoc-views/templates/ad-hoc-command.js":
/*!*************************************************************!*\
  !*** ./src/plugins/adhoc-views/templates/ad-hoc-command.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _ad_hoc_command_form_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ad-hoc-command-form.js */ "./src/plugins/adhoc-views/templates/ad-hoc-command-form.js");


/**
 * @param {import('../adhoc-commands').default} el
 * @param {import('../types').AdHocCommandUIProps} command
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el, command)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-item list-group-item"><div class="available-chatroom d-flex flex-row"><a class="open-room available-room w-100" @click="${(ev)=>el.toggleCommandForm(ev)}" data-command-node="${command.node}" data-command-jid="${command.jid}" data-command-name="${command.name}" title="${command.name}" href="#">${command.name || command.jid}</a></div>${command.node === el.showform ? (0,_ad_hoc_command_form_js__WEBPACK_IMPORTED_MODULE_1__["default"])(el, command) : ''}</li>`);


/***/ }),

/***/ "./src/plugins/adhoc-views/templates/ad-hoc.js":
/*!*****************************************************!*\
  !*** ./src/plugins/adhoc-views/templates/ad-hoc.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _ad_hoc_command_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ad-hoc-command.js */ "./src/plugins/adhoc-views/templates/ad-hoc-command.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_muc_views_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/muc-views/utils.js */ "./src/plugins/muc-views/utils.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/**
 * @typedef {import('../adhoc-commands').default} AdHocCommands
 */ 



/**
 * @param {AdHocCommands} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_choose_service = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('On which entity do you want to run commands?');
    const i18n_choose_service_instructions = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Certain XMPP services and entities allow privileged users to execute ad-hoc commands on them.');
    const i18n_commands_found = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Commands found');
    const i18n_fetch_commands = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('List available commands');
    const i18n_jid_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('XMPP Address');
    const i18n_no_commands_found = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No commands found');
    return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`${el.alert ? (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<div class="alert alert-${el.alert_type}" role="alert">${el.alert}</div>` : ''} ${el.note ? (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<p class="form-help">${el.note}</p>` : ''}<form class="converse-form" @submit="${el.fetchCommands}"><fieldset><label class="form-label">${i18n_choose_service}<p class="form-help">${i18n_choose_service_instructions}</p><converse-autocomplete .getAutoCompleteList="${plugins_muc_views_utils_js__WEBPACK_IMPORTED_MODULE_2__.getAutoCompleteList}" required placeholder="${i18n_jid_placeholder}" name="jid"></converse-autocomplete></label></fieldset><fieldset>${el.fetching ? (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<converse-spinner></converse-spinner>` : (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<input type="submit" class="btn btn-primary" value="${i18n_fetch_commands}">`}</fieldset>${el.view === 'list-commands' ? (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<fieldset><ul class="list-group"><li class="list-group-item active">${el.commands.length ? i18n_commands_found : i18n_no_commands_found}:</li>${el.commands.map((cmd)=>(0,_ad_hoc_command_js__WEBPACK_IMPORTED_MODULE_0__["default"])(el, cmd))}</ul></fieldset>` : ''}</form>`;
});


/***/ }),

/***/ "./src/plugins/bookmark-views/components/bookmark-form.js":
/*!****************************************************************!*\
  !*** ./src/plugins/bookmark-views/components/bookmark-form.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _templates_form_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/form.js */ "./src/plugins/bookmark-views/components/templates/form.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



class MUCBookmarkForm extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            'jid': {
                type: String
            }
        };
    }
    /**
     * @param {Map<PropertyKey, any>} changed_properties
     * @return {void}
     */ willUpdate(changed_properties) {
        const { chatboxes, bookmarks } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state;
        if (changed_properties.has('jid')) {
            this.model = chatboxes.get(this.jid);
            this.bookmark = bookmarks.get(this.jid);
        }
    }
    render() {
        return (0,_templates_form_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
    }
    /**
     * @param {Event} ev
     */ onBookmarkFormSubmitted(ev) {
        var /** @type {HTMLInputElement} */ _form_querySelector, /** @type {HTMLInputElement} */ _form_querySelector1, /** @type {HTMLInputElement} */ _form_querySelector2, /** @type {HTMLInputElement} */ _form_querySelector3;
        ev.preventDefault();
        const { bookmarks } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state;
        const form = /** @type {HTMLFormElement} */ ev.target;
        bookmarks.setBookmark({
            jid: this.jid,
            autojoin: ((_form_querySelector = form.querySelector('input[name="autojoin"]')) === null || _form_querySelector === void 0 ? void 0 : _form_querySelector.checked) || false,
            name: (_form_querySelector1 = form.querySelector('input[name=name]')) === null || _form_querySelector1 === void 0 ? void 0 : _form_querySelector1.value,
            nick: (_form_querySelector2 = form.querySelector('input[name=nick]')) === null || _form_querySelector2 === void 0 ? void 0 : _form_querySelector2.value,
            password: (_form_querySelector3 = form.querySelector('input[name=password]')) === null || _form_querySelector3 === void 0 ? void 0 : _form_querySelector3.value
        });
        this.closeBookmarkForm(ev);
    }
    /**
     * @param {Event} ev
     */ removeBookmark(ev) {
        var _this_bookmark;
        (_this_bookmark = this.bookmark) === null || _this_bookmark === void 0 ? void 0 : _this_bookmark.destroy();
        this.closeBookmarkForm(ev);
    }
    /**
     * @param {Event} ev
     */ closeBookmarkForm(ev) {
        ev.preventDefault();
        this.dispatchEvent(new Event('hide.bs.modal', {
            bubbles: true,
            cancelable: true
        }));
    }
    constructor(){
        super();
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-muc-bookmark-form', MUCBookmarkForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCBookmarkForm);


/***/ }),

/***/ "./src/plugins/bookmark-views/components/bookmarks-list.js":
/*!*****************************************************************!*\
  !*** ./src/plugins/bookmark-views/components/bookmarks-list.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ BookmarksView)
/* harmony export */ });
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _templates_list_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/list.js */ "./src/plugins/bookmark-views/components/templates/list.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _styles_bookmarks_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../styles/bookmarks.scss */ "./src/plugins/bookmark-views/styles/bookmarks.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}







const { initStorage } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u;
class BookmarksView extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__.CustomElement {
    initialize() {
        return _async_to_generator(function*() {
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.waitUntil('bookmarksInitialized');
            const { bookmarks, chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
            this.liveFilter = (0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_6__["default"])((ev)=>this.model.set({
                    text: ev.target.value
                }), 100);
            this.listenTo(bookmarks, 'add', ()=>this.requestUpdate());
            this.listenTo(bookmarks, 'remove', ()=>this.requestUpdate());
            this.listenTo(chatboxes, 'add', ()=>this.requestUpdate());
            this.listenTo(chatboxes, 'remove', ()=>this.requestUpdate());
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('bare_jid');
            const id = `converse.bookmarks-list-model-${bare_jid}`;
            this.model = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model({
                id
            });
            initStorage(this.model, id);
            this.listenTo(this.model, 'change', ()=>this.requestUpdate());
            this.model.fetch({
                'success': ()=>this.requestUpdate(),
                'error': ()=>this.requestUpdate()
            });
        }).call(this);
    }
    render() {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.bookmarks && this.model ? (0,_templates_list_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this) : (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_3__["default"])();
    }
    /**
     * @param {Event} ev
     */ clearFilter(ev) {
        var _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        this.model.set('text', '');
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-bookmarks', BookmarksView);


/***/ }),

/***/ "./src/plugins/bookmark-views/components/templates/form.js":
/*!*****************************************************************!*\
  !*** ./src/plugins/bookmark-views/components/templates/form.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_bookmark, _el_bookmark1;
    const name = el.model.getDisplayName();
    var _el_bookmark_get;
    const nick = (_el_bookmark_get = (_el_bookmark = el.bookmark) === null || _el_bookmark === void 0 ? void 0 : _el_bookmark.get('nick')) !== null && _el_bookmark_get !== void 0 ? _el_bookmark_get : el.model.get('nick');
    const i18n_heading = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Bookmark for "%1$s"', name);
    const i18n_autojoin = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Would you like this groupchat to be automatically joined upon startup?');
    const i18n_remove = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove');
    const i18n_name = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Name');
    const i18n_nick = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('What should your nickname for this groupchat be?');
    const i18n_password = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Password (for a protected groupchat)');
    const i18n_password_help = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If the groupchat requires a password to enter, you can save it here. Note this is not intended to be a secure storage.');
    const i18n_submit = el.bookmark ? (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Update') : (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Save');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="converse-form chatroom-form" @submit="${(ev)=>el.onBookmarkFormSubmitted(ev)}"><legend>${i18n_heading}</legend><fieldset><label class="form-label" for="converse_muc_bookmark_name">${i18n_name}</label> <input class="form-control" type="text" value="${name}" name="name" required="required" id="converse_muc_bookmark_name"></fieldset><fieldset><label class="form-label" for="converse_muc_bookmark_nick">${i18n_nick}</label> <input class="form-control" type="text" name="nick" value="${nick || ''}" id="converse_muc_bookmark_nick"></fieldset><fieldset><label for="muc-password" class="form-label">${i18n_password}</label><p class="form-help">${i18n_password_help}</p><input type="password" name="password" class="form-control" id="muc-password"></fieldset><fieldset class="form-group form-check"><input class="form-check-input" id="converse_muc_bookmark_autojoin" type="checkbox" ?checked="${(_el_bookmark1 = el.bookmark) === null || _el_bookmark1 === void 0 ? void 0 : _el_bookmark1.get('autojoin')}" name="autojoin"> <label class="form-check-label" for="converse_muc_bookmark_autojoin">${i18n_autojoin}</label></fieldset><fieldset><input class="btn btn-primary" type="submit" value="${i18n_submit}"> ${el.bookmark ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input class="btn btn-secondary button-remove" type="button" value="${i18n_remove}" @click="${(ev)=>el.removeBookmark(ev)}">` : ''}</fieldset></form>`;
});


/***/ }),

/***/ "./src/plugins/bookmark-views/components/templates/item.js":
/*!*****************************************************************!*\
  !*** ./src/plugins/bookmark-views/components/templates/item.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils.js */ "./src/plugins/bookmark-views/utils.js");



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((bm)=>{
    const jid = bm.get('jid');
    const info_remove_bookmark = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Unbookmark this groupchat');
    const open_title = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to open this groupchat');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="list-item room-item available-chatroom d-flex flex-row" data-room-jid="${jid}"><a class="list-item-link open-room w-100" data-room-jid="${jid}" title="${open_title}" @click="${_utils_js__WEBPACK_IMPORTED_MODULE_2__.openRoomViaEvent}">${bm.getDisplayName()}</a> <a class="list-item-action remove-bookmark align-self-center ${bm.get('bookmarked') ? 'button-on' : ''}" tabindex="0" data-room-jid="${jid}" data-bookmark-name="${bm.getDisplayName()}" title="${info_remove_bookmark}" @click="${_utils_js__WEBPACK_IMPORTED_MODULE_2__.removeBookmarkViaEvent}"><converse-icon class="fa fa-times" size="1em"></converse-icon></a></div>`;
});


/***/ }),

/***/ "./src/plugins/bookmark-views/components/templates/list.js":
/*!*****************************************************************!*\
  !*** ./src/plugins/bookmark-views/components/templates/list.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _item_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./item.js */ "./src/plugins/bookmark-views/components/templates/item.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");




const filterBookmark = (b, text)=>{
    var _b_get, _b_get1;
    return ((_b_get = b.get('name')) === null || _b_get === void 0 ? void 0 : _b_get.includes(text)) || ((_b_get1 = b.get('jid')) === null || _b_get1 === void 0 ? void 0 : _b_get1.includes(text));
};
/**
 * @param {import('../bookmarks-list').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter');
    const filter_text = el.model.get('text');
    const { bookmarks } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state;
    const shown_bookmarks = filter_text ? bookmarks.filter((b)=>filterBookmark(b, filter_text)) : bookmarks;
    return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<form class="converse-form bookmarks-filter"><div class="btn-group w-100"><input .value="${filter_text !== null && filter_text !== void 0 ? filter_text : ''}" @keydown="${(ev)=>el.liveFilter(ev)}" class="form-control" placeholder="${i18n_placeholder}"><converse-icon size="1em" class="fa fa-times clear-input ${!filter_text ? 'hidden' : ''}" @click="${el.clearFilter}"></converse-icon></div></form><div class="list-container list-container--bookmarks"><div class="items-list bookmarks rooms-list">${shown_bookmarks.map((bm)=>(0,_item_js__WEBPACK_IMPORTED_MODULE_0__["default"])(bm))}</div></div>`;
});


/***/ }),

/***/ "./src/plugins/bookmark-views/index.js":
/*!*********************************************!*\
  !*** ./src/plugins/bookmark-views/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _modals_bookmark_list_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modals/bookmark-list.js */ "./src/plugins/bookmark-views/modals/bookmark-list.js");
/* harmony import */ var _modals_bookmark_form_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modals/bookmark-form.js */ "./src/plugins/bookmark-views/modals/bookmark-form.js");
/* harmony import */ var _components_bookmark_form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/bookmark-form.js */ "./src/plugins/bookmark-views/components/bookmark-form.js");
/* harmony import */ var _components_bookmarks_list_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/bookmarks-list.js */ "./src/plugins/bookmark-views/components/bookmarks-list.js");
/* harmony import */ var _mixins_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mixins.js */ "./src/plugins/bookmark-views/mixins.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/bookmark-views/utils.js");
/* harmony import */ var _styles_bookmarks_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./styles/bookmarks.scss */ "./src/plugins/bookmark-views/styles/bookmarks.scss");
/**
 * @copyright 2025, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 







_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-bookmark-views', {
    /* Plugin dependencies are other plugins which might be
     * overridden or relied upon, and therefore need to be loaded before
     * this plugin.
     *
     * If the setting "strict_plugin_dependencies" is set to true,
     * an error will be raised if the plugin is not found. By default it's
     * false, which means these plugins are only loaded opportunistically.
     */ dependencies: [
        'converse-chatboxes',
        'converse-muc',
        'converse-muc-views'
    ],
    initialize () {
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            hide_open_bookmarks: true
        });
        const exports = {
            removeBookmarkViaEvent: _utils_js__WEBPACK_IMPORTED_MODULE_6__.removeBookmarkViaEvent,
            MUCBookmarkForm: _components_bookmark_form_js__WEBPACK_IMPORTED_MODULE_3__["default"],
            BookmarksView: _components_bookmarks_list_js__WEBPACK_IMPORTED_MODULE_4__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, exports);
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.ChatRoomView.prototype, _mixins_js__WEBPACK_IMPORTED_MODULE_5__.BookmarkableChatRoomView);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatRoomViewInitialized', /** @param {BookmarkableChatRoomView} view */ (view)=>view.setBookmarkState());
    }
});


/***/ }),

/***/ "./src/plugins/bookmark-views/mixins.js":
/*!**********************************************!*\
  !*** ./src/plugins/bookmark-views/mixins.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BookmarkableChatRoomView: () => (/* binding */ BookmarkableChatRoomView)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");

const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const BookmarkableChatRoomView = {
    /**
     * Set whether the groupchat is bookmarked or not.
     * @private
     */ setBookmarkState () {
        const { bookmarks } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        if (bookmarks) {
            const models = bookmarks.where({
                'jid': this.model.get('jid')
            });
            if (!models.length) {
                this.model.save('bookmarked', false);
            } else {
                this.model.save('bookmarked', true);
            }
        }
    },
    renderBookmarkForm () {
        if (!this.bookmark_form) {
            this.bookmark_form = new _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.MUCBookmarkForm({
                'model': this.model,
                'chatroomview': this
            });
            const container_el = this.querySelector('.chatroom-body');
            container_el.insertAdjacentElement('beforeend', this.bookmark_form.el);
        }
        u.showElement(this.bookmark_form.el);
    },
    showBookmarkModal (ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        const jid = this.model.get('jid');
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-bookmark-form-modal', {
            jid
        }, ev);
    }
};


/***/ }),

/***/ "./src/plugins/bookmark-views/modals/bookmark-form.js":
/*!************************************************************!*\
  !*** ./src/plugins/bookmark-views/modals/bookmark-form.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ BookmarkFormModal)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _components_bookmark_form_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/bookmark-form.js */ "./src/plugins/bookmark-views/components/bookmark-form.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");





class BookmarkFormModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    renderModal() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-bookmark-form class="muc-form-container" jid="${this.jid}"></converse-muc-bookmark-form>`;
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Bookmark');
    }
    constructor(options){
        super(options);
        this.jid = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-bookmark-form-modal', BookmarkFormModal);


/***/ }),

/***/ "./src/plugins/bookmark-views/modals/bookmark-list.js":
/*!************************************************************!*\
  !*** ./src/plugins/bookmark-views/modals/bookmark-list.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ BookmarkListModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _components_bookmarks_list_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/bookmarks-list.js */ "./src/plugins/bookmark-views/components/bookmarks-list.js");





class BookmarkListModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    renderModal() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-bookmarks></converse-bookmarks>`;
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Bookmarks');
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-bookmark-list-modal', BookmarkListModal);


/***/ }),

/***/ "./src/plugins/bookmark-views/styles/bookmarks.scss":
/*!**********************************************************!*\
  !*** ./src/plugins/bookmark-views/styles/bookmarks.scss ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_bookmarks_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./bookmarks.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/bookmark-views/styles/bookmarks.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_bookmarks_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_bookmarks_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_bookmarks_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_bookmarks_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/bookmark-views/utils.js":
/*!*********************************************!*\
  !*** ./src/plugins/bookmark-views/utils.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   openRoomViaEvent: () => (/* binding */ openRoomViaEvent),
/* harmony export */   removeBookmarkViaEvent: () => (/* binding */ removeBookmarkViaEvent)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


/**
 * @param {Event} ev
 */ function removeBookmarkViaEvent(ev) {
    return _async_to_generator(function*() {
        ev.preventDefault();
        const el = /** @type {Element} */ ev.currentTarget;
        const name = el.getAttribute('data-bookmark-name');
        const jid = el.getAttribute('data-room-jid');
        const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Are you sure you want to remove the bookmark "%1$s"?', name));
        if (result) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.bookmarks.where({
                jid
            }).forEach(/** @param {import('@converse/headless').Bookmark} b */ (b)=>b.destroy());
        }
    })();
}
/**
 * @param {Event} ev
 */ function openRoomViaEvent(ev) {
    ev.preventDefault();
    const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
    const el = /** @type {Element} */ ev.currentTarget;
    const name = el.textContent;
    const jid = el.getAttribute('data-room-jid');
    const data = {
        'name': name || Strophe.unescapeNode(Strophe.getNodeFromJid(jid)) || jid
    };
    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.open(jid, data, true);
}


/***/ }),

/***/ "./src/plugins/chatboxviews/container.js":
/*!***********************************************!*\
  !*** ./src/plugins/chatboxviews/container.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class ChatBoxViews {
    add(key, val) {
        this.views[key] = val;
    }
    get(key) {
        return this.views[key];
    }
    xget(id) {
        return this.keys().filter((k)=>k !== id).reduce((acc, k)=>{
            acc[k] = this.views[k];
            return acc;
        }, {});
    }
    getAll() {
        return Object.values(this.views);
    }
    keys() {
        return Object.keys(this.views);
    }
    remove(key) {
        delete this.views[key];
    }
    map(f) {
        return Object.values(this.views).map(f);
    }
    forEach(f) {
        return Object.values(this.views).forEach(f);
    }
    filter(f) {
        return Object.values(this.views).filter(f);
    }
    closeAllChatBoxes() {
        return Promise.all(Object.values(this.views).map((v)=>v.close({
                'name': 'closeAllChatBoxes'
            })));
    }
    constructor(){
        this.views = {};
        this.el = null;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatBoxViews);


/***/ }),

/***/ "./src/plugins/chatboxviews/index.js":
/*!*******************************************!*\
  !*** ./src/plugins/chatboxviews/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _view_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view.js */ "./src/plugins/chatboxviews/view.js");
/* harmony import */ var _container_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container.js */ "./src/plugins/chatboxviews/container.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/chatboxviews/utils.js");
/* harmony import */ var _styles_chats_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/chats.scss */ "./src/plugins/chatboxviews/styles/chats.scss");
/**
 * @copyright 2024, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 




_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-chatboxviews', {
    dependencies: [
        'converse-chatboxes',
        'converse-vcard'
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.promises.add([
            'chatBoxViewsInitialized'
        ]);
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            'animate': true
        });
        const chatboxviews = new _container_js__WEBPACK_IMPORTED_MODULE_2__["default"]();
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, {
            chatboxviews
        }); // XXX DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state, {
            chatboxviews
        });
        /************************ BEGIN Event Handlers ************************/ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxesInitialized', ()=>{
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.on('destroy', (m)=>chatboxviews.remove(m.get('jid')));
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('cleanup', ()=>Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, {
                chatboxviews: null
            })); // DEPRECATED
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('cleanup', ()=>delete _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('clearSession', ()=>chatboxviews.closeAllChatBoxes());
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxViewsInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_3__.calculateViewportHeightUnit);
        window.addEventListener('resize', _utils_js__WEBPACK_IMPORTED_MODULE_3__.calculateViewportHeightUnit);
        /************************ END Event Handlers ************************/ Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse, {
            /**
             * Public API method which will ensure that the #conversejs element
             * is inserted into a container element.
             *
             * This method is useful when the #conversejs element has been
             * detached from the DOM somehow.
             * @async
             * @memberOf converse
             * @method insertInto
             * @param {HTMLElement} container
             * @example
             * converse.insertInto(document.querySelector('#converse-container'));
             */ insertInto (container) {
                const el = chatboxviews.el;
                if (el && !container.contains(el)) {
                    container.insertAdjacentElement('afterbegin', el);
                } else if (!el) {
                    throw new Error('Cannot insert non-existing #conversejs element into the DOM');
                }
            }
        });
    }
});


/***/ }),

/***/ "./src/plugins/chatboxviews/styles/chats.scss":
/*!****************************************************!*\
  !*** ./src/plugins/chatboxviews/styles/chats.scss ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chats_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./chats.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatboxviews/styles/chats.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chats_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chats_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chats_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chats_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/chatboxviews/templates/chats.js":
/*!*****************************************************!*\
  !*** ./src/plugins/chatboxviews/templates/chats.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/utils */ "./src/shared/chat/utils.js");




const { CONTROLBOX_TYPE, CHATROOMS_TYPE, HEADLINES_TYPE, CONNECTION_STATUS } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.constants;
/**
 * @param {import('@converse/headless/types/shared/chatbox').default} c
 */ function shouldShowChat(c) {
    const is_minimized = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('view_mode') === 'overlayed' && c.get('hidden');
    return c.get('type') === CONTROLBOX_TYPE || !c.get('hidden') && !c.get('closed') && !is_minimized;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (()=>{
    const { chatboxes, connfeedback } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state;
    const view_mode = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('view_mode');
    const is_overlayed = view_mode === 'overlayed';
    const is_mobile = (0,shared_chat_utils__WEBPACK_IMPORTED_MODULE_3__.isMobileViewport)();
    const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.connection.get();
    const logged_out = !(connection === null || connection === void 0 ? void 0 : connection.connected) || !(connection === null || connection === void 0 ? void 0 : connection.authenticated) || (connection === null || connection === void 0 ? void 0 : connection.disconnecting);
    const connection_status = connfeedback.get('connection_status');
    const connecting = [
        'CONNECTED',
        'CONNECTING',
        'AUTHENTICATING',
        'RECONNECTING'
    ].includes(CONNECTION_STATUS[connection_status]);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${!logged_out && is_overlayed ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-minimized-chats class="col-auto"></converse-minimized-chats>` : ''} ${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(chatboxes.filter(shouldShowChat), (m)=>m.get('jid'), (m)=>{
        const width = m.get('width');
        const style = !is_mobile && is_overlayed && width ? `width: ${width}px` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing;
        if (m.get('type') === CONTROLBOX_TYPE) {
            return is_overlayed && m.get('closed') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-controlbox-toggle class="col-auto"></converse-controlbox-toggle>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-controlbox id="controlbox" class="col-auto chatbox ${logged_out && !connecting ? 'logged-out' : ''}" style="${style}"></converse-controlbox>`;
        } else if (m.get('type') === CHATROOMS_TYPE) {
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc jid="${m.get('jid')}" class="col-auto chatbox chatroom" style="${style}"></converse-muc>`;
        } else if (m.get('type') === HEADLINES_TYPE) {
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-headlines jid="${m.get('jid')}" class="col-auto chatbox headlines" style="${style}"></converse-headlines>`;
        } else {
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-chat jid="${m.get('jid')}" class="col-auto chatbox" style="${style}"></converse-chat>`;
        }
    })}`;
});


/***/ }),

/***/ "./src/plugins/chatboxviews/utils.js":
/*!*******************************************!*\
  !*** ./src/plugins/chatboxviews/utils.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   calculateViewportHeightUnit: () => (/* binding */ calculateViewportHeightUnit)
/* harmony export */ });
function calculateViewportHeightUnit() {
    const vh = window.innerHeight * 0.01;
    document.documentElement.style.setProperty('--vh', `${vh}px`);
}


/***/ }),

/***/ "./src/plugins/chatboxviews/view.js":
/*!******************************************!*\
  !*** ./src/plugins/chatboxviews/view.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_chats_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/chats.js */ "./src/plugins/chatboxviews/templates/chats.js");



class ConverseChats extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    initialize() {
        this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes;
        this.listenTo(this.model, 'add', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change:closed', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change:hidden', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change:jid', ()=>this.requestUpdate());
        this.listenTo(this.model, 'destroy', ()=>this.requestUpdate());
        // Use listenTo instead of api.listen.to so that event handlers
        // automatically get deregistered when the component is dismounted
        this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'connected', ()=>this.requestUpdate());
        this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'reconnected', ()=>this.requestUpdate());
        this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'disconnected', ()=>this.requestUpdate());
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
        this.listenTo(settings, 'change:view_mode', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:singleton', ()=>this.requestUpdate());
        const body = document.querySelector('body');
        body.classList.add(`converse-${_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode')}`);
        /**
         * Triggered once the ChatBoxViews view-colleciton has been initialized
         * @event _converse#chatBoxViewsInitialized
         * @example _converse.api.listen.on('chatBoxViewsInitialized', () => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('chatBoxViewsInitialized');
    }
    render() {
        return (0,_templates_chats_js__WEBPACK_IMPORTED_MODULE_2__["default"])();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-chats', ConverseChats);


/***/ }),

/***/ "./src/plugins/chatview/bottom-panel.js":
/*!**********************************************!*\
  !*** ./src/plugins/chatview/bottom-panel.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChatBottomPanel)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_bottom_panel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/bottom-panel.js */ "./src/plugins/chatview/templates/bottom-panel.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/chatview/utils.js");
/* harmony import */ var _message_form_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./message-form.js */ "./src/plugins/chatview/message-form.js");
/* harmony import */ var _styles_chat_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/chat-bottom-panel.scss */ "./src/plugins/chatview/styles/chat-bottom-panel.scss");
/**
 * @typedef {import('shared/chat/emoji-picker.js').default} EmojiPicker
 * @typedef {import('shared/chat/emoji-dropdown.js').default} EmojiDropdown
 * @typedef {import('./message-form.js').default} MessageForm
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class ChatBottomPanel extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            }
        };
    }
    connectedCallback() {
        var _this = this, _superprop_get_connectedCallback = ()=>super.connectedCallback;
        return _async_to_generator(function*() {
            _superprop_get_connectedCallback().call(_this);
            yield this.initialize();
            // Don't call in initialize, since the MUCBottomPanel subclasses it
            // and we want to render after it has finished as well.
            this.requestUpdate();
        }).call(this);
    }
    initialize() {
        return _async_to_generator(function*() {
            yield this.model.initialized;
            this.listenTo(this.model, 'change:num_unread', ()=>this.requestUpdate());
            this.listenTo(this.model, 'emoji-picker-autocomplete', this.autocompleteInPicker);
            this.addEventListener('emojipickerblur', ()=>/** @type {HTMLElement} */ this.querySelector('.chat-textarea').focus());
        }).call(this);
    }
    render() {
        if (!this.model) return '';
        return (0,_templates_bottom_panel_js__WEBPACK_IMPORTED_MODULE_2__["default"])({
            'model': this.model,
            'viewUnreadMessages': (ev)=>this.viewUnreadMessages(ev)
        });
    }
    viewUnreadMessages(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        this.model.ui.set({
            'scrolled': false
        });
    }
    onDragOver(ev) {
        ev.preventDefault();
    }
    clearMessages(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.clearMessages)(this.model);
    }
    /**
     * @typedef {Object} AutocompleteInPickerEvent
     * @property {HTMLTextAreaElement} target
     * @property {string} value
     * @param {AutocompleteInPickerEvent} ev
     */ autocompleteInPicker(ev) {
        return _async_to_generator(function*() {
            const { target: input, value } = ev;
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.emojis.initialize();
            const emoji_picker = /** @type {EmojiPicker} */ this.querySelector('converse-emoji-picker');
            if (emoji_picker) {
                emoji_picker.state.set({
                    ac_position: input.selectionStart,
                    autocompleting: value,
                    query: value
                });
                const emoji_dropdown = /** @type {EmojiDropdown} */ this.querySelector('converse-emoji-dropdown');
                emoji_dropdown === null || emoji_dropdown === void 0 ? void 0 : emoji_dropdown.dropdown.show();
            }
        }).call(this);
    }
    constructor(){
        super();
        this.model = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-chat-bottom-panel', ChatBottomPanel);


/***/ }),

/***/ "./src/plugins/chatview/chat.js":
/*!**************************************!*\
  !*** ./src/plugins/chatview/chat.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChatView)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_chatview_heading_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/chatview/heading.js */ "./src/plugins/chatview/heading.js");
/* harmony import */ var plugins_chatview_bottom_panel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/chatview/bottom-panel.js */ "./src/plugins/chatview/bottom-panel.js");
/* harmony import */ var shared_chat_baseview_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/baseview.js */ "./src/shared/chat/baseview.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! plugins/dragresize/mixin.js */ "./src/plugins/dragresize/mixin.js");
/* harmony import */ var _templates_chat_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./templates/chat.js */ "./src/plugins/chatview/templates/chat.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}







const { ACTIVE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class ChatView extends (0,plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_5__["default"])(shared_chat_baseview_js__WEBPACK_IMPORTED_MODULE_3__["default"]) {
    initialize() {
        return _async_to_generator(function*() {
            const { chatboxviews, chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            chatboxviews.add(this.jid, this);
            this.model = chatboxes.get(this.jid);
            this.listenTo(this.model, 'change:requesting', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:hidden', ()=>!this.model.get('hidden') && this.afterShown());
            this.listenTo(this.model, 'change:show_help_messages', ()=>this.requestUpdate());
            this.listenTo(this.model, 'contact:add', ()=>this.requestUpdate());
            this.listenTo(this.model, 'contact:change', ()=>this.requestUpdate());
            this.listenTo(this.model, 'contact:destroy', ()=>this.requestUpdate());
            document.addEventListener('visibilitychange', ()=>this.onWindowStateChanged());
            yield this.model.messages.fetched;
            !this.model.get('hidden') && this.afterShown();
            /**
         * Triggered once the {@link ChatView} has been initialized
         * @event _converse#chatBoxViewInitialized
         * @type {ChatView}
         * @example _converse.api.listen.on('chatBoxViewInitialized', view => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('chatBoxViewInitialized', this);
        }).call(this);
    }
    render() {
        return (0,_templates_chat_js__WEBPACK_IMPORTED_MODULE_6__["default"])(this);
    }
    getHelpMessages() {
        return [
            `<strong>/clear</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Remove messages')}`,
            `<strong>/close</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Close this chat')}`,
            `<strong>/me</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Write in the third person')}`,
            `<strong>/help</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Show this menu')}`
        ];
    }
    afterShown() {
        this.model.setChatState(ACTIVE);
        this.model.clearUnreadMsgCounter();
        this.maybeFocus();
    }
    constructor(...args){
        super(...args), _define_property(this, "length", 200);
    }
}
/**
 * The view of an open/ongoing chat conversation.
 */ 
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-chat', ChatView);


/***/ }),

/***/ "./src/plugins/chatview/heading.js":
/*!*****************************************!*\
  !*** ./src/plugins/chatview/heading.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChatHeading)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _templates_chat_head_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/chat-head.js */ "./src/plugins/chatview/templates/chat-head.js");
/* harmony import */ var shared_modals_user_details_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/modals/user-details.js */ "./src/shared/modals/user-details.js");
/* harmony import */ var _styles_chat_head_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/chat-head.scss */ "./src/plugins/chatview/styles/chat-head.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
class ChatHeading extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            jid: {
                type: String
            }
        };
    }
    initialize() {
        var _this_model_rosterContactAdded;
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        this.model = chatboxes.get(this.jid);
        this.listenTo(this.model, 'change:status', ()=>this.requestUpdate());
        this.listenTo(this.model, 'vcard:add', ()=>this.requestUpdate());
        this.listenTo(this.model, 'vcard:change', ()=>this.requestUpdate());
        if (this.model.contact) {
            this.listenTo(this.model.contact, 'destroy', ()=>this.requestUpdate());
        }
        (_this_model_rosterContactAdded = this.model.rosterContactAdded) === null || _this_model_rosterContactAdded === void 0 ? void 0 : _this_model_rosterContactAdded.then(()=>{
            this.listenTo(this.model.contact, 'change:nickname', ()=>this.requestUpdate());
            this.requestUpdate();
        });
        this.requestUpdate();
    }
    render() {
        return (0,_templates_chat_head_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    /**
     * @param {Event} ev
     */ showUserDetailsModal(ev) {
        var _this_model;
        ev.preventDefault();
        if (((_this_model = this.model) === null || _this_model === void 0 ? void 0 : _this_model.contact) instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.Profile) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-profile-modal', {
                model: this.model
            }, ev);
        } else {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-user-details-modal', {
                model: this.model
            }, ev);
        }
    }
    /**
     * @param {Event} ev
     */ close(ev) {
        ev.preventDefault();
        this.model.close();
    }
    /**
     * Returns a list of objects which represent buttons for the chat's header.
     * @emits _converse#getHeadingButtons
     * @returns {Promise<Array.<import('./types').HeadingButtonAttributes>>}
     */ getHeadingButtons() {
        return _async_to_generator(function*() {
            const buttons = [
                /** @type {import('./types').HeadingButtonAttributes} */ {
                    a_class: 'show-user-details-modal',
                    handler: /** @param {Event} ev */ (ev)=>this.showUserDetailsModal(ev),
                    i18n_text: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Details'),
                    i18n_title: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('See more information about this person'),
                    icon_class: 'fa-id-card',
                    name: 'details',
                    standalone: false
                }
            ];
            const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('domain');
            if (domain && (yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.supports(Strophe.NS.BLOCKING, domain))) {
                const blocklist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.blocklist.get();
                if (blocklist.get(this.model.get('jid'))) {
                    buttons.push({
                        a_class: 'unblock-user',
                        handler: /** @param {Event} ev */ (ev)=>_async_to_generator(function*() {
                                ev.preventDefault();
                                const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unblock user'), [
                                    (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Are you sure you want to unblock this user?')
                                ]);
                                if (result) {
                                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.blocklist.remove(this.model.get('jid'));
                                }
                            }).call(this),
                        i18n_text: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unblock this user'),
                        i18n_title: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Allow this user to send you messages'),
                        icon_class: 'fa-check',
                        name: 'unblock',
                        standalone: false
                    });
                } else {
                    buttons.push({
                        a_class: 'block-user',
                        handler: /** @param {Event} ev */ (ev)=>_async_to_generator(function*() {
                                ev.preventDefault();
                                const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Block user'), [
                                    (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Are you sure you want to prevent %1$s from contacting you further?', this.model.getDisplayName())
                                ]);
                                if (result) {
                                    const jid = this.model.get('jid');
                                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.blocklist.add(jid);
                                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.contacts.remove(jid, true);
                                    this.model.close();
                                }
                            }).call(this),
                        i18n_text: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Block this user'),
                        i18n_title: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Prevent this user from sending you any further messages'),
                        icon_class: 'fa-trash',
                        name: 'block',
                        standalone: false
                    });
                }
            }
            if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('singleton')) {
                buttons.push({
                    a_class: 'close-chatbox-button',
                    handler: /** @param {Event} ev */ (ev)=>this.close(ev),
                    i18n_text: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close'),
                    i18n_title: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close and end this conversation'),
                    icon_class: 'fa-times',
                    name: 'close',
                    standalone: _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed'
                });
            }
            const { chatboxviews } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            const el = chatboxviews.get(this.getAttribute('jid'));
            if (el) {
                /**
             * *Hook* which allows plugins to add more buttons to a chat's heading.
             *
             * Note: This hook is fired for both 1 on 1 chats and groupchats.
             * If you only care about one, you need to add a check in your code.
             *
             * @event _converse#getHeadingButtons
             * @param { HTMLElement } el
             *      The `converse-chat` (or `converse-muc`) DOM element that represents the chat
             * @param { Array.<import('./types').HeadingButtonAttributes> }
             *      An array of the existing buttons. New buttons may be added,
             *      and existing ones removed or modified.
             * @example
             *  api.listen.on('getHeadingButtons', (el, buttons) => {
             *      buttons.push({
             *          'i18n_title': __('Foo'),
             *          'i18n_text': __('Foo Bar'),
             *          'handler': ev => alert('Foo!'),
             *          'a_class': 'toggle-foo',
             *          'icon_class': 'fa-foo',
             *          'name': 'foo'
             *      });
             *      return buttons;
             *  });
             */ return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.hook('getHeadingButtons', el, buttons);
            } else {
                return buttons; // Happens during tests
            }
        }).call(this);
    }
    constructor(){
        super();
        this.jid = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-chat-heading', ChatHeading);


/***/ }),

/***/ "./src/plugins/chatview/index.js":
/*!***************************************!*\
  !*** ./src/plugins/chatview/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _chatboxviews_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../chatboxviews/index.js */ "./src/plugins/chatboxviews/index.js");
/* harmony import */ var shared_chat_chat_content_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/chat/chat-content.js */ "./src/shared/chat/chat-content.js");
/* harmony import */ var shared_chat_help_messages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/help-messages.js */ "./src/shared/chat/help-messages.js");
/* harmony import */ var shared_chat_toolbar_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/toolbar.js */ "./src/shared/chat/toolbar.js");
/* harmony import */ var _chat_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chat.js */ "./src/plugins/chatview/chat.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/chatview/utils.js");
/* harmony import */ var _styles_index_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./styles/index.scss */ "./src/plugins/chatview/styles/index.scss");
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 







const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_5__.converse.env;
_converse_headless__WEBPACK_IMPORTED_MODULE_5__.converse.plugins.add('converse-chatview', {
    /* Plugin dependencies are other plugins which might be
     * overridden or relied upon, and therefore need to be loaded before
     * this plugin.
     *
     * If the setting "strict_plugin_dependencies" is set to true,
     * an error will be raised if the plugin is not found. By default it's
     * false, which means these plugins are only loaded opportunistically.
     *
     * NB: These plugins need to have already been loaded via require.js.
     */ dependencies: [
        'converse-dragresize',
        'converse-chatboxviews',
        'converse-chat',
        'converse-disco',
        'converse-modal'
    ],
    initialize () {
        /* The initialize function gets called as soon as the plugin is
         * loaded by converse.js's plugin machinery.
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.settings.extend({
            'fetch_url_headers': false,
            'allowed_audio_domains': null,
            'allowed_image_domains': null,
            'allowed_video_domains': null,
            'auto_focus': true,
            'debounced_content_rendering': true,
            'filter_url_query_params': null,
            'image_urls_regex': null,
            'message_limit': 0,
            'muc_hats': [
                'xep317'
            ],
            'render_media': true,
            'show_message_avatar': true,
            'show_retraction_warning': true,
            'show_send_button': true,
            'show_toolbar': true,
            'time_format': 'HH:mm',
            'use_system_emojis': true,
            'visible_toolbar_buttons': {
                'call': false,
                'clear': true,
                'emoji': true,
                'spoiler': false
            }
        });
        const exports = {
            ChatBoxView: _chat_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            ChatView: _chat_js__WEBPACK_IMPORTED_MODULE_4__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_5__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_5__._converse.exports, exports);
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.listen.on('connected', ()=>_converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.disco.own.features.add(Strophe.NS.SPOILER));
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.listen.on('chatBoxClosed', (model)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.clearHistory)(model.get('jid')));
    }
});


/***/ }),

/***/ "./src/plugins/chatview/message-form.js":
/*!**********************************************!*\
  !*** ./src/plugins/chatview/message-form.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MessageForm)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_message_form_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/message-form.js */ "./src/plugins/chatview/templates/message-form.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/chatview/utils.js");
/**
 * @typedef {import('shared/chat/emoji-dropdown.js').default} EmojiDropdown
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { ACTIVE, COMPOSING } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class MessageForm extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            }
        };
    }
    initialize() {
        return _async_to_generator(function*() {
            yield this.model.initialized;
            this.listenTo(this.model, 'change:composing_spoiler', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:draft', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:hidden', ()=>{
                if (this.model.get('hidden')) {
                    var /** @type {HTMLInputElement} */ _this_querySelector, /** @type {HTMLTextAreaElement} */ _this_querySelector1;
                    const draft_hint = (_this_querySelector = this.querySelector('.spoiler-hint')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.value;
                    const draft_message = (_this_querySelector1 = this.querySelector('.chat-textarea')) === null || _this_querySelector1 === void 0 ? void 0 : _this_querySelector1.value;
                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(this.model, {
                        draft: draft_message,
                        draft_hint
                    });
                }
            });
            this.handleEmojiSelection = (/** @type { CustomEvent } */ { detail })=>{
                if (this.model.get('jid') === detail.jid) {
                    this.insertIntoTextArea(detail.value, detail.autocompleting, detail.ac_position);
                }
            };
            document.addEventListener('emojiSelected', this.handleEmojiSelection);
            this.requestUpdate();
        }).call(this);
    }
    disconnectedCallback() {
        super.disconnectedCallback();
        document.removeEventListener('emojiSelected', this.handleEmojiSelection);
    }
    render() {
        return (0,_templates_message_form_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    /**
     * Insert a particular string value into the textarea of this chat box.
     * @param {string} value - The value to be inserted.
     * @param {(boolean|string)} [replace] - Whether an existing value
     *  should be replaced. If set to `true`, the entire textarea will
     *  be replaced with the new value. If set to a string, then only
     *  that string will be replaced *if* a position is also specified.
     * @param {number} [position] - The end index of the string to be
     *  replaced with the new value.
     */ insertIntoTextArea(value, replace = false, position, separator = ' ') {
        const textarea = /** @type {HTMLTextAreaElement} */ this.querySelector('.chat-textarea');
        if (replace) {
            if (position && typeof replace == 'string') {
                textarea.value = textarea.value.replace(new RegExp(replace, 'g'), (match, offset)=>offset == position - replace.length ? value + separator : match);
            } else {
                textarea.value = value;
            }
        } else {
            let existing = textarea.value;
            if (existing && existing[existing.length - 1] !== separator) {
                existing = existing + separator;
            }
            textarea.value = existing + value + separator;
        }
        const ev = new Event('change', {
            bubbles: false,
            cancelable: true
        });
        textarea.dispatchEvent(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.placeCaretAtEnd(textarea);
    }
    /**
     * Handles the escape key press event to stop correcting a message.
     * @param {KeyboardEvent} ev
     */ onEscapePressed(ev) {
        const idx = this.model.messages.findLastIndex('correcting');
        const message = idx >= 0 ? this.model.messages.at(idx) : null;
        if (message) {
            ev.preventDefault();
            message.save('correcting', false);
        }
    }
    /**
     * Handles the paste event to insert text or files into the chat.
     * @param {ClipboardEvent} ev
     */ onPaste(ev) {
        if (ev.clipboardData.files.length !== 0) {
            ev.stopPropagation();
            ev.preventDefault();
            this.model.sendFiles(Array.from(ev.clipboardData.files));
            return;
        }
        const textarea = /** @type {HTMLTextAreaElement} */ this.querySelector('.chat-textarea');
        if (!textarea) {
            _converse_log__WEBPACK_IMPORTED_MODULE_1__["default"].error('onPaste: could not find textarea to paste in to!');
            return;
        }
        ev.preventDefault();
        ev.stopPropagation();
        var _textarea_value;
        const draft = (_textarea_value = textarea.value) !== null && _textarea_value !== void 0 ? _textarea_value : '';
        const pasted_text = ev.clipboardData.getData('text/plain');
        const cursor_pos = textarea.selectionStart;
        // Insert text at cursor position
        const before = draft.substring(0, cursor_pos);
        const after = draft.substring(textarea.selectionEnd);
        const separator = before.endsWith(' ') || before.length === 0 ? '' : ' ';
        const end_separator = after.startsWith(' ') || after.length === 0 ? '' : ' ';
        this.model.save({
            draft: `${before}${separator}${pasted_text}${end_separator}${after}`
        });
        // Set cursor position after the pasted text
        const new_pos = before.length + separator.length + pasted_text.length + end_separator.length;
        setTimeout(()=>textarea.setSelectionRange(new_pos, new_pos), 0);
    }
    /**
     * Handles the drop event to send files dragged-and-dropped into the chat.
     * @param {DragEvent} ev
     */ onDrop(ev) {
        if (ev.dataTransfer.files.length == 0) {
            return;
        }
        ev.preventDefault();
        this.model.sendFiles(ev.dataTransfer.files);
    }
    /**
     * @param {KeyboardEvent} ev
     */ onKeyUp(ev) {
        // Trigger an event, for `<converse-message-limit-indicator/>`
        this.model.trigger('event:keyup', {
            ev
        });
    }
    /**
     * @param {KeyboardEvent} [ev]
     */ onKeyDown(ev) {
        const { keycodes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse;
        if (ev.ctrlKey || ev.shiftKey && ev.key === keycodes.ENTER || [
            keycodes.SHIFT,
            keycodes.META,
            keycodes.ESCAPE,
            keycodes.ALT
        ].includes(ev.key)) {
            return;
        }
        if (!ev.shiftKey && !ev.altKey && !ev.metaKey) {
            const target = /** @type {HTMLInputElement|HTMLTextAreaElement} */ ev.target;
            if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.keycodes.TAB) {
                const value = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getCurrentWord(target, null, /(:.*?:)/g);
                if (value.startsWith(':')) {
                    ev.preventDefault();
                    ev.stopPropagation();
                    this.model.trigger('emoji-picker-autocomplete', {
                        target,
                        value
                    });
                }
            } else if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.keycodes.FORWARD_SLASH) {
                // Forward slash is used to run commands. Nothing to do here.
                return;
            } else if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.keycodes.ESCAPE) {
                return this.onEscapePressed(ev);
            } else if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.keycodes.ENTER) {
                return this.onFormSubmitted(ev);
            } else if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.keycodes.UP_ARROW && !target.selectionEnd) {
                const textarea = /** @type {HTMLTextAreaElement} */ this.querySelector('.chat-textarea');
                if (!textarea.value || this.model.get('correcting')) {
                    return this.model.editEarlierMessage();
                }
            } else if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.keycodes.DOWN_ARROW && target.selectionEnd === target.value.length && this.model.get('correcting')) {
                return this.model.editLaterMessage();
            }
        }
        if (this.model.get('chat_state') !== COMPOSING) {
            // Set chat state to composing if key is not a forward-slash
            // (which would imply an internal command and not a message).
            this.model.setChatState(COMPOSING);
        }
    }
    /**
     * @param {SubmitEvent|KeyboardEvent} ev
     */ onFormSubmitted(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault, /** @type {EmojiDropdown} */ _this_querySelector;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            const { chatboxviews } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            const textarea = /** @type {HTMLTextAreaElement} */ this.querySelector('.chat-textarea');
            const message_text = textarea.value.trim();
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('message_limit') && message_text.length > _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('message_limit') || !message_text.replace(/\s/g, '').length) {
                return;
            }
            if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get().authenticated) {
                const err_msg = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Sorry, the connection has been lost, and your message could not be sent');
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Error'), err_msg);
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.reconnect();
                return;
            }
            let spoiler_hint, hint_el = {};
            if (this.model.get('composing_spoiler')) {
                hint_el = /** @type {HTMLInputElement} */ this.querySelector('form.chat-message-form input.spoiler-hint');
                spoiler_hint = hint_el.value;
            }
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.addClass('disabled', textarea);
            textarea.setAttribute('disabled', 'disabled');
            (_this_querySelector = this.querySelector('converse-emoji-dropdown')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.dropdown.hide();
            const is_command = yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.parseMessageForCommands)(this.model, message_text);
            const message = is_command ? null : yield this.model.sendMessage({
                'body': message_text,
                spoiler_hint
            });
            if (is_command || message) {
                hint_el.value = '';
                textarea.value = '';
                textarea.style.height = 'auto';
                this.model.save({
                    'draft': ''
                });
            }
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed') {
                // XXX: Chrome flexbug workaround. The .chat-content area
                // doesn't resize when the textarea is resized to its original size.
                const chatview = chatboxviews.get(this.model.get('jid'));
                const msgs_container = chatview.querySelector('.chat-content__messages');
                msgs_container.parentElement.style.display = 'none';
            }
            textarea.removeAttribute('disabled');
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.removeClass('disabled', textarea);
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed') {
                // XXX: Chrome flexbug workaround.
                const chatview = chatboxviews.get(this.model.get('jid'));
                const msgs_container = chatview.querySelector('.chat-content__messages');
                msgs_container.parentElement.style.display = '';
            }
            // Suppress events, otherwise superfluous CSN gets set
            // immediately after the message, causing rate-limiting issues.
            this.model.setChatState(ACTIVE, {
                'silent': true
            });
            textarea.focus();
        }).call(this);
    }
    constructor(){
        super();
        this.model = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-message-form', MessageForm);


/***/ }),

/***/ "./src/plugins/chatview/styles/chat-bottom-panel.scss":
/*!************************************************************!*\
  !*** ./src/plugins/chatview/styles/chat-bottom-panel.scss ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./chat-bottom-panel.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/chat-bottom-panel.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/chatview/styles/chat-head.scss":
/*!****************************************************!*\
  !*** ./src/plugins/chatview/styles/chat-head.scss ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_head_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./chat-head.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/chat-head.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/chatview/styles/index.scss":
/*!************************************************!*\
  !*** ./src/plugins/chatview/styles/index.scss ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./index.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/chatview/styles/index.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/chatview/templates/bottom-panel.js":
/*!********************************************************!*\
  !*** ./src/plugins/chatview/templates/bottom-panel.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    const unread_msgs = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You have unread messages');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`${o.model.ui.get('scrolled') && o.model.get('num_unread') ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="new-msgs-indicator" @click="${(ev)=>o.viewUnreadMessages(ev)}">▼ ${unread_msgs} ▼</div>` : ''}<converse-message-form .model="${o.model}"></converse-message-form>`;
});


/***/ }),

/***/ "./src/plugins/chatview/templates/chat-head.js":
/*!*****************************************************!*\
  !*** ./src/plugins/chatview/templates/chat-head.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");





const { HEADLINES_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.constants;
/**
 * @param {import('../heading').default} el
 * @returns {import('lit').TemplateResult}
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_contact_vcard, _el_model_contact;
    const { jid, status, type } = el.model.attributes;
    const heading_buttons_promise = el.getHeadingButtons();
    const showUserDetailsModal = /** @param {Event} ev */ (ev)=>el.showUserDetailsModal(ev);
    const i18n_profile = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("The User's Profile Image");
    const display_name = el.model.getDisplayName();
    const avatar = (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span title="${i18n_profile}"><converse-avatar .model="${el.model.contact || el.model}" class="avatar chat-msg__avatar" name="${display_name}" nonce="${(_el_model_contact = el.model.contact) === null || _el_model_contact === void 0 ? void 0 : (_el_model_contact_vcard = _el_model_contact.vcard) === null || _el_model_contact_vcard === void 0 ? void 0 : _el_model_contact_vcard.get("vcard_updated")}" height="40" width="40"></converse-avatar></span>`;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chatbox-title ${status ? "" : "chatbox-title--no-desc"}"><div class="chatbox-title--row">${!_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.api.settings.get("singleton") ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-controlbox-navback jid="${jid}"></converse-controlbox-navback>` : ""} ${type !== HEADLINES_TYPE ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="show-msg-author-modal" @click="${showUserDetailsModal}">${avatar}</a>` : ""}<div class="chatbox-title__text" title="${jid}" role="heading" aria-level="2">${type !== HEADLINES_TYPE ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="user show-msg-author-modal" @click="${showUserDetailsModal}">${display_name}</a>` : display_name}</div></div><div class="chatbox-title__buttons btn-toolbar g-0">${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)((0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_4__.getStandaloneButtons)(heading_buttons_promise), "")} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)((0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_4__.getDropdownButtons)(heading_buttons_promise), "")}</div></div>${status ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="chat-head__desc">${status}</p>` : ""}`;
});


/***/ }),

/***/ "./src/plugins/chatview/templates/chat.js":
/*!************************************************!*\
  !*** ./src/plugins/chatview/templates/chat.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_chat_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/utils */ "./src/shared/chat/utils.js");




const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
/**
 * @param {import('../chat').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_contact;
    const help_messages = el.getHelpMessages();
    const show_help_messages = el.model.get('show_help_messages');
    const is_overlayed = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') === 'overlayed';
    const style = (0,shared_chat_utils__WEBPACK_IMPORTED_MODULE_3__.getChatStyle)(el.model);
    const requesting = (_el_model_contact = el.model.contact) === null || _el_model_contact === void 0 ? void 0 : _el_model_contact.get('requesting');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="flyout box-flyout" style="${style || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}">${is_overlayed ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-dragresize></converse-dragresize>` : ''} ${el.model ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-chat-heading jid="${el.model.get('jid')}" class="chat-head chat-head-chatbox row g-0"></converse-chat-heading><div class="chat-body">${requesting ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-contact-approval-alert .contact="${el.model.contact}"></converse-contact-approval-alert>` : ''}<div class="chat-content ${el.model.get('show_send_button') ? 'chat-content-sendbutton' : ''}" aria-live="polite"><converse-chat-content .model="${el.model}"></converse-chat-content>${show_help_messages ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chat-content__help"><converse-chat-help .model="${el.model}" .messages="${help_messages}" ?hidden="${!show_help_messages}" type="info" chat_type="${CHATROOMS_TYPE}"></converse-chat-help></div>` : ''}</div><converse-chat-bottom-panel .model="${el.model}" class="bottom-panel"></converse-chat-bottom-panel></div>` : ''}</div>`;
});


/***/ }),

/***/ "./src/plugins/chatview/templates/message-form.js":
/*!********************************************************!*\
  !*** ./src/plugins/chatview/templates/message-form.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/chatview/utils.js");




/**
 * @param {import('../message-form').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const composing_spoiler = el.model.get("composing_spoiler");
    const label_message = composing_spoiler ? (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Hidden message") : (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Message");
    const label_spoiler_hint = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Optional hint");
    const message_limit = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("message_limit");
    const show_call_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("visible_toolbar_buttons").call;
    const show_emoji_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("visible_toolbar_buttons").emoji;
    const show_send_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("show_send_button");
    const show_spoiler_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("visible_toolbar_buttons").spoiler;
    const show_toolbar = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("show_toolbar");
    var _el_model_get, _el_model_get1;
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<form class="chat-message-form" @submit="${(ev)=>el.onFormSubmitted(ev)}">${show_toolbar ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-chat-toolbar class="btn-toolbar chat-toolbar no-text-select" .model="${el.model}" ?composing_spoiler="${composing_spoiler}" ?show_call_button="${show_call_button}" ?show_emoji_button="${show_emoji_button}" ?show_send_button="${show_send_button}" ?show_spoiler_button="${show_spoiler_button}" ?show_toolbar="${show_toolbar}" message_limit="${message_limit}"></converse-chat-toolbar>` : ""} <input type="text" enterkeyhint="send" placeholder="${label_spoiler_hint || ""}" .value="${(_el_model_get = el.model.get("draft_hint")) !== null && _el_model_get !== void 0 ? _el_model_get : ""}" @change="${/** @param {Event} ev */ (ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.safeSave(el.model, {
            draft_hint: /** @type {HTMLInputElement} */ ev.target.value
        })}" class="${composing_spoiler ? "" : "hidden"} spoiler-hint"> <textarea autofocus type="text" enterkeyhint="send" .value="${(_el_model_get1 = el.model.get("draft")) !== null && _el_model_get1 !== void 0 ? _el_model_get1 : ""}" @drop="${(ev)=>el.onDrop(ev)}" @input="${_utils_js__WEBPACK_IMPORTED_MODULE_3__.resetElementHeight}" @keydown="${(ev)=>el.onKeyDown(ev)}" @keyup="${(ev)=>el.onKeyUp(ev)}" @paste="${(ev)=>el.onPaste(ev)}" @change="${/** @param {Event} ev */ (ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.safeSave(el.model, {
            draft: /** @type {HTMLTextAreaElement} */ ev.target.value
        })}" class="chat-textarea ${el.model.get("correcting") ? "correcting" : ""} ${show_send_button ? "chat-textarea-send-button" : ""} ${composing_spoiler ? "spoiler" : ""}" placeholder="${label_message}"></textarea></form>`;
});


/***/ }),

/***/ "./src/plugins/chatview/utils.js":
/*!***************************************!*\
  !*** ./src/plugins/chatview/utils.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clearHistory: () => (/* binding */ clearHistory),
/* harmony export */   clearMessages: () => (/* binding */ clearMessages),
/* harmony export */   parseMessageForCommands: () => (/* binding */ parseMessageForCommands),
/* harmony export */   resetElementHeight: () => (/* binding */ resetElementHeight)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


function clearHistory(jid) {
    if (location.hash === `converse/chat?jid=${jid}`) {
        history.pushState(null, '', window.location.pathname);
    }
}
function clearMessages(chat) {
    return _async_to_generator(function*() {
        const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Confirm'), (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Are you sure you want to clear the messages from this conversation?'));
        if (result) {
            yield chat.clearMessages();
        }
    })();
}
function parseMessageForCommands(chat, text) {
    return _async_to_generator(function*() {
        const match = text.replace(/^\s*/, '').match(/^\/(.*)\s*$/);
        if (match) {
            let handled = false;
            /**
         * *Hook* which allows plugins to add more commands to a chat's textbox.
         * Data provided is the chatbox model and the text typed - {model, text}.
         * Check `handled` to see if the hook was already handled.
         * @event _converse#parseMessageForCommands
         * @example
         *  api.listen.on('parseMessageForCommands', (data, handled) {
         *      if (!handled) {
         *         const command = (data.text.match(/^\/([a-zA-Z]*) ?/) || ['']).pop().toLowerCase();
         *         // custom code comes here
         *      }
         *      return handled;
         *  }
         */ handled = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.hook('parseMessageForCommands', {
                model: chat,
                text
            }, handled);
            if (handled) {
                return true;
            }
            if (match[1] === 'clear') {
                clearMessages(chat);
                return true;
            } else if (match[1] === 'close') {
                var _chatboxviews_get;
                const { chatboxviews } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
                (_chatboxviews_get = chatboxviews.get(chat.get('jid'))) === null || _chatboxviews_get === void 0 ? void 0 : _chatboxviews_get.close();
                return true;
            } else if (match[1] === 'help') {
                chat.set({
                    'show_help_messages': false
                }, {
                    'silent': true
                });
                chat.set({
                    'show_help_messages': true
                });
                return true;
            }
        }
        return false;
    })();
}
function resetElementHeight(ev) {
    var _window_CSS;
    if ((_window_CSS = window.CSS) === null || _window_CSS === void 0 ? void 0 : _window_CSS.supports('field-sizing', 'content')) {
        return;
    }
    if (ev.target.value) {
        const height = ev.target.scrollHeight + 'px';
        if (ev.target.style.height != height) {
            ev.target.style.height = 'auto';
            ev.target.style.height = height;
        }
    } else {
        ev.target.style = '';
    }
}


/***/ }),

/***/ "./src/plugins/controlbox/api.js":
/*!***************************************!*\
  !*** ./src/plugins/controlbox/api.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./model.js */ "./src/plugins/controlbox/model.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The "controlbox" namespace groups methods pertaining to the
     * controlbox view
     *
     * @namespace _converse.api.controlbox
     * @memberOf _converse.api
     */ controlbox: {
        /**
         * Opens the controlbox
         * @method _converse.api.controlbox.open
         * @returns { Promise<ControlBox> }
         */ open () {
            return _async_to_generator(function*() {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil('chatBoxesFetched');
                let model = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.chatboxes.get('controlbox');
                if (!model) {
                    model = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.chatboxes.create('controlbox', {}, _model_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
                }
                u.safeSave(model, {
                    'closed': false
                });
                return model;
            })();
        },
        /**
         * Returns the controlbox view.
         * @method _converse.api.controlbox.get
         * @returns {ControlBox} View representing the controlbox
         * @example const view = _converse.api.controlbox.get();
         */ get () {
            return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.get('controlbox');
        }
    }
});


/***/ }),

/***/ "./src/plugins/controlbox/buttons.js":
/*!*******************************************!*\
  !*** ./src/plugins/controlbox/buttons.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_buttons_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/buttons.js */ "./src/plugins/controlbox/templates/buttons.js");
/* harmony import */ var _styles_buttons_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/buttons.scss */ "./src/plugins/controlbox/styles/buttons.scss");




class ControlboxButtons extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    initialize() {
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        this.model = chatboxes.get('controlbox');
    }
    render() {
        return (0,_templates_buttons_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     */ showUserSettingsModal(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-user-settings-modal', {
            model: _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.xmppstatus,
            _converse: _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse
        }, ev);
    }
    /**
     * @param {MouseEvent} ev
     */ closeControlBox(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        const view = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.get('controlbox');
        view === null || view === void 0 ? void 0 : view.close();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-controlbox-buttons', ControlboxButtons);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControlboxButtons);


/***/ }),

/***/ "./src/plugins/controlbox/constants.js":
/*!*********************************************!*\
  !*** ./src/plugins/controlbox/constants.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CONNECTION_STATUS_CSS_CLASS: () => (/* binding */ CONNECTION_STATUS_CSS_CLASS)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const CONNECTION_STATUS_CSS_CLASS = Object.fromEntries([
    [
        Strophe.Status.ERROR,
        'danger'
    ],
    [
        Strophe.Status.CONNECTING,
        'info'
    ],
    [
        Strophe.Status.CONNFAIL,
        'danger'
    ],
    [
        Strophe.Status.AUTHENTICATING,
        'info'
    ],
    [
        Strophe.Status.AUTHFAIL,
        'danger'
    ],
    [
        Strophe.Status.CONNECTED,
        'info'
    ],
    [
        Strophe.Status.DISCONNECTED,
        'danger'
    ],
    [
        Strophe.Status.DISCONNECTING,
        'warning'
    ],
    [
        Strophe.Status.ATTACHED,
        'info'
    ],
    [
        Strophe.Status.REDIRECT,
        'info'
    ],
    [
        Strophe.Status.RECONNECTING,
        'warning'
    ]
]);


/***/ }),

/***/ "./src/plugins/controlbox/controlbox.js":
/*!**********************************************!*\
  !*** ./src/plugins/controlbox/controlbox.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var shared_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/constants.js */ "./src/shared/constants.js");
/* harmony import */ var plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/dragresize/mixin.js */ "./src/plugins/dragresize/mixin.js");
/* harmony import */ var _templates_controlbox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/controlbox.js */ "./src/plugins/controlbox/templates/controlbox.js");
/* harmony import */ var _navbar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./navbar.js */ "./src/plugins/controlbox/navbar.js");






const { LOGOUT } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
/**
 * The ControlBox is the section of the chat that contains the open groupchats,
 * bookmarks and roster.
 *
 * In `overlayed` `view_mode` it's a box like the chat boxes, in `fullscreen`
 * `view_mode` it's a left-aligned sidebar.
 */ class ControlBoxView extends (0,plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_3__["default"])(shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement) {
    initialize() {
        this.setModel();
        const { chatboxviews } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        chatboxviews.add('controlbox', this);
        if (this.model.get('connected') && this.model.get('closed') === undefined) {
            this.model.set('closed', !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('show_controlbox_by_default'));
        }
        this.viewportMediaQuery = window.matchMedia(`(max-width: ${shared_constants_js__WEBPACK_IMPORTED_MODULE_2__.MOBILE_CUTOFF}px)`);
        this.renderOnViewportChange = ()=>this.requestUpdate();
        /**
         * Triggered when the _converse.ControlBoxView has been initialized and therefore
         * exists. The controlbox contains the login and register forms when the user is
         * logged out and a list of the user's contacts and group chats when logged in.
         * @event _converse#controlBoxInitialized
         * @type {ControlBoxView}
         * @example _converse.api.listen.on('controlBoxInitialized', view => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('controlBoxInitialized', this);
    }
    connectedCallback() {
        super.connectedCallback();
        this.viewportMediaQuery.addEventListener('change', this.renderOnViewportChange);
    }
    disconnectedCallback() {
        super.disconnectedCallback();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.remove('controlbox', this);
        this.viewportMediaQuery.removeEventListener('change', this.renderOnViewportChange);
    }
    setModel() {
        this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.get('controlbox');
        this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.connfeedback, 'change:connection_status', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change:active-form', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change:connected', ()=>this.requestUpdate());
        this.requestUpdate();
    }
    render() {
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed') {
            return this.model && !this.model.get('closed') ? (0,_templates_controlbox_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this) : '';
        }
        return (0,_templates_controlbox_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    close(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
        if ((ev === null || ev === void 0 ? void 0 : ev.name) === 'closeAllChatBoxes' && (connection.disconnection_cause !== LOGOUT || _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('show_controlbox_by_default'))) {
            return;
        }
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('sticky_controlbox') || _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') !== 'overlayed') {
            return;
        }
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(this.model, {
            closed: true
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('controlBoxClosed', this);
        return this;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-controlbox', ControlBoxView);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControlBoxView);


/***/ }),

/***/ "./src/plugins/controlbox/index.js":
/*!*****************************************!*\
  !*** ./src/plugins/controlbox/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _loginform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./loginform.js */ "./src/plugins/controlbox/loginform.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model.js */ "./src/plugins/controlbox/model.js");
/* harmony import */ var _toggle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toggle.js */ "./src/plugins/controlbox/toggle.js");
/* harmony import */ var _controlbox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controlbox.js */ "./src/plugins/controlbox/controlbox.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./api.js */ "./src/plugins/controlbox/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/controlbox/utils.js");
/* harmony import */ var shared_components_brand_heading_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! shared/components/brand-heading.js */ "./src/shared/components/brand-heading.js");
/* harmony import */ var _chatview_index_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../chatview/index.js */ "./src/plugins/chatview/index.js");
/* harmony import */ var _navback_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./navback.js */ "./src/plugins/controlbox/navback.js");
/* harmony import */ var _buttons_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./buttons.js */ "./src/plugins/controlbox/buttons.js");
/* harmony import */ var _styles_controlbox_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./styles/_controlbox.scss */ "./src/plugins/controlbox/styles/_controlbox.scss");
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 











const { CONTROLBOX_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-controlbox', {
    /* Plugin dependencies are other plugins which might be
     * overridden or relied upon, and therefore need to be loaded before
     * this plugin.
     *
     * If the setting "strict_plugin_dependencies" is set to true,
     * an error will be raised if the plugin is not found. By default it's
     * false, which means these plugins are only loaded opportunistically.
     */ dependencies: [
        'converse-modal',
        'converse-chatboxes',
        'converse-chat',
        'converse-rosterview',
        'converse-chatview'
    ],
    enabled (_converse) {
        return !_converse.api.settings.get('singleton');
    },
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            allow_logout: true,
            allow_user_trust_override: true,
            default_domain: undefined,
            locked_domain: undefined,
            show_connection_url_input: false,
            show_controlbox_by_default: false,
            sticky_controlbox: false
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.promises.add('controlBoxInitialized', false);
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api, _api_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
        const exports = {
            ControlBox: _model_js__WEBPACK_IMPORTED_MODULE_2__["default"],
            ControlBoxView: _controlbox_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            ControlBoxToggle: _toggle_js__WEBPACK_IMPORTED_MODULE_3__["default"],
            LoginForm: _loginform_js__WEBPACK_IMPORTED_MODULE_1__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, exports);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.chatboxes.registry.add(CONTROLBOX_TYPE, _model_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxesFetched', _utils_js__WEBPACK_IMPORTED_MODULE_6__.onChatBoxesFetched);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('clearSession', _utils_js__WEBPACK_IMPORTED_MODULE_6__.clearSession);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('will-reconnect', _utils_js__WEBPACK_IMPORTED_MODULE_6__.disconnect);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil('chatBoxViewsInitialized').then(_utils_js__WEBPACK_IMPORTED_MODULE_6__.addControlBox).catch((e)=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.fatal(e));
    }
});


/***/ }),

/***/ "./src/plugins/controlbox/loginform.js":
/*!*********************************************!*\
  !*** ./src/plugins/controlbox/loginform.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/controlbox/utils.js");
/* harmony import */ var _templates_loginform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/loginform.js */ "./src/plugins/controlbox/templates/loginform.js");
/* harmony import */ var _styles_loginform_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/loginform.scss */ "./src/plugins/controlbox/styles/loginform.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { ANONYMOUS } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class LoginForm extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    initialize() {
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
        this.listenTo(settings, 'change:show_connection_url_input', ()=>this.requestUpdate());
        this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.connfeedback, 'change', ()=>this.requestUpdate());
        this.handler = ()=>this.requestUpdate();
    }
    connectedCallback() {
        super.connectedCallback();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.listen.on('change', this.handler);
    }
    disconnectedCallback() {
        super.disconnectedCallback();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.listen.not('change', this.handler);
    }
    render() {
        return (0,_templates_loginform_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ onLoginFormSubmitted(ev) {
        return _async_to_generator(function*() {
            ev === null || ev === void 0 ? void 0 : ev.preventDefault();
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('authentication') === ANONYMOUS) {
                const jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('jid');
                return this.connect(jid);
            }
            const form = /** @type {HTMLFormElement} */ ev.target;
            if (!(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.validateJID)(form)) {
                return;
            }
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.updateSettingsWithFormData)(form);
            if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('bosh_service_url') && !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('websocket_url')) {
                // We don't have a connection URL available, so we try here to discover
                // XEP-0156 connection methods now, and if not found we present the user
                // with the option to enter their own connection URL
                yield this.discoverConnectionMethods(form);
            }
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('bosh_service_url') || _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('websocket_url')) {
                // FIXME: The connection class will still try to discover XEP-0156 connection methods
                this.connect();
            } else {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.set('show_connection_url_input', true);
            }
        }).call(this);
    }
    /**
     * @param {HTMLFormElement} form
     */ discoverConnectionMethods(form) {
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("discover_connection_methods")) {
            return;
        }
        const form_data = new FormData(form);
        const jid = form_data.get('jid');
        if (jid instanceof File) throw new Error('Found file instead of string for "jid" field in form');
        const domain = Strophe.getDomainFromJid(jid);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.init(jid);
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get().discoverConnectionMethods(domain);
    }
    /**
     * @param {string} [jid]
     */ connect(jid) {
        var _api_connection_get;
        if ([
            'converse/login',
            'converse/register'
        ].includes(location.hash)) {
            history.pushState(null, '', window.location.pathname);
        }
        (_api_connection_get = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.reset();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.user.login(jid);
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-login-form', LoginForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoginForm);


/***/ }),

/***/ "./src/plugins/controlbox/modals/about.js":
/*!************************************************!*\
  !*** ./src/plugins/controlbox/modals/about.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");




class AboutModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('About Converse');
    }
    renderModal() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p>Converse is an open-source <a href="https://xmpp.org" target="_blank" rel="noopener">XMPP</a> chat app written in JavaScript.</p><p>Just like the XMPP protocol, Converse is built with extensibility in mind.</p><p>Because it is open source, integrators and developers can use it to add chat functionality to their websites.</p><p>Converse is also <a href="https://conversejs.org/docs/html/configuration.html" target="_blank" rel="noopener">configurable</a>, built with modern web technologies and <a href="https://conversejs.org/docs/html/plugin_development.html" target="_blank" rel="noopener">extensible with plugins</a>. It has different modes, which means it can be a full page app, an embedded chat widget, or an overlayed chat box. For a list of supported features and XMPP extensions, please see the <a href="https://github.com/conversejs/converse.js?tab=readme-ov-file#features" target="_blank" rel="noopener">README</a>.</p><p>Converse is translated into over 30 languages. You can <a target="_blank" rel="nofollow" href="https://hosted.weblate.org/projects/conversejs/#languages">translate</a> it into your own language.</p><p>Converse was created by <a target="_blank" rel="nofollow" href="https://opkode.com">JC Brand</a>. You can <a target="_blank" rel="nofollow" href="https://opkode.com/contact.html">hire me</a> for customizations, support or to build your next project.</p><p>If you're interested in sponsoring Converse, please visit: <a href="https://github.com/sponsors/jcbrand" target="_blank" rel="noopener">Github</a>, <a href="https://www.patreon.com/jcbrand" target="_blank" rel="noopener">Patreon</a>, <a href="https://liberapay.com/jcbrand" target="_blank" rel="noopener">Liberapay</a> or <a href="https://opkode.com/contact.html" target="_blank" rel="noopener">contact us</a>.</p>`;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-about-modal', AboutModal);


/***/ }),

/***/ "./src/plugins/controlbox/model.js":
/*!*****************************************!*\
  !*** ./src/plugins/controlbox/model.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


const { dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const { CONTROLBOX_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
/**
 * The ControlBox is the section of the chat that contains the open groupchats,
 * bookmarks and roster.
 *
 * In `overlayed` `view_mode` it's a box like the chat boxes, in `fullscreen`
 * `view_mode` it's a left-aligned sidebar.
 */ class ControlBox extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            bookmarked: false,
            box_id: 'controlbox',
            chat_state: undefined,
            closed: !_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_controlbox_by_default'),
            num_unread: 0,
            time_opened: dayjs(0).valueOf(),
            type: CONTROLBOX_TYPE,
            url: ''
        };
    }
    validate(attrs) {
        if (attrs.type === CONTROLBOX_TYPE) {
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') === 'embedded' && _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('singleton')) {
                return 'Controlbox not relevant in embedded view mode';
            }
            return;
        }
        return _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.ChatBox.prototype.validate.call(this, attrs);
    }
    /**
     * @param {boolean} [force]
     */ maybeShow(force) {
        if (!force && this.get('id') === 'controlbox') {
            // Must return the chatbox
            return this;
        }
        return _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.ChatBox.prototype.maybeShow.call(this, force);
    }
    onReconnection() {
        this.save('connected', true);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControlBox);


/***/ }),

/***/ "./src/plugins/controlbox/navback.js":
/*!*******************************************!*\
  !*** ./src/plugins/controlbox/navback.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _templates_navback_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/navback.js */ "./src/plugins/controlbox/templates/navback.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



class ControlBoxNavback extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            'jid': {
                type: String
            }
        };
    }
    render() {
        return (0,_templates_navback_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.jid);
    }
    constructor(){
        super();
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-controlbox-navback', ControlBoxNavback);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControlBoxNavback);


/***/ }),

/***/ "./src/plugins/controlbox/navbar.js":
/*!******************************************!*\
  !*** ./src/plugins/controlbox/navbar.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_navbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/navbar.js */ "./src/plugins/controlbox/templates/navbar.js");
/* harmony import */ var _modals_about_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modals/about.js */ "./src/plugins/controlbox/modals/about.js");




class NavBar extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    render() {
        return (0,_templates_navbar_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {Event} ev
     */ openAboutDialog(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-about-modal');
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-controlbox-navbar', NavBar);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NavBar);


/***/ }),

/***/ "./src/plugins/controlbox/styles/_controlbox.scss":
/*!********************************************************!*\
  !*** ./src/plugins/controlbox/styles/_controlbox.scss ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_controlbox_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./_controlbox.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/_controlbox.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_controlbox_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_controlbox_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_controlbox_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_controlbox_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/controlbox/styles/buttons.scss":
/*!****************************************************!*\
  !*** ./src/plugins/controlbox/styles/buttons.scss ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_buttons_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./buttons.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/buttons.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_buttons_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_buttons_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_buttons_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_buttons_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/controlbox/styles/loginform.scss":
/*!******************************************************!*\
  !*** ./src/plugins/controlbox/styles/loginform.scss ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_loginform_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./loginform.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/controlbox/styles/loginform.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_loginform_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_loginform_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_loginform_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_loginform_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/controlbox/templates/buttons.js":
/*!*****************************************************!*\
  !*** ./src/plugins/controlbox/templates/buttons.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");



/**
 * @param {import('../buttons').default} el
 */ function tplUserSettingsButton(el) {
    const i18n_details = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show details about this chat client');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="controlbox-heading__btn show-client-info align-self-center" title="${i18n_details}" @click="${el.showUserSettingsModal}"><converse-icon class="fa fa-cog" size="1em"></converse-icon></a>`;
}
/**
 * @param {import('../buttons').default} el
 */ function tplCloseButton(el) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="controlbox-heading__btn close align-self-center" @click="${(ev)=>el.closeControlBox(ev)}"><converse-icon class="fa fa-times" size="1em"></converse-icon></a>`;
}
/**
 * @param {import('../buttons').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const is_connected = el.model.get('connected');
    const show_settings_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_client_info') || _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_adhoc_commands');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="btn-toolbar g-0" role="toolbar"><div class="btn-group" role="group">${is_connected && show_settings_button ? tplUserSettingsButton(el) : ''} ${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('sticky_controlbox') ? '' : tplCloseButton(el)}</div></div>`;
});


/***/ }),

/***/ "./src/plugins/controlbox/templates/controlbox.js":
/*!********************************************************!*\
  !*** ./src/plugins/controlbox/templates/controlbox.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");



const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const { ANONYMOUS } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
/**
 * @param {import('../controlbox').default} el
 */ function whenNotConnected(el) {
    const is_fullscreen = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') === 'fullscreen';
    const connection_status = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.connfeedback.get('connection_status');
    const connecting = [
        Strophe.Status.RECONNECTING,
        Strophe.Status.CONNECTING
    ].includes(connection_status);
    const view_mode = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode');
    const show_bg = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_background');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${show_bg && view_mode === 'fullscreen' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-bg></converse-bg>` : ''}<converse-controlbox-buttons class="controlbox-padded"></converse-controlbox-buttons><div class="controlbox-pane d-flex flex-column justify-content-between">${is_fullscreen ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-controlbox-navbar></converse-controlbox-navbar>` : ''}<converse-brand-logo></converse-brand-logo>${connecting ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-spinner class="vertically-centered fade-in"></converse-spinner>` : el.model.get('active-form') === 'register' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-registration-form class="fade-in rounded"></converse-registration-form>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-login-form class="fade-in rounded"></converse-login-form>`} ${is_fullscreen ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-footer></converse-footer>` : ''}</div>`;
}
/**
 * @param {import('../controlbox').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const style = (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_2__.getChatStyle)(el.model);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="flyout box-flyout" style="${style || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}"><converse-dragresize></converse-dragresize>${el.model.get('connected') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-user-profile></converse-user-profile><div class="controlbox-pane"><converse-headlines-feeds-list class="controlbox-section"></converse-headlines-feeds-list><div id="chatrooms" class="controlbox-section"><converse-rooms-list></converse-rooms-list></div>${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('authentication') === ANONYMOUS ? '' : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div id="converse-roster" class="controlbox-section"><converse-roster></div>`}</div>` : whenNotConnected(el)}</div>`;
});


/***/ }),

/***/ "./src/plugins/controlbox/templates/loginform.js":
/*!*******************************************************!*\
  !*** ./src/plugins/controlbox/templates/loginform.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   tplConnectionURLInput: () => (/* binding */ tplConnectionURLInput)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants.js */ "./src/plugins/controlbox/constants.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_brand_heading_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/components/brand-heading.js */ "./src/shared/components/brand-heading.js");
/* harmony import */ var shared_components_footer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/components/footer.js */ "./src/shared/components/footer.js");







const { ANONYMOUS, EXTERNAL, LOGIN, PREBIND, CONNECTION_STATUS } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
/**
 * @param {boolean} checked
 */ function tplTrustCheckbox(checked) {
    const i18n_hint_trusted = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('To improve performance, we cache your data in this browser. ' + 'Uncheck this box if this is a public computer or if you want your data to be deleted when you log out. ' + "It's important that you explicitly log out, otherwise not all cached data might be deleted. " + 'Please note, when using an untrusted device, OMEMO encryption is NOT available.');
    const i18n_trusted = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('This is a trusted device');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="form-check mb-2 login-trusted"><input id="converse-login-trusted" type="checkbox" class="form-check-input" name="trusted" ?checked="${checked}"> <label for="converse-login-trusted" class="form-check-label login-trusted__desc">${i18n_trusted}</label><converse-popover title="${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Info')}" text="${i18n_hint_trusted}"></converse-popover></div>`;
}
function tplConnectionURLInput() {
    const i18n_connection_url = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Connection URL');
    const i18n_form_help = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('HTTP or websocket URL that is used to connect to your XMPP server');
    const i18n_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('e.g. wss://example.org/xmpp-websocket');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3 fade-in"><label for="converse-conn-url" class="form-label">${i18n_connection_url}</label><p class="form-help instructions">${i18n_form_help}</p><input required id="converse-conn-url" class="form-control" type="url" name="connection-url" placeholder="${i18n_placeholder}"></div>`;
}
function tplPasswordInput() {
    const i18n_password = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Password');
    var _api_settings_get;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label for="converse-login-password" class="form-label">${i18n_password}</label> <input id="converse-login-password" class="form-control" required="required" value="${(_api_settings_get = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('password')) !== null && _api_settings_get !== void 0 ? _api_settings_get : ''}" type="password" name="password" placeholder="${i18n_password}"></div>`;
}
function tplDomain(domain) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="input-group-text addon" id="basic-addon2">@${domain}</span>`;
}
function tplAuthFields() {
    const authentication = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('authentication');
    const i18n_login = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Log in');
    const i18n_xmpp_address = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('XMPP Address');
    const locked_domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('locked_domain');
    const default_domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('default_domain');
    const placeholder_username = (locked_domain || default_domain) && (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Username') || (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('user@domain');
    const show_trust_checkbox = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_user_trust_override');
    var _api_settings_get;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label for="converse-login-jid" class="form-label">${i18n_xmpp_address}:</label><div class="${locked_domain ? 'input-group' : ''}"><input id="converse-login-jid" ?autofocus="${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('auto_focus') ? true : false}" value="${(_api_settings_get = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('jid')) !== null && _api_settings_get !== void 0 ? _api_settings_get : ''}" required class="form-control" type="text" name="jid" placeholder="${placeholder_username}"> ${locked_domain ? tplDomain(locked_domain) : ''}</div></div>${authentication !== EXTERNAL ? tplPasswordInput() : ''} ${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_connection_url_input') ? tplConnectionURLInput() : ''} ${show_trust_checkbox ? tplTrustCheckbox(show_trust_checkbox === 'off' ? false : true) : ''}<div class="text-center mb-3"><button class="btn btn-primary px-5 mx-auto" type="submit">${i18n_login}</button></div><converse-register-link></converse-register-link>`;
}
function tplFormFields() {
    const authentication = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('authentication');
    const i18n_disconnected = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Disconnected');
    const i18n_anon_login = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Click here to log in anonymously');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${authentication == LOGIN || authentication == EXTERNAL ? tplAuthFields() : ''} ${authentication == ANONYMOUS ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="text-center mb-3"><button class="btn btn-primary login-anon px-5 mx-auto" type="submit">${i18n_anon_login}</button></div>` : ''} ${authentication == PREBIND ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="alert alert-warning">${i18n_disconnected}</p>` : ''}`;
}
/**
 * @param {import('../loginform.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const { connfeedback } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
    const connection_status = connfeedback.get('connection_status');
    var _CONNECTION_STATUS_CSS_CLASS_connection_status;
    const feedback_class = (_CONNECTION_STATUS_CSS_CLASS_connection_status = _constants_js__WEBPACK_IMPORTED_MODULE_3__.CONNECTION_STATUS_CSS_CLASS === null || _constants_js__WEBPACK_IMPORTED_MODULE_3__.CONNECTION_STATUS_CSS_CLASS === void 0 ? void 0 : _constants_js__WEBPACK_IMPORTED_MODULE_3__.CONNECTION_STATUS_CSS_CLASS[connection_status]) !== null && _CONNECTION_STATUS_CSS_CLASS_connection_status !== void 0 ? _CONNECTION_STATUS_CSS_CLASS_connection_status : 'none';
    const conn_feedback_message = connfeedback.get('message');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form id="converse-login" class="converse-form" method="post" @submit="${el.onLoginFormSubmitted}"><div class="alert ${`alert-${feedback_class}`} conn-feedback mb-3 ${!conn_feedback_message ? 'd-none' : ''}" role="alert"><span class="feedback-message">${conn_feedback_message}</span></div>${[
        'CONNECTED',
        'CONNECTING',
        'AUTHENTICATING',
        'RECONNECTING'
    ].includes(CONNECTION_STATUS[connection_status]) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="text-center my-3">${(0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__["default"])()}</div>` : tplFormFields()}</form>`;
});


/***/ }),

/***/ "./src/plugins/controlbox/templates/navback.js":
/*!*****************************************************!*\
  !*** ./src/plugins/controlbox/templates/navback.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/controlbox/utils.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((jid)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-icon size="1em" class="fa fa-arrow-left" @click="${()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.navigateToControlBox)(jid)}"></converse-icon>`;
});


/***/ }),

/***/ "./src/plugins/controlbox/templates/navbar.js":
/*!****************************************************!*\
  !*** ./src/plugins/controlbox/templates/navbar.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/**
 * @param {import('../navbar.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<nav class="navbar navbar-expand-lg"><div class="container-fluid"><div class="collapse navbar-collapse"><ul class="navbar-nav ms-auto mb-2 mb-lg-0"><li class="nav-item"><a class="nav-link" href="#" @click="${el.openAboutDialog}">About</a></li><li class="nav-item"><a class="nav-link" target="_blank" rel="noopener" href="https://github.com/conversejs/converse.js">Github</a></li><li class="nav-item"><a class="nav-link" target="_blank" rel="noopener" href="https://conversejs.org/docs/html">Documentation</a></li><li class="nav-item"><a class="nav-link" target="_blank" rel="noopener" href="https://opkode.com/contact.html">Contact</a></li></ul></div></div></nav>`;
});


/***/ }),

/***/ "./src/plugins/controlbox/templates/toggle.js":
/*!****************************************************!*\
  !*** ./src/plugins/controlbox/templates/toggle.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/controlbox/utils.js");



/**
 * @param {import('../toggle').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn toggle-controlbox ${((_el_model = el.model) === null || _el_model === void 0 ? void 0 : _el_model.get('closed')) ? '' : 'hidden'}" @click="${(ev)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.showControlBox)(ev)}"><span class="toggle-feedback">${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Chat')}</span></button>`;
});


/***/ }),

/***/ "./src/plugins/controlbox/toggle.js":
/*!******************************************!*\
  !*** ./src/plugins/controlbox/toggle.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_toggle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/toggle.js */ "./src/plugins/controlbox/templates/toggle.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



class ControlBoxToggle extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    connectedCallback() {
        var _this = this, _superprop_get_connectedCallback = ()=>super.connectedCallback;
        return _async_to_generator(function*() {
            _superprop_get_connectedCallback().call(_this);
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil('initialized');
            const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            this.model = chatboxes.get('controlbox');
            this.listenTo(this.model, 'change:closed', ()=>this.requestUpdate());
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return (0,_templates_toggle_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-controlbox-toggle', ControlBoxToggle);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ControlBoxToggle);


/***/ }),

/***/ "./src/plugins/controlbox/utils.js":
/*!*****************************************!*\
  !*** ./src/plugins/controlbox/utils.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addControlBox: () => (/* binding */ addControlBox),
/* harmony export */   clearSession: () => (/* binding */ clearSession),
/* harmony export */   disconnect: () => (/* binding */ disconnect),
/* harmony export */   navigateToControlBox: () => (/* binding */ navigateToControlBox),
/* harmony export */   onChatBoxesFetched: () => (/* binding */ onChatBoxesFetched),
/* harmony export */   showControlBox: () => (/* binding */ showControlBox),
/* harmony export */   updateSettingsWithFormData: () => (/* binding */ updateSettingsWithFormData),
/* harmony export */   validateJID: () => (/* binding */ validateJID)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n/index.js */ "./src/i18n/index.js");


const { Strophe, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
function addControlBox() {
    var _converse_state_chatboxviews_get;
    const m = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.add(new _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.ControlBox({
        'id': 'controlbox'
    }));
    (_converse_state_chatboxviews_get = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.get('controlbox')) === null || _converse_state_chatboxviews_get === void 0 ? void 0 : _converse_state_chatboxviews_get.setModel();
    return m;
}
/**
 * @param {Event} [ev]
 */ function showControlBox(ev) {
    var _ev_preventDefault;
    ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
    const controlbox = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.get('controlbox') || addControlBox();
    u.safeSave(controlbox, {
        'closed': false
    });
}
/**
 * @param {string} jid
 */ function navigateToControlBox(jid) {
    showControlBox();
    const model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.get(jid);
    u.safeSave(model, {
        'hidden': true
    });
}
function disconnect() {
    var _converse_state_chatboxes;
    // Upon disconnection, set connected to `false`, so that if
    // we reconnect, "onConnected" will be called,
    // to fetch the roster again and to send out a presence stanza.
    const model = (_converse_state_chatboxes = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes) === null || _converse_state_chatboxes === void 0 ? void 0 : _converse_state_chatboxes.get('controlbox');
    if (model) u.safeSave(model, {
        'connected': false
    });
}
function clearSession() {
    const { chatboxviews } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
    const view = chatboxviews === null || chatboxviews === void 0 ? void 0 : chatboxviews.get('controlbox');
    if (view) {
        u.safeSave(view.model, {
            connected: false
        });
        if (view === null || view === void 0 ? void 0 : view.controlbox_pane) {
            view.controlbox_pane.remove();
            delete view.controlbox_pane;
        }
    }
}
function onChatBoxesFetched() {
    const controlbox = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.get('controlbox') || addControlBox();
    controlbox.save({
        'connected': true
    });
}
/**
 * Given the login `<form>` element, parse its data and update the
 * converse settings with the supplied JID, password and connection URL.
 * @param {HTMLFormElement} form
 * @param {Object} settings - Extra settings that may be passed in and will
 *  also be set together with the form settings.
 */ function updateSettingsWithFormData(form, settings = {}) {
    const form_data = new FormData(form);
    const connection_url = /** @type {string} */ form_data.get('connection-url');
    if (connection_url === null || connection_url === void 0 ? void 0 : connection_url.startsWith('ws')) {
        settings['websocket_url'] = connection_url;
    } else if (connection_url === null || connection_url === void 0 ? void 0 : connection_url.startsWith('http')) {
        settings['bosh_service_url'] = connection_url;
    }
    let jid = /** @type {string} */ form_data.get('jid');
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('locked_domain')) {
        const last_part = '@' + _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('locked_domain');
        if (jid.endsWith(last_part)) {
            jid = jid.substr(0, jid.length - last_part.length);
        }
        jid = Strophe.escapeNode(jid) + last_part;
    } else if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('default_domain') && !jid.includes('@')) {
        jid = jid + '@' + _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('default_domain');
    }
    settings['jid'] = jid;
    settings['password'] = form_data.get('password');
    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.set(settings);
    _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.config.save({
        'trusted': form_data.get('trusted') && true || false
    });
}
/**
 * @param {HTMLFormElement} form
 */ function validateJID(form) {
    const jid_element = /** @type {HTMLInputElement} */ form.querySelector('input[name=jid]');
    if (jid_element.value && !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('locked_domain') && !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('default_domain') && !u.isValidJID(jid_element.value)) {
        jid_element.setCustomValidity((0,i18n_index_js__WEBPACK_IMPORTED_MODULE_1__.__)('Please enter a valid XMPP address'));
        return false;
    }
    jid_element.setCustomValidity('');
    return true;
}


/***/ }),

/***/ "./src/plugins/disco-views/disco-browser.js":
/*!**************************************************!*\
  !*** ./src/plugins/disco-views/disco-browser.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _templates_disco_browser_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/disco-browser.js */ "./src/plugins/disco-views/templates/disco-browser.js");
/* harmony import */ var _styles_disco_browser_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/disco-browser.scss */ "./src/plugins/disco-views/styles/disco-browser.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class DiscoBrowser extends shared_components_element__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            _entity_jids: {
                type: Array,
                state: true
            }
        };
    }
    render() {
        return (0,_templates_disco_browser_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     * @param {number} index
     */ handleBreadcrumbClick(ev, index) {
        ev.preventDefault();
        // Update the _entity_jids array to only include up to the clicked index
        this._entity_jids = [
            ...this._entity_jids.slice(0, index + 1)
        ];
    }
    /**
     * @param {SubmitEvent} ev
     */ queryEntity(ev) {
        ev.preventDefault();
        const form = /** @type {HTMLFormElement} */ ev.target;
        const data = new FormData(form);
        this._entity_jids = [
            /** @type {string} */ data.get('entity_jid').trim()
        ];
    }
    /**
     * @param {import('@converse/headless/types/plugins/disco/entity').default} i
     */ renderItem(i) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${i.get('name') ? `${i.get('name')} <${i.get('jid')}>` : `${i.get('jid')}`}`;
    }
    /**
     * @param {MouseEvent} ev
     * @param {import('@converse/headless/types/plugins/disco/entity').default} identity
     */ addEntityJID(ev, identity) {
        ev.preventDefault();
        this._entity_jids = [
            ...this._entity_jids,
            identity.get('jid')
        ];
    }
    getDiscoInfo() {
        return _async_to_generator(function*() {
            var _entity_features, _features_toSorted;
            const entity_jid = this._entity_jids[this._entity_jids.length - 1];
            const entity = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.disco.entities.get(entity_jid, true);
            yield entity.waitUntilItemsFetched;
            const error = entity.get('error');
            if (error) {
                if ([
                    'item-not-found',
                    'remote-server-not-found'
                ].includes(error)) {
                    return {
                        error: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No service found with that XMPP address')
                    };
                } else {
                    return {
                        error: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Error: %1$s', error)
                    };
                }
            }
            const features = ((_entity_features = entity.features) === null || _entity_features === void 0 ? void 0 : _entity_features.map((f)=>f.get('var'))) || [];
            const identities = entity.identities || [];
            const item_jids = entity.get('items') || [];
            const items = yield Promise.all(item_jids.map(/** @param {string} jid */ (jid)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.disco.entities.get(jid)));
            return {
                features: ((_features_toSorted = features.toSorted) === null || _features_toSorted === void 0 ? void 0 : _features_toSorted.call(features)) || features,
                identities,
                items
            };
        }).call(this);
    }
    constructor(){
        super();
        this._entity_jids = [
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('domain')
        ];
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-disco-browser', DiscoBrowser);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DiscoBrowser);


/***/ }),

/***/ "./src/plugins/disco-views/index.js":
/*!******************************************!*\
  !*** ./src/plugins/disco-views/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _disco_browser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./disco-browser.js */ "./src/plugins/disco-views/disco-browser.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-disco-views', {
    dependencies: [
        'converse-disco'
    ],
    enabled () {
        return true;
    },
    initialize () {}
});


/***/ }),

/***/ "./src/plugins/disco-views/styles/disco-browser.scss":
/*!***********************************************************!*\
  !*** ./src/plugins/disco-views/styles/disco-browser.scss ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_disco_browser_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./disco-browser.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/disco-views/styles/disco-browser.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_disco_browser_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_disco_browser_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_disco_browser_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_disco_browser_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/disco-views/templates/disco-browser.js":
/*!************************************************************!*\
  !*** ./src/plugins/disco-views/templates/disco-browser.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_rosterview_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! plugins/rosterview/utils */ "./src/plugins/rosterview/utils.js");





/**
 * @param {import('../disco-browser').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const disco = el.getDiscoInfo();
    const input_jid = el._entity_jids[el._entity_jids.length - 1];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<h4 class="mt-3 text-center">${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Discover Services')}</h4><form class="mt-2 mb-3" @submit="${(ev)=>el.queryEntity(ev)}"><div class="d-flex w-100"><converse-autocomplete .getAutoCompleteList="${plugins_rosterview_utils__WEBPACK_IMPORTED_MODULE_4__.getJIDsAutoCompleteList}" class="w-100" min_chars="2" name="entity_jid" position="below" required value="${input_jid}"></converse-autocomplete><button type="submit" class="btn btn-outline-secondary">${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Inspect')}</button></div></form><nav aria-label="breadcrumb"><ol class="breadcrumb"><li>${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Service')}: </li>${el._entity_jids.map((jid, index)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="breadcrumb-item"><a href="#" @click="${(ev)=>el.handleBreadcrumbClick(ev, index)}">${jid}</a></li>`)}</ol></nav>${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(disco.then(()=>''), (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-spinner></converse-spinner>`)} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(disco.then(({ error })=>error ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-danger" role="alert">${error}</div>` : ''), '')}<div class="container">${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(disco.then(({ identities })=>(identities === null || identities === void 0 ? void 0 : identities.length) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<h5 class="mt-3">${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Identities')}</h5><ul class="items-list identities">${identities.map((i)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="list-item"><ul class="list-unstyled">${i.get('name') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Name')}:</strong> ${i.get('name')}</li>` : ''} ${i.get('type') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Type')}:</strong> ${i.get('type')}</li>` : ''} ${i.get('category') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Category')}:</strong> ${i.get('category')}</li>` : ''}</ul></li>`)}</ul>` : ''), '')} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(disco.then(({ items })=>(items === null || items === void 0 ? void 0 : items.length) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<h5 class="mt-3">${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Items')}</h5><ul class="items-list disco-items">${items.map((i)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="list-item"><a @click="${(ev)=>el.addEntityJID(ev, i)}">${el.renderItem(i)}</a></li>`)}</ul>` : ''), '')} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(disco.then(({ features })=>(features === null || features === void 0 ? void 0 : features.length) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<h5 class="mt-3">${(0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Features')}</h5><ul class="items-list features">${features.map((f)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="list-item">${f}</li>`)}</ul>` : ''), '')}</div>`;
});


/***/ }),

/***/ "./src/plugins/dragresize/components/dragresize.js":
/*!*********************************************************!*\
  !*** ./src/plugins/dragresize/components/dragresize.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_dragresize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../templates/dragresize.js */ "./src/plugins/dragresize/templates/dragresize.js");



class ConverseDragResize extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    render() {
        return (0,_templates_dragresize_js__WEBPACK_IMPORTED_MODULE_2__["default"])();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-dragresize', ConverseDragResize);


/***/ }),

/***/ "./src/plugins/dragresize/index.js":
/*!*****************************************!*\
  !*** ./src/plugins/dragresize/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_dragresize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./components/dragresize.js */ "./src/plugins/dragresize/components/dragresize.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/dragresize/utils.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



_converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.plugins.add('converse-dragresize', {
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.extend({
            allow_dragresize: true,
            dragresize_top_margin: 0
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.listen.on('registeredGlobalEventHandlers', _utils_js__WEBPACK_IMPORTED_MODULE_1__.registerGlobalEventHandlers);
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.listen.on('unregisteredGlobalEventHandlers', _utils_js__WEBPACK_IMPORTED_MODULE_1__.unregisterGlobalEventHandlers);
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.listen.on('startDiagonalResize', _utils_js__WEBPACK_IMPORTED_MODULE_1__.dragresizeOverIframeHandler);
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.listen.on('startHorizontalResize', _utils_js__WEBPACK_IMPORTED_MODULE_1__.dragresizeOverIframeHandler);
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.listen.on('startVerticalResize', _utils_js__WEBPACK_IMPORTED_MODULE_1__.dragresizeOverIframeHandler);
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.listen.on('shouldDestroyOnClose', _utils_js__WEBPACK_IMPORTED_MODULE_1__.shouldDestroyOnClose);
    }
});


/***/ }),

/***/ "./src/plugins/dragresize/mixin.js":
/*!*****************************************!*\
  !*** ./src/plugins/dragresize/mixin.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DragResizable)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/dragresize/utils.js");



/**
 * @template {import('shared/components/types').CustomElementExtender} T
 * @param {T} BaseCustomElement
 */ function DragResizable(BaseCustomElement) {
    return class DragResizableElement extends BaseCustomElement {
        /**
         * Called when the element's properties change.
         * @param {import('lit').PropertyValues} changed
         */ updated(changed) {
            super.updated(changed);
            if (changed.has('model') && this.model) {
                this.initDragResize();
            }
        }
        initDragResize() {
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') == 'overlayed') {
                this.setupDragResize();
            }
        }
        setupDragResize() {
            const debouncedSetDimensions = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.debounce(()=>this.setDimensions(), 250);
            window.addEventListener('resize', debouncedSetDimensions);
            this.listenTo(this.model, 'destroy', ()=>window.removeEventListener('resize', debouncedSetDimensions));
            const flyout = /** @type {HTMLElement} */ this.querySelector('.box-flyout');
            this.model.set(this.getDefaultDimensions());
            const style = window.getComputedStyle(flyout);
            const min_width = style['min-width'];
            const min_height = style['min-height'];
            this.model.set('min_width', min_width.endsWith('px') ? Number(min_width.replace(/px$/, '')) : 0);
            this.model.set('min_height', min_height.endsWith('px') ? Number(min_height.replace(/px$/, '')) : 0);
            // Initialize last known mouse position
            this.prev_pageY = 0;
            this.prev_pageX = 0;
            this.height = this.model.get('height');
            this.width = this.model.get('width');
            return this;
        }
        /**
         * Returns the default height and width of a chat, i.e. what it
         * would have been if it wasn't resized.
         * @returns {{ default_height: number, default_width: number }}
         */ getDefaultDimensions() {
            const flyout = /** @type {HTMLElement} */ this.querySelector('.box-flyout');
            if (!this.model.get('height') && !this.model.get('width')) {
                const style = window.getComputedStyle(flyout);
                return {
                    default_height: parseInt(style.height.replace(/px$/, ''), 10),
                    default_width: parseInt(style.width.replace(/px$/, ''), 10)
                };
            } else {
                const style = flyout.getAttribute('style');
                flyout.removeAttribute('style');
                const dimensions = {
                    default_height: flyout.offsetHeight,
                    default_width: flyout.offsetWidth
                };
                flyout.setAttribute('style', style);
                return dimensions;
            }
        }
        setDimensions() {
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') === 'overlayed') {
                this.setChatBoxWidth(this.model.get('width'));
                this.setChatBoxHeight(this.model.get('height'));
            }
        }
        /**
         * @param {MouseEvent} ev
         */ resizeChatBox(ev) {
            let diff;
            const direction = (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.getResizingDirection)();
            if (direction.indexOf('top') === 0) {
                var _api_settings_get;
                const margin = (_api_settings_get = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('dragresize_top_margin')) !== null && _api_settings_get !== void 0 ? _api_settings_get : 0;
                const max_height = window.innerHeight - margin;
                diff = ev.pageY - this.prev_pageY;
                if (diff) {
                    const new_height = this.height - diff;
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug('------------');
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(`window.innerHeight: ${window.innerHeight}`);
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(`max_height: ${max_height}`);
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(`new_height: ${new_height}`);
                    _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].debug(`diff: ${diff}`);
                    this.height = this.height - diff > (this.model.get('min_height') || 0) ? new_height <= max_height ? new_height : max_height : this.model.get('min_height');
                    this.prev_pageY = ev.pageY;
                    this.setChatBoxHeight(this.height);
                }
            }
            if (direction.includes('left')) {
                diff = this.prev_pageX - ev.pageX;
                if (diff) {
                    this.width = this.width + diff > (this.model.get('min_width') || 0) ? this.width + diff : this.model.get('min_width');
                    this.prev_pageX = ev.pageX;
                    this.setChatBoxWidth(this.width);
                }
            }
        }
        /**
         * @param {number} height
         */ setChatBoxHeight(height) {
            const flyout_el = /** @type {HTMLElement} */ this.querySelector('.box-flyout');
            if (flyout_el !== null) {
                flyout_el.style.height = height ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.applyDragResistance)(height, this.model.get('default_height')) + 'px' : '';
            }
        }
        /**
         * @param {number} width
         */ setChatBoxWidth(width) {
            const style_width = width ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.applyDragResistance)(width, this.model.get('default_width')) + 'px' : '';
            this.style.width = style_width;
            const flyout_el = /** @type {HTMLElement} */ this.querySelector('.box-flyout');
            if (flyout_el !== null) {
                flyout_el.style.width = style_width;
            }
        }
        /**
         * @param {any[]} args
         */ constructor(...args){
            super(args);
            this.model = null;
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.listen.on('change:view_mode', ()=>this.initDragResize());
        }
    };
}


/***/ }),

/***/ "./src/plugins/dragresize/templates/dragresize.js":
/*!********************************************************!*\
  !*** ./src/plugins/dragresize/templates/dragresize.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/dragresize/utils.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (()=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="dragresize dragresize-top" @mousedown="${_utils_js__WEBPACK_IMPORTED_MODULE_1__.onStartVerticalResize}"></div><div class="dragresize dragresize-topleft" @mousedown="${_utils_js__WEBPACK_IMPORTED_MODULE_1__.onStartDiagonalResize}"></div><div class="dragresize dragresize-left" @mousedown="${_utils_js__WEBPACK_IMPORTED_MODULE_1__.onStartHorizontalResize}"></div>`);


/***/ }),

/***/ "./src/plugins/dragresize/utils.js":
/*!*****************************************!*\
  !*** ./src/plugins/dragresize/utils.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   applyDragResistance: () => (/* binding */ applyDragResistance),
/* harmony export */   dragresizeOverIframeHandler: () => (/* binding */ dragresizeOverIframeHandler),
/* harmony export */   getResizingDirection: () => (/* binding */ getResizingDirection),
/* harmony export */   onMouseMove: () => (/* binding */ onMouseMove),
/* harmony export */   onMouseUp: () => (/* binding */ onMouseUp),
/* harmony export */   onStartDiagonalResize: () => (/* binding */ onStartDiagonalResize),
/* harmony export */   onStartHorizontalResize: () => (/* binding */ onStartHorizontalResize),
/* harmony export */   onStartVerticalResize: () => (/* binding */ onStartVerticalResize),
/* harmony export */   registerGlobalEventHandlers: () => (/* binding */ registerGlobalEventHandlers),
/* harmony export */   shouldDestroyOnClose: () => (/* binding */ shouldDestroyOnClose),
/* harmony export */   unregisterGlobalEventHandlers: () => (/* binding */ unregisterGlobalEventHandlers)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");

const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
function registerGlobalEventHandlers() {
    document.addEventListener('mousemove', onMouseMove);
    document.addEventListener('mouseup', onMouseUp);
}
function unregisterGlobalEventHandlers() {
    document.removeEventListener('mousemove', onMouseMove);
    document.removeEventListener('mouseup', onMouseUp);
}
/**
 * This function registers mousedown and mouseup events hadlers to
 * all iframes in the DOM when converse UI resizing events are called
 * to prevent mouse drag stutter effect which is bad user experience.
 * @param {Element} e - dragging node element.
 */ function dragresizeOverIframeHandler(e) {
    const iframes = Array.from(document.getElementsByTagName('iframe'));
    for (const iframe of iframes){
        e.addEventListener('mousedown', ()=>{
            iframe.style.pointerEvents = 'none';
        }, {
            once: true
        });
        e.addEventListener('mouseup', ()=>{
            iframe.style.pointerEvents = 'initial';
        }, {
            once: true
        });
    }
}
/**
 * @typedef {Object} ResizingData
 * @property {HTMLElement} chatbox
 * @property {string} direction
 */ const resizing = {};
/**
 * @returns {string}
 */ function getResizingDirection() {
    return resizing.direction;
}
/**
 * @param {MouseEvent} ev
 * @param {boolean} [trigger=true]
 */ function onStartVerticalResize(ev, trigger = true) {
    if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_dragresize')) {
        return true;
    }
    ev.preventDefault();
    // Record element attributes for mouseMove().
    const flyout = u.ancestor(ev.target, '.box-flyout');
    const style = window.getComputedStyle(flyout);
    const chatbox_el = flyout.parentElement;
    chatbox_el.height = parseInt(style.height.replace(/px$/, ''), 10);
    resizing.chatbox = chatbox_el;
    resizing.direction = 'top';
    chatbox_el.prev_pageY = ev.pageY;
    if (trigger) {
        /**
         * Triggered once the user starts to vertically resize a {@link _converse.ChatBoxView}
         * @event _converse#startVerticalResize
         * @example _converse.api.listen.on('startVerticalResize', (view) => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('startVerticalResize', chatbox_el);
    }
}
/**
 * @param {MouseEvent} ev
 * @param {boolean} [trigger=true]
 */ function onStartHorizontalResize(ev, trigger = true) {
    if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_dragresize')) {
        return true;
    }
    ev.preventDefault();
    const flyout = u.ancestor(ev.target, '.box-flyout');
    const style = window.getComputedStyle(flyout);
    const chatbox_el = flyout.parentElement;
    chatbox_el.width = parseInt(style.width.replace(/px$/, ''), 10);
    resizing.chatbox = chatbox_el;
    resizing.direction = 'left';
    chatbox_el.prev_pageX = ev.pageX;
    if (trigger) {
        /**
         * Triggered once the user starts to horizontally resize a {@link _converse.ChatBoxView}
         * @event _converse#startHorizontalResize
         * @example _converse.api.listen.on('startHorizontalResize', (view) => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('startHorizontalResize', chatbox_el);
    }
}
/**
 * @param {MouseEvent} ev
 */ function onStartDiagonalResize(ev) {
    onStartHorizontalResize(ev, false);
    onStartVerticalResize(ev, false);
    resizing.direction = 'topleft';
    /**
     * Triggered once the user starts to diagonally resize a {@link _converse.ChatBoxView}
     * @event _converse#startDiagonalResize
     * @example _converse.api.listen.on('startDiagonalResize', (view) => { ... });
     */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('startDiagonalResize', this);
}
/**
 * Applies some resistance to `value` around the `default_value`.
 * If value is close enough to `default_value`, then it is returned, otherwise
 * `value` is returned.
 * @param {number} value
 * @param {number} default_value
 * @returns {number}
 */ function applyDragResistance(value, default_value) {
    if (value === undefined) {
        return undefined;
    } else if (default_value === undefined) {
        return value;
    }
    const resistance = 10;
    if (value !== default_value && Math.abs(value - default_value) < resistance) {
        return default_value;
    }
    return value;
}
/**
 * @param {MouseEvent} ev
 */ function onMouseMove(ev) {
    if (!resizing.chatbox || !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_dragresize')) {
        return true;
    }
    ev.preventDefault();
    resizing.chatbox.resizeChatBox(ev);
}
/**
 * @param {MouseEvent} ev
 */ function onMouseUp(ev) {
    if (!resizing.chatbox || !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_dragresize')) {
        return true;
    }
    ev.preventDefault();
    const default_width = resizing.chatbox.model.get('default_width');
    const default_height = resizing.chatbox.model.get('default_height');
    const height = applyDragResistance(resizing.chatbox.height, default_height);
    const width = applyDragResistance(resizing.chatbox.width, default_width);
    if (height !== default_height || width !== default_width) {
        u.safeSave(resizing.chatbox.model, {
            height,
            width
        });
    } else {
        u.safeSave(resizing.chatbox.model, {
            height: undefined,
            width: undefined
        });
    }
    delete resizing.chatbox;
    delete resizing.direction;
}
/**
 * @param {import('@converse/headless/types/shared/chatbox').default} chatbox
 * @param {boolean} should_destroy
 */ function shouldDestroyOnClose(chatbox, should_destroy) {
    if (chatbox.get('height') || chatbox.get('width')) {
        return false;
    }
    return should_destroy;
}


/***/ }),

/***/ "./src/plugins/fullscreen/index.js":
/*!*****************************************!*\
  !*** ./src/plugins/fullscreen/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_fullscreen_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./styles/fullscreen.scss */ "./src/plugins/fullscreen/styles/fullscreen.scss");
/**
 * @module converse-fullscreen
 * @license Mozilla Public License (MPLv2)
 * @copyright 2022, the Converse.js contributors
 */ 

const { isUniView } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u;
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-fullscreen', {
    enabled () {
        return isUniView();
    },
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            chatview_avatar_height: 50,
            chatview_avatar_width: 50,
            hide_open_bookmarks: true,
            show_controlbox_by_default: true,
            sticky_controlbox: true
        });
    }
});


/***/ }),

/***/ "./src/plugins/fullscreen/styles/fullscreen.scss":
/*!*******************************************************!*\
  !*** ./src/plugins/fullscreen/styles/fullscreen.scss ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_fullscreen_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./fullscreen.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/fullscreen/styles/fullscreen.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_fullscreen_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_fullscreen_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_fullscreen_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_fullscreen_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/headlines-view/feed-list.js":
/*!*************************************************!*\
  !*** ./src/plugins/headlines-view/feed-list.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   HeadlinesFeedsList: () => (/* binding */ HeadlinesFeedsList)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_feeds_list_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/feeds-list.js */ "./src/plugins/headlines-view/templates/feeds-list.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



const { HEADLINES_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class HeadlinesFeedsList extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    initialize() {
        this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes;
        this.listenTo(this.model, 'add', (m)=>this.renderIfHeadline(m));
        this.listenTo(this.model, 'remove', (m)=>this.renderIfHeadline(m));
        this.listenTo(this.model, 'destroy', (m)=>this.renderIfHeadline(m));
        this.requestUpdate();
    }
    render() {
        return (0,_templates_feeds_list_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    renderIfHeadline(model) {
        return (model === null || model === void 0 ? void 0 : model.get('type')) === HEADLINES_TYPE && this.requestUpdate();
    }
    openHeadline(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const jid = ev.target.getAttribute('data-headline-jid');
            const feed = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.headlines.get(jid);
            feed.maybeShow(true);
        })();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-headlines-feeds-list', HeadlinesFeedsList);


/***/ }),

/***/ "./src/plugins/headlines-view/heading.js":
/*!***********************************************!*\
  !*** ./src/plugins/headlines-view/heading.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ HeadlinesHeading)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _templates_chat_head_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/chat-head.js */ "./src/plugins/headlines-view/templates/chat-head.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}




class HeadlinesHeading extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            'jid': {
                type: String
            }
        };
    }
    initialize() {
        return _async_to_generator(function*() {
            this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.get(this.jid);
            yield this.model.initialized;
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return (0,_templates_chat_head_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_object_spread({}, this.model.toJSON(), {
            'display_name': this.model.getDisplayName(),
            'heading_buttons_promise': this.getHeadingButtons()
        }));
    }
    /**
     * Returns a list of objects which represent buttons for the headlines header.
     * @async
     * @emits _converse#getHeadingButtons
     * @method HeadlinesHeading#getHeadingButtons
     */ getHeadingButtons() {
        const buttons = [];
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('singleton')) {
            buttons.push({
                'a_class': 'close-chatbox-button',
                'handler': (ev)=>this.close(ev),
                'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close'),
                'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close these announcements'),
                'icon_class': 'fa-times',
                'name': 'close',
                'standalone': _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed'
            });
        }
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.hook('getHeadingButtons', this, buttons);
    }
    close(ev) {
        ev.preventDefault();
        this.model.close();
    }
    constructor(){
        super();
        this.jid = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-headlines-heading', HeadlinesHeading);


/***/ }),

/***/ "./src/plugins/headlines-view/index.js":
/*!*********************************************!*\
  !*** ./src/plugins/headlines-view/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _chatview_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../chatview/index.js */ "./src/plugins/chatview/index.js");
/* harmony import */ var _view_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view.js */ "./src/plugins/headlines-view/view.js");
/* harmony import */ var _feed_list_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./feed-list.js */ "./src/plugins/headlines-view/feed-list.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_headlines_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/headlines.scss */ "./src/plugins/headlines-view/styles/headlines.scss");
/* harmony import */ var _styles_headlines_head_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/headlines-head.scss */ "./src/plugins/headlines-view/styles/headlines-head.scss");
/**
 * @module converse-headlines-view
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 





_converse_headless__WEBPACK_IMPORTED_MODULE_3__.converse.plugins.add('converse-headlines-view', {
    /* Plugin dependencies are other plugins which might be
     * overridden or relied upon, and therefore need to be loaded before
     * this plugin.
     *
     * If the setting "strict_plugin_dependencies" is set to true,
     * an error will be raised if the plugin is not found. By default it's
     * false, which means these plugins are only loaded opportunistically.
     *
     * NB: These plugins need to have already been loaded by the bundler
     */ dependencies: [
        'converse-headlines',
        'converse-dragresize',
        'converse-chatview'
    ],
    initialize () {
        const exports = {
            HeadlinesFeedView: _view_js__WEBPACK_IMPORTED_MODULE_1__["default"],
            HeadlinesFeedsList: _feed_list_js__WEBPACK_IMPORTED_MODULE_2__.HeadlinesFeedsList,
            HeadlinesPanel: _feed_list_js__WEBPACK_IMPORTED_MODULE_2__.HeadlinesFeedsList
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.exports, exports);
    }
});


/***/ }),

/***/ "./src/plugins/headlines-view/styles/headlines-head.scss":
/*!***************************************************************!*\
  !*** ./src/plugins/headlines-view/styles/headlines-head.scss ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_head_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./headlines-head.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/headlines-view/styles/headlines-head.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/headlines-view/styles/headlines.scss":
/*!**********************************************************!*\
  !*** ./src/plugins/headlines-view/styles/headlines.scss ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./headlines.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/headlines-view/styles/headlines.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_headlines_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/headlines-view/templates/chat-head.js":
/*!***********************************************************!*\
  !*** ./src/plugins/headlines-view/templates/chat-head.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");




/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="chatbox-title ${o.status ? '' : "chatbox-title--no-desc"}"><div class="chatbox-title--row">${!_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.settings.get("singleton") ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<converse-controlbox-navback jid="${o.jid}"></converse-controlbox-navback>` : ''}<div class="chatbox-title__text" title="${o.jid}">${o.display_name}</div></div><div class="chatbox-title__buttons btn-toolbar g-0">${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__.until)((0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__.getDropdownButtons)(o.heading_buttons_promise), '')} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__.until)((0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__.getStandaloneButtons)(o.heading_buttons_promise), '')}</div></div>${o.status ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p class="chat-head__desc">${o.status}</p>` : ''}`;
});


/***/ }),

/***/ "./src/plugins/headlines-view/templates/feeds-list.js":
/*!************************************************************!*\
  !*** ./src/plugins/headlines-view/templates/feeds-list.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



const { HEADLINES_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.constants;
/**
 * @param {import('../feed-list').HeadlinesFeedsList} el
 * @param {import('@converse/headless/types/plugins/headlines/feed').default} feed
 */ function tplHeadlinesFeedsListItem(el, feed) {
    const open_title = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to open this server message');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="list-item controlbox-padded d-flex flex-row" data-headline-jid="${feed.get('jid')}"><a class="list-item-link open-headline available-room w-100" data-headline-jid="${feed.get('jid')}" title="${open_title}" @click="${(ev)=>el.openHeadline(ev)}" href="#">${feed.get('jid')}</a></div>`;
}
/**
 * @param {import('../feed-list').HeadlinesFeedsList} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const feeds = el.model.filter((m)=>m.get('type') === HEADLINES_TYPE);
    const heading_headline = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Announcements');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="controlbox-section" id="headline"><div class="d-flex controlbox-padded ${feeds.length ? '' : 'hidden'}"><span class="w-100 controlbox-heading controlbox-heading--headline" role="heading" aria-level="3">${heading_headline}</span></div></div><div class="list-container list-container--headline ${feeds.length ? '' : 'hidden'}"><div class="items-list rooms-list headline-list">${feeds.map((feed)=>tplHeadlinesFeedsListItem(el, feed))}</div></div>`;
});


/***/ }),

/***/ "./src/plugins/headlines-view/templates/headlines.js":
/*!***********************************************************!*\
  !*** ./src/plugins/headlines-view/templates/headlines.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _heading_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../heading.js */ "./src/plugins/headlines-view/heading.js");



/**
 * @param {import('../view').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const style = (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_1__.getChatStyle)(el.model);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="flyout box-flyout" style="${style || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}"><converse-dragresize></converse-dragresize>${el.model ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-headlines-heading jid="${el.model.get('jid')}" class="chat-head chat-head-chatbox row g-0"></converse-headlines-heading><div class="chat-body"><div class="chat-content" aria-live="polite"><converse-chat-content .model="${el.model}"></converse-chat-content></div></div>` : ''}</div>`;
});


/***/ }),

/***/ "./src/plugins/headlines-view/view.js":
/*!********************************************!*\
  !*** ./src/plugins/headlines-view/view.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_baseview_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/chat/baseview.js */ "./src/shared/chat/baseview.js");
/* harmony import */ var plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/dragresize/mixin.js */ "./src/plugins/dragresize/mixin.js");
/* harmony import */ var _templates_headlines_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/headlines.js */ "./src/plugins/headlines-view/templates/headlines.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class HeadlinesFeedView extends (0,plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_2__["default"])(shared_chat_baseview_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
    initialize() {
        return _async_to_generator(function*() {
            const { chatboxviews, chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            chatboxviews.add(this.jid, this);
            this.model = chatboxes.get(this.jid);
            this.listenTo(this.model, 'change:hidden', ()=>this.afterShown());
            this.listenTo(this.model, 'destroy', this.remove);
            this.listenTo(this.model.messages, 'add', ()=>this.requestUpdate());
            this.listenTo(this.model.messages, 'remove', ()=>this.requestUpdate());
            this.listenTo(this.model.messages, 'reset', ()=>this.requestUpdate());
            document.addEventListener('visibilitychange', ()=>this.onWindowStateChanged());
            yield this.model.messages.fetched;
            this.model.maybeShow();
            /**
         * Triggered once the {@link HeadlinesFeedView} has been initialized
         * @event _converse#headlinesBoxViewInitialized
         * @type {HeadlinesFeedView}
         * @example _converse.api.listen.on('headlinesBoxViewInitialized', view => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('headlinesBoxViewInitialized', this);
        }).call(this);
    }
    render() {
        return (0,_templates_headlines_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    /**
     * @param {Event} ev
     */ close(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            if (location.hash === 'converse/chat?jid=' + this.model.get('jid')) {
                history.pushState(null, '', window.location.pathname);
            }
            yield this.model.close(ev);
            return this;
        }).call(this);
    }
    getNotifications() {
        // eslint-disable-line class-methods-use-this
        // Override method in ChatBox. We don't show notifications for
        // headlines boxes.
        return [];
    }
    afterShown() {
        this.model.clearUnreadMsgCounter();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-headlines', HeadlinesFeedView);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HeadlinesFeedView);


/***/ }),

/***/ "./src/plugins/mam-views/index.js":
/*!****************************************!*\
  !*** ./src/plugins/mam-views/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _placeholder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./placeholder.js */ "./src/plugins/mam-views/placeholder.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/mam-views/utils.js");
/**
 * @description UI code for XEP-0313 Message Archive Management
 * @license Mozilla Public License (MPLv2)
 */ 


_converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.plugins.add('converse-mam-views', {
    dependencies: [
        'converse-mam',
        'converse-chatview',
        'converse-muc-views'
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.extend({
            auto_fill_history_gaps: true
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.listen.on('getMessageTemplate', _utils_js__WEBPACK_IMPORTED_MODULE_2__.getPlaceholderTemplate);
    }
});


/***/ }),

/***/ "./src/plugins/mam-views/placeholder.js":
/*!**********************************************!*\
  !*** ./src/plugins/mam-views/placeholder.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/observable.js */ "./src/shared/components/observable.js");
/* harmony import */ var _templates_placeholder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/placeholder.js */ "./src/plugins/mam-views/templates/placeholder.js");
/* harmony import */ var _styles_placeholder_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/placeholder.scss */ "./src/plugins/mam-views/styles/placeholder.scss");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}




class Placeholder extends shared_components_observable_js__WEBPACK_IMPORTED_MODULE_1__.ObservableElement {
    /**
     * @typedef {import('shared/components/types').ObservableProperty} ObservableProperty
     */ static get properties() {
        return _object_spread_props(_object_spread({}, super.properties), {
            model: {
                type: Object
            }
        });
    }
    render() {
        return (0,_templates_placeholder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {Event} [ev]
     */ fetchMissingMessages(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        this.model.fetchMissingMessages();
    }
    /**
     * @param {IntersectionObserverEntry} _entry
     */ onVisibilityChanged(_entry) {
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("auto_fill_history_gaps") && this.isVisible && !this.model.get("fetching")) {
            this.fetchMissingMessages();
        }
    }
    constructor(){
        super();
        this.model = null;
        this.observable = /** @type {ObservableProperty} */ "once";
        this.intersectionRatio = 0.1;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define("converse-mam-placeholder", Placeholder);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Placeholder);


/***/ }),

/***/ "./src/plugins/mam-views/styles/placeholder.scss":
/*!*******************************************************!*\
  !*** ./src/plugins/mam-views/styles/placeholder.scss ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_placeholder_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./placeholder.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/mam-views/styles/placeholder.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_placeholder_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_placeholder_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_placeholder_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_placeholder_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/mam-views/templates/placeholder.js":
/*!********************************************************!*\
  !*** ./src/plugins/mam-views/templates/placeholder.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit/html.js */ "./node_modules/lit/html.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");



/**
 * @param {import('../placeholder').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    return el.model.get("fetching") ? (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__["default"])({
        classes: "hor_centered"
    }) : (0,lit_html_js__WEBPACK_IMPORTED_MODULE_0__.html)`<a @click="${(ev)=>el.fetchMissingMessages(ev)}" title="${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Click to load missing messages')}"><div class="message mam-placeholder"></div></a>`;
});


/***/ }),

/***/ "./src/plugins/mam-views/utils.js":
/*!****************************************!*\
  !*** ./src/plugins/mam-views/utils.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fetchMessagesOnScrollUp: () => (/* binding */ fetchMessagesOnScrollUp),
/* harmony export */   getPlaceholderTemplate: () => (/* binding */ getPlaceholderTemplate)
/* harmony export */ });
/* harmony import */ var lit_html_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit/html.js */ "./node_modules/lit/html.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @typedef {import('../chatview/chat.js').default} ChatView
 * @typedef {import('../muc-views/muc.js').default} MUCView
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}


const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
function getPlaceholderTemplate(message, tpl) {
    if (message instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_1__.MAMPlaceholderMessage) {
        return (0,lit_html_js__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-mam-placeholder .model="${message}"></converse-mam-placeholder>`;
    } else {
        return tpl;
    }
}
/**
 * @param {ChatView|MUCView} view
 */ function fetchMessagesOnScrollUp(view) {
    return _async_to_generator(function*() {
        if (view.model.ui.get('chat-content-spinner-top')) {
            return;
        }
        if (view.model.messages.length) {
            const is_groupchat = view.model.get('type') === CHATROOMS_TYPE;
            const oldest_message = view.model.getOldestMessage();
            if (oldest_message) {
                const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('bare_jid');
                const by_jid = is_groupchat ? view.model.get('jid') : bare_jid;
                const stanza_id = oldest_message.get(`stanza_id ${by_jid}`);
                view.model.ui.set('chat-content-spinner-top', true);
                try {
                    if (stanza_id) {
                        yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.mam.fetchArchivedMessages(view.model, {
                            'before': stanza_id
                        });
                    } else {
                        yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.mam.fetchArchivedMessages(view.model, {
                            'end': oldest_message.get('time')
                        });
                    }
                } catch (e) {
                    _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
                    view.model.ui.set('chat-content-spinner-top', false);
                    return;
                }
                if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_url_history_change')) {
                    history.pushState(null, '', `#${oldest_message.get('msgid')}`);
                }
                setTimeout(()=>view.model.ui.set('chat-content-spinner-top', false), 250);
            }
        }
    })();
}


/***/ }),

/***/ "./src/plugins/minimize/index.js":
/*!***************************************!*\
  !*** ./src/plugins/minimize/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _toggle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toggle.js */ "./src/plugins/minimize/toggle.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/minimize/utils.js");
/* harmony import */ var _view_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view.js */ "./src/plugins/minimize/view.js");
/* harmony import */ var _minimized_chat_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./minimized-chat.js */ "./src/plugins/minimize/minimized-chat.js");
/* harmony import */ var _styles_minimize_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/minimize.scss */ "./src/plugins/minimize/styles/minimize.scss");
/**
 * @module converse-minimize
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 






const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-minimize', {
    /**
     * @typedef {import('@converse/headless').MUC} MUC
     * @typedef {import('@converse/headless').ChatBox} ChatBox
     */ /* Optional dependencies are other plugins which might be
     * overridden or relied upon, and therefore need to be loaded before
     * this plugin. They are called "optional" because they might not be
     * available, in which case any overrides applicable to them will be
     * ignored.
     */ dependencies: [
        "converse-chatview",
        "converse-controlbox",
        "converse-muc-views",
        "converse-headlines-view",
        "converse-dragresize"
    ],
    enabled (_converse) {
        return _converse.api.settings.get("view_mode") === 'overlayed';
    },
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            'no_trimming': false
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.promises.add('minimizedChatsInitialized');
        const exports = {
            MinimizedChatsToggle: _toggle_js__WEBPACK_IMPORTED_MODULE_1__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, exports);
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, {
            minimize: {
                trimChats: _utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats,
                minimize: _utils_js__WEBPACK_IMPORTED_MODULE_2__.minimize,
                maximize: _utils_js__WEBPACK_IMPORTED_MODULE_2__.maximize
            }
        }); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, {
            minimize: {
                trimChats: _utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats,
                minimize: _utils_js__WEBPACK_IMPORTED_MODULE_2__.minimize,
                maximize: _utils_js__WEBPACK_IMPORTED_MODULE_2__.maximize
            }
        });
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u, {
            trimChats: _utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats,
            minimize: _utils_js__WEBPACK_IMPORTED_MODULE_2__.minimize,
            maximize: _utils_js__WEBPACK_IMPORTED_MODULE_2__.maximize
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxViewInitialized', (view)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats)(view));
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatRoomViewInitialized', (view)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats)(view));
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('controlBoxInitialized', (view)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats)(view));
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_2__.initializeChat);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatRoomInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_2__.initializeChat);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('getHeadingButtons', (view, buttons)=>{
            if (view.model.get('type') === CHATROOMS_TYPE) {
                return (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.addMinimizeButtonToMUC)(view, buttons);
            } else {
                return (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.addMinimizeButtonToChat)(view, buttons);
            }
        });
        const debouncedTrimChats = (0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_6__["default"])(()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.trimChats)(), 250);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('registeredGlobalEventHandlers', ()=>window.addEventListener("resize", debouncedTrimChats));
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('unregisteredGlobalEventHandlers', ()=>window.removeEventListener("resize", debouncedTrimChats));
    }
});


/***/ }),

/***/ "./src/plugins/minimize/minimized-chat.js":
/*!************************************************!*\
  !*** ./src/plugins/minimize/minimized-chat.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MinimizedChat)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _templates_trimmed_chat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/trimmed_chat.js */ "./src/plugins/minimize/templates/trimmed_chat.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/minimize/utils.js");




class MinimizedChat extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            },
            title: {
                type: String
            },
            type: {
                type: String
            },
            num_unread: {
                type: Number
            }
        };
    }
    render() {
        return (0,_templates_trimmed_chat_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     */ close(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        this.model.close();
    }
    /**
     * @param {MouseEvent} ev
     */ restore(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.maximize)(this.model);
    }
    constructor(){
        super();
        this.model = null;
        this.num_unread = null;
        this.type = null;
        this.title = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-minimized-chat', MinimizedChat);


/***/ }),

/***/ "./src/plugins/minimize/styles/minimize.scss":
/*!***************************************************!*\
  !*** ./src/plugins/minimize/styles/minimize.scss ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_minimize_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./minimize.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/minimize/styles/minimize.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_minimize_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_minimize_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_minimize_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_minimize_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/minimize/templates/toggle.js":
/*!**************************************************!*\
  !*** ./src/plugins/minimize/templates/toggle.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import('../view').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const chats = el.model.where({
        'hidden': true
    });
    const num_unread = chats.reduce((acc, chat)=>acc + chat.get('num_unread'), 0);
    const num_minimized = chats.reduce((acc, chat)=>acc + (chat.get('hidden') ? 1 : 0), 0);
    const collapsed = el.minchats.get('collapsed');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div id="minimized-chats" class="${chats.length ? '' : 'hidden'}"><button type="button" class="btn btn-primary" @click="${(ev)=>el.toggle(ev)}">${num_minimized} ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('hidden')} <span class="badge bg-secondary unread-message-count ${!num_unread ? 'hidden' : ''}">${num_unread}</span></button><div class="flyout minimized-chats-flyout row g-0 ${collapsed ? 'hidden' : ''}">${chats.map((chat)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-minimized-chat .model="${chat}" title="${chat.getDisplayName()}" type="${chat.get('type')}" num_unread="${chat.get('num_unread')}"></converse-minimized-chat>`)}</div></div>`;
});


/***/ }),

/***/ "./src/plugins/minimize/templates/trimmed_chat.js":
/*!********************************************************!*\
  !*** ./src/plugins/minimize/templates/trimmed_chat.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import('../minimized-chat').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_tooltip = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Click to restore this chat');
    let close_color;
    if (el.type === 'chatroom') {
        close_color = "var(--muc-color)";
    } else if (el.type === 'headline') {
        close_color = "var(--headlines-color)";
    } else {
        close_color = "var(--chat-color)";
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chat-head-${el.type} chat-head row g-0"><a class="col-10 restore-chat align-self-center" title="${i18n_tooltip}" @click="${(ev)=>el.restore(ev)}">${el.num_unread ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="message-count badge badge-light">${el.num_unread}</span>` : ''} ${el.title} </a><a class="col-2 pl-1" @click="${(ev)=>el.close(ev)}"><converse-icon color="${close_color}" class="fas fa-times" @click="${(ev)=>el.close(ev)}" size="1em"></converse-icon></a></div>`;
});


/***/ }),

/***/ "./src/plugins/minimize/toggle.js":
/*!****************************************!*\
  !*** ./src/plugins/minimize/toggle.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);

class MinimizedChatsToggle extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            'collapsed': false
        };
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MinimizedChatsToggle);


/***/ }),

/***/ "./src/plugins/minimize/utils.js":
/*!***************************************!*\
  !*** ./src/plugins/minimize/utils.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addMinimizeButtonToChat: () => (/* binding */ addMinimizeButtonToChat),
/* harmony export */   addMinimizeButtonToMUC: () => (/* binding */ addMinimizeButtonToMUC),
/* harmony export */   initializeChat: () => (/* binding */ initializeChat),
/* harmony export */   maximize: () => (/* binding */ maximize),
/* harmony export */   minimize: () => (/* binding */ minimize),
/* harmony export */   onMinimizedChanged: () => (/* binding */ onMinimizedChanged),
/* harmony export */   trimChats: () => (/* binding */ trimChats)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/**
 * @typedef {import('@converse/headless').MUC} MUC
 * @typedef {import('@converse/headless').ChatBox} ChatBox
 * @typedef {import('plugins/chatview/chat').default} ChatView
 * @typedef {import('plugins/muc-views/muc').default} MUCView
 * @typedef {import('plugins/controlbox/controlbox').default} ControlBoxView
 * @typedef {import('plugins/headlines-view/view').default} HeadlinesFeedView
 */ 

const { ACTIVE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
/**
 * @param {ChatBox|MUC} chat
 */ function initializeChat(chat) {
    chat.on('change:hidden', ()=>onMinimizedChanged(chat));
    if (chat.get('id') === 'controlbox') {
        return;
    }
    chat.save({
        'hidden': !!chat.get('hidden'),
        'time_minimized': chat.get('time_minimized')
    });
}
function getChatBoxWidth(view) {
    if (view.model.get('id') === 'controlbox') {
        // We return the width of the controlbox or its toggle,
        // depending on which is visible.
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.isVisible(view)) {
            return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getOuterWidth(view, true);
        } else {
            const toggle = document.querySelector('converse-controlbox-toggle');
            return toggle ? _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getOuterWidth(toggle, true) : 0;
        }
    } else if (!view.model.get('hidden') && _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.isVisible(view)) {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getOuterWidth(view, true);
    }
    return 0;
}
function getShownChats() {
    return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.filter((el)=>// The controlbox can take a while to close,
        // so we need to check its state. That's why we checked the 'closed' state.
        !el.model.get('hidden') && !el.model.get('closed') && _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.isVisible(el));
}
function getMinimizedWidth() {
    const minimized_el = document.querySelector('converse-minimized-chats');
    return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.pluck('hidden').includes(true) ? _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getOuterWidth(minimized_el, true) : 0;
}
function getBoxesWidth(newchat) {
    const new_id = newchat ? newchat.model.get('id') : null;
    const newchat_width = newchat ? _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getOuterWidth(newchat, true) : 0;
    return Object.values(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.xget(new_id)).reduce((memo, view)=>memo + getChatBoxWidth(view), newchat_width);
}
/**
 * This method is called when a newly created chat box will be shown.
 * It checks whether there is enough space on the page to show
 * another chat box. Otherwise it minimizes the oldest chat box
 * to create space.
 * @param {ChatView|MUCView|ControlBoxView|HeadlinesFeedView} [newchat]
 */ function trimChats(newchat) {
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('no_trimming') || _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("view_mode") !== 'overlayed') {
        return;
    }
    const shown_chats = getShownChats();
    if (shown_chats.length <= 1) {
        return;
    }
    const body_width = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getOuterWidth(document.querySelector('body'), true);
    if (getChatBoxWidth(shown_chats[0]) === body_width) {
        // If the chats shown are the same width as the body,
        // then we're in responsive mode and the chats are
        // fullscreen. In this case we don't trim.
        return;
    }
    const minimized_el = document.querySelector('converse-minimized-chats');
    if (minimized_el) {
        while(getMinimizedWidth() + getBoxesWidth(newchat) > body_width){
            const new_id = newchat ? newchat.model.get('id') : null;
            const oldest_chat = getOldestMaximizedChat([
                new_id
            ]);
            if (oldest_chat) {
                const model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.get(oldest_chat.get('id'));
                model === null || model === void 0 ? void 0 : model.save('hidden', true);
                minimize(oldest_chat);
            } else {
                break;
            }
        }
    }
}
function getOldestMaximizedChat(exclude_ids) {
    // Get oldest view (if its id is not excluded)
    exclude_ids.push('controlbox');
    let i = 0;
    let model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.sort().at(i);
    while(exclude_ids.includes(model.get('id')) || model.get('hidden') === true){
        i++;
        model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.at(i);
        if (!model) {
            return null;
        }
    }
    return model;
}
function addMinimizeButtonToChat(view, buttons) {
    const data = {
        'a_class': 'toggle-chatbox-button',
        'handler': (ev)=>minimize(ev, view.model),
        'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Minimize'),
        'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Minimize this chat'),
        'icon_class': "fa-minus",
        'name': 'minimize',
        'standalone': _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.settings.get("view_mode") === 'overlayed'
    };
    const names = buttons.map((t)=>t.name);
    const idx = names.indexOf('close');
    return idx > -1 ? [
        ...buttons.slice(0, idx),
        data,
        ...buttons.slice(idx)
    ] : [
        data,
        ...buttons
    ];
}
function addMinimizeButtonToMUC(view, buttons) {
    const data = {
        'a_class': 'toggle-chatbox-button',
        'handler': (ev)=>minimize(ev, view.model),
        'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Minimize'),
        'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Minimize this groupchat'),
        'icon_class': "fa-minus",
        'name': 'minimize',
        'standalone': _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.settings.get("view_mode") === 'overlayed'
    };
    const names = buttons.map((t)=>t.name);
    const idx = names.indexOf('signout');
    return idx > -1 ? [
        ...buttons.slice(0, idx),
        data,
        ...buttons.slice(idx)
    ] : [
        data,
        ...buttons
    ];
}
function maximize(ev, chatbox) {
    if (ev === null || ev === void 0 ? void 0 : ev.preventDefault) {
        ev.preventDefault();
    } else {
        chatbox = ev;
    }
    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(chatbox, {
        'hidden': false,
        'time_opened': new Date().getTime()
    });
}
function minimize(ev, model) {
    if (ev === null || ev === void 0 ? void 0 : ev.preventDefault) {
        ev.preventDefault();
    } else {
        model = ev;
    }
    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(model, {
        'hidden': true,
        'time_minimized': new Date().toISOString()
    });
}
/**
 * Will trigger {@link _converse#chatBoxMaximized}
 * @param {ChatBox|MUC} model
 */ function onMaximized(model) {
    if (!model.isScrolledUp()) {
        model.clearUnreadMsgCounter();
    }
    model.setChatState(ACTIVE);
    /**
     * Triggered when a previously minimized chat gets maximized
     * @event _converse#chatBoxMaximized
     * @type {ChatBox|MUC}
     * @example _converse.api.listen.on('chatBoxMaximized', view => { ... });
     */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('chatBoxMaximized', model);
}
/**
 * Handler which gets called when a {@link _converse#ChatBox} has it's
 * `minimized` property set to true.
 * @param {ChatBox|MUC} model
 *
 * Will trigger {@link _converse#chatBoxMinimized}
 */ function onMinimized(model) {
    /**
     * Triggered when a previously maximized chat gets Minimized
     * @event _converse#chatBoxMinimized
     * @type { ChatBox|MUC }
     * @example _converse.api.listen.on('chatBoxMinimized', view => { ... });
     */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('chatBoxMinimized', model);
}
/**
 * @param {ChatBox|MUC} model
 */ function onMinimizedChanged(model) {
    if (model.get('hidden')) {
        onMinimized(model);
    } else {
        onMaximized(model);
    }
}


/***/ }),

/***/ "./src/plugins/minimize/view.js":
/*!**************************************!*\
  !*** ./src/plugins/minimize/view.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MinimizedChats)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _toggle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toggle.js */ "./src/plugins/minimize/toggle.js");
/* harmony import */ var _templates_toggle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/toggle.js */ "./src/plugins/minimize/templates/toggle.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class MinimizedChats extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    initialize() {
        return _async_to_generator(function*() {
            this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes;
            yield this.initToggle();
            this.listenTo(this.minchats, 'change:collapsed', ()=>this.requestUpdate());
            this.listenTo(this.model, 'add', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:fullname', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:jid', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:hidden', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:name', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:num_unread', ()=>this.requestUpdate());
            this.listenTo(this.model, 'remove', ()=>this.requestUpdate());
            this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'connected', ()=>this.requestUpdate());
            this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'reconnected', ()=>this.requestUpdate());
            this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'disconnected', ()=>this.requestUpdate());
        }).call(this);
    }
    render() {
        return (0,_templates_toggle_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    initToggle() {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
            const id = `converse.minchatstoggle-${bare_jid}`;
            this.minchats = new _toggle_js__WEBPACK_IMPORTED_MODULE_2__["default"]({
                id
            });
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.initStorage(this.minchats, id, 'session');
            yield new Promise((resolve)=>this.minchats.fetch({
                    'success': resolve,
                    'error': resolve
                }));
        }).call(this);
    }
    /**
     * @param {Event} [ev]
     */ toggle(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        this.minchats.save({
            'collapsed': !this.minchats.get('collapsed')
        });
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-minimized-chats', MinimizedChats);


/***/ }),

/***/ "./src/plugins/modal/alert.js":
/*!************************************!*\
  !*** ./src/plugins/modal/alert.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Alert)
/* harmony export */ });
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_alert_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/alert.js */ "./src/plugins/modal/templates/alert.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



class Alert extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    initialize() {
        super.initialize();
        this.addEventListener('hide.bs.modal', ()=>this.remove(), false);
    }
    renderModal() {
        return (0,_templates_alert_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.state.toJSON());
    }
    getModalTitle() {
        return this.state.get('title');
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-alert-modal', Alert);


/***/ }),

/***/ "./src/plugins/modal/api.js":
/*!**********************************!*\
  !*** ./src/plugins/modal/api.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _alert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./alert.js */ "./src/plugins/modal/alert.js");
/* harmony import */ var _confirm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./confirm.js */ "./src/plugins/modal/confirm.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}




let modals = [];
let modals_map = {};
let toasts_map = {};
const modal_api = {
    /**
     * API namespace for methods relating to modals
     * @namespace _converse.api.modal
     * @memberOf _converse.api
     */ modal: {
        /**
         * Shows a modal of type `ModalClass` to the user.
         * Will create a new instance of that class if an existing one isn't
         * found.
         * @param {string|any} name
         * @param {Object} [properties] - Optional properties that will be set on a newly created modal instance.
         * @param {Event} [ev] - The DOM event that causes the modal to be shown.
         */ show (name, properties, ev) {
            let modal;
            if (typeof name === 'string') {
                var _this_get;
                modal = (_this_get = this.get(name)) !== null && _this_get !== void 0 ? _this_get : this.create(name, properties);
                Object.assign(modal, properties);
            } else {
                // Legacy...
                const ModalClass = name;
                var _ModalClass_id;
                const id = (_ModalClass_id = ModalClass.id) !== null && _ModalClass_id !== void 0 ? _ModalClass_id : properties.id;
                var _this_get1;
                modal = (_this_get1 = this.get(id)) !== null && _this_get1 !== void 0 ? _this_get1 : this.create(ModalClass, properties);
            }
            modal.show(ev);
            return modal;
        },
        /**
         * Return a modal with the passed-in identifier, if it exists.
         * @param {String} id
         */ get (id) {
            var _modals_map_id;
            return (_modals_map_id = modals_map[id]) !== null && _modals_map_id !== void 0 ? _modals_map_id : modals.filter((m)=>m.id == id).pop();
        },
        /**
         * Create a modal of the passed-in type.
         * @param {String} name
         * @param {Object} [properties] - Optional properties that will be
         *  set on the modal instance.
         */ create (name, properties) {
            const ModalClass = customElements.get(name);
            const modal = modals_map[name] = new ModalClass(properties);
            return modal;
        },
        /**
         * Remove a particular modal
         * @param {String} name
         */ remove (name) {
            let modal;
            if (typeof name === 'string') {
                modal = modals_map[name];
                delete modals_map[name];
            } else {
                // Legacy...
                modal = name;
                modals = modals.filter((m)=>m !== modal);
            }
            modal === null || modal === void 0 ? void 0 : modal.remove();
        },
        /**
         * Remove all modals
         */ removeAll () {
            modals.forEach((m)=>m.remove());
            modals = [];
            modals_map = {};
        }
    },
    /**
     * Show a confirm modal to the user.
     * @method _converse.api.confirm
     * @param {String} title - The header text for the confirmation dialog
     * @param {(Array<String>|String)} messages - The text to show to the user
     * @param {Array<import('./types').Field>} fields - An object representing a field presented to the user.
     * @returns {Promise<Array|false>} A promise which resolves with an array of
     *  filled in fields or `false` if the confirm dialog was closed or canceled.
     */ confirm (_0) {
        return _async_to_generator(function*(title, messages = [], fields = []) {
            if (typeof messages === 'string') {
                messages = [
                    messages
                ];
            }
            const state = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model({
                title,
                messages,
                fields,
                'type': 'confirm'
            });
            const confirm = new _confirm_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
                state
            });
            confirm.show();
            let result;
            try {
                result = yield confirm.confirmation;
            } catch (e) {
                result = false;
            }
            confirm.remove();
            return result;
        }).apply(this, arguments);
    },
    /**
     * Show a prompt modal to the user.
     * @method _converse.api.prompt
     * @param { String } title - The header text for the prompt
     * @param { (Array<String>|String) } messages - The prompt text to show to the user
     * @param { String } placeholder - The placeholder text for the prompt input
     * @returns { Promise<String|false> } A promise which resolves with the text provided by the
     *  user or `false` if the user canceled the prompt.
     */ prompt (_0) {
        return _async_to_generator(function*(title, messages = [], placeholder = '') {
            if (typeof messages === 'string') {
                messages = [
                    messages
                ];
            }
            const state = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model({
                title,
                messages,
                fields: [
                    {
                        'name': 'reason',
                        'placeholder': placeholder
                    }
                ],
                type: 'prompt'
            });
            const prompt = new _confirm_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
                state
            });
            prompt.show();
            let result;
            try {
                var _pop;
                result = (_pop = (yield prompt.confirmation).pop()) === null || _pop === void 0 ? void 0 : _pop.value;
            } catch (e) {
                result = false;
            }
            prompt.remove();
            return result;
        }).apply(this, arguments);
    },
    /**
     * Show an alert modal to the user.
     * @method _converse.api.alert
     * @param { ('info'|'warn'|'error') } type - The type of alert.
     * @param { String } title - The header text for the alert.
     * @param { (Array<String>|String) } messages - The alert text to show to the user.
     */ alert (type, title, messages) {
        if (typeof messages === 'string') {
            messages = [
                messages
            ];
        }
        let level;
        if (type === 'error') {
            level = 'alert-danger';
        } else if (type === 'info') {
            level = 'alert-info';
        } else if (type === 'warn') {
            level = 'alert-warning';
        }
        const state = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_2__.Model({
            title,
            messages,
            level,
            'type': 'alert'
        });
        modal_api.modal.show('converse-alert-modal', {
            state
        });
    },
    /**
     * API namespace for methods relating to toast messages
     * @namespace _converse.api.toast
     * @memberOf _converse.api
     */ toast: {
        /**
         * @param {string} name
         * @param {import('./types').ToastProperties} [properties] - Optional properties that will be set on a newly created toast instance.
         */ show (name, properties) {
            toasts_map[name] = properties;
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.trigger('showToast', properties);
        },
        /**
         * @param {String} [name]
         */ get (name) {
            if (name) {
                return toasts_map[name];
            } else {
                return Object.keys(toasts_map).map((name)=>_object_spread({
                        name
                    }, toasts_map[name]));
            }
        },
        /**
         * @param {String} [name]
         */ remove (name) {
            delete toasts_map[name];
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.trigger('hideToast');
        }
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (modal_api);


/***/ }),

/***/ "./src/plugins/modal/confirm.js":
/*!**************************************!*\
  !*** ./src/plugins/modal/confirm.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Confirm)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_prompt_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/prompt.js */ "./src/plugins/modal/templates/prompt.js");




class Confirm extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.state, 'change', ()=>this.requestUpdate());
        this.addEventListener('hide.bs.modal', ()=>{
            if (!this.confirmation.isResolved) {
                this.confirmation.reject();
            }
        }, false);
        this.onKeyDown = /** @param {KeyboardEvent} ev */ (ev)=>{
            if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants.KEYCODES.ENTER) {
                ev.preventDefault();
                ev.stopPropagation();
                const button = /** @type {HTMLFormElement} */ this.querySelector('form.confirm button[type=submit]');
                button.click();
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        this.addEventListener('keydown', this.onKeyDown);
    }
    disconnectedCallback() {
        this.removeEventListener('keydown', this.onKeyDown);
        super.disconnectedCallback();
    }
    renderModal() {
        return (0,_templates_prompt_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    getModalTitle() {
        return this.state.get('title');
    }
    renderModalFooter() {
        return '';
    }
    /**
     * @param {SubmitEvent} ev
     */ onConfimation(ev) {
        ev.preventDefault();
        const form = /** @type {HTMLFormElement} */ ev.target;
        const form_data = new FormData(form);
        const fields = (this.state.get('fields') || []).map(/** @param {import('./types.js').Field} field */ (field)=>{
            const value = form_data.get(field.name);
            field.value = /** @type {string} */ value;
            if (field.challenge) {
                field.challenge_failed = value !== field.challenge;
            }
            return field;
        });
        if (fields.filter((c)=>c.challenge_failed).length) {
            this.state.set('fields', fields);
            // Setting an array doesn't trigger a change event
            this.state.trigger('change');
            return;
        }
        this.confirmation.resolve(fields);
        this.modal.hide();
    }
    constructor(options){
        super(options);
        this.confirmation = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-confirm-modal', Confirm);


/***/ }),

/***/ "./src/plugins/modal/index.js":
/*!************************************!*\
  !*** ./src/plugins/modal/index.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api.js */ "./src/plugins/modal/api.js");
/* harmony import */ var _modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _popover_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./popover.js */ "./src/plugins/modal/popover.js");
/* harmony import */ var _toast_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toast.js */ "./src/plugins/modal/toast.js");
/* harmony import */ var _modals_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modals.js */ "./src/plugins/modal/modals.js");
/* harmony import */ var _toasts_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toasts.js */ "./src/plugins/modal/toasts.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 






_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add("converse-modal", {
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("disconnect", ()=>{
            const container = document.querySelector("#converse-modals");
            if (container) {
                container.innerHTML = "";
            }
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("clearSession", ()=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.removeAll());
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, {
            BaseModal: _modal_js__WEBPACK_IMPORTED_MODULE_2__["default"],
            Popover: _popover_js__WEBPACK_IMPORTED_MODULE_3__["default"],
            Toast: _toast_js__WEBPACK_IMPORTED_MODULE_4__["default"]
        });
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api, _api_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
    }
});


/***/ }),

/***/ "./src/plugins/modal/modal.js":
/*!************************************!*\
  !*** ./src/plugins/modal/modal.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var bootstrap_js_src_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap/js/src/modal.js */ "./node_modules/bootstrap/js/src/modal.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _templates_buttons_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./templates/buttons.js */ "./src/plugins/modal/templates/buttons.js");
/* harmony import */ var _templates_modal_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./templates/modal.js */ "./src/plugins/modal/templates/modal.js");
/* harmony import */ var _styles_modal_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles/_modal.scss */ "./src/plugins/modal/styles/_modal.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_apply_descriptor_get(receiver, descriptor) {
    if (descriptor.get) {
        return descriptor.get.call(receiver);
    }
    return descriptor.value;
}
function _class_apply_descriptor_set(receiver, descriptor, value) {
    if (descriptor.set) {
        descriptor.set.call(receiver, value);
    } else {
        if (!descriptor.writable) {
            throw new TypeError("attempted to set read only private field");
        }
        descriptor.value = value;
    }
}
function _class_extract_field_descriptor(receiver, privateMap, action) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to " + action + " private field on non-instance");
    }
    return privateMap.get(receiver);
}
function _class_private_field_get(receiver, privateMap) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
    return _class_apply_descriptor_get(receiver, descriptor);
}
function _class_private_field_init(obj, privateMap, value) {
    _check_private_redeclaration(obj, privateMap);
    privateMap.set(obj, value);
}
function _class_private_field_set(receiver, privateMap, value) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
    _class_apply_descriptor_set(receiver, descriptor, value);
    return value;
}









var /** @type {Modal} */ _modal = /*#__PURE__*/ new WeakMap();
class BaseModal extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__.CustomElement {
    /**
     * @typedef {import('lit').TemplateResult} TemplateResult
     */ static get properties() {
        return {
            model: {
                type: _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__.Model
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        window.addEventListener('keydown', this.onKeyDown);
    }
    disconnectedCallback() {
        window.removeEventListener('resize', this.onKeyDown);
        super.disconnectedCallback();
    }
    get modal() {
        if (!_class_private_field_get(this, _modal)) {
            _class_private_field_set(this, _modal, new bootstrap_js_src_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"](this, {
                backdrop: _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.isTestEnv() ? false : true,
                keyboard: true
            }));
        }
        return _class_private_field_get(this, _modal);
    }
    initialize() {
        this.requestUpdate();
        this.initialized.resolve();
    }
    /**
     * @returns {TemplateResult|string}
     */ renderModal() {
        return '';
    }
    /**
     * @returns {TemplateResult|string}
     */ renderModalFooter() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="modal-footer">${_templates_buttons_js__WEBPACK_IMPORTED_MODULE_6__.modal_close_button}</div>`;
    }
    render() {
        return (0,_templates_modal_js__WEBPACK_IMPORTED_MODULE_7__["default"])(this);
    }
    /**
     * @returns {string|TemplateResult}
     */ getModalTitle() {
        // Intended to be overwritten
        return '';
    }
    /**
     * @param {Event} [ev]
     */ switchTab(ev) {
        ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        this.tab = /** @type {HTMLElement} */ ev.target.getAttribute('data-name');
        this.requestUpdate();
    }
    close() {
        this.modal.hide();
    }
    insertIntoDOM() {
        const container_el = document.querySelector('#converse-modals');
        container_el.insertAdjacentElement('beforeend', this);
    }
    /**
     * @param {string|null} [message]
     * @param {'info'|'primary'|'secondary'|'danger'} type
     * @param {boolean} [is_ephemeral=true]
     */ alert(message, type = 'primary', is_ephemeral = true) {
        this.state.set('alert', {
            message,
            type
        });
        if (is_ephemeral) {
            if (this.alertTimeout) {
                clearTimeout(this.alertTimeout);
            }
            this.alertTimeout = setTimeout(()=>{
                this.state.set('alert', undefined);
            }, 5000);
        }
    }
    show() {
        return _async_to_generator(function*() {
            yield this.initialized;
            this.modal.show();
            this.requestUpdate();
        }).call(this);
    }
    /**
     * @param {Object} options
     */ constructor(options){
        super(), _class_private_field_init(this, _modal, {
            writable: true,
            value: void 0
        });
        this.model = null;
        this.state = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_3__.Model();
        this.listenTo(this.state, 'change', ()=>this.requestUpdate());
        this.className = _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.isTestEnv() ? 'modal' : 'modal fade';
        this.tabIndex = -1;
        this.ariaHidden = 'true';
        this.onKeyDown = /** @param {KeyboardEvent} ev */ (ev)=>{
            if (ev.key === 'Escape' && this.ariaHidden === 'false') {
                this.close();
            }
        };
        this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_2__.getOpenPromise)();
        // Allow properties to be set via passed in options
        Object.assign(this, options);
        setTimeout(()=>this.insertIntoDOM());
        this.addEventListener('shown.bs.modal', ()=>{
            this.ariaHidden = 'false';
        });
        this.addEventListener('hidden.bs.modal', ()=>{
            this.ariaHidden = 'true';
            _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.modal.remove(this.nodeName.toLowerCase());
        });
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseModal);


/***/ }),

/***/ "./src/plugins/modal/modals.js":
/*!*************************************!*\
  !*** ./src/plugins/modal/modals.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ModalsContainer: () => (/* binding */ ModalsContainer),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");



class ModalsContainer extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-about-modal></converse-about-modal>`;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-modals', ModalsContainer);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModalsContainer);


/***/ }),

/***/ "./src/plugins/modal/popover.js":
/*!**************************************!*\
  !*** ./src/plugins/modal/popover.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var bootstrap_js_src_popover_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap/js/src/popover.js */ "./node_modules/bootstrap/js/src/popover.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _styles_popover_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/popover.scss */ "./src/plugins/modal/styles/popover.scss");






class Popover extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            title: {
                type: String
            },
            text: {
                type: String
            }
        };
    }
    /**
     * @param {import("lit").PropertyValues} changedProperties
     */ firstUpdated(changedProperties) {
        super.firstUpdated(changedProperties);
        new bootstrap_js_src_popover_js__WEBPACK_IMPORTED_MODULE_1__["default"](this.firstElementChild, {
            container: 'converse-root',
            trigger: 'focus'
        });
    }
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn p-0" data-toggle="popover" data-bs-title="${this.title}" data-bs-content="${this.text}"><converse-icon class="fa fa-info-circle" size="1.2em"></converse-icon></button>`;
    }
    constructor(){
        super();
        this.title = null;
        this.text = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define("converse-popover", Popover);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popover);


/***/ }),

/***/ "./src/plugins/modal/styles/_modal.scss":
/*!**********************************************!*\
  !*** ./src/plugins/modal/styles/_modal.scss ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_modal_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./_modal.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/_modal.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/modal/styles/popover.scss":
/*!***********************************************!*\
  !*** ./src/plugins/modal/styles/popover.scss ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_popover_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./popover.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/popover.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_popover_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_popover_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_popover_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_popover_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/modal/styles/toast.scss":
/*!*********************************************!*\
  !*** ./src/plugins/modal/styles/toast.scss ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toast_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./toast.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/modal/styles/toast.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toast_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toast_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toast_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toast_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/modal/templates/alert.js":
/*!**********************************************!*\
  !*** ./src/plugins/modal/templates/alert.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="modal-body"><span class="modal-alert"></span> ${o.messages.map((message)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p>${message}</p>`)}</div>`);


/***/ }),

/***/ "./src/plugins/modal/templates/buttons.js":
/*!************************************************!*\
  !*** ./src/plugins/modal/templates/buttons.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   modal_close_button: () => (/* binding */ modal_close_button),
/* harmony export */   modal_header_close_button: () => (/* binding */ modal_header_close_button)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


const modal_close_button = (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Close')}</button>`;
const modal_header_close_button = (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn d-flex align-items-center justify-content-center" data-bs-dismiss="modal" aria-label="${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Close')}"><converse-icon size="1.25em" class="fa fa-times"></converse-icon></button>`;


/***/ }),

/***/ "./src/plugins/modal/templates/modal.js":
/*!**********************************************!*\
  !*** ./src/plugins/modal/templates/modal.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _buttons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buttons.js */ "./src/plugins/modal/templates/buttons.js");


/**
 * @param {string} type
 * @param {'danger'|'warning'|'info'} message
 */ function tplAlert(type, message) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-${type}" role="alert">${message}</div>`;
}
/**
 * @param {import ('../modal').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_state, _el_state1;
    const alert = (_el_state = el.state) === null || _el_state === void 0 ? void 0 : _el_state.get('alert');
    var _el_state_get;
    const level = (_el_state_get = (_el_state1 = el.state) === null || _el_state1 === void 0 ? void 0 : _el_state1.get('level')) !== null && _el_state_get !== void 0 ? _el_state_get : '';
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="modal-dialog" role="document" role="dialog"><div class="modal-content"><div class="modal-header ${level}"><h5 class="modal-title">${el.getModalTitle()}</h5>${_buttons_js__WEBPACK_IMPORTED_MODULE_1__.modal_header_close_button}</div><div class="modal-body">${alert ? tplAlert(alert.type, alert.message) : ''} ${el.renderModal()}</div>${el.renderModalFooter()}</div></div>`;
});


/***/ }),

/***/ "./src/plugins/modal/templates/prompt.js":
/*!***********************************************!*\
  !*** ./src/plugins/modal/templates/prompt.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import("../types").Field} f
 */ function tplField(f) {
    return f.type === 'checkbox' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="form-check"><input name="${f.name}" class="form-check-input" type="checkbox" id="${f.name}"> <label class="form-check-label" for="${f.name}">${f.label}</label></div>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label class="form-label" for="${f.name}">${f.label || ''}</label> <input type="text" name="${f.name}" class="${f.challenge_failed ? 'is-invalid' : ''} form-control" ?required="${f.required}" placeholder="${f.placeholder}" id="${f.name}"> ${f.challenge_failed ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="invalid-feedback">Please provide a valid input.</div>` : ''}</div>`;
}
/**
 * @param {import('../confirm').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_state_get, _el_state_get1, _el_state_get2;
    const first_msg = (_el_state_get = el.state.get('messages')) === null || _el_state_get === void 0 ? void 0 : _el_state_get[0];
    const subsequent_msgs = ((_el_state_get1 = el.state.get('messages')) === null || _el_state_get1 === void 0 ? void 0 : _el_state_get1.slice(1)) || [];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="converse-form converse-form--modal confirm" action="#" @submit="${(ev)=>el.onConfimation(ev)}"><div class="mb-3 lh-base"><strong>${first_msg}</strong></div><div class="mb-3">${subsequent_msgs === null || subsequent_msgs === void 0 ? void 0 : subsequent_msgs.map(/** @param {string} msg */ (msg)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p>${msg}</p>`)}</div>${(_el_state_get2 = el.state.get('fields')) === null || _el_state_get2 === void 0 ? void 0 : _el_state_get2.map(/** @param {import('../types').Field} f */ (f)=>tplField(f))}<div class="d-flex justify-content-end"><button type="submit" class="btn btn-primary me-2">${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Confirm')}</button> <input type="button" class="btn btn-secondary" data-bs-dismiss="modal" value="${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel')}"></div></form>`;
});


/***/ }),

/***/ "./src/plugins/modal/toast.js":
/*!************************************!*\
  !*** ./src/plugins/modal/toast.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Toast)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _styles_toast_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/toast.scss */ "./src/plugins/modal/styles/toast.scss");





class Toast extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            type: {
                type: String
            },
            name: {
                type: String
            },
            title: {
                type: String
            },
            body: {
                type: String
            }
        };
    }
    /**
     * @param {import('lit').PropertyValues} changed
     */ updated(changed) {
        if (changed.get('type') !== 'danger') {
            this.timeoutId = setTimeout(()=>this.hide(), 5000);
        } else {
            clearTimeout(this.timeoutId);
        }
    }
    render() {
        var _this_type, _this_title, _this_body;
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="toast show text-bg-${(_this_type = this.type) !== null && _this_type !== void 0 ? _this_type : 'info'}" role="alert" aria-live="assertive" aria-atomic="true">${this.title ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="toast-header"><img src="/logo/conversejs-filled.svg" class="rounded me-2" alt="${(0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Converse logo')}"> <strong class="me-auto">${(_this_title = this.title) !== null && _this_title !== void 0 ? _this_title : ''}</strong> <button @click="${this.hide}" type="button" class="btn-close" aria-label="${(0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close')}"></button></div>` : ''} ${this.body ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="d-flex justify-content-between toast-body__container"><div class="toast-body w-100">${(_this_body = this.body) !== null && _this_body !== void 0 ? _this_body : ''}</div>${!this.title ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button @click="${this.hide}" type="button" class="btn centered" aria-label="${(0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close')}"><converse-icon size="1em" class="fa fa-times"></converse-icon></button>` : ''}</div>` : ''}</div>`;
    }
    /**
     * @param {MouseEvent} [ev]
     */ hide(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.remove(this.name);
    }
    constructor(){
        super();
        this.name = '';
        this.body = '';
        this.header = '';
        this.type = 'info';
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-toast', Toast);


/***/ }),

/***/ "./src/plugins/modal/toasts.js":
/*!*************************************!*\
  !*** ./src/plugins/modal/toasts.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ToastsContainer: () => (/* binding */ ToastsContainer),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");



class ToastsContainer extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    initialize() {
        super.initialize();
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.listen.on('showToast', ()=>this.requestUpdate());
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.listen.on('hideToast', ()=>this.requestUpdate());
    }
    render() {
        const toasts = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.get();
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${toasts.map(/** @param {import('./types').ToastProperties} toast */ (toast)=>{
            var _toast_title, _toast_body, _toast_type;
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-toast name="${toast.name}" title="${(_toast_title = toast.title) !== null && _toast_title !== void 0 ? _toast_title : ''}" body="${(_toast_body = toast.body) !== null && _toast_body !== void 0 ? _toast_body : ''}" type="${(_toast_type = toast.type) !== null && _toast_type !== void 0 ? _toast_type : ''}"></converse-toast>`;
        })}`;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-toasts', ToastsContainer);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ToastsContainer);


/***/ }),

/***/ "./src/plugins/muc-views/affiliation-form.js":
/*!***************************************************!*\
  !*** ./src/plugins/muc-views/affiliation-form.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _templates_affiliation_form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/affiliation-form.js */ "./src/plugins/muc-views/templates/affiliation-form.js");
/* harmony import */ var _styles_affiliation_form_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/affiliation-form.scss */ "./src/plugins/muc-views/styles/affiliation-form.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
class AffiliationForm extends shared_components_element__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            muc: {
                type: Object
            },
            jid: {
                type: String
            },
            affiliation: {
                type: String
            },
            alert_message: {
                type: String,
                attribute: false
            },
            alert_type: {
                type: String,
                attribute: false
            }
        };
    }
    render() {
        return (0,_templates_affiliation_form_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    alert(message, type) {
        this.alert_message = message;
        this.alert_type = type;
    }
    assignAffiliation(ev) {
        return _async_to_generator(function*() {
            ev.stopPropagation();
            ev.preventDefault();
            this.alert(); // clear alert messages
            const data = new FormData(ev.target);
            const affiliation = /** @type {string} */ data.get('affiliation');
            const attrs = {
                jid: this.jid,
                reason: /** @type {string} */ data.get('reason')
            };
            const muc_jid = this.muc.get('jid');
            try {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.muc.setAffiliation(affiliation, muc_jid, [
                    attrs
                ]);
            } catch (e) {
                if (e === null) {
                    this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Timeout error while trying to set the affiliation'), 'danger');
                } else if (sizzle(`not-allowed[xmlns="${Strophe.NS.STANZAS}"]`, e).length) {
                    this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Sorry, you're not allowed to make that change"), 'danger');
                } else {
                    this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sorry, something went wrong while trying to set the affiliation'), 'danger');
                }
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                return;
            }
            yield this.muc.occupants.fetchMembers();
            /**
         * @event affiliationChanged
         * @example
         *  const el = document.querySelector('converse-muc-affiliation-form');
         *  el.addEventListener('affiliationChanged', () => { ... });
         */ const event = new CustomEvent('affiliationChanged', {
                bubbles: true
            });
            this.dispatchEvent(event);
        }).call(this);
    }
    constructor(){
        super();
        this.jid = null;
        this.muc = null;
        this.affiliation = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-affiliation-form', AffiliationForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AffiliationForm);


/***/ }),

/***/ "./src/plugins/muc-views/bottom-panel.js":
/*!***********************************************!*\
  !*** ./src/plugins/muc-views/bottom-panel.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCBottomPanel)
/* harmony export */ });
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var plugins_chatview_bottom_panel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/chatview/bottom-panel.js */ "./src/plugins/chatview/bottom-panel.js");
/* harmony import */ var _templates_muc_bottom_panel_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/muc-bottom-panel.js */ "./src/plugins/muc-views/templates/muc-bottom-panel.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_muc_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/muc-bottom-panel.scss */ "./src/plugins/muc-views/styles/muc-bottom-panel.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





class MUCBottomPanel extends plugins_chatview_bottom_panel_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            yield _superprop_get_initialize().call(_this);
            this.listenTo(this.model, 'change:hidden_occupants', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:num_unread_general', ()=>this.requestUpdate());
            this.listenTo(this.model.features, 'change:moderated', ()=>this.requestUpdate());
            this.listenTo(this.model.occupants, 'add', this.renderIfOwnOccupant);
            this.listenTo(this.model.occupants, 'change:role', this.renderIfOwnOccupant);
            this.listenTo(this.model.session, 'change:connection_status', ()=>this.requestUpdate());
        }).call(this);
    }
    render() {
        if (!this.model) return '';
        return (0,_templates_muc_bottom_panel_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    renderIfOwnOccupant(o) {
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
        o.get('jid') === bare_jid && this.requestUpdate();
    }
    sendButtonClicked(ev) {
        var _ev_delegateTarget;
        if (((_ev_delegateTarget = ev.delegateTarget) === null || _ev_delegateTarget === void 0 ? void 0 : _ev_delegateTarget.dataset.action) === 'sendMessage') {
            const form = /** @type {HTMLFormElement} */ this.querySelector('converse-muc-message-form');
            form === null || form === void 0 ? void 0 : form.onFormSubmitted(ev);
        }
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-muc-bottom-panel', MUCBottomPanel);


/***/ }),

/***/ "./src/plugins/muc-views/chatarea.js":
/*!*******************************************!*\
  !*** ./src/plugins/muc-views/chatarea.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCChatArea)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var shared_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/constants.js */ "./src/shared/constants.js");
/* harmony import */ var _templates_muc_chatarea_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/muc-chatarea.js */ "./src/plugins/muc-views/templates/muc-chatarea.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_private_method_get(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
}
function _class_private_method_init(obj, privateSet) {
    _check_private_redeclaration(obj, privateSet);
    privateSet.add(obj);
}





var /**
     * @param {MediaQueryListEvent} [event]
     */ _hideSidebarIfSmallViewport = /*#__PURE__*/ new WeakSet();
class MUCChatArea extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            jid: {
                type: String
            },
            show_help_messages: {
                type: Boolean
            },
            type: {
                type: String
            }
        };
    }
    initialize() {
        return _async_to_generator(function*() {
            this.model = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.get(this.jid);
            this.listenTo(this.model, 'change:show_help_messages', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change:hidden_occupants', ()=>this.requestUpdate());
            this.listenTo(this.model.session, 'change:connection_status', ()=>this.requestUpdate());
            _class_private_method_get(this, _hideSidebarIfSmallViewport, hideSidebarIfSmallViewport).call(this);
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return this.model ? (0,_templates_muc_chatarea_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this) : '';
    }
    /**
     * Called when the element's properties change.
     * @param {import('lit').PropertyValues} changed
     */ updated(changed) {
        super.updated(changed);
        if (changed.has('jid') && this.model && this.jid !== this.model.get('jid')) {
            this.stopListening();
            this.initialize();
        }
    }
    connectedCallback() {
        super.connectedCallback();
        this.hideSidebarIfSmallViewport = _class_private_method_get(this, _hideSidebarIfSmallViewport, hideSidebarIfSmallViewport).bind(this);
        this.viewportMediaQuery.addEventListener('change', this.hideSidebarIfSmallViewport);
    }
    disconnectedCallback() {
        var _this_viewportMediaQuery;
        super.disconnectedCallback();
        (_this_viewportMediaQuery = this.viewportMediaQuery) === null || _this_viewportMediaQuery === void 0 ? void 0 : _this_viewportMediaQuery.removeEventListener('change', this.hideSidebarIfSmallViewport);
    }
    shouldShowSidebar() {
        return !this.model.get('hidden_occupants') && this.model.session.get('connection_status') === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.ROOMSTATUS.ENTERED;
    }
    getHelpMessages() {
        const setting = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_disable_slash_commands');
        const disabled_commands = Array.isArray(setting) ? setting : [];
        return [
            `<strong>/admin</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Change user's affiliation to admin")}`,
            `<strong>/ban</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Ban user by changing their affiliation to outcast')}`,
            `<strong>/clear</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Clear the chat area')}`,
            `<strong>/close</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Close this groupchat')}`,
            `<strong>/deop</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change user role to participant')}`,
            `<strong>/destroy</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove this groupchat')}`,
            `<strong>/help</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show this menu')}`,
            `<strong>/kick</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Kick user from groupchat')}`,
            `<strong>/me</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Write in 3rd person')}`,
            `<strong>/member</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Grant membership to a user')}`,
            `<strong>/modtools</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Opens up the moderator tools GUI')}`,
            `<strong>/mute</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Remove user's ability to post messages")}`,
            `<strong>/nick</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change your nickname')}`,
            `<strong>/op</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Grant moderator role to user')}`,
            `<strong>/owner</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Grant ownership of this groupchat')}`,
            `<strong>/register</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Register your nickname')}`,
            `<strong>/revoke</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Revoke the user's current affiliation")}`,
            `<strong>/subject</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set groupchat subject')}`,
            `<strong>/topic</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set groupchat subject (alias for /subject)')}`,
            `<strong>/voice</strong>: ${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Allow muted user to post messages')}`
        ].filter((line)=>disabled_commands.every((c)=>!line.startsWith(c + '<', 9))).filter((line)=>this.model.getAllowedCommands().some((c)=>line.startsWith(c + '<', 9)));
    }
    constructor(){
        super(), _class_private_method_init(this, _hideSidebarIfSmallViewport);
        this.jid = null;
        this.type = null;
        this.split = null;
        this.viewportMediaQuery = window.matchMedia(`(max-width: ${shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.MOBILE_CUTOFF}px)`);
    }
}
function hideSidebarIfSmallViewport(event) {
    var _this_model, _this_model1;
    if ((_this_model = this.model) === null || _this_model === void 0 ? void 0 : _this_model.get('hidden_occupants')) return;
    const is_small = event ? event.matches : this.viewportMediaQuery.matches;
    if (is_small) (_this_model1 = this.model) === null || _this_model1 === void 0 ? void 0 : _this_model1.save('hidden_occupants', true);
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-chatarea', MUCChatArea);


/***/ }),

/***/ "./src/plugins/muc-views/destroyed.js":
/*!********************************************!*\
  !*** ./src/plugins/muc-views/destroyed.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _templates_muc_destroyed_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/muc-destroyed.js */ "./src/plugins/muc-views/templates/muc-destroyed.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



class MUCDestroyed extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            'jid': {
                type: String
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.chatboxes.get(this.jid);
    }
    render() {
        const reason = this.model.get('destroyed_reason');
        const moved_jid = this.model.get('moved_jid');
        return (0,_templates_muc_destroyed_js__WEBPACK_IMPORTED_MODULE_0__["default"])({
            moved_jid,
            reason,
            'onSwitch': (ev)=>this.onSwitch(ev)
        });
    }
    onSwitch(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const moved_jid = this.model.get('moved_jid');
            const room = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.rooms.get(moved_jid, {}, true);
            room.maybeShow(true);
            this.model.destroy();
        }).call(this);
    }
    constructor(){
        super();
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-muc-destroyed', MUCDestroyed);


/***/ }),

/***/ "./src/plugins/muc-views/disconnected.js":
/*!***********************************************!*\
  !*** ./src/plugins/muc-views/disconnected.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _templates_muc_disconnect_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/muc-disconnect.js */ "./src/plugins/muc-views/templates/muc-disconnect.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");




class MUCDisconnected extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            'jid': {
                type: String
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.chatboxes.get(this.jid);
    }
    render() {
        const message = this.model.session.get('disconnection_message');
        if (!message) {
            return;
        }
        const messages = [
            message
        ];
        const actor = this.model.session.get('disconnection_actor');
        if (actor) {
            messages.push((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This action was done by %1$s.', actor));
        }
        const reason = this.model.session.get('disconnection_reason');
        if (reason) {
            messages.push((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The reason given is: "%1$s".', reason));
        }
        return (0,_templates_muc_disconnect_js__WEBPACK_IMPORTED_MODULE_0__["default"])(messages);
    }
    constructor(){
        super();
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-muc-disconnected', MUCDisconnected);


/***/ }),

/***/ "./src/plugins/muc-views/heading.js":
/*!******************************************!*\
  !*** ./src/plugins/muc-views/heading.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCHeading)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _modals_config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modals/config.js */ "./src/plugins/muc-views/modals/config.js");
/* harmony import */ var _modals_muc_details_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modals/muc-details.js */ "./src/plugins/muc-views/modals/muc-details.js");
/* harmony import */ var _modals_nickname_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modals/nickname.js */ "./src/plugins/muc-views/modals/nickname.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/muc-views/utils.js");
/* harmony import */ var _templates_muc_head_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./templates/muc-head.js */ "./src/plugins/muc-views/templates/muc-head.js");
/* harmony import */ var _styles_muc_head_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles/muc-head.scss */ "./src/plugins/muc-views/styles/muc-head.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}









class MUCHeading extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__.CustomElement {
    /**
     * @typedef {import('@converse/headless/types/plugins/muc/occupant').default} MUCOccupant
     */ initialize() {
        return _async_to_generator(function*() {
            const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            this.model = chatboxes.get(this.getAttribute('jid'));
            this.listenTo(this.model, 'change', ()=>this.requestUpdate());
            this.listenTo(this.model, 'vcard:add', ()=>this.requestUpdate());
            this.listenTo(this.model, 'vcard:change', ()=>this.requestUpdate());
            this.user_settings = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.user.settings.getModel();
            this.listenTo(this.user_settings, 'change:mucs_with_hidden_subject', ()=>this.requestUpdate());
            yield this.model.initialized;
            const own_occupant = this.model.occupants.findOccupant({
                jid: _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid')
            });
            if (own_occupant) this.updateIfOwnOccupant(own_occupant);
            this.listenTo(this.model.occupants, "add", this.updateIfOwnOccupant);
            this.listenTo(this.model.occupants, "change:affiliation", this.updateIfOwnOccupant);
            this.listenTo(this.model.occupants, "change:role", this.updateIfOwnOccupant);
            this.listenTo(this.model.session, "change:connection_status", ()=>this.requestUpdate());
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return this.model ? (0,_templates_muc_head_js__WEBPACK_IMPORTED_MODULE_7__["default"])(this) : '';
    }
    /**
     * @param {MUCOccupant} occupant
     */ updateIfOwnOccupant(occupant) {
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
        if (occupant.get('jid') === bare_jid) {
            this.requestUpdate();
        }
    }
    /**
     * @param {Event} ev
     */ showRoomDetailsModal(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-muc-details-modal', {
            model: this.model
        }, ev);
    }
    /**
     * @param {Event} ev
     */ showNicknameModal(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-muc-nickname-modal', {
            model: this.model
        }, ev);
    }
    /**
     * @param {Event} ev
     */ toggleTopic(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        this.model.toggleSubjectHiddenState();
    }
    /**
     * @param {Event} ev
     */ toggleOccupants(ev) {
        var _ev_preventDefault, _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        this.model.save({
            'hidden_occupants': !this.model.get('hidden_occupants')
        });
    }
    /**
     * @param {Event} ev
     */ showConfigModal(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-muc-config-modal', {
            model: this.model
        }, ev);
    }
    /**
     * @param {Event} ev
     */ close(ev) {
        ev.preventDefault();
        this.model.close();
    }
    /**
     * @param {Event} ev
     */ destroy(ev) {
        ev.preventDefault();
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.destroyMUC)(this.model);
    }
    /**
     * Returns a list of objects which represent buttons for the groupchat header.
     * @emits _converse#getHeadingButtons
     *
     * @param {boolean} subject_hidden
     */ getHeadingButtons(subject_hidden) {
        const buttons = [];
        buttons.push({
            'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Details'),
            'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show more information about this groupchat'),
            'handler': /** @param {Event} ev */ (ev)=>this.showRoomDetailsModal(ev),
            'a_class': 'show-muc-details-modal',
            'icon_class': 'fa-info-circle',
            'name': 'details'
        });
        if (this.model.getOwnAffiliation() === 'owner') {
            buttons.push({
                'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Configure'),
                'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Configure this groupchat'),
                'handler': /** @param {Event} ev */ (ev)=>this.showConfigModal(ev),
                'a_class': 'configure-chatroom-button',
                'icon_class': 'fa-wrench',
                'name': 'configure'
            });
        }
        buttons.push({
            'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Nickname'),
            'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Change the nickname you're using in this groupchat"),
            'handler': /** @param {Event} ev */ (ev)=>this.showNicknameModal(ev),
            'a_class': 'open-nickname-modal',
            'icon_class': 'fa-smile',
            'name': 'nickname'
        });
        const subject = this.model.get('subject');
        if (subject && subject.text) {
            buttons.push({
                'i18n_text': subject_hidden ? (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show topic') : (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Hide topic'),
                'i18n_title': subject_hidden ? (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show the topic message in the heading') : (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Hide the topic in the heading'),
                'handler': /** @param {Event} ev */ (ev)=>this.toggleTopic(ev),
                'a_class': 'hide-topic',
                'icon_class': 'fa-minus-square',
                'name': 'toggle-topic'
            });
        }
        buttons.push({
            'i18n_text': this.model.get('hidden_occupants') ? (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show participants') : (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Hide participants'),
            'i18n_title': this.model.get('hidden_occupants') ? (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show the groupchat participants') : (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Hide the groupchat participants'),
            'handler': /** @param {Event} ev */ (ev)=>this.toggleOccupants(ev),
            'icon_class': 'fa-users'
        });
        const conn_status = this.model.session.get('connection_status');
        if (conn_status === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.ROOMSTATUS.ENTERED) {
            const allowed_commands = this.model.getAllowedCommands();
            if (allowed_commands.includes('modtools')) {
                buttons.push({
                    'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Moderate'),
                    'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Moderate this groupchat'),
                    'handler': ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.showModeratorToolsModal)(this.model),
                    'a_class': 'moderate-chatroom-button',
                    'icon_class': 'fa-user-cog',
                    'name': 'moderate'
                });
            }
            if (allowed_commands.includes('destroy')) {
                buttons.push({
                    'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Destroy'),
                    'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Remove this groupchat'),
                    'handler': (ev)=>this.destroy(ev),
                    'a_class': 'destroy-chatroom-button',
                    'icon_class': 'fa-trash',
                    'name': 'destroy'
                });
            }
        }
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('singleton')) {
            buttons.push({
                'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Leave'),
                'i18n_title': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Leave and close this groupchat'),
                'handler': (ev)=>_async_to_generator(function*() {
                        ev.stopPropagation();
                        const messages = [
                            (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Are you sure you want to leave this groupchat?')
                        ];
                        const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Confirm'), messages);
                        result && this.close(ev);
                    }).call(this),
                'a_class': 'close-chatbox-button',
                'standalone': _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed',
                'icon_class': 'fa-sign-out-alt',
                'name': 'signout'
            });
        }
        const { chatboxviews } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        const el = chatboxviews.get(this.getAttribute('jid'));
        if (el) {
            // This hook is described in src/plugins/chatview/heading.js
            return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api.hook('getHeadingButtons', el, buttons);
        } else {
            return Promise.resolve(buttons); // Happens during tests
        }
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-heading', MUCHeading);


/***/ }),

/***/ "./src/plugins/muc-views/index.js":
/*!****************************************!*\
  !*** ./src/plugins/muc-views/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _chatboxviews_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../chatboxviews/index.js */ "./src/plugins/chatboxviews/index.js");
/* harmony import */ var _affiliation_form_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./affiliation-form.js */ "./src/plugins/muc-views/affiliation-form.js");
/* harmony import */ var _role_form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./role-form.js */ "./src/plugins/muc-views/role-form.js");
/* harmony import */ var _muc_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./muc.js */ "./src/plugins/muc-views/muc.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/muc-views/utils.js");
/* harmony import */ var _styles_index_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles/index.scss */ "./src/plugins/muc-views/styles/index.scss");
/**
 * @copyright The Converse.js developers
 * @description XEP-0045 Multi-User Chat Views
 * @license Mozilla Public License (MPLv2)
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.MUC.VIEWS = {
    CONFIG: 'config-form'
};
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-muc-views', {
    /* Dependencies are other plugins which might be
     * overridden or relied upon, and therefore need to be loaded before
     * this plugin. They are "optional" because they might not be
     * available, in which case any overrides applicable to them will be
     * ignored.
     *
     * NB: These plugins need to have already been loaded via require.js.
     *
     * It's possible to make these dependencies "non-optional".
     * If the setting "strict_plugin_dependencies" is set to true,
     * an error will be raised if the plugin is not found.
     */ dependencies: [
        'converse-modal',
        'converse-dragresize',
        'converse-controlbox',
        'converse-chatview'
    ],
    initialize () {
        const { _converse } = this;
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            'auto_list_rooms': false,
            'cache_muc_messages': true,
            'locked_muc_nickname': false,
            'modtools_disable_query': [],
            'muc_disable_slash_commands': false,
            'muc_mention_autocomplete_filter': 'contains',
            'muc_mention_autocomplete_min_chars': 0,
            'muc_mention_autocomplete_show_avatar': true,
            'muc_roomid_policy': null,
            'muc_roomid_policy_hint': null,
            'muc_search_service': 'api@search.jabber.network',
            'roomconfig_whitelist': [],
            'show_retraction_warning': true
        });
        const exports = {
            ChatRoomView: _muc_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            MUCView: _muc_js__WEBPACK_IMPORTED_MODULE_4__["default"]
        };
        Object.assign(_converse, exports); // DEPRECATED
        Object.assign(_converse.exports, exports);
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_domain')) {
            // Use service discovery to get the default MUC domain
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('serviceDiscovered', (feature)=>_async_to_generator(function*() {
                    if ((feature === null || feature === void 0 ? void 0 : feature.get('var')) === Strophe.NS.MUC) {
                        if (feature.entity.get('jid').includes('@')) {
                            // Ignore full JIDs, we're only looking for a MUC service, not a room
                            return;
                        }
                        const identity = yield feature.entity.getIdentity('conference', 'text');
                        if (identity) {
                            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.set('muc_domain', Strophe.getDomainFromJid(feature.get('from')));
                        }
                    }
                })());
        }
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('clearsession', ()=>{
            const view = _converse.chatboxviews.get('controlbox');
            if (view && view.roomspanel) {
                view.roomspanel.model.destroy();
                view.roomspanel.remove();
                delete view.roomspanel;
            }
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxClosed', (model)=>{
            if (model.get('type') === CHATROOMS_TYPE) {
                (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.clearHistory)(model.get('jid'));
            }
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('parseMessageForCommands', _utils_js__WEBPACK_IMPORTED_MODULE_5__.parseMessageForMUCCommands);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('confirmDirectMUCInvitation', _utils_js__WEBPACK_IMPORTED_MODULE_5__.confirmDirectMUCInvitation);
    }
});


/***/ }),

/***/ "./src/plugins/muc-views/message-form.js":
/*!***********************************************!*\
  !*** ./src/plugins/muc-views/message-form.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCMessageForm)
/* harmony export */ });
/* harmony import */ var shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/autocomplete/utils.js */ "./src/shared/autocomplete/utils.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_autocomplete_autocomplete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/autocomplete/autocomplete.js */ "./src/shared/autocomplete/autocomplete.js");
/* harmony import */ var plugins_chatview_message_form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/chatview/message-form.js */ "./src/plugins/chatview/message-form.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/muc-views/utils.js");
/* harmony import */ var _templates_message_form_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./templates/message-form.js */ "./src/plugins/muc-views/templates/message-form.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class MUCMessageForm extends plugins_chatview_message_form_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            yield this.model.initialized;
            this.initMentionAutoComplete();
        }).call(this);
    }
    render() {
        return (0,_templates_message_form_js__WEBPACK_IMPORTED_MODULE_5__["default"])(this);
    }
    /**
     * @returns {boolean}
     */ shouldAutoComplete() {
        const muc = this.model instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_1__.MUCOccupant ? this.model.collection.chatroom : this.model;
        if (muc) {
            const entered = muc.session.get("connection_status") === _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.ROOMSTATUS.ENTERED;
            return entered && !(muc.features.get("moderated") && muc.getOwnRole() === "visitor");
        }
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.debug("Could not determine MUC for MUCMessageForm element");
        return false;
    }
    initMentionAutoComplete() {
        this.auto_complete = new shared_autocomplete_autocomplete_js__WEBPACK_IMPORTED_MODULE_2__["default"](this, {
            auto_first: true,
            min_chars: _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("muc_mention_autocomplete_min_chars"),
            match_current_word: true,
            list: ()=>this.getAutoCompleteList(),
            filter: _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("muc_mention_autocomplete_filter") == "contains" ? shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_0__.FILTER_CONTAINS : shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_0__.FILTER_STARTSWITH,
            ac_triggers: [
                "Tab",
                "@"
            ],
            include_triggers: [],
            item: (text, input)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getAutoCompleteListItem)(this.model, text, input)
        });
        this.auto_complete.on("suggestion-box-selectcomplete", ()=>this.auto_completing = false);
    }
    getAutoCompleteList() {
        return this.model.getAllKnownNicknames().map((nick)=>({
                label: nick,
                value: `@${nick}`
            }));
    }
    /**
     * @param {KeyboardEvent} ev
     */ onKeyDown(ev) {
        if (this.shouldAutoComplete() && this.auto_complete.onKeyDown(ev)) {
            return;
        }
        super.onKeyDown(ev);
    }
    /**
     * @param {KeyboardEvent} ev
     */ onKeyUp(ev) {
        if (this.shouldAutoComplete() && this.auto_complete.auto_completing) {
            this.auto_complete.evaluate(ev);
        }
        super.onKeyUp(ev);
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define("converse-muc-message-form", MUCMessageForm);


/***/ }),

/***/ "./src/plugins/muc-views/modals/add-muc.js":
/*!*************************************************!*\
  !*** ./src/plugins/muc-views/modals/add-muc.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AddMUCModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_add_muc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/add-muc.js */ "./src/plugins/muc-views/modals/templates/add-muc.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _styles_add_muc_modal_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../styles/add-muc-modal.scss */ "./src/plugins/muc-views/styles/add-muc-modal.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}





const u = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env.utils;
const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
class AddMUCModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    initialize() {
        super.initialize();
        this.requestUpdate();
        this.addEventListener('shown.bs.modal', ()=>{
            var /** @type {HTMLInputElement} */ _this_querySelector;
            (_this_querySelector = this.querySelector('input[name="chatroom"]')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
        }, false);
    }
    renderModal() {
        return (0,_templates_add_muc_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enter a new Groupchat');
    }
    /**
     * @param {HTMLFormElement} form
     * @returns {{ jid: string, nick: string }}
     */ parseRoomDataFromEvent(form) {
        var /** @type {string} */ _data_get;
        const data = new FormData(form);
        const jid = (_data_get = data.get('chatroom')) === null || _data_get === void 0 ? void 0 : _data_get.trim();
        let nick;
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('locked_muc_nickname')) {
            nick = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.getDefaultMUCNickname();
            if (!nick) {
                throw new Error('Using locked_muc_nickname but no nickname found!');
            }
        } else {
            nick = /** @type {string} */ data.get('nickname').trim();
        }
        return {
            jid,
            nick
        };
    }
    /**
     * Takes a string and returns a normalized lowercase value representing the node (localpart) of a MUC JID.
     * Replaces all spaces with dashes, replaces diacritics with ASCII, and
     * removes all characters besides letters and numbers and dashes.
     * @param {string} s
     * @returns {string}
     */ normalizeNode(s) {
        return s.trim().replace(/\s+/g, '-').replace(/\u0142/g, 'l').replace(/[^\x00-\x7F]/g, (c)=>c.normalize('NFD').replace(/[\u0300-\u036f]/g, '')).replace(/[^a-zA-Z0-9-]/g, '-').replace(/-+/g, '-').replace(/[^a-zA-Z0-9]$/g, '').toLowerCase();
    }
    /**
     * @param {Event} ev
     */ openChatRoom(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const autocomplete_el = /** @type {import('shared/autocomplete/component').default} */ this.querySelector('converse-autocomplete');
            if ((yield autocomplete_el.onChange()).error_message) return;
            const { escapeNode, getNodeFromJid, getDomainFromJid } = Strophe;
            const form = /** @type {HTMLFormElement} */ ev.target;
            const data = this.parseRoomDataFromEvent(form);
            var _data_nick;
            const settings = {
                nick: (_data_nick = data.nick) !== null && _data_nick !== void 0 ? _data_nick : undefined
            };
            let jid;
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('locked_muc_domain') || !u.isValidJID(data.jid)) {
                const muc_service = yield u.muc.getDefaultMUCService();
                if (muc_service) {
                    settings.name = data.jid;
                    settings.auto_configure = true;
                    settings.roomconfig = {
                        roomname: data.jid
                    };
                    jid = `${this.normalizeNode(data.jid)}@${muc_service}`.toLowerCase();
                }
            }
            if (!jid) {
                jid = `${escapeNode(getNodeFromJid(data.jid))}@${getDomainFromJid(data.jid)}`.toLowerCase();
            }
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.open(jid, _object_spread_props(_object_spread({}, settings), {
                jid
            }), true);
            form.reset();
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {string} jid
     * @return {Promise<string>}
     */ validateMUCJID(jid) {
        return _async_to_generator(function*() {
            if (jid.length === 0) {
                return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Invalid groupchat address, it cannot be empty.');
            }
            const num_slashes = jid.split('/').length - 1;
            if (num_slashes > 0) {
                return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Invalid groupchat address, a forward slash is not allowed.');
            }
            const num_ats = jid.split('@').length - 1;
            if (num_ats > 1) {
                return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Invalid groupchat address, more than one @ sign is not allowed.');
            }
            if (jid.startsWith('@') || jid.endsWith('@')) {
                return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Invalid groupchat address, it cannot start or end with an @ sign.');
            }
            if (!jid.includes('@')) {
                const muc_service = yield u.muc.getDefaultMUCService();
                if (!muc_service) {
                    return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("No default groupchat service found. " + "You'll need to specify the full address, for example room@conference.example.org");
                }
            }
            const policy = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_roomid_policy');
            if (policy && _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_domain')) {
                if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('locked_muc_domain') || !u.isValidJID(jid)) {
                    jid = `${Strophe.escapeNode(jid)}@${_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_domain')}`;
                }
                const muc_jid = Strophe.getNodeFromJid(jid);
                const muc_domain = Strophe.getDomainFromJid(jid);
                if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_domain') === muc_domain && !policy.test(muc_jid)) {
                    return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Groupchat id is invalid.');
                }
            }
            return '';
        })();
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-add-muc-modal', AddMUCModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/config.js":
/*!************************************************!*\
  !*** ./src/plugins/muc-views/modals/config.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCConfigModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _templates_muc_config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/muc-config.js */ "./src/plugins/muc-views/modals/templates/muc-config.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var utils_file_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! utils/file.js */ "./src/utils/file.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { sizzle, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
class MUCConfigModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    initialize() {
        super.initialize();
        this.addListeners();
    }
    addListeners() {
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.listenTo(this.model.features, 'change:passwordprotected', ()=>this.requestUpdate());
        this.listenTo(this.model.session, 'change:config_stanza', ()=>this.requestUpdate());
    }
    renderModal() {
        return (0,_templates_muc_config_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this);
    }
    /**
     * @param {Map<string, any>} changed
     */ shouldUpdate(changed) {
        if (changed.has('model') && this.model) {
            this.stopListening();
            this.addListeners();
            this.getConfig();
        }
        return true;
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Configure %1$s', this.model.getDisplayName());
    }
    getConfig() {
        return _async_to_generator(function*() {
            const iq = yield this.model.fetchRoomConfiguration();
            this.model.session.set('config_stanza', iq.outerHTML);
        }).call(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ setAvatar(ev) {
        return _async_to_generator(function*() {
            if (!this.model.features.get('vcard-temp')) {
                return;
            }
            const form_data = new FormData(/** @type {HTMLFormElement} */ ev.target);
            const image_file = /** @type {File} */ form_data.get('avatar_image');
            if (image_file === null || image_file === void 0 ? void 0 : image_file.size) {
                const image_data = utils_file_js__WEBPACK_IMPORTED_MODULE_4__.isImageWithAlphaChannel ? image_file : yield (0,utils_file_js__WEBPACK_IMPORTED_MODULE_4__.compressImage)(image_file);
                const reader = new FileReader();
                reader.onloadend = ()=>_async_to_generator(function*() {
                        const vcard_data = /** @type {VCardData} */ {
                            image: btoa(/** @type {string} */ reader.result),
                            image_type: image_file.type
                        };
                        yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.vcard.set(this.model.get('jid'), vcard_data);
                    }).call(this);
                reader.readAsBinaryString(image_data);
            }
        }).call(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ submitConfigForm(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const inputs = sizzle(':input:not([type=button]):not([type=submit]):not([name="avatar_image"][type="file"])', ev.target);
            const config_array = inputs.map(u.webForm2xForm).filter((f)=>f);
            try {
                yield this.model.sendConfiguration(config_array);
            } catch (e) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                const message = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Sorry, an error occurred while trying to submit the config form.") + " " + (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Check your browser's developer console for details.");
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Error'), message);
            }
            try {
                yield this.setAvatar(ev);
            } catch (err) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.fatal(err);
                this.alert([
                    (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Sorry, an error happened while trying to save the groupchat avatar."),
                    (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("You can check your browser's developer console for any error output.")
                ].join(" "));
                return;
            }
            yield this.model.refreshDiscoInfo();
            this.modal.hide();
        }).call(this);
    }
    /**
     * @typedef {import('@converse/headless/types/plugins/vcard/types').VCardData} VCardData
     */ constructor(options){
        super(options);
        this.id = 'converse-muc-config-modal';
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-config-modal', MUCConfigModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/moderator-tools.js":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/modals/moderator-tools.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ModeratorToolsModal)
/* harmony export */ });
/* harmony import */ var _modtools_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../modtools.js */ "./src/plugins/muc-views/modtools.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");





class ModeratorToolsModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    renderModal() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_4__.html)`<converse-modtools jid="${this.jid}" affiliation="${this.affiliation}"></converse-modtools>`;
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Moderator Tools');
    }
    constructor(options){
        super(options);
        this.id = "converse-modtools-modal";
        this.affiliation = options.affiliation;
        this.jid = options.jid;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-modtools-modal', ModeratorToolsModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/muc-details.js":
/*!*****************************************************!*\
  !*** ./src/plugins/muc-views/modals/muc-details.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCDetailsModal)
/* harmony export */ });
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_muc_details_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/muc-details.js */ "./src/plugins/muc-views/modals/templates/muc-details.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_muc_details_modal_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../styles/muc-details-modal.scss */ "./src/plugins/muc-views/styles/muc-details-modal.scss");





class MUCDetailsModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.listenTo(this.model.features, 'change', ()=>this.requestUpdate());
        this.listenTo(this.model.occupants, 'add', ()=>this.requestUpdate());
        this.listenTo(this.model.occupants, 'change', ()=>this.requestUpdate());
    }
    renderModal() {
        return (0,_templates_muc_details_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.model);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Groupchat info');
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-muc-details-modal', MUCDetailsModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/muc-invite.js":
/*!****************************************************!*\
  !*** ./src/plugins/muc-views/modals/muc-invite.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCInviteModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var _templates_muc_invite_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/muc-invite.js */ "./src/plugins/muc-views/modals/templates/muc-invite.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");





const u = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env.utils;
class MUCInviteModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    renderModal() {
        return (0,_templates_muc_invite_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Invite someone to this groupchat');
    }
    getAutoCompleteList() {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.roster.map((i)=>({
                label: i.getDisplayName(),
                value: i.get('jid')
            }));
    }
    /**
     * @param {Event} ev
     */ submitInviteForm(ev) {
        var /** @type {string} */ _data_get;
        ev.preventDefault();
        // TODO: Add support for sending an invite to multiple JIDs
        const data = new FormData(/** @type {HTMLFormElement} */ ev.target);
        const jid = (_data_get = data.get('invitee_jids')) === null || _data_get === void 0 ? void 0 : _data_get.trim();
        const reason = data.get('reason');
        if (u.isValidJID(jid)) {
            // TODO: Create and use API here
            this.muc.directInvite(jid, reason);
            this.modal.hide();
        } else {
            this.state.set({
                invalid_invite_jid: true
            });
        }
    }
    constructor(options){
        super(options);
        this.id = 'converse-muc-invite-modal';
        this.muc = options.muc;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-invite-modal', MUCInviteModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/muc-list.js":
/*!**************************************************!*\
  !*** ./src/plugins/muc-views/modals/muc-list.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCListModal)
/* harmony export */ });
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_muc_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../templates/muc-description.js */ "./src/plugins/muc-views/templates/muc-description.js");
/* harmony import */ var _templates_muc_list_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../templates/muc-list.js */ "./src/plugins/muc-views/templates/muc-list.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");






const { Strophe, $iq, sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_5__.converse.env;
const { getAttributes } = _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u;
/**
 * Insert groupchat info (based on returned #disco IQ stanza)
 * @param {HTMLElement} el - The HTML DOM element that contains the info.
 * @param {Element} stanza - The IQ stanza containing the groupchat info.
 */ function insertRoomInfo(el, stanza) {
    var _sizzle_shift, _sizzle_shift1;
    // All MUC features found here: https://xmpp.org/registrar/disco-features.html
    el.querySelector('span.spinner').remove();
    el.querySelector('a.room-info').classList.add('selected');
    el.insertAdjacentHTML('beforeend', _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.getElementFromTemplateResult((0,_templates_muc_description_js__WEBPACK_IMPORTED_MODULE_1__["default"])({
        'jid': stanza.getAttribute('from'),
        'desc': (_sizzle_shift = sizzle('field[var="muc#roominfo_description"] value', stanza).shift()) === null || _sizzle_shift === void 0 ? void 0 : _sizzle_shift.textContent,
        'occ': (_sizzle_shift1 = sizzle('field[var="muc#roominfo_occupants"] value', stanza).shift()) === null || _sizzle_shift1 === void 0 ? void 0 : _sizzle_shift1.textContent,
        'hidden': sizzle('feature[var="muc_hidden"]', stanza).length,
        'membersonly': sizzle('feature[var="muc_membersonly"]', stanza).length,
        'moderated': sizzle('feature[var="muc_moderated"]', stanza).length,
        'nonanonymous': sizzle('feature[var="muc_nonanonymous"]', stanza).length,
        'open': sizzle('feature[var="muc_open"]', stanza).length,
        'passwordprotected': sizzle('feature[var="muc_passwordprotected"]', stanza).length,
        'persistent': sizzle('feature[var="muc_persistent"]', stanza).length,
        'publicroom': sizzle('feature[var="muc_publicroom"]', stanza).length,
        'semianonymous': sizzle('feature[var="muc_semianonymous"]', stanza).length,
        'temporary': sizzle('feature[var="muc_temporary"]', stanza).length,
        'unmoderated': sizzle('feature[var="muc_unmoderated"]', stanza).length
    })));
}
/**
 * Show/hide extra information about a groupchat in a listing.
 * @param {Event} ev
 */ function toggleRoomInfo(ev) {
    const parent_el = _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.ancestor(ev.target, '.room-item');
    const div_el = parent_el.querySelector('div.room-info');
    if (div_el) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.slideIn(div_el).then(_converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.removeElement);
        parent_el.querySelector('a.room-info').classList.remove('selected');
    } else {
        parent_el.insertAdjacentElement('beforeend', _converse_headless__WEBPACK_IMPORTED_MODULE_5__.u.getElementFromTemplateResult((0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_3__["default"])()));
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.disco.info(/** @type HTMLElement */ ev.target.getAttribute('data-room-jid'), null).then((stanza)=>insertRoomInfo(parent_el, stanza)).catch((e)=>_converse_headless__WEBPACK_IMPORTED_MODULE_5__.log.error(e));
    }
}
class MUCListModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.model, 'change:muc_domain', this.onDomainChange);
        this.listenTo(this.model, 'change:feedback_text', ()=>this.requestUpdate());
        this.addEventListener('shown.bs.modal', ()=>_converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.settings.get('locked_muc_domain') && this.updateRoomsList());
        this.model.save('feedback_text', '');
    }
    renderModal() {
        return (0,_templates_muc_list_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object.assign(this.model.toJSON(), {
            'show_form': !_converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.settings.get('locked_muc_domain'),
            'server_placeholder': this.model.get('muc_domain') || (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('conference.example.org'),
            'items': this.items,
            'loading_items': this.loading_items,
            'openRoom': (ev)=>this.openRoom(ev),
            'setDomainFromEvent': (ev)=>this.setDomainFromEvent(ev),
            'submitForm': (ev)=>this.showRooms(ev),
            'toggleRoomInfo': (ev)=>this.toggleRoomInfo(ev)
        }));
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Query for Groupchats');
    }
    openRoom(ev) {
        ev.preventDefault();
        const jid = ev.target.getAttribute('data-room-jid');
        const name = ev.target.getAttribute('data-room-name');
        this.modal.hide();
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.rooms.open(jid, {
            'name': name
        }, true);
    }
    toggleRoomInfo(ev) {
        ev.preventDefault();
        toggleRoomInfo(ev);
    }
    onDomainChange() {
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.settings.get('auto_list_rooms') && this.updateRoomsList();
    }
    /**
     * Handle the IQ stanza returned from the server, containing
     * all its public groupchats.
     * @method _converse.ChatRoomView#onRoomsFound
     * @param {HTMLElement} [iq]
     */ onRoomsFound(iq) {
        this.loading_items = false;
        const rooms = iq ? sizzle('query item', iq) : [];
        if (rooms.length) {
            this.model.set({
                'feedback_text': (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Groupchats found')
            }, {
                'silent': true
            });
            this.items = rooms.map(getAttributes);
        } else {
            this.items = [];
            this.model.set({
                'feedback_text': (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No groupchats found')
            }, {
                'silent': true
            });
        }
        this.requestUpdate();
        return true;
    }
    /**
     * Send an IQ stanza to the server asking for all groupchats
     * @private
     * @method _converse.ChatRoomView#updateRoomsList
     */ updateRoomsList() {
        const iq = $iq({
            'to': this.model.get('muc_domain'),
            'from': _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.connection.get().jid,
            'type': "get"
        }).c("query", {
            xmlns: Strophe.NS.DISCO_ITEMS
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.sendIQ(iq).then((iq)=>this.onRoomsFound(iq)).catch(()=>this.onRoomsFound());
    }
    showRooms(ev) {
        ev.preventDefault();
        this.loading_items = true;
        this.requestUpdate();
        const data = new FormData(ev.target);
        this.model.setDomain(data.get('server'));
        this.updateRoomsList();
    }
    setDomainFromEvent(ev) {
        this.model.setDomain(ev.target.value);
    }
    setNick(ev) {
        this.model.save({
            nick: ev.target.value
        });
    }
    constructor(options){
        super(options);
        this.items = [];
        this.loading_items = false;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_5__.api.elements.define('converse-muc-list-modal', MUCListModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/nickname.js":
/*!**************************************************!*\
  !*** ./src/plugins/muc-views/modals/nickname.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCNicknameModal)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");




class MUCNicknameModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    renderModal() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-nickname-form jid="${this.model.get('jid')}"></converse-muc-nickname-form>`;
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Change your nickname');
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-muc-nickname-modal', MUCNicknameModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/occupant.js":
/*!**************************************************!*\
  !*** ./src/plugins/muc-views/modals/occupant.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ OccupantModal)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_occupant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/occupant.js */ "./src/plugins/muc-views/modals/templates/occupant.js");





const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
class OccupantModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    initialize() {
        super.initialize();
        var _this_model;
        const model = (_this_model = this.model) !== null && _this_model !== void 0 ? _this_model : this.message;
        this.listenTo(model, 'change', ()=>this.requestUpdate());
        /**
         * Triggered once the OccupantModal has been initialized
         * @event _converse#occupantModalInitialized
         * @type { Object }
         * @example _converse.api.listen.on('occupantModalInitialized', data);
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.trigger('occupantModalInitialized', {
            'model': this.model,
            'message': this.message
        });
    }
    renderModal() {
        return (0,_templates_occupant_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     */ openChat(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.chats.open(this.model.get('jid'), {}, true);
        this.close();
    }
    getVcard() {
        var _this_model;
        const model = (_this_model = this.model) !== null && _this_model !== void 0 ? _this_model : this.message;
        if (model.vcard) {
            return model.vcard;
        }
        const jid = (model === null || model === void 0 ? void 0 : model.get('jid')) || (model === null || model === void 0 ? void 0 : model.get('from'));
        return jid ? _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.vcards.get(jid) : null;
    }
    getModalTitle() {
        var _this_model;
        const model = (_this_model = this.model) !== null && _this_model !== void 0 ? _this_model : this.message;
        return model === null || model === void 0 ? void 0 : model.getDisplayName();
    }
    addToContacts() {
        var _this_model;
        const model = (_this_model = this.model) !== null && _this_model !== void 0 ? _this_model : this.message;
        const jid = model.get('jid');
        if (jid) _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-add-contact-modal', {
            state: new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model({
                jid
            })
        });
    }
    toggleForm(ev) {
        const toggle = u.ancestor(ev.target, '.toggle-form');
        const form = toggle.getAttribute('data-form');
        if (form === 'row-form') {
            this.show_role_form = !this.show_role_form;
        } else {
            this.show_affiliation_form = !this.show_affiliation_form;
        }
        this.requestUpdate();
    }
    constructor(options){
        super();
        this.message = options.message;
        this.addEventListener("affiliationChanged", ()=>this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Affiliation changed')));
        this.addEventListener("roleChanged", ()=>this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('role changed')));
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-muc-occupant-modal', OccupantModal);


/***/ }),

/***/ "./src/plugins/muc-views/modals/styles/config.scss":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/modals/styles/config.scss ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_config_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./config.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/modals/styles/config.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_config_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_config_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_config_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_config_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/modals/styles/occupant.scss":
/*!***********************************************************!*\
  !*** ./src/plugins/muc-views/modals/styles/occupant.scss ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./occupant.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/modals/styles/occupant.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/modals/templates/add-muc.js":
/*!***********************************************************!*\
  !*** ./src/plugins/muc-views/modals/templates/add-muc.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.es.mjs");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit/directives/unsafe-html.js */ "./node_modules/lit/directives/unsafe-html.js");
/* harmony import */ var _search_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../search.js */ "./src/plugins/muc-views/search.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");






const nickname_input = ()=>{
    const i18n_nickname = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Nickname');
    const i18n_required_field = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('This field is required');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="mb-3"><label for="nickname" class="form-label">${i18n_nickname}:</label> <input type="text" title="${i18n_required_field}" required name="nickname" value="${_converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.exports.getDefaultMUCNickname() || ''}" class="form-control"></div>`;
};
/**
 * @param {import('../add-muc.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_join = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Join');
    let label_name;
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('locked_muc_domain')) {
        label_name = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Groupchat name');
    } else {
        label_name = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Groupchat name or address');
    }
    const policy_hint = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_roomid_policy_hint');
    const muc_search_service = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_search_service');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<form class="converse-form add-chatroom needs-validation" @submit="${(ev)=>el.openChatRoom(ev)}" novalidate><div class="mb-3"><label for="chatroom" class="form-label">${label_name}:</label><div class="input-group">${muc_search_service ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-autocomplete .getAutoCompleteList="${_search_js__WEBPACK_IMPORTED_MODULE_4__.getAutoCompleteList}" .validate="${(v)=>el.validateMUCJID(v)}" ?autofocus="${true}" class="add-muc-autocomplete" min_chars="3" name="chatroom" position="below" required></converse-autocomplete>` : ''}</div>${policy_hint ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="mb-3">${(0,lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_3__.unsafeHTML)(dompurify__WEBPACK_IMPORTED_MODULE_0__["default"].sanitize(policy_hint, {
        'ALLOWED_TAGS': [
            'b',
            'br',
            'em'
        ]
    }))}</div>` : ''}</div>${!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('locked_muc_nickname') ? nickname_input() : ''} <input type="submit" class="btn btn-primary mt-3" name="join" value="${i18n_join || ''}"></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/modals/templates/muc-config.js":
/*!**************************************************************!*\
  !*** ./src/plugins/muc-views/modals/templates/muc-config.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_image_picker_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/image-picker.js */ "./src/shared/components/image-picker.js");
/* harmony import */ var _styles_config_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../styles/config.scss */ "./src/plugins/muc-views/modals/styles/config.scss");






const u = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env.utils;
/**
 * @param {import('../config').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const whitelist = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('roomconfig_whitelist');
    let fieldTemplates = [];
    let instructions = '';
    let title = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Loading configuration form');
    const config_stanza = el.model.session.get('config_stanza');
    if (config_stanza) {
        var _stanza_querySelector, _stanza_querySelector1;
        const stanza = u.toStanza(config_stanza);
        let { fields } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.parsers.parseXForm(stanza);
        if (whitelist.length) {
            fields = fields.filter((f)=>whitelist.includes(f.var));
        }
        const options = {
            new_password: !el.model.features.get('passwordprotected'),
            fixed_username: el.model.get('jid')
        };
        fieldTemplates = fields.map((f)=>u.xFormField2TemplateResult(f, options));
        instructions = (_stanza_querySelector = stanza.querySelector('instructions')) === null || _stanza_querySelector === void 0 ? void 0 : _stanza_querySelector.textContent;
        title = (_stanza_querySelector1 = stanza.querySelector('title')) === null || _stanza_querySelector1 === void 0 ? void 0 : _stanza_querySelector1.textContent;
    }
    const i18n_save = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Save');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<form class="converse-form chatroom-form ${fieldTemplates.length ? '' : 'converse-form--spinner'}" autocomplete="off" @submit="${(ev)=>el.submitConfigForm(ev)}"><fieldset><legend class="centered">${title}</legend>${title !== instructions ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p class="form-help">${instructions}</p>` : ''} ${fieldTemplates.length && el.model.features.get('vcard-temp') ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="row py-2"><converse-image-picker .model="${el.model}" width="96" height="96"></converse-image-picker></div>` : ''} ${fieldTemplates.length ? fieldTemplates : (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__["default"])({
        'classes': 'hor_centered'
    })}</fieldset>${fieldTemplates.length ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<fieldset><input type="submit" class="btn btn-primary" value="${i18n_save}"></fieldset>` : ''}</form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/modals/templates/muc-details.js":
/*!***************************************************************!*\
  !*** ./src/plugins/muc-views/modals/templates/muc-details.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* eslint max-len: 0 */ 

/**
 * @param {import('@converse/headless').MUC} model
 */ const subject = (model)=>{
    const subject = model.get('subject');
    const i18n_topic = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Topic');
    const i18n_topic_author = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Topic author');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p class="room-info"><strong>${i18n_topic}:</strong><converse-texture text="${subject.text}" render_styling></converse-texture></p><p class="room-info"><strong>${i18n_topic_author}:</strong> ${subject && subject.author}</p>`;
};
/**
 * @param {import('@converse/headless').MUC} model
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((model)=>{
    var _model_vcard;
    const config = model.config.toJSON();
    const features = model.features.toJSON();
    const num_occupants = model.occupants.filter((o)=>o.get('show') !== 'offline').length;
    const i18n_address = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('XMPP address');
    const i18n_archiving = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Message archiving');
    const i18n_archiving_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Messages are archived on the server');
    const i18n_desc = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Description');
    const i18n_features = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Features');
    const i18n_hidden = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Hidden');
    const i18n_hidden_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat is not publicly searchable');
    const i18n_members_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat is restricted to members only');
    const i18n_members_only = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Members only');
    const i18n_moderated = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Moderated');
    const i18n_moderated_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Participants entering this groupchat need to request permission to write');
    const i18n_name = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name');
    const i18n_no_pass_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat does not require a password upon entry');
    const i18n_no_password_required = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No password required');
    const i18n_not_anonymous = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Not anonymous');
    const i18n_not_anonymous_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All other groupchat participants can see your XMPP address');
    const i18n_not_moderated = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Not moderated');
    const i18n_not_moderated_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Participants entering this groupchat can write right away');
    const i18n_online_users = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Online users');
    const i18n_open = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Open');
    const i18n_open_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Anyone can join this groupchat');
    const i18n_password_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat requires a password before entry');
    const i18n_password_protected = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Password protected');
    const i18n_persistent = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Persistent');
    const i18n_persistent_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat persists even if it\'s unoccupied');
    const i18n_public = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Public');
    const i18n_public_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat is publicly searchable');
    const i18n_semi_anon = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Semi-anonymous');
    const i18n_semi_anon_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Only moderators can see your XMPP address');
    const i18n_temporary = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Temporary');
    const i18n_temporary_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat will disappear once the last person leaves');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="room-info"><converse-avatar .model="${model}" class="avatar align-self-center" name="${model.getDisplayName()}" nonce="${(_model_vcard = model.vcard) === null || _model_vcard === void 0 ? void 0 : _model_vcard.get('vcard_updated')}" height="72" width="72"></converse-avatar><p class="room-info"><strong>${i18n_name}:</strong> ${model.get('name')}</p><p class="room-info"><strong>${i18n_address}:</strong><converse-texture text="xmpp:${model.get('jid')}?join"></converse-texture></p><br><p class="room-info"><strong>${i18n_desc}:</strong><converse-texture text="${config.description}" render_styling></converse-texture></p>${model.get('subject') ? subject(model) : ''}<p class="room-info"><strong>${i18n_online_users}:</strong> ${num_occupants}</p><p class="room-info"><strong>${i18n_features}:</strong></p><div class="chatroom-features"><ul class="features-list">${features.passwordprotected ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-lock"></converse-icon>${i18n_password_protected} - <em>${i18n_password_help}</em></li>` : ''} ${features.unsecured ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-unlock"></converse-icon>${i18n_no_password_required} - <em>${i18n_no_pass_help}</em></li>` : ''} ${features.hidden ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-eye-slash"></converse-icon>${i18n_hidden} - <em>${i18n_hidden_help}</em></li>` : ''} ${features.public_room ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-eye"></converse-icon>${i18n_public} - <em>${i18n_public_help}</em></li>` : ''} ${features.membersonly ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-address-book"></converse-icon>${i18n_members_only} - <em>${i18n_members_help}</em></li>` : ''} ${features.open ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-globe"></converse-icon>${i18n_open} - <em>${i18n_open_help}</em></li>` : ''} ${features.persistent ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-save"></converse-icon>${i18n_persistent} - <em>${i18n_persistent_help}</em></li>` : ''} ${features.temporary ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-snowflake"></converse-icon>${i18n_temporary} - <em>${i18n_temporary_help}</em></li>` : ''} ${features.nonanonymous ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-id-card"></converse-icon>${i18n_not_anonymous} - <em>${i18n_not_anonymous_help}</em></li>` : ''} ${features.semianonymous ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-user-secret"></converse-icon>${i18n_semi_anon} - <em>${i18n_semi_anon_help}</em></li>` : ''} ${features.moderated ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-gavel"></converse-icon>${i18n_moderated} - <em>${i18n_moderated_help}</em></li>` : ''} ${features.unmoderated ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-info-circle"></converse-icon>${i18n_not_moderated} - <em>${i18n_not_moderated_help}</em></li>` : ''} ${features.mam_enabled ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="feature"><converse-icon size="1em" class="fa fa-database"></converse-icon>${i18n_archiving} - <em>${i18n_archiving_help}</em></li>` : ''}</ul></div><p></p></div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/modals/templates/muc-invite.js":
/*!**************************************************************!*\
  !*** ./src/plugins/muc-views/modals/templates/muc-invite.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_invite = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Invite');
    const i18n_jid_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('user@example.org');
    const i18n_error_message = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Please enter a valid XMPP address');
    const i18n_invite_label = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('XMPP Address');
    const i18n_reason = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Optional reason for the invitation');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="converse-form" @submit="${(ev)=>el.submitInviteForm(ev)}"><fieldset><label class="form-label clearfix" for="invitee_jids">${i18n_invite_label}:</label> ${el.state.get('invalid_invite_jid') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="error error-feedback">${i18n_error_message}</div>` : ''}<converse-autocomplete .getAutoCompleteList="${()=>el.getAutoCompleteList()}" ?autofocus="${true}" min_chars="1" position="below" required="required" name="invitee_jids" id="invitee_jids" placeholder="${i18n_jid_placeholder}"></converse-autocomplete></fieldset><fieldset><label class="form-label">${i18n_reason}:</label> <textarea class="form-control" name="reason"></textarea></fieldset><fieldset><input type="submit" class="btn btn-primary" value="${i18n_invite}"></fieldset></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/modals/templates/occupant.js":
/*!************************************************************!*\
  !*** ./src/plugins/muc-views/modals/templates/occupant.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var shared_avatar_avatar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/avatar/avatar.js */ "./src/shared/avatar/avatar.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_occupant_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../styles/occupant.scss */ "./src/plugins/muc-views/modals/styles/occupant.scss");






/**
 * @param {import('../occupant').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model, _el_model1, _el_model_get, _el_model2;
    var _el_model3;
    const model = (_el_model3 = el.model) !== null && _el_model3 !== void 0 ? _el_model3 : el.message;
    const jid = model === null || model === void 0 ? void 0 : model.get('jid');
    const vcard = el.getVcard();
    const nick = model.get('nick');
    const occupant_id = model.get('occupant_id');
    const role = (_el_model = el.model) === null || _el_model === void 0 ? void 0 : _el_model.get('role');
    const affiliation = (_el_model1 = el.model) === null || _el_model1 === void 0 ? void 0 : _el_model1.get('affiliation');
    const hats = ((_el_model2 = el.model) === null || _el_model2 === void 0 ? void 0 : (_el_model_get = _el_model2.get('hats')) === null || _el_model_get === void 0 ? void 0 : _el_model_get.length) ? el.model.get('hats') : null;
    const muc = el.model.collection.chatroom;
    const i18n_add_to_contacts = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Add to Contacts');
    const allowed_commands = muc.getAllowedCommands();
    const may_moderate = allowed_commands.includes('modtools');
    const can_see_real_jids = muc.features.get('nonanonymous') || muc.getOwnRole() === 'moderator';
    const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_4__._converse.session.get('bare_jid');
    const not_me = jid != bare_jid;
    const add_to_contacts = _converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.settings.get('singleton') ? '' // in singleton mode, there is no roster, so adding to contact makes no sense.
     : _converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.contacts.get(jid).then((contact)=>!contact && not_me && can_see_real_jids).then((add)=>add ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li><button class="btn btn-primary" type="button" @click="${()=>el.addToContacts()}">${i18n_add_to_contacts}</button></li>` : '');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="row"><div class="col-auto"><converse-avatar .model="${el.model}" class="avatar modal-avatar" name="${el.model.getDisplayName()}" nonce="${vcard === null || vcard === void 0 ? void 0 : vcard.get('vcard_updated')}" height="120" width="120"></converse-avatar></div><div class="col"><ul class="occupant-details list-unstyled"><li class="row mb-2"><div class="col text-start"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Nickname')}:</strong></div><div class="col text-end">${nick}</div></li><li class="row mb-2"><div class="col text-start"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('XMPP Address')}:</strong></div><div class="col text-end">${jid ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a href="#" @click="${el.openChat}">${jid}</a>` : ''}</div></li><li class="row mb-2"><div class="col text-start"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Affiliation')}:</strong></div><div class="col text-end">${affiliation}  ${may_moderate ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a href="#" data-form="affiliation-form" class="toggle-form" @click="${(ev)=>el.toggleForm(ev)}"><converse-icon class="fa fa-wrench" size="1em"></converse-icon></a>` : ''}</div>${el.show_affiliation_form ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="row mt-2"><converse-muc-affiliation-form jid="${jid}" .muc="${muc}" affiliation="${affiliation}"></converse-muc-affiliation-form></div>` : ''}</li><li class="row mb-2"><div class="col text-start"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Role')}:</strong></div><div class="col text-end">${role}  ${may_moderate && role ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a href="#" data-form="row-form" class="toggle-form" @click="${(ev)=>el.toggleForm(ev)}"><converse-icon class="fa fa-wrench" size="1em"></converse-icon></a>` : ''}</div>${el.show_role_form ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="row mt-2"><converse-muc-role-form jid="${jid}" .muc="${muc}" role="${role}"></converse-muc-role-form></div>` : ''}</li><li class="row mb-2"><div class="col text-start"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Hats')}:</strong></div><div class="col text-end">${hats}</div></li><li class="row mb-2"><div class="col text-start"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Occupant Id')}:</strong></div><div class="col text-end text-occupant-id">${occupant_id}</div></li>${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_3__.until)(add_to_contacts, '')}</ul></div></div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/modtools.js":
/*!*******************************************!*\
  !*** ./src/plugins/muc-views/modtools.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ModeratorTools)
/* harmony export */ });
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_moderator_tools_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/moderator-tools.js */ "./src/plugins/muc-views/templates/moderator-tools.js");
/* harmony import */ var _styles_moderator_tools_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/moderator-tools.scss */ "./src/plugins/muc-views/styles/moderator-tools.scss");
/**
 * @typedef {module:muc-affiliations-utils.NonOutcastAffiliation} NonOutcastAffiliation
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const { AFFILIATIONS, ROLES } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
class ModeratorTools extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            affiliation: {
                type: String
            },
            affiliations_filter: {
                type: String,
                attribute: false
            },
            alert_message: {
                type: String,
                attribute: false
            },
            alert_type: {
                type: String,
                attribute: false
            },
            jid: {
                type: String
            },
            muc: {
                type: Object,
                attribute: false
            },
            role: {
                type: String
            },
            roles_filter: {
                type: String,
                attribute: false
            },
            tab: {
                type: String
            },
            users_with_affiliation: {
                type: Array,
                attribute: false
            },
            users_with_role: {
                type: Array,
                attribute: false
            }
        };
    }
    updated(changed) {
        changed.has('role') && this.onSearchRoleChange();
        changed.has('affiliation') && this.onSearchAffiliationChange();
        changed.has('jid') && changed.get('jid') && this.initialize();
    }
    initialize() {
        return _async_to_generator(function*() {
            this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_0__.getOpenPromise)();
            const muc = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.rooms.get(this.jid);
            yield muc.initialized;
            this.muc = muc;
            this.initialized.resolve();
        }).call(this);
    }
    render() {
        var _this_muc;
        if ((_this_muc = this.muc) === null || _this_muc === void 0 ? void 0 : _this_muc.occupants) {
            const occupant = this.muc.occupants.getOwnOccupant();
            return (0,_templates_moderator_tools_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this, {
                'affiliations_filter': this.affiliations_filter,
                'alert_message': this.alert_message,
                'alert_type': this.alert_type,
                'assignable_affiliations': occupant.getAssignableAffiliations(),
                'assignable_roles': occupant.getAssignableRoles(),
                'filterAffiliationResults': (ev)=>this.filterAffiliationResults(ev),
                'filterRoleResults': (ev)=>this.filterRoleResults(ev),
                'loading_users_with_affiliation': this.loading_users_with_affiliation,
                'queryAffiliation': (ev)=>this.queryAffiliation(ev),
                'queryRole': (ev)=>this.queryRole(ev),
                'queryable_affiliations': AFFILIATIONS.filter((a)=>!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('modtools_disable_query').includes(a)),
                'queryable_roles': ROLES.filter((a)=>!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('modtools_disable_query').includes(a)),
                'roles_filter': this.roles_filter,
                'switchTab': (ev)=>this.switchTab(ev),
                'tab': this.tab,
                'toggleForm': (ev)=>this.toggleForm(ev),
                'users_with_affiliation': this.users_with_affiliation,
                'users_with_role': this.users_with_role
            });
        } else {
            return '';
        }
    }
    switchTab(ev) {
        ev.stopPropagation();
        ev.preventDefault();
        this.tab = ev.target.getAttribute('data-name');
        this.requestUpdate();
    }
    onSearchAffiliationChange() {
        return _async_to_generator(function*() {
            if (!this.affiliation) return;
            yield this.initialized;
            this.clearAlert();
            this.loading_users_with_affiliation = true;
            this.users_with_affiliation = null;
            if (this.shouldFetchAffiliationsList()) {
                const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.rooms.affiliations.get(this.affiliation, this.jid);
                if (result instanceof Error) {
                    this.alert(result.message, 'danger');
                    this.users_with_affiliation = [];
                } else {
                    this.users_with_affiliation = result;
                }
            } else {
                this.users_with_affiliation = this.muc.getOccupantsWithAffiliation(this.affiliation);
            }
            this.loading_users_with_affiliation = false;
        }).call(this);
    }
    onSearchRoleChange() {
        return _async_to_generator(function*() {
            if (!this.role) {
                return;
            }
            yield this.initialized;
            this.clearAlert();
            this.users_with_role = this.muc.getOccupantsWithRole(this.role);
        }).call(this);
    }
    shouldFetchAffiliationsList() {
        const affiliation = this.affiliation;
        if (affiliation === 'none') {
            return false;
        }
        const auto_fetched_affs = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.MUCOccupants.getAutoFetchedAffiliationLists();
        if (auto_fetched_affs.includes(affiliation)) {
            return false;
        } else {
            return true;
        }
    }
    toggleForm(ev) {
        ev.stopPropagation();
        ev.preventDefault();
        const toggle = u.ancestor(ev.target, '.toggle-form');
        const sel = toggle.getAttribute('data-form');
        const form = u.ancestor(toggle, '.list-group-item').querySelector(sel);
        if (u.hasClass('hidden', form)) {
            u.removeClass('hidden', form);
        } else {
            u.addClass('hidden', form);
        }
    }
    filterRoleResults(ev) {
        this.roles_filter = ev.target.value;
        this.requestUpdate();
    }
    filterAffiliationResults(ev) {
        this.affiliations_filter = ev.target.value;
    }
    queryRole(ev) {
        ev.stopPropagation();
        ev.preventDefault();
        const data = new FormData(ev.target);
        const role = /** @type {string} */ data.get('role');
        this.role = null;
        this.role = role;
    }
    queryAffiliation(ev) {
        ev.stopPropagation();
        ev.preventDefault();
        const data = new FormData(ev.target);
        const affiliation = /** @type {NonOutcastAffiliation} */ data.get('affiliation');
        this.affiliation = null;
        this.affiliation = affiliation;
    }
    alert(message, type) {
        this.alert_message = message;
        this.alert_type = type;
    }
    clearAlert() {
        this.alert_message = undefined;
        this.alert_type = undefined;
    }
    constructor(){
        super();
        this.jid = null;
        this.tab = 'affiliations';
        this.affiliation = null;
        this.affiliations_filter = '';
        this.role = '';
        this.roles_filter = '';
        this.addEventListener("affiliationChanged", ()=>{
            this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Affiliation changed'), 'primary');
            this.onSearchAffiliationChange();
            this.requestUpdate();
        });
        this.addEventListener("roleChanged", ()=>{
            this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Role changed'), 'primary');
            this.requestUpdate();
        });
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-modtools', ModeratorTools);


/***/ }),

/***/ "./src/plugins/muc-views/muc-chat-content.js":
/*!***************************************************!*\
  !*** ./src/plugins/muc-views/muc-chat-content.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCChatContent)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_chat_content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/chat/chat-content */ "./src/shared/chat/chat-content.js");
/* harmony import */ var shared_chat_message_history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/message-history */ "./src/shared/chat/message-history.js");
/* harmony import */ var _styles_muc_chat_content_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/muc-chat-content.scss */ "./src/plugins/muc-views/styles/muc-chat-content.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class MUCChatContent extends shared_chat_chat_content__WEBPACK_IMPORTED_MODULE_1__["default"] {
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            yield _superprop_get_initialize().call(_this);
            this.listenTo(this.model, 'change:hidden_occupants', ()=>this.requestUpdate());
            this.listenTo(this.model.occupants, 'change', ()=>this.requestUpdate());
        }).call(this);
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-chat-content', MUCChatContent);


/***/ }),

/***/ "./src/plugins/muc-views/muc.js":
/*!**************************************!*\
  !*** ./src/plugins/muc-views/muc.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCView)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_baseview_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/chat/baseview.js */ "./src/shared/chat/baseview.js");
/* harmony import */ var plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/dragresize/mixin.js */ "./src/plugins/dragresize/mixin.js");
/* harmony import */ var _templates_muc_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/muc.js */ "./src/plugins/muc-views/templates/muc.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}




class MUCView extends (0,plugins_dragresize_mixin_js__WEBPACK_IMPORTED_MODULE_2__["default"])(shared_chat_baseview_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
    initialize() {
        return _async_to_generator(function*() {
            this.model = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.get(this.jid);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.add(this.jid, this);
            this.setAttribute('id', this.model.get('box_id'));
            this.listenTo(this.model.session, 'change:connection_status', this.onConnectionStatusChanged);
            this.listenTo(this.model.session, 'change:view', ()=>this.requestUpdate());
            document.addEventListener('visibilitychange', ()=>this.onWindowStateChanged());
            this.onConnectionStatusChanged();
            this.model.maybeShow();
            /**
         * Triggered once a {@link MUCView} has been opened
         * @event _converse#chatRoomViewInitialized
         * @type {MUCView}
         * @example _converse.api.listen.on('chatRoomViewInitialized', view => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('chatRoomViewInitialized', this);
        }).call(this);
    }
    render() {
        return (0,_templates_muc_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    onConnectionStatusChanged() {
        const conn_status = this.model.session.get('connection_status');
        if (conn_status === _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.ROOMSTATUS.CONNECTING) {
            this.model.session.save({
                'disconnection_actor': undefined,
                'disconnection_message': undefined,
                'disconnection_reason': undefined
            });
            this.model.save({
                'moved_jid': undefined,
                'password_validation_message': undefined,
                'reason': undefined
            });
        }
        this.requestUpdate();
    }
    constructor(...args){
        super(...args), _define_property(this, "length", 300), _define_property(this, "is_chatroom", true);
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc', MUCView);


/***/ }),

/***/ "./src/plugins/muc-views/nickname-form.js":
/*!************************************************!*\
  !*** ./src/plugins/muc-views/nickname-form.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _templates_muc_nickname_form_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/muc-nickname-form.js */ "./src/plugins/muc-views/templates/muc-nickname-form.js");
/* harmony import */ var _styles_nickname_form_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/nickname-form.scss */ "./src/plugins/muc-views/styles/nickname-form.scss");




class MUCNicknameForm extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            jid: {
                type: String
            }
        };
    }
    /**
     * @param {Map<string, any>} changed
     */ shouldUpdate(changed) {
        if (changed.has('jid') && this.jid) {
            const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            this.model = chatboxes.get(this.jid);
        }
        return true;
    }
    render() {
        return (0,_templates_muc_nickname_form_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {Event} ev
     */ submitNickname(ev) {
        ev.preventDefault();
        const form = /** @type {HTMLFormElement} */ ev.target;
        const nick = form.nick.value.trim();
        if (!nick) return;
        if (this.model.isEntered()) {
            this.model.setNickname(nick);
            this.closeModal();
        } else {
            this.model.join(nick);
        }
    }
    closeModal() {
        /** @type {import('plugins/modal/modal').default} */ document.querySelector('converse-muc-nickname-modal').close();
    }
    constructor(){
        super();
        this.jid = null;
        this.model = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-nickname-form', MUCNicknameForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCNicknameForm);


/***/ }),

/***/ "./src/plugins/muc-views/occupant-bottom-panel.js":
/*!********************************************************!*\
  !*** ./src/plugins/muc-views/occupant-bottom-panel.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ OccupantBottomPanel)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var plugins_chatview_bottom_panel_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/chatview/bottom-panel.js */ "./src/plugins/chatview/bottom-panel.js");
/* harmony import */ var _templates_occupant_bottom_panel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/occupant-bottom-panel.js */ "./src/plugins/muc-views/templates/occupant-bottom-panel.js");
/* harmony import */ var _styles_occupant_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/occupant-bottom-panel.scss */ "./src/plugins/muc-views/styles/occupant-bottom-panel.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class OccupantBottomPanel extends plugins_chatview_bottom_panel_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    static get properties() {
        return {
            model: {
                type: Object,
                noAccessor: true
            },
            muc: {
                type: Object
            }
        };
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            yield _superprop_get_initialize().call(_this);
            this.listenTo(this.muc.session, 'change:connection_status', ()=>this.requestUpdate());
        }).call(this);
    }
    render() {
        if (!this.model) return '';
        return (0,_templates_occupant_bottom_panel_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    canPostMessages() {
        return this.muc.isEntered() && this.model.get('show') !== 'offline';
    }
    openChat() {
        const jid = this.model.get('jid');
        return jid ? _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.chats.open(jid, {}, true) : _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error'), 'Could not find XMPP address');
    }
    invite() {
        const jid = this.model.get('jid');
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.once('roomInviteSent', ()=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.alert('info', (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Success'), (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The user has been invited to join this groupchat')));
        return jid ? this.muc.directInvite(jid) : _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error'), 'Could not find XMPP address');
    }
    constructor(){
        super();
        this.muc = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-occupant-bottom-panel', OccupantBottomPanel);


/***/ }),

/***/ "./src/plugins/muc-views/occupant.js":
/*!*******************************************!*\
  !*** ./src/plugins/muc-views/occupant.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCOccupant)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_muc_occupant_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/muc-occupant.js */ "./src/plugins/muc-views/templates/muc-occupant.js");
/* harmony import */ var _occupant_bottom_panel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./occupant-bottom-panel.js */ "./src/plugins/muc-views/occupant-bottom-panel.js");
/* harmony import */ var _styles_muc_occupant_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/muc-occupant.scss */ "./src/plugins/muc-views/styles/muc-occupant.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;

class MUCOccupant extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            muc_jid: {
                type: String
            },
            occupant_id: {
                type: String
            }
        };
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
            this.muc = chatboxes.get(this.muc_jid);
            yield this.muc.initialized;
            this.model = this.muc.occupants.get(this.occupant_id);
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return this.muc ? (0,_templates_muc_occupant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this) : '';
    }
    /**
     * @param {string} jid
     */ openChat(jid) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.chats.open(jid, {}, true);
    }
    closeSidebar() {
        u.safeSave(this.muc, {
            'hidden_occupants': true
        });
    }
    /** @param {MouseEvent} [ev] */ showOccupantModal(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-muc-occupant-modal', {
            model: this.model
        }, ev);
    }
    getVcard() {
        const model = this.model;
        if (model.vcard) {
            return model.vcard;
        }
        const jid = (model === null || model === void 0 ? void 0 : model.get('jid')) || (model === null || model === void 0 ? void 0 : model.get('from'));
        return jid ? _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.vcards.get(jid) : null;
    }
    addToContacts() {
        const model = this.model;
        const jid = model.get('jid');
        if (jid) _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-add-contact-modal', {
            state: new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model({
                jid
            })
        });
    }
    /**
     * @param {MouseEvent} ev
     */ toggleForm(ev) {
        const toggle = u.ancestor(ev.target, '.toggle-form');
        const form = toggle.getAttribute('data-form');
        if (form === 'row-form') {
            this.show_role_form = !this.show_role_form;
        } else {
            this.show_affiliation_form = !this.show_affiliation_form;
        }
        this.requestUpdate();
    }
    constructor(){
        super();
        this.muc_jid = null;
        this.occupant_id = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-muc-occupant', MUCOccupant);


/***/ }),

/***/ "./src/plugins/muc-views/occupants.js":
/*!********************************************!*\
  !*** ./src/plugins/muc-views/occupants.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCOccupants)
/* harmony export */ });
/* harmony import */ var lodash_es_debounce_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es/debounce.js */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_muc_occupants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/muc-occupants.js */ "./src/plugins/muc-views/templates/muc-occupants.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var _modals_muc_invite_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modals/muc-invite.js */ "./src/plugins/muc-views/modals/muc-invite.js");
/* harmony import */ var _occupant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./occupant.js */ "./src/plugins/muc-views/occupant.js");
/* harmony import */ var shared_styles_status_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/styles/status.scss */ "./src/shared/styles/status.scss");
/* harmony import */ var _styles_muc_occupants_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./styles/muc-occupants.scss */ "./src/plugins/muc-views/styles/muc-occupants.scss");









const { initStorage } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u;
class MUCOccupants extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            jid: {
                type: String
            }
        };
    }
    initialize() {
        const filter_id = `_converse.occupants-filter-${this.jid}`;
        this.filter = new _converse_headless__WEBPACK_IMPORTED_MODULE_0__.RosterFilter();
        this.filter.id = filter_id;
        initStorage(this.filter, filter_id);
        this.filter.fetch();
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        this.model = chatboxes.get(this.jid);
        // To avoid rendering continuously the participant list in case of massive joins/leaves:
        const debouncedRequestUpdate = (0,lodash_es_debounce_js__WEBPACK_IMPORTED_MODULE_8__["default"])(()=>this.requestUpdate(), 200, {
            maxWait: 1000
        });
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.listenTo(this.model.occupants, 'add', debouncedRequestUpdate);
        this.listenTo(this.model.occupants, 'change', debouncedRequestUpdate);
        this.listenTo(this.model.occupants, 'remove', debouncedRequestUpdate);
        this.listenTo(this.model.occupants, 'sort', debouncedRequestUpdate);
        this.listenTo(this.model.features, 'change:open', ()=>this.requestUpdate());
        this.model.initialized.then(()=>this.requestUpdate());
    }
    render() {
        return (0,_templates_muc_occupants_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     */ showInviteModal(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-muc-invite-modal', {
            muc: this.model
        }, ev);
    }
    /** @param {MouseEvent} ev */ toggleFilter(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(this.model, {
            'filter_visible': !this.model.get('filter_visible')
        });
    }
    /** @param {MouseEvent} ev */ closeSidebar(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(this.model, {
            'hidden_occupants': true
        });
    }
    constructor(){
        super();
        this.jid = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-occupants', MUCOccupants);


/***/ }),

/***/ "./src/plugins/muc-views/password-form.js":
/*!************************************************!*\
  !*** ./src/plugins/muc-views/password-form.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _templates_muc_password_form_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/muc-password-form.js */ "./src/plugins/muc-views/templates/muc-password-form.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



class MUCPasswordForm extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            'jid': {
                type: String
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state;
        this.model = chatboxes.get(this.jid);
        this.listenTo(this.model, 'change:password_validation_message', ()=>this.requestUpdate());
        this.requestUpdate();
    }
    render() {
        return (0,_templates_muc_password_form_js__WEBPACK_IMPORTED_MODULE_0__["default"])({
            'jid': this.model.get('jid'),
            'submitPassword': (ev)=>this.submitPassword(ev),
            'validation_message': this.model.get('password_validation_message')
        });
    }
    submitPassword(ev) {
        ev.preventDefault();
        const password = /** @type {HTMLInputElement} */ this.querySelector('input[type=password]').value;
        this.model.join(this.model.get('nick'), password);
        this.model.set('password_validation_message', null);
    }
    constructor(){
        super();
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-muc-password-form', MUCPasswordForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MUCPasswordForm);


/***/ }),

/***/ "./src/plugins/muc-views/role-form.js":
/*!********************************************!*\
  !*** ./src/plugins/muc-views/role-form.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_role_form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/role-form.js */ "./src/plugins/muc-views/templates/role-form.js");
/* harmony import */ var _styles_role_form_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/role-form.scss */ "./src/plugins/muc-views/styles/role-form.scss");





const { Strophe, sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
class RoleForm extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            muc: {
                type: Object
            },
            jid: {
                type: String
            },
            role: {
                type: String
            },
            alert_message: {
                type: String,
                attribute: false
            },
            alert_type: {
                type: String,
                attribute: false
            }
        };
    }
    render() {
        return (0,_templates_role_form_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    alert(message, type) {
        this.alert_message = message;
        this.alert_type = type;
    }
    assignRole(ev) {
        ev.stopPropagation();
        ev.preventDefault();
        this.alert(); // clear alert
        const data = new FormData(ev.target);
        const occupant = this.muc.getOccupant(data.get('jid') || data.get('nick'));
        const role = data.get('role');
        const reason = data.get('reason');
        this.muc.setRole(occupant, role, reason, ()=>{
            /**
                 * @event roleChanged
                 * @example
                 *  const el = document.querySelector('converse-muc-role-form');
                 *  el.addEventListener('roleChanged', () => { ... });
                 */ const event = new CustomEvent('roleChanged', {
                bubbles: true
            });
            this.dispatchEvent(event);
        }, (e)=>{
            if (sizzle(`not-allowed[xmlns="${Strophe.NS.STANZAS}"]`, e).length) {
                this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("You're not allowed to make that change"), 'danger');
            } else {
                this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sorry, something went wrong while trying to set the role'), 'danger');
                if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.isErrorObject(e)) _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
            }
        });
    }
    constructor(){
        super();
        this.muc = null;
        this.nick = null;
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-role-form', RoleForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RoleForm);


/***/ }),

/***/ "./src/plugins/muc-views/search.js":
/*!*****************************************!*\
  !*** ./src/plugins/muc-views/search.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAutoCompleteList: () => (/* binding */ getAutoCompleteList)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

const { Strophe, $iq, sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
Strophe.addNamespace('MUCSEARCH', 'https://xmlns.zombofant.net/muclumbus/search/1.0');
const rooms_cache = {};
/**
 * @param {string} query
 */ function searchRooms(query) {
    return _async_to_generator(function*() {
        const muc_search_service = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_search_service');
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
        const iq = $iq({
            'type': 'get',
            'from': bare_jid,
            'to': muc_search_service
        }).c('search', {
            'xmlns': Strophe.NS.MUCSEARCH
        }).c('set', {
            'xmlns': Strophe.NS.RSM
        }).c('max').t(10).up().up().c('x', {
            'xmlns': Strophe.NS.XFORM,
            'type': 'submit'
        }).c('field', {
            'var': 'FORM_TYPE',
            'type': 'hidden'
        }).c('value').t('https://xmlns.zombofant.net/muclumbus/search/1.0#params').up().up().c('field', {
            'var': 'q',
            'type': 'text-single'
        }).c('value').t(query).up().up().c('field', {
            'var': 'sinname',
            'type': 'boolean'
        }).c('value').t('true').up().up().c('field', {
            'var': 'sindescription',
            'type': 'boolean'
        }).c('value').t('false').up().up().c('field', {
            'var': 'sinaddr',
            'type': 'boolean'
        }).c('value').t('true').up().up().c('field', {
            'var': 'min_users',
            'type': 'text-single'
        }).c('value').t('1').up().up().c('field', {
            'var': 'key',
            'type': 'list-single'
        }).c('value').t('address').up().c('option').c('value').t('nusers').up().up().c('option').c('value').t('address');
        let iq_result;
        try {
            iq_result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.sendIQ(iq);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
            return [];
        }
        const s = `result[xmlns="${Strophe.NS.MUCSEARCH}"] item`;
        return sizzle(s, iq_result).map((i)=>{
            var _i_querySelector;
            const jid = i.getAttribute('address');
            return {
                'label': `${(_i_querySelector = i.querySelector('name')) === null || _i_querySelector === void 0 ? void 0 : _i_querySelector.textContent} (${jid})`,
                'value': jid
            };
        });
    })();
}
/**
 * @param {string} query
 */ function getAutoCompleteList(query) {
    if (!rooms_cache[query]) {
        rooms_cache[query] = searchRooms(query);
    }
    return rooms_cache[query];
}


/***/ }),

/***/ "./src/plugins/muc-views/sidebar-occupant.js":
/*!***************************************************!*\
  !*** ./src/plugins/muc-views/sidebar-occupant.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCOccupantListItem)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/observable.js */ "./src/shared/components/observable.js");
/* harmony import */ var _templates_occupant_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/occupant.js */ "./src/plugins/muc-views/templates/occupant.js");
/* harmony import */ var _occupant_bottom_panel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./occupant-bottom-panel.js */ "./src/plugins/muc-views/occupant-bottom-panel.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}





class MUCOccupantListItem extends shared_components_observable_js__WEBPACK_IMPORTED_MODULE_2__.ObservableElement {
    static get properties() {
        return _object_spread_props(_object_spread({}, super.properties), {
            model: {
                type: _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model
            },
            muc: {
                type: _converse_headless__WEBPACK_IMPORTED_MODULE_1__.MUC
            }
        });
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            yield this.muc.initialized;
            this.listenTo(this.model, "change", ()=>this.requestUpdate());
            this.listenTo(this.model, "vcard:add", ()=>this.requestUpdate());
            this.listenTo(this.model, "vcard:change", ()=>this.requestUpdate());
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return this.muc ? (0,_templates_occupant_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this) : "";
    }
    /**
     * @param {MouseEvent} ev
     * @param {import('@converse/headless/types/plugins/muc/occupant.js').default} occupant
     */ onOccupantClicked(ev, occupant) {
        ev.preventDefault();
        if (this.muc.getOwnOccupant() === occupant) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show("converse-profile-modal", {
                model: _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.xmppstatus
            }, ev);
        } else {
            this.muc.save({
                sidebar_view: `occupant:${occupant.id}`
            });
        }
    }
    /**
     * @typedef {import('shared/components/types').ObservableProperty} ObservableProperty
     */ constructor(){
        super();
        this.muc = null;
        this.observable = /** @type {ObservableProperty} */ "once";
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define("converse-muc-occupant-list-item", MUCOccupantListItem);


/***/ }),

/***/ "./src/plugins/muc-views/sidebar.js":
/*!******************************************!*\
  !*** ./src/plugins/muc-views/sidebar.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MUCSidebar)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_muc_sidebar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/muc-sidebar.js */ "./src/plugins/muc-views/templates/muc-sidebar.js");
/* harmony import */ var _modals_muc_invite_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modals/muc-invite.js */ "./src/plugins/muc-views/modals/muc-invite.js");
/* harmony import */ var _occupants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./occupants.js */ "./src/plugins/muc-views/occupants.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var shared_styles_status_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/styles/status.scss */ "./src/shared/styles/status.scss");
/* harmony import */ var _styles_muc_sidebar_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./styles/muc-sidebar.scss */ "./src/plugins/muc-views/styles/muc-sidebar.scss");








class MUCSidebar extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            jid: {
                type: String
            }
        };
    }
    initialize() {
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        this.model = chatboxes.get(this.jid);
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.listenTo(this.model.features, 'change:open', ()=>this.requestUpdate());
        this.model.initialized.then(()=>this.requestUpdate());
    }
    render() {
        return (0,_templates_muc_sidebar_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /** @param {MouseEvent} ev */ closeSidebar(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.safeSave(this.model, {
            'hidden_occupants': true
        });
    }
    constructor(){
        super();
        this.jid = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-muc-sidebar', MUCSidebar);


/***/ }),

/***/ "./src/plugins/muc-views/styles/add-muc-modal.scss":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/styles/add-muc-modal.scss ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_muc_modal_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./add-muc-modal.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/add-muc-modal.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_muc_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_muc_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_muc_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_muc_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/affiliation-form.scss":
/*!************************************************************!*\
  !*** ./src/plugins/muc-views/styles/affiliation-form.scss ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_affiliation_form_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./affiliation-form.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/affiliation-form.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_affiliation_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_affiliation_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_affiliation_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_affiliation_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/index.scss":
/*!*************************************************!*\
  !*** ./src/plugins/muc-views/styles/index.scss ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./index.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/index.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/moderator-tools.scss":
/*!***********************************************************!*\
  !*** ./src/plugins/muc-views/styles/moderator-tools.scss ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_moderator_tools_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./moderator-tools.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/moderator-tools.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_moderator_tools_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_moderator_tools_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_moderator_tools_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_moderator_tools_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-bottom-panel.scss":
/*!************************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-bottom-panel.scss ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-bottom-panel.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-bottom-panel.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-chat-content.scss":
/*!************************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-chat-content.scss ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-chat-content.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-chat-content.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-details-modal.scss":
/*!*************************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-details-modal.scss ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_details_modal_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-details-modal.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-details-modal.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_details_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_details_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_details_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_details_modal_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-head.scss":
/*!****************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-head.scss ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_head_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-head.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-head.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_head_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-occupant.scss":
/*!********************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-occupant.scss ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupant_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-occupant.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-occupant.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupant_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-occupants.scss":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-occupants.scss ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupants_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-occupants.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-occupants.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupants_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupants_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupants_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_occupants_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/muc-sidebar.scss":
/*!*******************************************************!*\
  !*** ./src/plugins/muc-views/styles/muc-sidebar.scss ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_sidebar_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./muc-sidebar.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/muc-sidebar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_sidebar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_sidebar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_sidebar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_muc_sidebar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/nickname-form.scss":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/styles/nickname-form.scss ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_nickname_form_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./nickname-form.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/nickname-form.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_nickname_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_nickname_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_nickname_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_nickname_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/occupant-bottom-panel.scss":
/*!*****************************************************************!*\
  !*** ./src/plugins/muc-views/styles/occupant-bottom-panel.scss ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./occupant-bottom-panel.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/occupant-bottom-panel.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_occupant_bottom_panel_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/styles/role-form.scss":
/*!*****************************************************!*\
  !*** ./src/plugins/muc-views/styles/role-form.scss ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_role_form_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./role-form.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/muc-views/styles/role-form.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_role_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_role_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_role_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_role_form_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/muc-views/templates/affiliation-form.js":
/*!*************************************************************!*\
  !*** ./src/plugins/muc-views/templates/affiliation-form.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import('../affiliation-form').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_change_affiliation = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change affiliation');
    const i18n_new_affiliation = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New affiliation');
    const i18n_reason = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reason');
    const occupant = el.muc.getOwnOccupant();
    const assignable_affiliations = occupant.getAssignableAffiliations();
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="affiliation-form" @submit="${(ev)=>el.assignAffiliation(ev)}">${el.alert_message ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-${el.alert_type}" role="alert">${el.alert_message}</div>` : ''}<div class="mb-3"><div class="row"><div class="col-md-6"><label class="form-label"><strong>${i18n_new_affiliation}:</strong></label> <select class="form-select select-affiliation" name="affiliation">${assignable_affiliations.map((aff)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<option value="${aff}" ?selected="${aff === el.affiliation}">${aff}</option>`)}</select></div><div class="col-md-6"><label class="form-label"><strong>${i18n_reason}:</strong></label> <input class="form-control" type="text" name="reason" placeholder="${i18n_reason}"></div></div></div><div class="text-end"><button type="submit" class="btn btn-primary" name="change">${i18n_change_affiliation}</button></div></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/mep-message.js":
/*!********************************************************!*\
  !*** ./src/plugins/muc-views/templates/mep-message.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


const { dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const isodate = dayjs(el.model.get('time')).toISOString();
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="message chat-info message--mep ${el.getExtraMessageClasses()}" data-isodate="${isodate}" data-type="${el.data_name}" data-value="${el.data_value}"><div class="chat-msg__content"><div class="chat-msg__body chat-msg__body--${el.model.get('type')} ${el.model.get('is_delayed') ? 'chat-msg__body--delayed' : ''}"><div class="chat-info__message">${el.model.isRetracted() ? el.renderRetraction() : (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<converse-texture .mentions="${el.model.get('references')}" render_styling text="${el.model.getMessageText()}"></converse-texture>${el.model.get('reason') ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<q class="reason"><converse-texture text="${el.model.get('reason')}"></converse-texture></q>` : ``}`}</div><converse-message-actions ?is_retracted="${el.model.isRetracted()}" .model="${el.model}"></converse-message-actions></div></div></div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/message-form.js":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/templates/message-form.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var plugins_chatview_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/chatview/utils.js */ "./src/plugins/chatview/utils.js");




/**
 * @param {import('../message-form').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const composing_spoiler = el.model.get("composing_spoiler");
    const label_message = composing_spoiler ? (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Hidden message") : (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Message");
    const label_spoiler_hint = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Optional hint");
    const message_limit = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("message_limit");
    const show_call_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("visible_toolbar_buttons").call;
    const show_emoji_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("visible_toolbar_buttons").emoji;
    const show_send_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("show_send_button");
    const show_spoiler_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("visible_toolbar_buttons").spoiler;
    const show_toolbar = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get("show_toolbar");
    var _el_model_get, _el_model_get1;
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<form class="setNicknameButtonForm hidden"><input type="submit" class="btn btn-primary" name="join" value="Join"></form><form class="chat-message-form" @submit="${(ev)=>el.onFormSubmitted(ev)}">${show_toolbar ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-chat-toolbar class="btn-toolbar chat-toolbar no-text-select" .model="${el.model}" ?hidden_occupants="${el.model.get("hidden_occupants")}" ?is_groupchat="${el.model.get("message_type") === "groupchat"}" ?show_call_button="${show_call_button}" ?show_emoji_button="${show_emoji_button}" ?show_send_button="${show_send_button}" ?show_spoiler_button="${show_spoiler_button}" ?show_toolbar="${show_toolbar}" message_limit="${message_limit}"></converse-chat-toolbar>` : ""} <input type="text" placeholder="${label_spoiler_hint || ""}" .value="${(_el_model_get = el.model.get("draft_hint")) !== null && _el_model_get !== void 0 ? _el_model_get : ""}" @change="${/** @param {Event} ev */ (ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.safeSave(el.model, {
            draft_hint: /** @type {HTMLInputElement} */ ev.target.value
        })}" class="${composing_spoiler ? "" : "hidden"} spoiler-hint"><div class="suggestion-box"><ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul><textarea autofocus type="text" .value="${(_el_model_get1 = el.model.get("draft")) !== null && _el_model_get1 !== void 0 ? _el_model_get1 : ""}" @drop="${(ev)=>el.onDrop(ev)}" @input="${plugins_chatview_utils_js__WEBPACK_IMPORTED_MODULE_3__.resetElementHeight}" @keydown="${(ev)=>el.onKeyDown(ev)}" @keyup="${(ev)=>el.onKeyUp(ev)}" @paste="${(ev)=>el.onPaste(ev)}" @change="${/** @param {Event} ev */ (ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.safeSave(el.model, {
            draft: /** @type {HTMLTextAreaElement} */ ev.target.value
        })}" class="chat-textarea suggestion-box__input ${el.model.get("correcting") ? "correcting" : ""} ${show_send_button ? "chat-textarea-send-button" : ""} ${composing_spoiler ? "spoiler" : ""}" placeholder="${label_message}"></textarea> <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span></div></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/moderator-tools.js":
/*!************************************************************!*\
  !*** ./src/plugins/muc-views/templates/moderator-tools.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");



function getRoleHelpText(role) {
    if (role === 'moderator') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Moderators are privileged users who can change the roles of other users (except those with admin or owner affiliations.");
    } else if (role === 'participant') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("The default role, implies that you can read and write messages.");
    } else if (role == 'visitor') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Visitors aren't allowed to write messages in a moderated multi-user chat.");
    }
}
function getAffiliationHelpText(aff) {
    if (aff === 'owner') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Owner is the highest affiliation. Owners can modify roles and affiliations of all other users.");
    } else if (aff === 'admin') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Admin is the 2nd highest affiliation. Admins can modify roles and affiliations of all other users except owners.");
    } else if (aff === 'outcast') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("To ban a user, you give them the affiliation of \"outcast\".");
    }
}
const role_option = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<option value="${o.item || ''}" ?selected="${o.item === o.role}" title="${getRoleHelpText(o.item)}">${o.item}</option>`;
const affiliation_option = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<option value="${o.item || ''}" ?selected="${o.item === o.affiliation}" title="${getAffiliationHelpText(o.item)}">${o.item}</option>`;
const tplRoleFormToggle = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a href="#" data-form="converse-muc-role-form" class="toggle-form right" color="var(--secondary-color)" @click="${o.toggleForm}"><converse-icon class="fa fa-wrench" size="1em"></converse-icon></a>`;
const tplRoleListItem = (el, o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item" data-nick="${o.item.nick}"><ul class="list-group"><li class="list-group-item active"><div><strong>JID:</strong> ${o.item.jid}</div></li><li class="list-group-item"><div><strong>Nickname:</strong> ${o.item.nick}</div></li><li class="list-group-item"><div><strong>Role:</strong> ${o.item.role} ${o.assignable_roles.length ? tplRoleFormToggle(o) : ''}</div>${o.assignable_roles.length ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-muc-role-form class="hidden" .muc="${el.muc}" jid="${o.item.jid}" role="${o.item.role}"></converse-muc-role-form>` : ''}</li></ul></li>`;
const affiliation_form_toggle = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a href="#" data-form="converse-muc-affiliation-form" class="toggle-form right" color="var(--secondary-color)" @click="${o.toggleForm}"><converse-icon class="fa fa-wrench" size="1em"></converse-icon></a>`;
const affiliation_list_item = (el, o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item" data-nick="${o.item.nick}"><ul class="list-group"><li class="list-group-item active"><div><strong>JID:</strong> ${o.item.jid}</div></li><li class="list-group-item"><div><strong>Nickname:</strong> ${o.item.nick}</div></li><li class="list-group-item"><div><strong>Affiliation:</strong> ${o.item.affiliation} ${o.assignable_affiliations.length ? affiliation_form_toggle(o) : ''}</div>${o.assignable_affiliations.length ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-muc-affiliation-form class="hidden" .muc="${el.muc}" jid="${o.item.jid}" affiliation="${o.item.affiliation}"></converse-muc-affiliation-form>` : ''}</li></ul></li>`;
const tplNavigation = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<ul class="nav nav-pills justify-content-center"><li role="presentation" class="nav-item"><a class="nav-link ${o.tab === "affiliations" ? "active" : ""}" id="affiliations-tab" href="#affiliations-tabpanel" aria-controls="affiliations-tabpanel" role="tab" data-name="affiliations" @click="${o.switchTab}">Affiliations</a></li><li role="presentation" class="nav-item"><a class="nav-link ${o.tab === "roles" ? "active" : ""}" id="roles-tab" href="#roles-tabpanel" aria-controls="roles-tabpanel" role="tab" data-name="roles" @click="${o.switchTab}">Roles</a></li></ul>`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el, o)=>{
    const i18n_affiliation = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Affiliation');
    const i18n_no_users_with_aff = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No users with that affiliation found.');
    const i18n_no_users_with_role = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No users with that role found.');
    const i18n_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Type here to filter the search results');
    const i18n_role = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Role');
    const i18n_show_users = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show users');
    const i18n_helptext_role = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Roles are assigned to users to grant or deny them certain abilities in a multi-user chat. " + "They're assigned either explicitly or implicitly as part of an affiliation. " + "A role that's not due to an affiliation, is only valid for the duration of the user's session.");
    const i18n_helptext_affiliation = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("An affiliation is a long-lived entitlement which typically implies a certain role and which " + "grants privileges and responsibilities. For example admins and owners automatically have the " + "moderator role.");
    const show_both_tabs = o.queryable_roles.length && o.queryable_affiliations.length;
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`${o.alert_message ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="alert alert-${o.alert_type}" role="alert">${o.alert_message}</div>` : ''} ${show_both_tabs ? tplNavigation(o) : ''}<div class="tab-content">${o.queryable_affiliations.length ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="tab-pane tab-pane--columns ${o.tab === 'affiliations' ? 'active' : ''}" id="affiliations-tabpanel" role="tabpanel" aria-labelledby="affiliations-tab"><form class="converse-form query-affiliation" @submit="${o.queryAffiliation}"><p class="helptext pb-3">${i18n_helptext_affiliation}</p><div><label class="form-label" for="affiliation"><strong>${i18n_affiliation}:</strong></label><div class="row"><div class="col"><select class="form-select select-affiliation" name="affiliation">${o.queryable_affiliations.map((item)=>affiliation_option(Object.assign({
            item
        }, o)))}</select></div><div class="col"><input type="submit" class="btn btn-primary" name="users_with_affiliation" value="${i18n_show_users}"></div></div><div class="row"><div class="col mt-3">${Array.isArray(o.users_with_affiliation) && o.users_with_affiliation.length > 5 ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<input class="form-control" .value="${o.affiliations_filter}" @keyup="${o.filterAffiliationResults}" type="text" name="filter" placeholder="${i18n_filter}">` : ''}</div></div>${getAffiliationHelpText(o.affiliation) ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="row"><div class="col pt-2"><p class="helptext pb-3">${getAffiliationHelpText(o.affiliation)}</p></div></div>` : ''}</div></form><div class="scrollable-container"><ul class="list-group list-group--users">${o.loading_users_with_affiliation ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item">${(0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_0__["default"])()}</li>` : ''} ${Array.isArray(o.users_with_affiliation) && o.users_with_affiliation.length === 0 ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item">${i18n_no_users_with_aff}</li>` : ''} ${o.users_with_affiliation instanceof Error ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item">${o.users_with_affiliation.message}</li>` : (o.users_with_affiliation || []).map((item)=>(item.nick || item.jid).match(new RegExp(o.affiliations_filter, 'i')) ? affiliation_list_item(el, Object.assign({
            item
        }, o)) : '')}</ul></div></div>` : ''} ${o.queryable_roles.length ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="tab-pane tab-pane--columns ${o.tab === 'roles' ? 'active' : ''}" id="roles-tabpanel" role="tabpanel" aria-labelledby="roles-tab"><form class="converse-form query-role" @submit="${o.queryRole}"><p class="helptext pb-3">${i18n_helptext_role}</p><div><label class="form-label" for="role"><strong>${i18n_role}:</strong></label><div class="row"><div class="col"><select class="form-select select-role" name="role">${o.queryable_roles.map((item)=>role_option(Object.assign({
            item
        }, o)))}</select></div><div class="col"><input type="submit" class="btn btn-primary" name="users_with_role" value="${i18n_show_users}"></div></div><div class="row"><div class="col mt-3">${Array.isArray(o.users_with_role) && o.users_with_role.length > 5 ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<input class="form-control" .value="${o.roles_filter}" @keyup="${o.filterRoleResults}" type="text" name="filter" placeholder="${i18n_filter}">` : ''}</div></div>${getRoleHelpText(o.role) ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="row"><div class="col pt-2"><p class="helptext pb-3">${getRoleHelpText(o.role)}</p></div></div>` : ''}</div></form><div class="scrollable-container"><ul class="list-group list-group--users">${o.loading_users_with_role ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item">${(0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_0__["default"])()}</li>` : ''} ${o.users_with_role && o.users_with_role.length === 0 ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="list-group-item">${i18n_no_users_with_role}</li>` : ''} ${(o.users_with_role || []).map((item)=>item.nick.match(o.roles_filter) ? tplRoleListItem(el, Object.assign({
            item
        }, o)) : '')}</ul></div></div>` : ''}</div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-bottom-panel.js":
/*!*************************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-bottom-panel.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _message_form_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../message-form.js */ "./src/plugins/muc-views/message-form.js");
/* harmony import */ var _nickname_form_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../nickname-form.js */ "./src/plugins/muc-views/nickname-form.js");
/* harmony import */ var shared_chat_toolbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/toolbar.js */ "./src/shared/chat/toolbar.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");






/**
 * @param {import('../bottom-panel').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const unread_msgs = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You have unread messages');
    const conn_status = el.model.session.get('connection_status');
    const i18n_not_allowed = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("You're not allowed to send messages in this room");
    if (conn_status === _converse_headless__WEBPACK_IMPORTED_MODULE_4__.converse.ROOMSTATUS.ENTERED) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`${el.model.ui.get('scrolled') && el.model.get('num_unread_general') ? (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<div class="new-msgs-indicator" @click="${(ev)=>el.viewUnreadMessages(ev)}">▼ ${unread_msgs} ▼</div>` : ''} ${el.model.canPostMessages() ? (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<converse-muc-message-form .model="${el.model}"></converse-muc-message-form>` : (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<span class="muc-bottom-panel muc-bottom-panel--muted">${i18n_not_allowed}</span>`}`;
    } else if (conn_status == _converse_headless__WEBPACK_IMPORTED_MODULE_4__.converse.ROOMSTATUS.NICKNAME_REQUIRED) {
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.settings.get('muc_show_logs_before_join')) {
            return (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<span class="muc-bottom-panel muc-bottom-panel--nickname"><converse-muc-nickname-form .model="${el.model}"></converse-muc-nickname-form></span>`;
        }
    } else {
        return '';
    }
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-chatarea.js":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-chatarea.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_help_messages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/help-messages.js */ "./src/shared/chat/help-messages.js");
/* harmony import */ var shared_components_split_resize_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/split-resize.js */ "./src/shared/components/split-resize.js");
/* harmony import */ var _bottom_panel_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../bottom-panel.js */ "./src/plugins/muc-views/bottom-panel.js");
/* harmony import */ var _sidebar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../sidebar.js */ "./src/plugins/muc-views/sidebar.js");
/* harmony import */ var _muc_chat_content_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../muc-chat-content.js */ "./src/plugins/muc-views/muc-chat-content.js");







const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
/**
 * @param {import('../chatarea').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model;
    const show_send_button = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_send_button');
    const view_mode = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode');
    let chat_area_classes, sidebar_classes;
    if (view_mode === 'overlayed') {
        chat_area_classes = 'd-none d-md-flex col-s-10 col-md-8';
        sidebar_classes = 'col-xs-12 col-s-2 col-md-4';
    } else if (view_mode === 'fullscreen') {
        chat_area_classes = 'd-none d-md-flex col-md-8 col-xl-10';
        sidebar_classes = 'col-xs-12 col-md-4 col-xl-2';
    } else if (view_mode === 'embedded') {
        chat_area_classes = 'd-flex col-8';
        sidebar_classes = 'col-4';
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chat-area ${el.shouldShowSidebar() ? chat_area_classes : 'col-xs-12'}"><div class="chat-content ${show_send_button ? 'chat-content-sendbutton' : ''}" aria-live="polite"><converse-muc-chat-content .model="${el.model}"></converse-muc-chat-content>${((_el_model = el.model) === null || _el_model === void 0 ? void 0 : _el_model.get('show_help_messages')) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chat-content__help"><converse-chat-help .model="${el.model}" .messages="${el.getHelpMessages()}" type="info" chat_type="${CHATROOMS_TYPE}"></converse-chat-help></div>` : ''}</div><converse-muc-bottom-panel .model="${el.model}" class="bottom-panel"></converse-muc-bottom-panel></div>${el.model && el.shouldShowSidebar() ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-split-resize></converse-split-resize><converse-muc-sidebar class="${sidebar_classes}" jid="${el.jid}"></converse-muc-sidebar>` : ''}`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-description.js":
/*!************************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-description.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    const i18n_desc = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Description:');
    const i18n_jid = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Groupchat XMPP Address:');
    const i18n_occ = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Participants:');
    const i18n_features = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Features:');
    const i18n_requires_auth = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Requires authentication');
    const i18n_hidden = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Hidden');
    const i18n_requires_invite = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Requires an invitation');
    const i18n_moderated = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Moderated');
    const i18n_non_anon = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Non-anonymous');
    const i18n_open_room = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Open');
    const i18n_permanent_room = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Permanent');
    const i18n_public = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Public');
    const i18n_semi_anon = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Semi-anonymous');
    const i18n_temp_room = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Temporary');
    const i18n_unmoderated = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Unmoderated');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="room-info"><p class="room-info"><strong>${i18n_jid}</strong> ${o.jid}</p><p class="room-info"><strong>${i18n_desc}</strong> ${o.desc}</p><p class="room-info"><strong>${i18n_occ}</strong> ${o.occ}</p><p class="room-info"><strong>${i18n_features}</strong></p><ul>${o.passwordprotected ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info locked">${i18n_requires_auth}</li>` : ''} ${o.hidden ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_hidden}</li>` : ''} ${o.membersonly ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_requires_invite}</li>` : ''} ${o.moderated ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_moderated}</li>` : ''} ${o.nonanonymous ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_non_anon}</li>` : ''} ${o.open ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_open_room}</li>` : ''} ${o.persistent ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_permanent_room}</li>` : ''} ${o.publicroom ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_public}</li>` : ''} ${o.semianonymous ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_semi_anon}</li>` : ''} ${o.temporary ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_temp_room}</li>` : ''} ${o.unmoderated ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="room-info">${i18n_unmoderated}</li>` : ''}</ul><p></p></div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-destroyed.js":
/*!**********************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-destroyed.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


const tplMoved = (o)=>{
    const i18n_moved = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The conversation has moved to a new address. Click the link below to enter.');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p class="moved-label">${i18n_moved}</p><p class="moved-link"><a class="switch-chat" @click="${(ev)=>o.onSwitch(ev)}">${o.moved_jid}</a></p>`;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    const i18n_non_existent = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This groupchat no longer exists');
    const i18n_reason = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The following reason was given: "%1$s"', o.reason || '');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="alert alert-danger"><h3 class="alert-heading disconnect-msg">${i18n_non_existent}</h3></div>${o.reason ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p class="destroyed-reason">${i18n_reason}</p>` : ''} ${o.moved_jid ? tplMoved(o) : ''}`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-disconnect.js":
/*!***********************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-disconnect.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((messages)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-danger"><h3 class="alert-heading disconnect-msg">${messages[0]}</h3>${messages.slice(1).map((m)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="disconnect-msg">${m}</p>`)}</div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-head.js":
/*!*****************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-head.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var shared_components_dropdown_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/components/dropdown.js */ "./src/shared/components/dropdown.js");
/* harmony import */ var shared_texture_components_texture_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/texture/components/texture.js */ "./src/shared/texture/components/texture.js");







/** @param {import('../heading').default} el} */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_user_settings_get, _el_user_settings, _el_model_vcard;
    const o = el.model.toJSON();
    const subject_hidden = (_el_user_settings = el.user_settings) === null || _el_user_settings === void 0 ? void 0 : (_el_user_settings_get = _el_user_settings.get('mucs_with_hidden_subject', [])) === null || _el_user_settings_get === void 0 ? void 0 : _el_user_settings_get.includes(el.model.get('jid'));
    const heading_buttons_promise = el.getHeadingButtons(subject_hidden);
    const i18n_hide_topic = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hide the groupchat topic');
    const subject = o.subject ? o.subject.text : '';
    const show_subject = subject && !subject_hidden;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chatbox-title ${show_subject ? '' : 'chatbox-title--no-desc'}"><div class="chatbox-title--row">${!_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.api.settings.get('singleton') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-controlbox-navback jid="${o.jid}"></converse-controlbox-navback>` : ''} <a data-room-jid="${el.model.get('jid')}" title="${(0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show more information on this groupchat')}" @click="${(ev)=>el.showRoomDetailsModal(ev)}"><converse-avatar .model="${el.model}" class="avatar align-self-center" name="${el.model.getDisplayName()}" nonce="${(_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.get('vcard_updated')}" height="40" width="40"></converse-avatar></a><div class="chatbox-title__text" role="heading" aria-level="2" title="${_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get('locked_muc_domain') !== 'hidden' ? o.jid : ''}">${el.model.getDisplayName()}</div></div><div class="chatbox-title__buttons btn-toolbar g-0">${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)((0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_4__.getStandaloneButtons)(heading_buttons_promise), '')} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)((0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_4__.getDropdownButtons)(heading_buttons_promise), '')}</div></div>${show_subject ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="chat-head__desc" title="${i18n_hide_topic}"><converse-texture text="${subject}" render_styling embed_audio></converse-texture></p>` : ''}`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-list.js":
/*!*****************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-list.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");




const form = (o)=>{
    const i18n_query = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Show groupchats');
    const i18n_server_address = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Server address');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<form class="converse-form list-chatrooms" @submit="${o.submitForm}"><div><label class="form-label" for="chatroom">${i18n_server_address}:</label> <input type="text" autofocus @change="${o.setDomainFromEvent}" value="${o.muc_domain || ''}" required="required" name="server" class="form-control" placeholder="${o.server_placeholder}"></div><input type="submit" class="btn btn-primary" name="list" value="${i18n_query}"></form>`;
};
const tplItem = (o, item)=>{
    const i18n_info_title = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Show more information on this groupchat');
    const i18n_open_title = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to open this groupchat');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="room-item list-group-item"><div class="available-chatroom d-flex flex-row"><a class="open-room available-room w-100" @click="${o.openRoom}" data-room-jid="${item.jid}" data-room-name="${item.name}" title="${i18n_open_title}" href="#">${item.name || item.jid}</a> <a class="right room-info icon-room-info" @click="${o.toggleRoomInfo}" data-room-jid="${item.jid}" title="${i18n_info_title}" href="#"></a></div></li>`;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`${o.show_form ? form(o) : ''}<ul class="available-chatrooms list-group">${o.loading_items ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="list-group-item">${(0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_3__["default"])()}</li>` : ''} ${o.feedback_text ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="list-group-item active">${o.feedback_text}</li>` : ''} ${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__.repeat)(o.items, (item)=>item.jid, (item)=>tplItem(o, item))}</ul>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-nickname-form.js":
/*!**************************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-nickname-form.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");



/**
 * @param {import('../nickname-form').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model, _el_model1, _el_model2;
    const i18n_nickname = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Nickname');
    const i18n_join = ((_el_model = el.model) === null || _el_model === void 0 ? void 0 : _el_model.isEntered()) ? (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Change nickname') : (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enter groupchat');
    const i18n_heading = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_show_logs_before_join') ? (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Choose a nickname to enter') : (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please choose your nickname');
    const validation_message = (_el_model1 = el.model) === null || _el_model1 === void 0 ? void 0 : _el_model1.get('nickname_validation_message');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="chatroom-form-container muc-nickname-form"><form class="converse-form chatroom-form converse-centered-form" @submit="${(ev)=>el.submitNickname(ev)}"><fieldset><label class="form-label">${i18n_heading}</label><p class="validation-message">${validation_message}</p><input type="text" required="required" name="nick" value="${((_el_model2 = el.model) === null || _el_model2 === void 0 ? void 0 : _el_model2.get('nick')) || ''}" class="form-control ${validation_message ? 'error' : ''}" placeholder="${i18n_nickname}"></fieldset><fieldset><input type="submit" class="btn btn-primary" name="join" value="${i18n_join}"></fieldset></form></div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-occupant.js":
/*!*********************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-occupant.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");



/**
 * @param {import('../occupant').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model, _el_model1, _el_model2, _el_model3, _el_model_get, _el_model4, _el_getVcard;
    const i18n_close = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hide');
    const i18n_no_occupant = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No participant data found');
    const i18n_participants = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Participants');
    const i18n_show_details = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show details');
    const jid = (_el_model = el.model) === null || _el_model === void 0 ? void 0 : _el_model.get('jid');
    const nick = (_el_model1 = el.model) === null || _el_model1 === void 0 ? void 0 : _el_model1.get('nick');
    const role = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.firstCharToUpperCase((_el_model2 = el.model) === null || _el_model2 === void 0 ? void 0 : _el_model2.get('role'));
    const affiliation = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.firstCharToUpperCase((_el_model3 = el.model) === null || _el_model3 === void 0 ? void 0 : _el_model3.get('affiliation'));
    const hats = ((_el_model4 = el.model) === null || _el_model4 === void 0 ? void 0 : (_el_model_get = _el_model4.get('hats')) === null || _el_model_get === void 0 ? void 0 : _el_model_get.length) ? el.model.get('hats').map(({ title })=>title) : [];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="sidebar-occupant"><div class="sidebar-heading"><span><button type="button" class="btn btn--transparent back-button" @click="${()=>el.muc.save({
            'sidebar_view': 'occupants'
        })}"><converse-icon size="1em" class="fa fa-arrow-left"></converse-icon></button> <a @click="${(ev)=>{
        ev.preventDefault();
        el.muc.save({
            'sidebar_view': 'occupants'
        });
    }}">${i18n_participants}</a></span><converse-dropdown .items="${[
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="dropdown-item show-occupant-modal" role="button" title="${i18n_show_details}" @click="${()=>el.showOccupantModal()}"><converse-icon class="fa fa-id-card" size="1em"></converse-icon>${i18n_show_details}</a>`,
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item" role="button" @click="${()=>el.closeSidebar()}"><converse-icon size="1em" class="fa fa-times"></converse-icon>${i18n_close}</a>`
    ]}"></converse-dropdown></div>${el.model ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row"><div class="col"><a title="${i18n_show_details}" @click="${()=>el.showOccupantModal()}"><converse-avatar .model="${el.model}" class="avatar modal-avatar justify-content-center" name="${el.model.getDisplayName()}" nonce="${(_el_getVcard = el.getVcard()) === null || _el_getVcard === void 0 ? void 0 : _el_getVcard.get('vcard_updated')}" height="120" width="120"></converse-avatar></a></div></div>` : ''}<ul class="occupant-details">${el.model ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${nick ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="occupant-details-nickname">${nick}</li>` : ''}<li class="occupant-details-jid">${jid ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a @click="${()=>el.openChat(jid)}">${jid}</a>` : ''}</li><li>${affiliation && affiliation !== 'None' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="badge text-bg-primary">${affiliation}</span>` : ''} ${role ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="badge text-bg-secondary">${role}</span>` : ''} ${hats.length ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${hats.map((h)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="badge text-bg-info">${h}</span>`)}` : ''}</li>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li>${i18n_no_occupant}</li>`}</ul>${el.model ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chat-body"><div class="chat-content chat-content-sendbutton" aria-live="polite"><converse-chat-content .model="${el.model}"></converse-chat-content></div><converse-occupant-bottom-panel .model="${el.model}" .muc="${el.muc}" class="bottom-panel"></converse-occupant-bottom-panel></div>` : ''}</span>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-occupants.js":
/*!**********************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-occupants.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_list_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/list-filter.js */ "./src/shared/components/list-filter.js");
/* harmony import */ var _sidebar_occupant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../sidebar-occupant.js */ "./src/plugins/muc-views/sidebar-occupant.js");
/* harmony import */ var _occupants_filter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./occupants-filter.js */ "./src/plugins/muc-views/templates/occupants-filter.js");
/**
 * @typedef {import('@converse/headless').MUCOccupant} MUCOccupant
 */ 





/**
 * @param {import('../occupants').default} el
 * @param {MUCOccupant} occ
 */ function isOccupantFiltered(el, occ) {
    if (!el.model.get('filter_visible')) return false;
    const type = el.filter.get('type');
    const q = type === 'state' ? el.filter.get('state').toLowerCase() : el.filter.get('text').toLowerCase();
    if (!q) return false;
    if (type === 'state') {
        var _occ_get;
        const presence = occ.get('presence');
        if (q === 'online') {
            return [
                "offline",
                "unavailable"
            ].includes(presence);
        } else if (q === 'ofline') {
            return presence === 'online';
        }
        return !((_occ_get = occ.get('show')) === null || _occ_get === void 0 ? void 0 : _occ_get.includes(q));
    } else if (type === 'items') {
        return !occ.getDisplayName().toLowerCase().includes(q);
    }
}
/**
 * @param {import('../occupants').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_participants = el.model.occupants === 1 ? (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Participant') : (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Participants');
    const i18n_close = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hide');
    const i18n_show_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show filter');
    const i18n_hide_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Hide filter');
    const is_filter_visible = el.model.get('filter_visible');
    const i18n_invite = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Invite someone');
    const i18n_invite_title = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Invite someone to join this groupchat');
    const btns = /** @type {TemplateResult[]} */ [];
    if (el.model.invitesAllowed()) {
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item open-invite-modal" role="button" title="${i18n_invite_title}" @click="${(/** @type {MouseEvent} */ ev)=>el.showInviteModal(ev)}"><converse-icon size="1em" class="fa fa-user-plus"></converse-icon>${i18n_invite}</a>`);
    }
    if (el.model.occupants.length > 5) {
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item toggle-filter" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.toggleFilter(ev)}"><converse-icon size="1em" class="fa fa-filter"></converse-icon>${is_filter_visible ? i18n_hide_filter : i18n_show_filter}</a>`);
    }
    if (btns.length) {
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.closeSidebar(ev)}"><converse-icon size="1em" class="fa fa-times"></converse-icon>${i18n_close}</a>`);
    } else {
        // Only a single button is shown, not a dropdown.
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<i class="hide-occupants" @click="${(/** @type {MouseEvent} */ ev)=>el.closeSidebar(ev)}"><converse-icon class="fa fa-times" size="1em"></converse-icon></i>`);
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="occupants"><div class="occupants-header"><div class="occupants-header--title"><span class="occupants-heading sidebar-heading">${el.model.occupants.length} ${i18n_participants}</span> ${btns.length === 1 ? btns[0] : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-dropdown class="chatbox-btn btn-group dropstart" .items="${btns}"></converse-dropdown>`}</div></div><ul class="items-list occupant-list">${is_filter_visible ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-list-filter @update="${()=>el.requestUpdate()}" .promise="${el.model.initialized}" .items="${el.model.occupants}" .template="${_occupants_filter_js__WEBPACK_IMPORTED_MODULE_5__["default"]}" .model="${el.filter}"></converse-list-filter>` : ''} ${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(el.model.occupants.models, (occ)=>occ.get('jid'), (occ)=>isOccupantFiltered(el, occ) ? '' : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-occupant-list-item .muc="${el.model}" .model="${occ}">`)}</ul></div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-password-form.js":
/*!**************************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-password-form.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    const i18n_heading = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This groupchat requires a password');
    const i18n_password = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Password: ');
    const i18n_submit = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Submit');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="converse-form chatroom-form converse-centered-form" @submit="${o.submitPassword}"><fieldset><label class="form-label">${i18n_heading}</label><p class="validation-message">${o.validation_message}</p><input class="hidden-username" aria-hidden="true" type="text" autocomplete="username" value="${o.jid}"><input type="password" name="password" required="required" class="form-control ${o.validation_message ? 'error' : ''}" placeholder="${i18n_password}"></fieldset><fieldset><input class="btn btn-primary" type="submit" value="${i18n_submit}"></fieldset></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc-sidebar.js":
/*!********************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc-sidebar.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/**
 * @param {import('../sidebar').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const model = el.model;
    const sidebar_view = model.get('sidebar_view') || '';
    const occupant_id = sidebar_view.split('occupant:').pop();
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(sidebar_view === null || sidebar_view === void 0 ? void 0 : sidebar_view.startsWith('occupant:')) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-occupant muc_jid="${el.jid}" occupant_id="${occupant_id}"></converse-muc-occupant>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-occupants jid="${el.jid}"></converse-muc-occupants>`}`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/muc.js":
/*!************************************************!*\
  !*** ./src/plugins/muc-views/templates/muc.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/muc-views/utils.js");
/* harmony import */ var _chatarea_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../chatarea.js */ "./src/plugins/muc-views/chatarea.js");
/* harmony import */ var _destroyed_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../destroyed.js */ "./src/plugins/muc-views/destroyed.js");
/* harmony import */ var _disconnected_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../disconnected.js */ "./src/plugins/muc-views/disconnected.js");
/* harmony import */ var _heading_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../heading.js */ "./src/plugins/muc-views/heading.js");
/* harmony import */ var _nickname_form_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../nickname-form.js */ "./src/plugins/muc-views/nickname-form.js");
/* harmony import */ var _password_form_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../password-form.js */ "./src/plugins/muc-views/password-form.js");










/**
 * @param {import('../muc').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const style = el.model ? (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_2__.getChatStyle)(el.model) : '';
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="flyout box-flyout" style="${style || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}">${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') === 'overlayed' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-dragresize></converse-dragresize>` : ''} ${el.model ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-heading jid="${el.model.get('jid')}" class="chat-head chat-head-chatroom row g-0"></converse-muc-heading><div class="chat-body chatroom-body row g-0">${(0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.getChatRoomBodyTemplate)(el.model)}</div>` : ''}</div>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/occupant-bottom-panel.js":
/*!******************************************************************!*\
  !*** ./src/plugins/muc-views/templates/occupant-bottom-panel.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _message_form_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../message-form.js */ "./src/plugins/muc-views/message-form.js");
/* harmony import */ var _nickname_form_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../nickname-form.js */ "./src/plugins/muc-views/nickname-form.js");
/* harmony import */ var shared_chat_toolbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/toolbar.js */ "./src/shared/chat/toolbar.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");






/**
 * @param {import('../occupant-bottom-panel').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const unread_msgs = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You have unread messages');
    const conn_status = el.muc.session.get('connection_status');
    const i18n_not_allowed = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("This user is not currently in this groupchat and can't receive messages.");
    const i18n_invite_tooltip = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Invite this user to join this groupchat');
    const i18n_open_chat_tooltip = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Open a one-on-one chat with this user');
    const i18n_open_chat = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Open Chat');
    const i18n_invite = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Invite');
    if (conn_status === _converse_headless__WEBPACK_IMPORTED_MODULE_4__.converse.ROOMSTATUS.ENTERED) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`${el.muc.ui.get('scrolled') && el.model.get('num_unread') ? (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<div class="new-msgs-indicator" @click="${(ev)=>el.viewUnreadMessages(ev)}">▼ ${unread_msgs} ▼</div>` : ''} ${el.canPostMessages() ? (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<converse-muc-message-form .model="${el.model}"></converse-muc-message-form>` : (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<div class="bottom-panel bottom-panel--muted"><p class="bottom-panel--muted__msg">${i18n_not_allowed}</p>${el.model.get('jid') ? (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`<button @click="${el.openChat}" type="button" class="btn btn-primary" title="${i18n_open_chat_tooltip}">${i18n_open_chat}</button> <button @click="${el.invite}" type="button" class="btn btn-secondary" title="${i18n_invite_tooltip}">${i18n_invite}</button>` : ''}</div>`}`;
    } else {
        return '';
    }
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/occupant.js":
/*!*****************************************************!*\
  !*** ./src/plugins/muc-views/templates/occupant.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/constants.js */ "./src/shared/constants.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var utils_color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! utils/color.js */ "./src/utils/color.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/**
 * @typedef {import('@converse/headless').MUCOccupant} MUCOccupant
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}







const i18n_occupant_hint = /** @param {MUCOccupant} o */ (o)=>{
    return (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Click to mention %1$s in your message.', o.get('nick'));
};
let badges_definitions; // will be initialized at first call (to be sure that the __ function is correctly loaded).
/**
 * Inits badges definitions.
 * For short labels, it will use the label first letter. If there is ambigous short labels, it will try to add up to 4 letters.
 * Letters will be uppercase.
 */ function initBadgesDefinitions() {
    badges_definitions = {};
    badges_definitions['owner'] = {
        label: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Owner'),
        classname: 'badge-groupchat'
    };
    badges_definitions['admin'] = {
        label: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Admin'),
        classname: 'badge-info'
    };
    badges_definitions['member'] = {
        label: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Member'),
        classname: 'badge-info'
    };
    badges_definitions['moderator'] = {
        label: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Moderator'),
        classname: 'badge-info'
    };
    badges_definitions['visitor'] = {
        label: (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Visitor'),
        classname: 'badge-secondary'
    };
    // And now we must compute unique short labels.
    let seen;
    for(let current_length = 1; current_length < 5 && (!seen || Object.values(seen).find((count)=>count > 1)); current_length++){
        const currently_seen = {};
        for (const definition of Object.values(badges_definitions)){
            var _seen_definition_shortlabel;
            if (!seen || ((_seen_definition_shortlabel = seen[definition.shortlabel]) !== null && _seen_definition_shortlabel !== void 0 ? _seen_definition_shortlabel : 0) >= 2) {
                var _currently_seen, _definition_shortlabel;
                // (first loop, or count >= 2 in the previous loop)
                definition.shortlabel = definition.label.substr(0, current_length).toLocaleUpperCase();
                var _;
                (_ = (_currently_seen = currently_seen)[_definition_shortlabel = definition.shortlabel]) !== null && _ !== void 0 ? _ : _currently_seen[_definition_shortlabel] = 0;
                currently_seen[definition.shortlabel]++;
            }
        }
        seen = currently_seen;
    }
}
/**
 * Badge template.
 * @param {string} badge_code The badge to use ('owner', 'admin', ...)
 */ function tplBadge(badge_code) {
    if (!badges_definitions) {
        initBadgesDefinitions();
    }
    const definition = badges_definitions[badge_code];
    if (!definition) {
        return '';
    }
    var _definition_classname;
    return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<span title="${definition.label}" aria-label="${definition.label}" class="badge ${(_definition_classname = definition.classname) !== null && _definition_classname !== void 0 ? _definition_classname : 'badge-info'}">${definition.shortlabel}</span>`;
}
/**
 * @param {MUCOccupant} o
 * @returns {string}
 */ function getOccupantTitle(o) {
    const role = o.get('role');
    const hint_occupant = i18n_occupant_hint(o);
    const i18n_moderator_hint = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This user is a moderator.');
    const i18n_participant_hint = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This user can send messages in this groupchat.');
    const i18n_visitor_hint = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This user can NOT send messages in this groupchat.');
    const spaced_jid = o.get('jid') ? `${o.get('jid')} ` : '';
    if (role === 'moderator') {
        return `${spaced_jid}${i18n_moderator_hint} ${hint_occupant}`;
    } else if (role === 'participant') {
        return `${spaced_jid}${i18n_participant_hint} ${hint_occupant}`;
    } else if (role === 'visitor') {
        return `${spaced_jid}${i18n_visitor_hint} ${hint_occupant}`;
    } else if (![
        'visitor',
        'participant',
        'moderator'
    ].includes(role)) {
        return `${spaced_jid}${hint_occupant}`;
    }
}
/**
 * @param {MUCOccupant} o
 */ function tplActionButtons(o) {
    return _async_to_generator(function*() {
        /**
     * *Hook* which allows plugins to add action buttons on occupants
     * @event _converse#getOccupantActionButtons
     * @example
     *  api.listen.on('getOccupantActionButtons', (el, buttons) => {
     *      buttons.push({
     *          'i18n_text': 'Foo',
     *          'handler': ev => alert('Foo!'),
     *          'button_class': 'chat-occupant__action-foo',
     *          'icon_class': 'fa fa-check',
     *          'name': 'foo'
     *      });
     *      return buttons;
     *  });
     */ const buttons = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.hook('getOccupantActionButtons', o, []);
        if (!(buttons === null || buttons === void 0 ? void 0 : buttons.length)) {
            return '';
        }
        const items = buttons.map((b)=>{
            return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<button class="dropdown-item ${b.button_class}" @click="${b.handler}" type="button"><converse-icon class="${b.icon_class}" color="var(--foreground-color)" size="1em" aria-hidden="true"></converse-icon> ${b.i18n_text}</button>`;
        });
        return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<converse-dropdown class="occupant-actions chatbox-btn" .items="${items}"></converse-dropdown>`;
    })();
}
/**
 * @param {import('../sidebar-occupant').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _o_vcard;
    const o = el.model;
    const { show, presence, affiliation } = el.model.attributes;
    const hint_show = shared_constants_js__WEBPACK_IMPORTED_MODULE_1__.PRETTY_CHAT_STATUS[show || presence];
    const role = o.get('role');
    let classes, color;
    if (show === 'chat' || !show && presence === 'online') {
        [classes, color] = [
            'fa fa-circle',
            'chat-status-online'
        ];
    } else if (show === 'dnd') {
        [classes, color] = [
            'fa fa-minus-circle',
            'chat-status-busy'
        ];
    } else if (show === 'away' || show === 'xa') {
        [classes, color] = [
            'fa fa-circle',
            'chat-status-away'
        ];
    } else {
        [classes, color] = [
            'fa fa-circle',
            'chat-status-offline'
        ];
    }
    const num_unread = (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_6__.getUnreadMsgsDisplay)(o);
    return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<li class="list-item occupant" id="${o.id}"><a @click="${(ev)=>el.onOccupantClicked(ev, o)}"><div class="row g-0"><div class="col-auto"><converse-avatar .model="${o}" class="avatar chat-msg__avatar" name="${o.getDisplayName()}" nonce="${(_o_vcard = o.vcard) === null || _o_vcard === void 0 ? void 0 : _o_vcard.get('vcard_updated')}" height="30" width="30"></converse-avatar><converse-icon title="${hint_show}" color="var(--${color})" size="0.82em" class="${classes} chat-status chat-status--avatar"></converse-icon>${num_unread ? (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<span class="msgs-indicator badge">${num_unread}</span>` : ''}</div><div class="col occupant-nick-badge"><span class="occupant-nick" title="${getOccupantTitle(o)}" style="${(0,utils_color_js__WEBPACK_IMPORTED_MODULE_5__.getAuthorStyle)(o)}">${o.getDisplayName()}</span> <span class="occupant-badges">${affiliation === 'owner' ? tplBadge('owner') : ''} ${affiliation === 'admin' ? tplBadge('admin') : ''} ${affiliation === 'member' ? tplBadge('member') : ''} ${role === 'moderator' ? tplBadge('moderator') : ''} ${role === 'visitor' ? tplBadge('visitor') : ''} </span>${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_4__.until)(tplActionButtons(o))}</div></div></a></li>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/occupants-filter.js":
/*!*************************************************************!*\
  !*** ./src/plugins/muc-views/templates/occupants-filter.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



/**
 * @param {import('shared/components/list-filter').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter');
    const title_contact_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter by name');
    const title_status_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter by status');
    const label_any = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Any');
    const label_online = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Online');
    const label_chatty = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Chatty');
    const label_busy = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Busy');
    const label_away = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Away');
    const label_xa = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Extended Away');
    const label_offline = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Offline');
    const chat_state = el.model.get('state');
    const filter_text = el.model.get('text');
    const filter_type = el.model.get('type');
    const is_overlay_mode = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('view_mode') === 'overlayed';
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="items-filter-form input-button-group ${!el.shouldBeVisible() ? 'hidden' : 'fade-in'}" @submit="${(ev)=>el.submitFilter(ev)}"><div class="${is_overlay_mode ? '' : 'flex-nowrap'}"><div class="filter-by d-flex flex-nowrap"><converse-icon size="1em" @click="${(ev)=>el.changeTypeFilter(ev)}" class="fa fa-user clickable ${filter_type === 'items' ? 'selected' : ''}" data-type="items" title="${title_contact_filter}"></converse-icon><converse-icon size="1em" @click="${(ev)=>el.changeTypeFilter(ev)}" class="fa fa-circle clickable ${filter_type === 'state' ? 'selected' : ''}" data-type="state" title="${title_status_filter}"></converse-icon></div><div class="btn-group"><input .value="${filter_text || ''}" @keydown="${(ev)=>el.liveFilter(ev)}" class="items-filter form-control ${filter_type === 'state' ? 'hidden' : ''}" placeholder="${i18n_placeholder}"><converse-icon size="1em" class="fa fa-times clear-input ${!filter_text || filter_type === 'state' ? 'hidden' : ''}" @click="${(ev)=>el.clearFilter(ev)}"></converse-icon></div><select class="form-control state-type ${filter_type !== 'state' ? 'hidden' : ''}" @change="${(ev)=>el.changeChatStateFilter(ev)}"><option value="">${label_any}</option><option ?selected="${chat_state === 'online'}" value="online">${label_online}</option><option ?selected="${chat_state === 'chat'}" value="chat">${label_chatty}</option><option ?selected="${chat_state === 'dnd'}" value="dnd">${label_busy}</option><option ?selected="${chat_state === 'away'}" value="away">${label_away}</option><option ?selected="${chat_state === 'xa'}" value="xa">${label_xa}</option><option ?selected="${chat_state === 'offline'}" value="offline">${label_offline}</option></select></div></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/templates/role-form.js":
/*!******************************************************!*\
  !*** ./src/plugins/muc-views/templates/role-form.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import('../role-form').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_change_role = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change role');
    const i18n_new_role = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New Role');
    const i18n_reason = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reason');
    const occupant = el.muc.getOwnOccupant();
    const assignable_roles = occupant.getAssignableRoles();
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="role-form" @submit="${el.assignRole}"><input type="hidden" name="jid" value="${el.jid}"> <input type="hidden" name="nick" value="${el.nick}"><div class="mb-3"><div class="row"><div class="col-md-6"><label class="form-label"><strong>${i18n_new_role}:</strong></label> <select class="form-select select-role" name="role">${assignable_roles.map((role)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<option value="${role}" ?selected="${role === el.role}">${role}</option>`)}</select></div><div class="col-md-6"><label class="form-label"><strong>${i18n_reason}:</strong></label> <input class="form-control" type="text" name="reason" placeholder="${i18n_reason}"></div></div></div><div class="text-end"><button type="submit" class="btn btn-primary">${i18n_change_role}</button></div></form>`;
});


/***/ }),

/***/ "./src/plugins/muc-views/utils.js":
/*!****************************************!*\
  !*** ./src/plugins/muc-views/utils.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   clearHistory: () => (/* binding */ clearHistory),
/* harmony export */   confirmDirectMUCInvitation: () => (/* binding */ confirmDirectMUCInvitation),
/* harmony export */   destroyMUC: () => (/* binding */ destroyMUC),
/* harmony export */   getAutoCompleteList: () => (/* binding */ getAutoCompleteList),
/* harmony export */   getAutoCompleteListItem: () => (/* binding */ getAutoCompleteListItem),
/* harmony export */   getChatRoomBodyTemplate: () => (/* binding */ getChatRoomBodyTemplate),
/* harmony export */   getNicknameRequiredTemplate: () => (/* binding */ getNicknameRequiredTemplate),
/* harmony export */   parseMessageForMUCCommands: () => (/* binding */ parseMessageForMUCCommands),
/* harmony export */   showModeratorToolsModal: () => (/* binding */ showModeratorToolsModal),
/* harmony export */   showOccupantModal: () => (/* binding */ showOccupantModal)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _modals_occupant_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modals/occupant.js */ "./src/plugins/muc-views/modals/occupant.js");
/* harmony import */ var _modals_moderator_tools_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modals/moderator-tools.js */ "./src/plugins/muc-views/modals/moderator-tools.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/**
 * @typedef {import('@converse/headless/types/plugins/muc/muc.js').default} MUC
 * @typedef {import("shared/avatar/avatar").default} Avatar
 * @typedef {import("shared/autocomplete/suggestion").default} Suggestion
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { Strophe, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
const COMMAND_TO_AFFILIATION = {
    admin: 'admin',
    ban: 'outcast',
    member: 'member',
    owner: 'owner',
    revoke: 'none'
};
const COMMAND_TO_ROLE = {
    deop: 'participant',
    kick: 'none',
    mute: 'visitor',
    op: 'moderator',
    voice: 'participant'
};
/**
 * Presents a confirmation modal to the user asking them to accept or decline a
 * MUC invitation.
 * @async
 */ function confirmDirectMUCInvitation({ contact, jid, reason }) {
    if (!reason) {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Invitation to a groupchat'), (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('%1$s has invited you to join the groupchat "%2$s"', contact, jid));
    } else {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Invitation to a groupchat'), (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('%1$s has invited you to join the groupchat "%2$s", and left the following reason: "%3$s"', contact, jid, reason));
    }
}
/**
 * @param {string} jid
 */ function clearHistory(jid) {
    if (location.hash === `converse/room?jid=${jid}`) {
        history.pushState(null, '', window.location.pathname);
    }
}
/**
 * @param {MUC} model
 */ function destroyMUC(model) {
    return _async_to_generator(function*() {
        const messages = [
            (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Are you sure you want to destroy this groupchat?')
        ];
        let fields = [
            {
                'name': 'challenge',
                'label': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Please enter the XMPP address of this groupchat to confirm'),
                'challenge': model.get('jid'),
                'placeholder': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('name@example.org'),
                'required': true
            },
            {
                'name': 'reason',
                'label': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Optional reason for destroying this groupchat'),
                'placeholder': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Reason')
            },
            {
                'name': 'newjid',
                'label': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Optional XMPP address for a new groupchat that replaces this one'),
                'placeholder': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('replacement@example.org')
            }
        ];
        try {
            var _fields_filter_pop, _fields_filter_pop1;
            fields = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Confirm'), messages, fields);
            const reason = (_fields_filter_pop = fields.filter((f)=>f.name === 'reason').pop()) === null || _fields_filter_pop === void 0 ? void 0 : _fields_filter_pop.value;
            const newjid = (_fields_filter_pop1 = fields.filter((f)=>f.name === 'newjid').pop()) === null || _fields_filter_pop1 === void 0 ? void 0 : _fields_filter_pop1.value;
            return model.sendDestroyIQ(reason, newjid).then(()=>model.close());
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
        }
    })();
}
/**
 * @param {MUC} model
 */ function getNicknameRequiredTemplate(model) {
    const jid = model.get('jid');
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_show_logs_before_join')) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-chatarea class="row g-0" jid="${jid}"></converse-muc-chatarea>`;
    } else {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-nickname-form jid="${jid}"></converse-muc-nickname-form>`;
    }
}
/**
 * @param {MUC} model
 */ function getChatRoomBodyTemplate(model) {
    const view = model.session.get('view');
    const jid = model.get('jid');
    const RS = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.ROOMSTATUS;
    const conn_status = model.session.get('connection_status');
    if (view === _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.MUC.VIEWS.CONFIG) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-config-form class="muc-form-container" jid="${jid}"></converse-muc-config-form>`;
    } else {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${conn_status == RS.PASSWORD_REQUIRED ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-password-form class="muc-form-container" jid="${jid}"></converse-muc-password-form>` : ''} ${conn_status == RS.ENTERED ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-chatarea class="row g-0" jid="${jid}"></converse-muc-chatarea>` : ''} ${conn_status == RS.CONNECTING ? (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_4__["default"])({
            class: 'vertically-centered'
        }) : ''} ${conn_status == RS.NICKNAME_REQUIRED ? getNicknameRequiredTemplate(model) : ''} ${conn_status == RS.DISCONNECTED ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-disconnected jid="${jid}"></converse-muc-disconnected>` : ''} ${conn_status == RS.BANNED ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-disconnected jid="${jid}"></converse-muc-disconnected>` : ''} ${conn_status == RS.DESTROYED ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-muc-destroyed jid="${jid}"></converse-muc-destroyed>` : ''}`;
    }
}
/**
 * @param {MUC} muc
 * @param {Suggestion} text
 * @param {string} input
 * @returns {import('lit').TemplateResult} The rendered HTML for the item.
 */ function getAutoCompleteListItem(muc, text, input) {
    input = input.trim();
    let avatar_model;
    const show_avatar = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_mention_autocomplete_show_avatar');
    if (show_avatar) {
        const t = text.label.toLowerCase();
        avatar_model = muc.occupants.findWhere((o)=>{
            var _o_getDisplayName_toLowerCase, _o_getDisplayName, _o_get_toLowerCase, _o_get, _o_get_toLowerCase1, _o_get1;
            if ((_o_getDisplayName = o.getDisplayName()) === null || _o_getDisplayName === void 0 ? void 0 : (_o_getDisplayName_toLowerCase = _o_getDisplayName.toLowerCase()) === null || _o_getDisplayName_toLowerCase === void 0 ? void 0 : _o_getDisplayName_toLowerCase.startsWith(t)) {
                return o;
            } else if ((_o_get = o.get('nickname')) === null || _o_get === void 0 ? void 0 : (_o_get_toLowerCase = _o_get.toLowerCase()) === null || _o_get_toLowerCase === void 0 ? void 0 : _o_get_toLowerCase.startsWith(t)) {
                return o;
            } else if ((_o_get1 = o.get('jid')) === null || _o_get1 === void 0 ? void 0 : (_o_get_toLowerCase1 = _o_get1.toLowerCase()) === null || _o_get_toLowerCase1 === void 0 ? void 0 : _o_get_toLowerCase1.startsWith(t)) {
                return o;
            }
        });
    }
    const regex = new RegExp('(' + input + ')', 'ig');
    const parts = input ? text.split(regex) : [
        text
    ];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li aria-selected="false">${show_avatar ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-avatar .model="${avatar_model}" name="${avatar_model.getDisplayName()}" height="22" width="22" class="avatar avatar-autocomplete"></converse-avatar>` : ''} <span class="autocomplete-item">${parts.map((txt)=>input && txt.match(regex) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<mark>${txt}</mark>` : txt)}</span></li>`;
}
function getAutoCompleteList() {
    return _async_to_generator(function*() {
        const models = [
            ...yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.rooms.get(),
            ...yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.contacts.get()
        ];
        const jids = [
            ...new Set(models.map((o)=>Strophe.getDomainFromJid(o.get('jid'))))
        ];
        return jids;
    })();
}
/**
 * @param {MUC} muc
 */ function setRole(muc, command, args, required_affiliations = [], required_roles = []) {
    const role = COMMAND_TO_ROLE[command];
    if (!role) {
        throw Error(`ChatRoomView#setRole called with invalid command: ${command}`);
    }
    if (!muc.verifyAffiliations(required_affiliations) || !muc.verifyRoles(required_roles)) {
        return false;
    }
    if (!muc.validateRoleOrAffiliationChangeArgs(command, args)) {
        return false;
    }
    const nick_or_jid = muc.getNickOrJIDFromCommandArgs(args);
    if (!nick_or_jid) {
        return false;
    }
    const reason = args.split(nick_or_jid, 2)[1].trim();
    // We're guaranteed to have an occupant due to getNickOrJIDFromCommandArgs
    const occupant = muc.getOccupant(nick_or_jid);
    muc.setRole(occupant, role, reason, undefined, (e)=>muc.onCommandError(e));
    return true;
}
/**
 * @param {MUC} muc
 */ function verifyAndSetAffiliation(muc, command, args, required_affiliations) {
    const affiliation = COMMAND_TO_AFFILIATION[command];
    if (!affiliation) {
        throw Error(`verifyAffiliations called with invalid command: ${command}`);
    }
    if (!muc.verifyAffiliations(required_affiliations)) {
        return false;
    }
    if (!muc.validateRoleOrAffiliationChangeArgs(command, args)) {
        return false;
    }
    const nick_or_jid = muc.getNickOrJIDFromCommandArgs(args);
    if (!nick_or_jid) {
        return false;
    }
    let jid;
    const reason = args.split(nick_or_jid, 2)[1].trim();
    const occupant = muc.getOccupant(nick_or_jid);
    if (occupant) {
        jid = occupant.get('jid');
    } else {
        if (u.isValidJID(nick_or_jid)) {
            jid = nick_or_jid;
        } else {
            const message = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Couldn't find a participant with that nickname. " + 'They might have left the groupchat.');
            muc.createMessage({
                message,
                'type': 'error'
            });
            return;
        }
    }
    const attrs = {
        jid,
        reason
    };
    if (occupant && _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('auto_register_muc_nickname')) {
        attrs['nick'] = occupant.get('nick');
    }
    u.muc.setAffiliation(affiliation, muc.get('jid'), [
        attrs
    ]).then(()=>muc.occupants.fetchMembers()).catch((err)=>muc.onCommandError(err));
}
/**
 * @param {MUC} muc
 * @param {string} [affiliation]
 */ function showModeratorToolsModal(muc, affiliation) {
    if (!muc.verifyRoles([
        'moderator'
    ])) {
        return;
    }
    let modal = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.get('converse-modtools-modal');
    if (modal) {
        modal.affiliation = affiliation;
        modal.render();
    } else {
        modal = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.create('converse-modtools-modal', {
            affiliation,
            'jid': muc.get('jid')
        });
    }
    modal.show();
}
function showOccupantModal(ev, occupant) {
    _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-muc-occupant-modal', {
        'model': occupant
    }, ev);
}
function parseMessageForMUCCommands(data, handled) {
    const model = data.model;
    if (handled || model.get('type') !== CHATROOMS_TYPE || _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_disable_slash_commands') && !Array.isArray(_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_disable_slash_commands'))) {
        return handled;
    }
    let text = data.text;
    text = text.replace(/^\s*/, '');
    const command = (text.match(/^\/([a-zA-Z]*) ?/) || [
        ''
    ]).pop().toLowerCase();
    if (!command) {
        return false;
    }
    const args = text.slice(('/' + command).length + 1).trim();
    var _model_getAllowedCommands;
    const allowed_commands = (_model_getAllowedCommands = model.getAllowedCommands()) !== null && _model_getAllowedCommands !== void 0 ? _model_getAllowedCommands : [];
    if (command === 'admin' && allowed_commands.includes(command)) {
        verifyAndSetAffiliation(model, command, args, [
            'owner'
        ]);
        return true;
    } else if (command === 'ban' && allowed_commands.includes(command)) {
        verifyAndSetAffiliation(model, command, args, [
            'admin',
            'owner'
        ]);
        return true;
    } else if (command === 'modtools' && allowed_commands.includes(command)) {
        showModeratorToolsModal(model, args);
        return true;
    } else if (command === 'deop' && allowed_commands.includes(command)) {
        // FIXME: /deop only applies to setting a moderators
        // role to "participant" (which only admin/owner can
        // do). Moderators can however set non-moderator's role
        // to participant (e.g. visitor => participant).
        // Currently we don't distinguish between these two
        // cases.
        setRole(model, command, args, [
            'admin',
            'owner'
        ]);
        return true;
    } else if (command === 'destroy' && allowed_commands.includes(command)) {
        if (!model.verifyAffiliations([
            'owner'
        ])) {
            return true;
        }
        destroyMUC(model).catch((e)=>model.onCommandError(e));
        return true;
    } else if (command === 'help' && allowed_commands.includes(command)) {
        model.set({
            'show_help_messages': false
        }, {
            'silent': true
        });
        model.set({
            'show_help_messages': true
        });
        return true;
    } else if (command === 'kick' && allowed_commands.includes(command)) {
        setRole(model, command, args, [], [
            'moderator'
        ]);
        return true;
    } else if (command === 'mute' && allowed_commands.includes(command)) {
        setRole(model, command, args, [], [
            'moderator'
        ]);
        return true;
    } else if (command === 'member' && allowed_commands.includes(command)) {
        verifyAndSetAffiliation(model, command, args, [
            'admin',
            'owner'
        ]);
        return true;
    } else if (command === 'nick' && allowed_commands.includes(command)) {
        if (!model.verifyRoles([
            'visitor',
            'participant',
            'moderator'
        ])) {
            return true;
        } else if (args.length === 0) {
            // e.g. Your nickname is "coolguy69"
            const message = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Your nickname is "%1$s"', model.get('nick'));
            model.createMessage({
                message,
                'type': 'error'
            });
        } else {
            model.setNickname(args);
        }
        return true;
    } else if (command === 'owner' && allowed_commands.includes(command)) {
        verifyAndSetAffiliation(model, command, args, [
            'owner'
        ]);
        return true;
    } else if (command === 'op' && allowed_commands.includes(command)) {
        setRole(model, command, args, [
            'admin',
            'owner'
        ]);
        return true;
    } else if (command === 'register' && allowed_commands.includes(command)) {
        if (args.length > 1) {
            model.createMessage({
                'message': (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Error: invalid number of arguments'),
                'type': 'error'
            });
        } else {
            model.registerNickname().then((err_msg)=>{
                err_msg && model.createMessage({
                    'message': err_msg,
                    'type': 'error'
                });
            });
        }
        return true;
    } else if (command === 'revoke' && allowed_commands.includes(command)) {
        verifyAndSetAffiliation(model, command, args, [
            'admin',
            'owner'
        ]);
        return true;
    } else if (command === 'topic' && allowed_commands.includes(command) || command === 'subject' && allowed_commands.includes(command)) {
        model.setSubject(args);
        return true;
    } else if (command === 'voice' && allowed_commands.includes(command)) {
        setRole(model, command, args, [], [
            'moderator'
        ]);
        return true;
    } else {
        return false;
    }
}


/***/ }),

/***/ "./src/plugins/notifications/index.js":
/*!********************************************!*\
  !*** ./src/plugins/notifications/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/notifications/utils.js");
/**
 * @module converse-notification
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-notification', {
    dependencies: [
        'converse-chatboxes'
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            // ^ a list of JIDs to ignore concerning chat state notifications
            chatstate_notification_blacklist: [],
            notification_delay: 5000,
            notification_icon: '/images/logo/conversejs-filled.svg',
            notify_all_room_messages: false,
            notify_nicknames_without_references: false,
            play_sounds: true,
            show_chat_state_notifications: false,
            show_desktop_notifications: true,
            show_tab_notifications: true,
            sounds_path: _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('assets_path') + '/sounds/'
        });
        /************************ Event Handlers ************************/ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('clearSession', _utils_js__WEBPACK_IMPORTED_MODULE_1__.clearFavicon); // Needed for tests
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil('chatBoxesInitialized').then(()=>{
            const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
            chatboxes.on('change:num_unread', _utils_js__WEBPACK_IMPORTED_MODULE_1__.updateUnreadFavicon);
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('pluginsInitialized', function() {
            // We only register event handlers after all plugins are
            // registered, because other plugins might override some of our
            // handlers.
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('contactRequest', _utils_js__WEBPACK_IMPORTED_MODULE_1__.handleContactRequestNotification);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('contactPresenceChanged', _utils_js__WEBPACK_IMPORTED_MODULE_1__.handleChatStateNotification);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('message', _utils_js__WEBPACK_IMPORTED_MODULE_1__.handleMessageNotification);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('feedback', _utils_js__WEBPACK_IMPORTED_MODULE_1__.handleFeedback);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('connected', _utils_js__WEBPACK_IMPORTED_MODULE_1__.requestPermission);
        });
    }
});


/***/ }),

/***/ "./src/plugins/notifications/utils.js":
/*!********************************************!*\
  !*** ./src/plugins/notifications/utils.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   areDesktopNotificationsEnabled: () => (/* binding */ areDesktopNotificationsEnabled),
/* harmony export */   clearFavicon: () => (/* binding */ clearFavicon),
/* harmony export */   handleChatStateNotification: () => (/* binding */ handleChatStateNotification),
/* harmony export */   handleContactRequestNotification: () => (/* binding */ handleContactRequestNotification),
/* harmony export */   handleFeedback: () => (/* binding */ handleFeedback),
/* harmony export */   handleMessageNotification: () => (/* binding */ handleMessageNotification),
/* harmony export */   isMessageToHiddenChat: () => (/* binding */ isMessageToHiddenChat),
/* harmony export */   requestPermission: () => (/* binding */ requestPermission),
/* harmony export */   shouldNotifyOfGroupMessage: () => (/* binding */ shouldNotifyOfGroupMessage),
/* harmony export */   showFeedbackNotification: () => (/* binding */ showFeedbackNotification),
/* harmony export */   updateUnreadFavicon: () => (/* binding */ updateUnreadFavicon)
/* harmony export */ });
/* harmony import */ var favico_js_slevomat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! favico.js-slevomat */ "./node_modules/favico.js-slevomat/favico.js");
/* harmony import */ var favico_js_slevomat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(favico_js_slevomat__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @typedef {import('@converse/headless/plugins/muc/types').MUCMessageAttributes} MUCMessageAttributes
 * @typedef {module:headless-plugins-muc-muc.MUCMessageData} MUCMessageData
 * @typedef {module:headless-plugins-chat-utils.MessageData} MessageData
 * @typedef {import('@converse/headless').RosterContact} RosterContact
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



const { Strophe, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env;
const { isEmptyMessage, isTestEnv } = u;
const supports_html5_notification = 'Notification' in window;
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env.Favico = (favico_js_slevomat__WEBPACK_IMPORTED_MODULE_0___default());
let favicon;
/**
 * @param {string} from - The JID of the sender
 * @returns {boolean}
 */ function isMessageToHiddenChat(from) {
    var _converse_state_chatboxes_get;
    var _converse_state_chatboxes_get_isHidden;
    return isTestEnv() || ((_converse_state_chatboxes_get_isHidden = (_converse_state_chatboxes_get = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.chatboxes.get(from)) === null || _converse_state_chatboxes_get === void 0 ? void 0 : _converse_state_chatboxes_get.isHidden()) !== null && _converse_state_chatboxes_get_isHidden !== void 0 ? _converse_state_chatboxes_get_isHidden : false) || document.hidden;
}
function areDesktopNotificationsEnabled() {
    return isTestEnv() || supports_html5_notification && _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_desktop_notifications') && Notification.permission === 'granted';
}
/**
 * @typedef {Navigator & {clearAppBadge: Function, setAppBadge: Function} } navigator
 */ function clearFavicon() {
    var _navigator_clearAppBadge, /** @type navigator */ _navigator;
    favicon === null || favicon === void 0 ? void 0 : favicon.badge(0);
    favicon = null;
    (_navigator_clearAppBadge = (_navigator = navigator).clearAppBadge) === null || _navigator_clearAppBadge === void 0 ? void 0 : _navigator_clearAppBadge.call(_navigator).catch((e)=>_converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error('Could not clear unread count in app badge ' + e));
}
function updateUnreadFavicon() {
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_tab_notifications')) {
        var _navigator_setAppBadge, /** @type navigator */ _navigator;
        favicon = favicon !== null && favicon !== void 0 ? favicon : new _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env.Favico({
            type: 'circle',
            animation: 'pop'
        });
        const chats = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.chatboxes.models;
        const num_unread = chats.reduce((acc, chat)=>acc + (chat.get('num_unread') || 0), 0);
        favicon.badge(num_unread);
        (_navigator_setAppBadge = (_navigator = navigator).setAppBadge) === null || _navigator_setAppBadge === void 0 ? void 0 : _navigator_setAppBadge.call(_navigator, num_unread).catch((e)=>_converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error('Could set unread count in app badge - ' + e));
    }
}
/**
 * @param {Array<Object>} references - A list of objects representing XEP-0372 references
 * @param {string} muc_jid
 * @param {string} nick
 */ function isReferenced(references, muc_jid, nick) {
    const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get('bare_jid');
    const check = (r)=>[
            bare_jid,
            `${muc_jid}/${nick}`
        ].includes(r.uri.replace(/^xmpp:/, ''));
    return references.reduce((acc, r)=>acc || r.uri && check(r), false);
}
/**
 * Is this a group message for which we should notify the user?
 * @param {MUCMessageAttributes} attrs
 */ function shouldNotifyOfGroupMessage(attrs) {
    return _async_to_generator(function*() {
        if (!(attrs === null || attrs === void 0 ? void 0 : attrs.body) && !(attrs === null || attrs === void 0 ? void 0 : attrs.message)) {
            // attrs.message is used by 'info' messages
            return false;
        }
        const jid = attrs.from;
        const muc_jid = attrs.from_muc;
        const notify_all = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notify_all_room_messages');
        const room = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.chatboxes.get(muc_jid);
        const resource = Strophe.getResourceFromJid(jid);
        const sender = resource && Strophe.unescapeNode(resource) || '';
        let is_mentioned = false;
        const nick = room.get('nick');
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notify_nicknames_without_references')) {
            is_mentioned = new RegExp(`\\b${nick}\\b`).test(attrs.body);
        }
        const is_not_mine = sender !== nick;
        const should_notify_user = notify_all === true || Array.isArray(notify_all) && notify_all.includes(muc_jid) || isReferenced(attrs.references, muc_jid, nick) || is_mentioned;
        if (is_not_mine && !!should_notify_user) {
            /**
         * *Hook* which allows plugins to run further logic to determine
         * whether a notification should be sent out for this message.
         * @event _converse#shouldNotifyOfGroupMessage
         * @example
         *  api.listen.on('shouldNotifyOfGroupMessage', (should_notify) => {
         *      return should_notify && flurb === floob;
         *  });
         */ const should_notify = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.hook('shouldNotifyOfGroupMessage', attrs, true);
            return should_notify;
        }
        return false;
    })();
}
function shouldNotifyOfInfoMessage(attrs) {
    return _async_to_generator(function*() {
        if (!attrs.from_muc) {
            return false;
        }
        const room = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.rooms.get(attrs.from_muc);
        if (!room) {
            return false;
        }
        const nick = room.get('nick');
        const muc_jid = attrs.from_muc;
        const notify_all = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notify_all_room_messages');
        return notify_all === true || Array.isArray(notify_all) && notify_all.includes(muc_jid) || isReferenced(attrs.references, muc_jid, nick);
    })();
}
/**
 * @async
 * @method shouldNotifyOfMessage
 * @param {MessageData|MUCMessageData} data
 */ function shouldNotifyOfMessage(data) {
    const { attrs } = data;
    if (!attrs || attrs.is_forwarded) {
        return false;
    }
    if (attrs['type'] === 'groupchat') {
        return shouldNotifyOfGroupMessage(attrs);
    } else if (attrs['type'] === 'info') {
        return shouldNotifyOfInfoMessage(attrs);
    } else if (attrs.is_headline) {
        // We want to show notifications for headline messages.
        return isMessageToHiddenChat(attrs);
    }
    const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get('bare_jid');
    const is_me = Strophe.getBareJidFromJid(attrs.from) === bare_jid;
    return !isEmptyMessage(attrs) && !is_me && (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_desktop_notifications') === 'all' || isMessageToHiddenChat(attrs));
}
function showFeedbackNotification(data) {
    if (data.klass === 'error' || data.klass === 'warn') {
        const n = new Notification(data.subject, {
            body: data.message,
            lang: i18n__WEBPACK_IMPORTED_MODULE_1__.i18n.getLocale(),
            icon: _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_icon')
        });
        setTimeout(n.close.bind(n), 5000);
    }
}
/**
 * Creates an HTML5 Notification to inform of a change in a
 * contact's chat state.
 * @param {RosterContact} contact
 */ function showChatStateNotification(contact) {
    var _api_settings_get;
    if ((_api_settings_get = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('chatstate_notification_blacklist')) === null || _api_settings_get === void 0 ? void 0 : _api_settings_get.includes(contact.get('jid'))) {
        // Don't notify if the user is being ignored.
        return;
    }
    const chat_state = contact.presence.get('show');
    let message = null;
    if (chat_state === 'offline') {
        message = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('has gone offline');
    } else if (chat_state === 'away') {
        message = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('has gone away');
    } else if (chat_state === 'dnd') {
        message = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('is busy');
    } else if (chat_state === 'online') {
        message = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('has come online');
    }
    if (message === null) {
        return;
    }
    const n = new Notification(contact.getDisplayName(), {
        body: message,
        lang: i18n__WEBPACK_IMPORTED_MODULE_1__.i18n.getLocale(),
        icon: _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_icon')
    });
    setTimeout(()=>n.close(), 5000);
}
/**
 * Shows an HTML5 Notification with the passed in message
 * @param {MessageData|MUCMessageData} data
 */ function showMessageNotification(data) {
    const { attrs } = data;
    if (attrs.is_error) {
        return;
    }
    if (!areDesktopNotificationsEnabled()) {
        return;
    }
    let title, roster_item;
    const full_from_jid = attrs.from;
    const from_jid = Strophe.getBareJidFromJid(full_from_jid);
    if (attrs.type == 'info') {
        title = attrs.message;
    } else if (attrs.type === 'headline') {
        if (!from_jid.includes('@') || _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_non_roster_messaging')) {
            title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Notification from %1$s', from_jid);
        } else {
            return;
        }
    } else if (!from_jid.includes('@')) {
        // workaround for Prosody which doesn't give type "headline"
        title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Notification from %1$s', from_jid);
    } else if (attrs.type === 'groupchat') {
        title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s says', Strophe.getResourceFromJid(full_from_jid));
    } else {
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.roster === undefined) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error('Could not send notification, because roster is undefined');
            return;
        }
        roster_item = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.roster.get(from_jid);
        if (roster_item !== undefined) {
            title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s says', roster_item.getDisplayName());
        } else {
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_non_roster_messaging')) {
                title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s says', from_jid);
            } else {
                return;
            }
        }
    }
    let body;
    if (attrs.type == 'info') {
        body = attrs.reason;
    } else {
        body = attrs.is_encrypted ? attrs.plaintext : attrs.body;
        if (!body) {
            return;
        }
    }
    const n = new Notification(title, {
        body,
        lang: i18n__WEBPACK_IMPORTED_MODULE_1__.i18n.getLocale(),
        icon: _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_icon'),
        requireInteraction: !_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_delay')
    });
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_delay')) {
        setTimeout(()=>n.close(), _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_delay'));
    }
    n.onclick = function(event) {
        event.preventDefault();
        window.focus();
        const chat = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.chatboxes.get(from_jid);
        chat.maybeShow(true);
    };
}
function playSoundNotification() {
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('play_sounds') && window.Audio !== undefined) {
        const audioOgg = new Audio(_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('sounds_path') + 'msg_received.ogg');
        const canPlayOgg = audioOgg.canPlayType('audio/ogg');
        if (canPlayOgg === 'probably') {
            return audioOgg.play();
        }
        const audioMp3 = new Audio(_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('sounds_path') + 'msg_received.mp3');
        const canPlayMp3 = audioMp3.canPlayType('audio/mp3');
        if (canPlayMp3 === 'probably') {
            audioMp3.play();
        } else if (canPlayOgg === 'maybe') {
            audioOgg.play();
        } else if (canPlayMp3 === 'maybe') {
            audioMp3.play();
        }
    }
}
/**
 * Event handler for the on('message') event. Will call methods
 * to play sounds and show HTML5 notifications.
 */ function handleMessageNotification(data) {
    return _async_to_generator(function*() {
        if (!(yield shouldNotifyOfMessage(data))) {
            return false;
        }
        /**
     * Triggered when a notification (sound or HTML5 notification) for a new
     * message has will be made.
     * @event _converse#messageNotification
     * @type {MessageData|MUCMessageData}
     * @example _converse.api.listen.on('messageNotification', data => { ... });
     */ _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.trigger('messageNotification', data);
        try {
            playSoundNotification();
        } catch (error) {
            // Likely "play() failed because the user didn't interact with the document first"
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(error);
        }
        showMessageNotification(data);
    })();
}
function handleFeedback(data) {
    if (areDesktopNotificationsEnabled()) {
        showFeedbackNotification(data);
    }
}
/**
 * Event handler for on('contactPresenceChanged').
 * Will show an HTML5 notification to indicate that the chat status has changed.
 * @param {RosterContact} contact
 */ function handleChatStateNotification(contact) {
    if (areDesktopNotificationsEnabled() && _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_chat_state_notifications')) {
        showChatStateNotification(contact);
    }
}
/**
 * @param {RosterContact} contact
 */ function showContactRequestNotification(contact) {
    const n = new Notification(contact.getDisplayName(), {
        body: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('wants to be your contact'),
        lang: i18n__WEBPACK_IMPORTED_MODULE_1__.i18n.getLocale(),
        icon: _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('notification_icon')
    });
    setTimeout(()=>n.close(), 5000);
}
/**
 * @param {RosterContact} contact
 */ function handleContactRequestNotification(contact) {
    if (areDesktopNotificationsEnabled()) {
        showContactRequestNotification(contact);
    }
}
function requestPermission() {
    if (supports_html5_notification && ![
        'denied',
        'granted'
    ].includes(Notification.permission)) {
        // Ask user to enable HTML5 notifications
        Notification.requestPermission();
    }
}


/***/ }),

/***/ "./src/plugins/omemo/api.js":
/*!**********************************!*\
  !*** ./src/plugins/omemo/api.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/omemo/utils.js");
/* harmony import */ var _store_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./store.js */ "./src/plugins/omemo/store.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    /**
     * The "omemo" namespace groups methods relevant to OMEMO
     * encryption.
     *
     * @namespace _converse.api.omemo
     * @memberOf _converse.api
     */ omemo: {
        /**
         * Returns the device ID of the current device.
         */ getDeviceID () {
            return _async_to_generator(function*() {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil("OMEMOInitialized");
                return _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.omemo_store.get("device_id");
            })();
        },
        session: {
            restore () {
                return _async_to_generator(function*() {
                    const { state } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse;
                    if (state.omemo_store === undefined) {
                        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get("bare_jid");
                        const id = `converse.omemosession-${bare_jid}`;
                        state.omemo_store = new _store_js__WEBPACK_IMPORTED_MODULE_2__["default"]({
                            id
                        });
                        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.initStorage(state.omemo_store, id);
                    }
                    yield state.omemo_store.fetchSession();
                })();
            }
        },
        /**
         * The "devicelists" namespace groups methods related to OMEMO device lists
         *
         * @namespace _converse.api.omemo.devicelists
         * @memberOf _converse.api.omemo
         */ devicelists: {
            /**
             * Returns the {@link DeviceList} for a particular JID.
             * The device list will be created if it doesn't exist already.
             * @method _converse.api.omemo.devicelists.get
             * @param {String} jid - The Jabber ID for which the device list will be returned.
             * @param {boolean} create=false - Set to `true` if the device list
             *      should be created if it cannot be found.
             */ get (jid, create = false) {
                return _async_to_generator(function*() {
                    const { devicelists } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
                    const list = devicelists.get(jid) || (create ? devicelists.create({
                        jid
                    }) : null);
                    yield list === null || list === void 0 ? void 0 : list.initialized;
                    return list;
                })();
            }
        },
        /**
         * The "bundle" namespace groups methods relevant to the user's OMEMO bundle.
         * @namespace _converse.api.omemo.bundle
         * @memberOf _converse.api.omemo
         */ bundle: {
            /**
             * Lets you generate a new OMEMO device bundle
             *
             * @method _converse.api.omemo.bundle.generate
             * @returns {promise} Promise which resolves once we have a result from the server.
             */ generate () {
                return _async_to_generator(function*() {
                    yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil("OMEMOInitialized");
                    // Remove current device
                    const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get("bare_jid");
                    const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.omemo.devicelists.get(bare_jid);
                    const { omemo_store } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
                    const device_id = omemo_store.get("device_id");
                    if (device_id) {
                        const device = devicelist.devices.get(device_id);
                        omemo_store.unset(device_id);
                        if (device) {
                            yield new Promise((done)=>device.destroy({
                                    "success": done,
                                    "error": done
                                }));
                        }
                        devicelist.devices.trigger("remove");
                    }
                    // Generate new device bundle and publish
                    // https://xmpp.org/extensions/attic/xep-0384-0.3.0.html#usecases-announcing
                    yield omemo_store.generateBundle();
                    yield devicelist.publishDevices();
                    const device = devicelist.devices.get(omemo_store.get("device_id"));
                    const fp = (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.generateFingerprint)(device);
                    yield omemo_store.publishBundle();
                    return fp;
                })();
            }
        }
    }
});


/***/ }),

/***/ "./src/plugins/omemo/consts.js":
/*!*************************************!*\
  !*** ./src/plugins/omemo/consts.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   KEY_ALGO: () => (/* binding */ KEY_ALGO),
/* harmony export */   TAG_LENGTH: () => (/* binding */ TAG_LENGTH),
/* harmony export */   TRUSTED: () => (/* binding */ TRUSTED),
/* harmony export */   UNDECIDED: () => (/* binding */ UNDECIDED),
/* harmony export */   UNTRUSTED: () => (/* binding */ UNTRUSTED)
/* harmony export */ });
const UNDECIDED = 0;
const TRUSTED = 1;
const UNTRUSTED = -1;
const TAG_LENGTH = 128;
const KEY_ALGO = {
    'name': 'AES-GCM',
    'length': 128
};


/***/ }),

/***/ "./src/plugins/omemo/device.js":
/*!*************************************!*\
  !*** ./src/plugins/omemo/device.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/errors.js */ "./src/shared/errors.js");
/* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./consts.js */ "./src/plugins/omemo/consts.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/omemo/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, sizzle, stx } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
class Device extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            trusted: _consts_js__WEBPACK_IMPORTED_MODULE_3__.UNDECIDED,
            active: true
        };
    }
    /**
     * @returns {import('./types').PreKey}
     */ getRandomPreKey() {
        // XXX: assumes that the bundle has already been fetched
        const bundle = this.get("bundle");
        return bundle.prekeys[_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getRandomInt(bundle.prekeys.length)];
    }
    /**
     * Fetch the device's OMEMO bundle from the server.
     * A bundle is a collection of publicly accessible data that can
     * be used to build a session with a device, namely its public IdentityKey,
     * a signed PreKey with corresponding signature, and a list of (single use) PreKeys.
     * @returns {Promise<import('./types').Bundle>}
     */ fetchBundleFromServer() {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get("bare_jid");
            const stanza = stx`
            <iq type="get" from="${bare_jid}" to="${this.get("jid")}" xmlns="jabber:client">
                <pubsub xmlns="${Strophe.NS.PUBSUB}">
                    <items node="${Strophe.NS.OMEMO_BUNDLES}:${this.get("id")}"/>
                </pubsub>
            </iq>`;
            let iq;
            try {
                iq = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.sendIQ(stanza);
            } catch (iq) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(`Could not fetch bundle for device ${this.get("id")} from ${this.get("jid")}`);
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(iq);
                return null;
            }
            if (iq.querySelector("error")) {
                throw new shared_errors_js__WEBPACK_IMPORTED_MODULE_2__.IQError("Could not fetch bundle", iq);
            }
            const publish_el = sizzle(`items[node="${Strophe.NS.OMEMO_BUNDLES}:${this.get("id")}"]`, iq).pop();
            const bundle_el = sizzle(`bundle[xmlns="${Strophe.NS.OMEMO}"]`, publish_el).pop();
            const bundle = (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.parseBundle)(bundle_el);
            this.save("bundle", bundle);
            return bundle;
        }).call(this);
    }
    /**
     * Fetch and save the bundle information associated with
     * this device, if the information is not cached already.
     * @returns {Promise<import('./types').Bundle>}
     */ getBundle() {
        if (this.get("bundle")) {
            return Promise.resolve(this.get("bundle"));
        } else {
            return this.fetchBundleFromServer();
        }
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Device);


/***/ }),

/***/ "./src/plugins/omemo/devicelist.js":
/*!*****************************************!*\
  !*** ./src/plugins/omemo/devicelist.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



const { Strophe, stx, sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env;
class DeviceList extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    get idAttribute() {
        return "jid";
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            this.initialized = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
            yield this.initDevices();
            this.initialized.resolve();
        }).call(this);
    }
    initDevices() {
        this.devices = new _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.exports.Devices();
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
        const id = `converse.devicelist-${bare_jid}-${this.get("jid")}`;
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.initStorage(this.devices, id);
        return this.fetchDevices();
    }
    /**
     * @param {import('./devices').default} collection
     */ onDevicesFound(collection) {
        return _async_to_generator(function*() {
            if (collection.length === 0) {
                let ids = [];
                try {
                    ids = yield this.fetchDevicesFromServer();
                } catch (e) {
                    if (e === null) {
                        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(`Timeout error while fetching OMEMO devices for ${this.get("jid")}`);
                        this.destroy();
                    } else if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.isElement(e) && (yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.parsers.parseErrorStanza(e)) instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_2__.errors.ItemNotFoundError) {
                        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.debug(`No OMEMO devices found for ${this.get("jid")}`);
                    } else {
                        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(`Could not fetch OMEMO devices for ${this.get("jid")}`);
                        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(e);
                        this.destroy();
                    }
                }
                const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
                if (this.get("jid") === bare_jid) {
                    this.publishCurrentDevice(ids);
                }
            }
        }).call(this);
    }
    fetchDevices() {
        if (this._devices_promise === undefined) {
            this._devices_promise = new Promise((resolve)=>{
                this.devices.fetch({
                    success: (c)=>resolve(this.onDevicesFound(c)),
                    error: (_, e)=>{
                        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(e);
                        resolve();
                    }
                });
            });
        }
        return this._devices_promise;
    }
    /**
     * @returns {Promise<string>}
     */ getOwnDeviceId() {
        return _async_to_generator(function*() {
            const { omemo_store } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state;
            let device_id = omemo_store.get("device_id");
            if (!this.devices.get(device_id)) {
                // Generate a new bundle if we cannot find our device
                yield omemo_store.generateBundle();
                device_id = omemo_store.get("device_id");
            }
            return device_id;
        }).call(this);
    }
    /**
     * @param {string[]} device_ids
     */ publishCurrentDevice(device_ids) {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
            if (this.get("jid") !== bare_jid) {
                return; // We only publish for ourselves.
            }
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.omemo.session.restore();
            if (!_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.omemo_store) {
                // Happens during tests. The connection gets torn down
                // before publishCurrentDevice has time to finish.
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.debug("publishCurrentDevice: omemo_store is not defined, likely a timing issue");
                return;
            }
            if (!device_ids.includes((yield this.getOwnDeviceId()))) {
                return this.publishDevices();
            }
        }).call(this);
    }
    /**
     * @returns {Promise<import('./device').default[]>}
     */ fetchDevicesFromServer() {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
            const stanza = stx`
            <iq type='get' from='${bare_jid}' to='${this.get("jid")}' xmlns="jabber:client">
                <pubsub xmlns='${Strophe.NS.PUBSUB}'>
                    <items node='${Strophe.NS.OMEMO_DEVICELIST}'/>
                </pubsub>
            </iq>`;
            const iq = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.sendIQ(stanza);
            const selector = `list[xmlns="${Strophe.NS.OMEMO}"] device`;
            const device_ids = sizzle(selector, iq).map((d)=>d.getAttribute("id"));
            const jid = this.get("jid");
            return Promise.all(device_ids.map((id)=>this.devices.create({
                    id,
                    jid
                }, {
                    promise: true
                })));
        }).call(this);
    }
    /**
     * Sends an IQ stanza to the current user's "devices" PEP node to
     * ensure that all devices are published for potential chat partners to see.
     * See: https://xmpp.org/extensions/attic/xep-0384-0.3.0.html#usecases-announcing
     */ publishDevices() {
        const item = stx`
            <item id='current'>
                <list xmlns='${Strophe.NS.OMEMO}'>
                    ${this.devices.filter((d)=>d.get("active")).map((d)=>stx`<device id='${d.get("id")}'/>`)}
                </list>
            </item>`;
        const options = {
            access_model: "open"
        };
        return _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.pubsub.publish(null, Strophe.NS.OMEMO_DEVICELIST, item, options, false);
    }
    /**
     * @param {string[]} device_ids
     */ removeOwnDevices(device_ids) {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
            if (this.get("jid") !== bare_jid) {
                throw new Error("Cannot remove devices from someone else's device list");
            }
            yield Promise.all(device_ids.map((id)=>this.devices.get(id)).map((d)=>new Promise((resolve)=>d.destroy({
                        success: resolve,
                        error: (_, e)=>{
                            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(e);
                            resolve();
                        }
                    }))));
            return this.publishDevices();
        }).call(this);
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeviceList);


/***/ }),

/***/ "./src/plugins/omemo/devicelists.js":
/*!******************************************!*\
  !*** ./src/plugins/omemo/devicelists.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _devicelist_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./devicelist.js */ "./src/plugins/omemo/devicelist.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);


class DeviceLists extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Collection {
    constructor(){
        super();
        this.model = _devicelist_js__WEBPACK_IMPORTED_MODULE_0__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeviceLists);


/***/ }),

/***/ "./src/plugins/omemo/devices.js":
/*!**************************************!*\
  !*** ./src/plugins/omemo/devices.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _device_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./device.js */ "./src/plugins/omemo/device.js");


class Devices extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Collection {
    constructor(){
        super();
        this.model = _device_js__WEBPACK_IMPORTED_MODULE_1__["default"];
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Devices);


/***/ }),

/***/ "./src/plugins/omemo/fingerprints.js":
/*!*******************************************!*\
  !*** ./src/plugins/omemo/fingerprints.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Fingerprints: () => (/* binding */ Fingerprints)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_fingerprints_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/fingerprints.js */ "./src/plugins/omemo/templates/fingerprints.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



class Fingerprints extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            "jid": {
                type: String
            }
        };
    }
    initialize() {
        return _async_to_generator(function*() {
            this.devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.omemo.devicelists.get(this.jid, true);
            this.listenTo(this.devicelist.devices, "change:bundle", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "change:trusted", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "remove", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "add", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "reset", ()=>this.requestUpdate());
            this.requestUpdate();
        }).call(this);
    }
    render() {
        return this.devicelist ? (0,_templates_fingerprints_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this) : "";
    }
    toggleDeviceTrust(ev) {
        const radio = ev.target;
        const device = this.devicelist.devices.get(radio.getAttribute("name"));
        device.save("trusted", parseInt(radio.value, 10));
    }
    constructor(){
        super();
        this.jid = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define("converse-omemo-fingerprints", Fingerprints);


/***/ }),

/***/ "./src/plugins/omemo/index.js":
/*!************************************!*\
  !*** ./src/plugins/omemo/index.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _fingerprints_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fingerprints.js */ "./src/plugins/omemo/fingerprints.js");
/* harmony import */ var _profile_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./profile.js */ "./src/plugins/omemo/profile.js");
/* harmony import */ var shared_modals_user_details_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/modals/user-details.js */ "./src/shared/modals/user-details.js");
/* harmony import */ var _device_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./device.js */ "./src/plugins/omemo/device.js");
/* harmony import */ var _devicelist_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./devicelist.js */ "./src/plugins/omemo/devicelist.js");
/* harmony import */ var _devicelists_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./devicelists.js */ "./src/plugins/omemo/devicelists.js");
/* harmony import */ var _devices_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./devices.js */ "./src/plugins/omemo/devices.js");
/* harmony import */ var _store_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./store.js */ "./src/plugins/omemo/store.js");
/* harmony import */ var _api_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./api.js */ "./src/plugins/omemo/api.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/omemo/utils.js");
/* harmony import */ var _styles_omemo_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./styles/omemo.scss */ "./src/plugins/omemo/styles/omemo.scss");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @module plugins-omemo-index
 * @typedef {Window & globalThis & {libsignal: any} } WindowWithLibsignal
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}












const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { shouldClearCache } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u;
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env.omemo = _utils_js__WEBPACK_IMPORTED_MODULE_10__.omemo;
Strophe.addNamespace("OMEMO_DEVICELIST", Strophe.NS.OMEMO + ".devicelist");
Strophe.addNamespace("OMEMO_VERIFICATION", Strophe.NS.OMEMO + ".verification");
Strophe.addNamespace("OMEMO_WHITELISTED", Strophe.NS.OMEMO + ".whitelisted");
Strophe.addNamespace("OMEMO_BUNDLES", Strophe.NS.OMEMO + ".bundles");
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add("converse-omemo", {
    enabled (_converse) {
        return /** @type WindowWithLibsignal */ window.libsignal && _converse.config.get("trusted") && !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("clear_cache_on_logout") && !_converse.api.settings.get("blacklisted_plugins").includes("converse-omemo");
    },
    dependencies: [
        "converse-chatview",
        "converse-pubsub",
        "converse-profile"
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            omemo_default: false
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.promises.add([
            "OMEMOInitialized"
        ]);
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.api, _api_js__WEBPACK_IMPORTED_MODULE_9__["default"]);
        const exports = {
            OMEMOStore: _store_js__WEBPACK_IMPORTED_MODULE_8__["default"],
            Device: _device_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            Devices: _devices_js__WEBPACK_IMPORTED_MODULE_7__["default"],
            DeviceList: _devicelist_js__WEBPACK_IMPORTED_MODULE_5__["default"],
            DeviceLists: _devicelists_js__WEBPACK_IMPORTED_MODULE_6__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, exports);
        /******************** Event Handlers ********************/ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatRoomInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_10__.onChatInitialized);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_10__.onChatInitialized);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("getOutgoingMessageAttributes", _utils_js__WEBPACK_IMPORTED_MODULE_10__.getOutgoingMessageAttributes);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("createMessageStanza", (chat, data)=>_async_to_generator(function*() {
                try {
                    data = yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_10__.createOMEMOMessageStanza)(chat, data);
                } catch (e) {
                    (0,_utils_js__WEBPACK_IMPORTED_MODULE_10__.handleMessageSendError)(e, chat);
                }
                return data;
            })());
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("afterFileUploaded", (msg, attrs)=>msg.file.xep454_ivkey ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_10__.setEncryptedFileURL)(msg, attrs) : attrs);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("beforeFileUpload", (chat, file)=>chat.get("omemo_active") ? (0,_utils_js__WEBPACK_IMPORTED_MODULE_10__.encryptFile)(file) : file);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("parseMessage", _utils_js__WEBPACK_IMPORTED_MODULE_10__.parseEncryptedMessage);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("parseMUCMessage", _utils_js__WEBPACK_IMPORTED_MODULE_10__.parseEncryptedMessage);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("chatBoxViewInitialized", _utils_js__WEBPACK_IMPORTED_MODULE_10__.onChatComponentInitialized);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("chatRoomViewInitialized", _utils_js__WEBPACK_IMPORTED_MODULE_10__.onChatComponentInitialized);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("connected", _utils_js__WEBPACK_IMPORTED_MODULE_10__.registerPEPPushHandler);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("getToolbarButtons", _utils_js__WEBPACK_IMPORTED_MODULE_10__.getOMEMOToolbarButton);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("statusInitialized", _utils_js__WEBPACK_IMPORTED_MODULE_10__.initOMEMO);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("addClientFeatures", ()=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.own.features.add(`${Strophe.NS.OMEMO_DEVICELIST}+notify`));
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("afterMessageBodyTransformed", _utils_js__WEBPACK_IMPORTED_MODULE_10__.handleEncryptedFiles);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("userDetailsModalInitialized", (contact)=>{
            const jid = contact.get("jid");
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_10__.generateFingerprints)(jid).catch((e)=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e));
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("profileModalInitialized", ()=>{
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get("bare_jid");
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_10__.generateFingerprints)(bare_jid).catch((e)=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e));
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on("clearSession", ()=>{
            delete _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.omemo_store;
            if (shouldClearCache(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse) && _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.devicelists) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.devicelists.clearStore();
                delete _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.devicelists;
            }
        });
    }
});


/***/ }),

/***/ "./src/plugins/omemo/profile.js":
/*!**************************************!*\
  !*** ./src/plugins/omemo/profile.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Profile: () => (/* binding */ Profile)
/* harmony export */ });
/* harmony import */ var _templates_profile_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/profile.js */ "./src/plugins/omemo/templates/profile.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { Strophe, sizzle, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_4__.converse.env;
class Profile extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    initialize() {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_4__._converse.session.get("bare_jid");
            this.devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.omemo.devicelists.get(bare_jid, true);
            yield this.setAttributes();
            this.listenTo(this.devicelist.devices, "change:bundle", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "reset", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "reset", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "remove", ()=>this.requestUpdate());
            this.listenTo(this.devicelist.devices, "add", ()=>this.requestUpdate());
            this.requestUpdate();
        }).call(this);
    }
    setAttributes() {
        return _async_to_generator(function*() {
            this.device_id = yield _converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.omemo.getDeviceID();
            this.current_device = this.devicelist.devices.get(this.device_id);
            this.other_devices = this.devicelist.devices.filter((d)=>d.get("id") !== this.device_id);
        }).call(this);
    }
    render() {
        return this.devicelist ? (0,_templates_profile_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this) : (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
    }
    selectAll(ev) {
        // eslint-disable-line class-methods-use-this
        let sibling = u.ancestor(ev.target, "li");
        while(sibling){
            sibling.querySelector('input[type="checkbox"]').checked = ev.target.checked;
            sibling = sibling.nextElementSibling;
        }
    }
    removeSelectedFingerprints(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            ev.stopPropagation();
            ev.target.querySelector(".select-all").checked = false;
            const device_ids = sizzle('.fingerprint-removal-item input[type="checkbox"]:checked', ev.target).map((c)=>c.value);
            try {
                yield this.devicelist.removeOwnDevices(device_ids);
            } catch (err) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_4__.log.error(err);
                _converse_headless__WEBPACK_IMPORTED_MODULE_4__._converse.api.alert(Strophe.LogLevel.ERROR, (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Error"), [
                    (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Sorry, an error occurred while trying to remove the devices.")
                ]);
            }
            yield this.setAttributes();
            this.requestUpdate();
        }).call(this);
    }
    generateOMEMODeviceBundle(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Confirm"), (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Are you sure you want to generate new OMEMO keys? " + "This will remove your old keys and all previously " + "encrypted messages will no longer be decryptable on this device."));
            if (result) {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.omemo.bundle.generate();
                yield this.setAttributes();
                this.requestUpdate();
            }
        }).call(this);
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.elements.define("converse-omemo-profile", Profile);


/***/ }),

/***/ "./src/plugins/omemo/store.js":
/*!************************************!*\
  !*** ./src/plugins/omemo/store.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/omemo/utils.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @typedef {module:plugins-omemo-index.WindowWithLibsignal} WindowWithLibsignal
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}



const { Strophe, stx, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env;
class OMEMOStore extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    get Direction() {
        return {
            SENDING: 1,
            RECEIVING: 2
        };
    }
    getIdentityKeyPair() {
        const keypair = this.get("identity_keypair");
        return Promise.resolve({
            "privKey": u.base64ToArrayBuffer(keypair.privKey),
            "pubKey": u.base64ToArrayBuffer(keypair.pubKey)
        });
    }
    getLocalRegistrationId() {
        return Promise.resolve(parseInt(this.get("device_id"), 10));
    }
    isTrustedIdentity(identifier, identity_key, _direction) {
        if (identifier === null || identifier === undefined) {
            throw new Error("Can't check identity key for invalid key");
        }
        if (!(identity_key instanceof ArrayBuffer)) {
            throw new Error("Expected identity_key to be an ArrayBuffer");
        }
        const trusted = this.get("identity_key" + identifier);
        if (trusted === undefined) {
            return Promise.resolve(true);
        }
        return Promise.resolve(u.arrayBufferToBase64(identity_key) === trusted);
    }
    loadIdentityKey(identifier) {
        if (identifier === null || identifier === undefined) {
            throw new Error("Can't load identity_key for invalid identifier");
        }
        return Promise.resolve(u.base64ToArrayBuffer(this.get("identity_key" + identifier)));
    }
    saveIdentity(identifier, identity_key) {
        if (identifier === null || identifier === undefined) {
            throw new Error("Can't save identity_key for invalid identifier");
        }
        const { libsignal } = /** @type WindowWithLibsignal */ window;
        const address = new libsignal.SignalProtocolAddress.fromString(identifier);
        const existing = this.get("identity_key" + address.getName());
        const b64_idkey = u.arrayBufferToBase64(identity_key);
        this.save("identity_key" + address.getName(), b64_idkey);
        if (existing && b64_idkey !== existing) {
            return Promise.resolve(true);
        } else {
            return Promise.resolve(false);
        }
    }
    getPreKeys() {
        return this.get("prekeys") || {};
    }
    loadPreKey(key_id) {
        const res = this.getPreKeys()[key_id];
        if (res) {
            return Promise.resolve({
                "privKey": u.base64ToArrayBuffer(res.privKey),
                "pubKey": u.base64ToArrayBuffer(res.pubKey)
            });
        }
        return Promise.resolve();
    }
    storePreKey(key_id, key_pair) {
        const prekey = {};
        prekey[key_id] = {
            "pubKey": u.arrayBufferToBase64(key_pair.pubKey),
            "privKey": u.arrayBufferToBase64(key_pair.privKey)
        };
        this.save("prekeys", Object.assign(this.getPreKeys(), prekey));
        return Promise.resolve();
    }
    removePreKey(key_id) {
        const prekeys = _object_spread({}, this.getPreKeys());
        delete prekeys[key_id];
        this.save("prekeys", prekeys);
        return Promise.resolve();
    }
    loadSignedPreKey(_keyId) {
        const res = this.get("signed_prekey");
        if (res) {
            return Promise.resolve({
                "privKey": u.base64ToArrayBuffer(res.privKey),
                "pubKey": u.base64ToArrayBuffer(res.pubKey)
            });
        }
        return Promise.resolve();
    }
    storeSignedPreKey(spk) {
        if (typeof spk !== "object") {
            // XXX: We've changed the signature of this method from the
            // example given in InMemorySignalProtocolStore.
            // Should be fine because the libsignal code doesn't
            // actually call this method.
            throw new Error("storeSignedPreKey: expected an object");
        }
        this.save("signed_prekey", {
            "id": spk.keyId,
            "privKey": u.arrayBufferToBase64(spk.keyPair.privKey),
            "pubKey": u.arrayBufferToBase64(spk.keyPair.pubKey),
            // XXX: The InMemorySignalProtocolStore does not pass
            // in or store the signature, but we need it when we
            // publish our bundle and this method isn't called from
            // within libsignal code, so we modify it to also store
            // the signature.
            "signature": u.arrayBufferToBase64(spk.signature)
        });
        return Promise.resolve();
    }
    removeSignedPreKey(key_id) {
        if (this.get("signed_prekey")["id"] === key_id) {
            this.unset("signed_prekey");
            this.save();
        }
        return Promise.resolve();
    }
    loadSession(identifier) {
        return Promise.resolve(this.get("session" + identifier));
    }
    storeSession(identifier, record) {
        return Promise.resolve(this.save("session" + identifier, record));
    }
    removeSession(identifier) {
        return Promise.resolve(this.unset("session" + identifier));
    }
    removeAllSessions(identifier) {
        const keys = Object.keys(this.attributes).filter((key)=>key.startsWith("session" + identifier) ? key : false);
        const attrs = {};
        keys.forEach((key)=>{
            attrs[key] = undefined;
        });
        this.save(attrs);
        return Promise.resolve();
    }
    publishBundle() {
        const signed_prekey = this.get("signed_prekey");
        const node = `${Strophe.NS.OMEMO_BUNDLES}:${this.get("device_id")}`;
        const item = stx`
            <item>
                <bundle xmlns="${Strophe.NS.OMEMO}">
                    <signedPreKeyPublic signedPreKeyId="${signed_prekey.id}">${signed_prekey.pubKey}</signedPreKeyPublic>
                    <signedPreKeySignature>${signed_prekey.signature}</signedPreKeySignature>
                    <identityKey>${this.get("identity_keypair").pubKey}</identityKey>
                    <prekeys>${Object.values(this.get("prekeys")).map((prekey, id)=>stx`<preKeyPublic preKeyId="${id}">${prekey.pubKey}</preKeyPublic>`)}
                    </prekeys>
                </bundle>
            </item>`;
        const options = {
            access_model: "open"
        };
        return _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.pubsub.publish(null, node, item, options, false);
    }
    generateMissingPreKeys() {
        return _async_to_generator(function*() {
            const { libsignal } = /** @type WindowWithLibsignal */ window;
            const { KeyHelper } = libsignal;
            const prekeyIds = Object.keys(this.getPreKeys());
            const missing_keys = Array.from({
                length: _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.NUM_PREKEYS
            }, (_, id)=>id.toString()).filter((id)=>!prekeyIds.includes(id));
            if (missing_keys.length < 1) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.debug("No missing prekeys to generate for our own device");
                return Promise.resolve();
            }
            const keys = yield Promise.all(missing_keys.map((id)=>KeyHelper.generatePreKey(parseInt(id, 10))));
            keys.forEach((k)=>this.storePreKey(k.keyId, k.keyPair));
            const prekeys = this.getPreKeys();
            const marshalled_keys = Object.keys(prekeys).map((id)=>({
                    id,
                    key: prekeys[id].pubKey
                }));
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
            const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.omemo.devicelists.get(bare_jid);
            const device = devicelist.devices.get(this.get("device_id"));
            const bundle = yield device.getBundle();
            device.save("bundle", Object.assign(bundle, {
                "prekeys": marshalled_keys
            }));
        }).call(this);
    }
    /**
     * Generates, stores and then returns pre-keys.
     *
     * Pre-keys are one half of a X3DH key exchange and are published as part
     * of the device bundle.
     *
     * For a new contact or device to establish an encrypted session, it needs
     * to use a pre-key, which it chooses randomly from the list of available
     * ones.
     */ generatePreKeys() {
        return _async_to_generator(function*() {
            const amount = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.NUM_PREKEYS;
            const { libsignal } = /** @type WindowWithLibsignal */ window;
            const { KeyHelper } = libsignal;
            const keys = yield Promise.all([
                ...Array(amount).keys()
            ].map((id)=>KeyHelper.generatePreKey(id)));
            keys.forEach((k)=>this.storePreKey(k.keyId, k.keyPair));
            return keys.map((k)=>({
                    id: k.keyId,
                    key: u.arrayBufferToBase64(k.keyPair.pubKey)
                }));
        }).call(this);
    }
    /**
     * Generate the cryptographic data used by the X3DH key agreement protocol
     * in order to build a session with other devices.
     *
     * By generating a bundle, and publishing it via PubSub, we allow other
     * clients to download it and start asynchronous encrypted sessions with us,
     * even if we're offline at that time.
     */ generateBundle() {
        return _async_to_generator(function*() {
            const { libsignal } = /** @type WindowWithLibsignal */ window;
            // The first thing that needs to happen if a client wants to
            // start using OMEMO is they need to generate an IdentityKey
            // and a Device ID.
            // The IdentityKey is a Curve25519 public/private Key pair.
            const identity_keypair = yield libsignal.KeyHelper.generateIdentityKeyPair();
            const identity_key = u.arrayBufferToBase64(identity_keypair.pubKey);
            // The Device ID is a randomly generated integer between 1 and 2^31 - 1.
            const device_id = yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.generateDeviceID)();
            this.save({
                device_id,
                identity_key,
                identity_keypair: {
                    privKey: u.arrayBufferToBase64(identity_keypair.privKey),
                    pubKey: identity_key
                }
            });
            const signed_prekey = yield libsignal.KeyHelper.generateSignedPreKey(identity_keypair, 0);
            this.storeSignedPreKey(signed_prekey);
            const prekeys = yield this.generatePreKeys();
            const bundle = {
                identity_key,
                device_id,
                prekeys
            };
            bundle["signed_prekey"] = {
                id: signed_prekey.keyId,
                public_key: u.arrayBufferToBase64(signed_prekey.keyPair.pubKey),
                signature: u.arrayBufferToBase64(signed_prekey.signature)
            };
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get("bare_jid");
            const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.omemo.devicelists.get(bare_jid);
            const device = yield devicelist.devices.create({
                id: bundle.device_id,
                "jid": bare_jid
            }, {
                promise: true
            });
            device.save("bundle", bundle);
        }).call(this);
    }
    fetchSession() {
        if (this._setup_promise === undefined) {
            this._setup_promise = new Promise((resolve, reject)=>{
                this.fetch({
                    success: ()=>{
                        if (!this.get("device_id")) {
                            this.generateBundle().then(resolve).catch(reject);
                        } else {
                            resolve();
                        }
                    },
                    error: (_model, resp)=>{
                        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.warn(`Could restore OMEMO session, we'll generate a new one: ${resp}`);
                        this.generateBundle().then(resolve).catch(reject);
                    }
                });
            });
        }
        return this._setup_promise;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OMEMOStore);


/***/ }),

/***/ "./src/plugins/omemo/styles/omemo.scss":
/*!*********************************************!*\
  !*** ./src/plugins/omemo/styles/omemo.scss ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_omemo_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./omemo.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/omemo/styles/omemo.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_omemo_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_omemo_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_omemo_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_omemo_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/omemo/templates/fingerprints.js":
/*!*****************************************************!*\
  !*** ./src/plugins/omemo/templates/fingerprints.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/omemo/utils.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");




const { u } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.converse.env;
/**
 * @param {import('../fingerprints').Fingerprints} el
 * @param {import('../device').default} device
 */ const device_fingerprint = (el, device)=>{
    const i18n_trusted = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Trusted");
    const i18n_untrusted = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Untrusted");
    const i18n_toggle_trusted_devices = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Choose which devices you trust for OMEMO encrypted communication");
    const id1 = u.getUniqueId();
    const id2 = u.getUniqueId();
    const is_trusted = device.get("trusted") !== -1;
    if (device.get("bundle") && device.get("bundle").fingerprint) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="list-group-item"><form class="fingerprint-trust"><div class="btn-group btn-group-toggle" role="group" aria-label="${i18n_toggle_trusted_devices}"><input type="radio" class="btn-check" name="${device.get("id")}" id="${id1}" autocomplete="off" value="1" @click="${el.toggleDeviceTrust}" ?checked="${is_trusted}"> <label class="btn ${is_trusted ? "btn-primary active" : "btn-outline-secondary"}" for="${id1}">${i18n_trusted}</label> <input type="radio" class="btn-check" name="${device.get("id")}" id="${id2}" autocomplete="off" value="-1" @click="${el.toggleDeviceTrust}" ?checked="${!is_trusted}"> <label class="btn ${!is_trusted ? "btn-primary active" : "btn-outline-secondary"}" for="${id2}">${i18n_untrusted}</label></div><code class="fingerprint">${(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.formatFingerprint)(device.get("bundle").fingerprint)}</code></form></li>`;
    } else {
        return "";
    }
};
/**
 * @param {import('../fingerprints').Fingerprints} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_fingerprints = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("OMEMO Fingerprints");
    const i18n_no_devices = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)("No OMEMO-enabled devices found");
    const devices = el.devicelist.devices;
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<ul class="list-group fingerprints"><li class="list-group-item active">${i18n_fingerprints}</li>${devices.length ? devices.map((device)=>device_fingerprint(el, device)) : (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="list-group-item">${i18n_no_devices}</li>`}</ul>`;
});


/***/ }),

/***/ "./src/plugins/omemo/templates/profile.js":
/*!************************************************!*\
  !*** ./src/plugins/omemo/templates/profile.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var plugins_omemo_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/omemo/utils.js */ "./src/plugins/omemo/utils.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_qrcode_component_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/qrcode/component.js */ "./src/shared/qrcode/component.js");





/**
 * @param {import('../profile').Profile} el
 */ function tplFingerprint(el) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<span class="fingerprint">${(0,plugins_omemo_utils_js__WEBPACK_IMPORTED_MODULE_1__.formatFingerprint)(el.current_device.get("bundle").fingerprint)}</span>`;
}
function tplDeviceWithFingerprint(device) {
    const i18n_fingerprint_checkbox_label = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Checkbox for selecting the following fingerprint");
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="fingerprint-removal-item list-group-item"><label class="form-label"><input type="checkbox" value="${device.get("id")}" aria-label="${i18n_fingerprint_checkbox_label}"> <span class="fingerprint">${(0,plugins_omemo_utils_js__WEBPACK_IMPORTED_MODULE_1__.formatFingerprint)(device.get("bundle").fingerprint)}</span></label></li>`;
}
function tplDeviceWithoutFingerprint(device) {
    const i18n_device_without_fingerprint = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Device without a fingerprint");
    const i18n_fingerprint_checkbox_label = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Checkbox for selecting the following device");
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="fingerprint-removal-item list-group-item"><label class="form-label"><input type="checkbox" value="${device.get("id")}" aria-label="${i18n_fingerprint_checkbox_label}"> <span>${i18n_device_without_fingerprint}</span></label></li>`;
}
function tplDeviceItem(device) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`${device.get("bundle") && device.get("bundle").fingerprint ? tplDeviceWithFingerprint(device) : tplDeviceWithoutFingerprint(device)}`;
}
/**
 * @param {import('../profile').Profile} el
 */ function tplDeviceList(el) {
    var _el_other_devices;
    const i18n_other_devices = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Other OMEMO-enabled devices");
    const i18n_other_devices_label = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Checkbox to select fingerprints of all other OMEMO devices");
    const i18n_remove_devices = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Remove checked devices and close");
    const i18n_select_all = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Select all");
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<ul class="list-group fingerprints"><li class="list-group-item active"><label class="form-label"><input type="checkbox" class="select-all" @change="${el.selectAll}" title="${i18n_select_all}" aria-label="${i18n_other_devices_label}"> ${i18n_other_devices}</label></li>${(_el_other_devices = el.other_devices) === null || _el_other_devices === void 0 ? void 0 : _el_other_devices.map((device)=>tplDeviceItem(device))}</ul><div><button type="submit" class="save-form btn btn-primary">${i18n_remove_devices}</button></div>`;
}
/**
 * @param {import('../profile').Profile} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_current_device, _el_other_devices;
    const i18n_fingerprint = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("This device's OMEMO fingerprint");
    const i18n_generate = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("Generate new keys and fingerprint");
    const fingerprint = el === null || el === void 0 ? void 0 : (_el_current_device = el.current_device) === null || _el_current_device === void 0 ? void 0 : _el_current_device.get("bundle").fingerprint;
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<form class="converse-form fingerprint-removal" @submit="${el.removeSelectedFingerprints}"><ul class="list-group fingerprints"><li class="list-group-item active">${i18n_fingerprint}</li><li class="list-group-item">${fingerprint ? tplFingerprint(el) : (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_0__["default"])()}</li><li class="list-group-item p-4">${fingerprint ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-qr-code class="centered" text="${(0,plugins_omemo_utils_js__WEBPACK_IMPORTED_MODULE_1__.formatFingerprintForQRCode)(fingerprint)}"></converse-qr-code>` : ""}</li></ul><div class="pb-3"><button type="button" class="generate-bundle btn btn-danger" @click="${el.generateOMEMODeviceBundle}">${i18n_generate}</button></div>${((_el_other_devices = el.other_devices) === null || _el_other_devices === void 0 ? void 0 : _el_other_devices.length) ? tplDeviceList(el) : ""}</form>`;
});


/***/ }),

/***/ "./src/plugins/omemo/utils.js":
/*!************************************!*\
  !*** ./src/plugins/omemo/utils.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   contactHasOMEMOSupport: () => (/* binding */ contactHasOMEMOSupport),
/* harmony export */   createOMEMOMessageStanza: () => (/* binding */ createOMEMOMessageStanza),
/* harmony export */   encryptFile: () => (/* binding */ encryptFile),
/* harmony export */   formatFingerprint: () => (/* binding */ formatFingerprint),
/* harmony export */   formatFingerprintForQRCode: () => (/* binding */ formatFingerprintForQRCode),
/* harmony export */   generateDeviceID: () => (/* binding */ generateDeviceID),
/* harmony export */   generateFingerprint: () => (/* binding */ generateFingerprint),
/* harmony export */   generateFingerprints: () => (/* binding */ generateFingerprints),
/* harmony export */   getDeviceForContact: () => (/* binding */ getDeviceForContact),
/* harmony export */   getDevicesForContact: () => (/* binding */ getDevicesForContact),
/* harmony export */   getOMEMOToolbarButton: () => (/* binding */ getOMEMOToolbarButton),
/* harmony export */   getOutgoingMessageAttributes: () => (/* binding */ getOutgoingMessageAttributes),
/* harmony export */   getSession: () => (/* binding */ getSession),
/* harmony export */   getSessionCipher: () => (/* binding */ getSessionCipher),
/* harmony export */   handleEncryptedFiles: () => (/* binding */ handleEncryptedFiles),
/* harmony export */   handleMessageSendError: () => (/* binding */ handleMessageSendError),
/* harmony export */   initOMEMO: () => (/* binding */ initOMEMO),
/* harmony export */   omemo: () => (/* binding */ omemo),
/* harmony export */   onChatComponentInitialized: () => (/* binding */ onChatComponentInitialized),
/* harmony export */   onChatInitialized: () => (/* binding */ onChatInitialized),
/* harmony export */   parseBundle: () => (/* binding */ parseBundle),
/* harmony export */   parseEncryptedMessage: () => (/* binding */ parseEncryptedMessage),
/* harmony export */   registerPEPPushHandler: () => (/* binding */ registerPEPPushHandler),
/* harmony export */   restoreOMEMOSession: () => (/* binding */ restoreOMEMOSession),
/* harmony export */   setEncryptedFileURL: () => (/* binding */ setEncryptedFileURL)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_texture_templates_audio_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/texture/templates/audio.js */ "./src/shared/texture/templates/audio.js");
/* harmony import */ var templates_file_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/file.js */ "./src/templates/file.js");
/* harmony import */ var shared_texture_templates_image_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/texture/templates/image.js */ "./src/shared/texture/templates/image.js");
/* harmony import */ var shared_texture_templates_video_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! shared/texture/templates/video.js */ "./src/shared/texture/templates/video.js");
/* harmony import */ var _consts_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./consts.js */ "./src/plugins/omemo/consts.js");
/* harmony import */ var utils_file_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! utils/file.js */ "./src/utils/file.js");
/* harmony import */ var shared_errors_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! shared/errors.js */ "./src/shared/errors.js");
/* harmony import */ var _devicelists_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./devicelists.js */ "./src/plugins/omemo/devicelists.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");
/**
 * @typedef {module:plugins-omemo-index.WindowWithLibsignal} WindowWithLibsignal
 * @typedef {import('@converse/headless/shared/types').MessageAttributes} MessageAttributes
 * @typedef {import('@converse/headless/plugins/muc/types').MUCMessageAttributes} MUCMessageAttributes
 * @typedef {import('@converse/headless').ChatBox} ChatBox
 * @typedef {import('@converse/headless/types/shared/message').default} BaseMessage
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}













const { Strophe, sizzle, stx } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.converse.env;
const { CHATROOMS_TYPE, PRIVATE_CHAT_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.constants;
const { appendArrayBuffer, arrayBufferToBase64, arrayBufferToHex, arrayBufferToString, base64ToArrayBuffer, hexToArrayBuffer, initStorage, isAudioURL, isError, isImageURL, isVideoURL, stringToArrayBuffer } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.u;
/**
 * @param {string} fp
 */ function formatFingerprint(fp) {
    fp = fp.replace(/^05/, '');
    for(let i = 1; i < 8; i++){
        const idx = i * 8 + i - 1;
        fp = fp.slice(0, idx) + ' ' + fp.slice(idx);
    }
    return fp;
}
/**
 * @param {string} fp
 */ function formatFingerprintForQRCode(fp) {
    const sid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store.get('device_id');
    const jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
    fp = fp.replace(/^05/, '');
    return `xmpp:${jid}?omemo-sid-${sid}=${fp}`;
}
/**
 * @param {Error|IQError|UserFacingError} e
 * @param {ChatBox} chat
 */ function handleMessageSendError(e, chat) {
    if (e instanceof shared_errors_js__WEBPACK_IMPORTED_MODULE_10__.IQError) {
        chat.save('omemo_supported', false);
        const err_msgs = [];
        if (sizzle(`presence-subscription-required[xmlns="${Strophe.NS.PUBSUB_ERROR}"]`, e.iq).length) {
            err_msgs.push((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Sorry, we're unable to send an encrypted message because %1$s " + 'requires you to be subscribed to their presence in order to see their OMEMO information', e.iq.getAttribute('from')));
        } else if (sizzle(`remote-server-not-found[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]`, e.iq).length) {
            err_msgs.push((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Sorry, we're unable to send an encrypted message because the remote server for %1$s could not be found", e.iq.getAttribute('from')));
        } else {
            err_msgs.push((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Unable to send an encrypted message due to an unexpected error.'));
            err_msgs.push(e.iq.outerHTML);
        }
        _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error'), err_msgs);
    } else if (e instanceof shared_errors_js__WEBPACK_IMPORTED_MODULE_10__.UserFacingError) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error'), [
            e.message
        ]);
    }
    throw e;
}
/**
 * @param {string} jid
 */ function contactHasOMEMOSupport(jid) {
    return _async_to_generator(function*() {
        /* Checks whether the contact advertises any OMEMO-compatible devices. */ const devices = yield getDevicesForContact(jid);
        return devices.length > 0;
    })();
}
/**
 * @param {ChatBox|MUC} chat
 * @param {MessageAttributes} attrs
 * @return {MessageAttributes}
 */ function getOutgoingMessageAttributes(chat, attrs) {
    if (chat.get('omemo_active') && attrs.body) {
        return _object_spread_props(_object_spread({}, attrs), {
            is_encrypted: true,
            plaintext: attrs.body,
            body: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This is an OMEMO encrypted message which your client doesn’t seem to support. ' + 'Find more information on https://conversations.im/omemo')
        });
    }
    return attrs;
}
/**
 * @param {string} plaintext
 * @returns {Promise<import('./types').EncryptedMessage>}
 */ function encryptMessage(plaintext) {
    return _async_to_generator(function*() {
        // The client MUST use fresh, randomly generated key/IV pairs
        // with AES-128 in Galois/Counter Mode (GCM).
        // For GCM a 12 byte IV is strongly suggested as other IV lengths
        // will require additional calculations. In principle any IV size
        // can be used as long as the IV doesn't ever repeat. NIST however
        // suggests that only an IV size of 12 bytes needs to be supported
        // by implementations.
        //
        // https://crypto.stackexchange.com/questions/26783/ciphertext-and-tag-size-and-iv-transmission-with-aes-in-gcm-mode
        const iv = crypto.getRandomValues(new window.Uint8Array(12));
        const key = yield crypto.subtle.generateKey(_consts_js__WEBPACK_IMPORTED_MODULE_8__.KEY_ALGO, true, [
            'encrypt',
            'decrypt'
        ]);
        const algo = /** @type {AesGcmParams} */ {
            iv,
            name: 'AES-GCM',
            tagLength: _consts_js__WEBPACK_IMPORTED_MODULE_8__.TAG_LENGTH
        };
        const encrypted = yield crypto.subtle.encrypt(algo, key, stringToArrayBuffer(plaintext));
        const length = encrypted.byteLength - (128 + 7 >> 3);
        const ciphertext = encrypted.slice(0, length);
        const tag = encrypted.slice(length);
        const exported_key = yield crypto.subtle.exportKey('raw', key);
        return {
            tag,
            key: exported_key,
            key_and_tag: appendArrayBuffer(exported_key, tag),
            payload: arrayBufferToBase64(ciphertext),
            iv: arrayBufferToBase64(iv)
        };
    })();
}
/**
 * @param {import('./types').EncryptedMessage} obj
 * @returns {Promise<string>}
 */ function decryptMessage(obj) {
    return _async_to_generator(function*() {
        const key_obj = yield crypto.subtle.importKey('raw', obj.key, _consts_js__WEBPACK_IMPORTED_MODULE_8__.KEY_ALGO, true, [
            'encrypt',
            'decrypt'
        ]);
        const cipher = appendArrayBuffer(base64ToArrayBuffer(obj.payload), obj.tag);
        const algo = /** @type {AesGcmParams} */ {
            name: 'AES-GCM',
            iv: base64ToArrayBuffer(obj.iv),
            tagLength: _consts_js__WEBPACK_IMPORTED_MODULE_8__.TAG_LENGTH
        };
        return arrayBufferToString((yield crypto.subtle.decrypt(algo, key_obj, cipher)));
    })();
}
/**
 * @param {File} file
 * @returns {Promise<File>}
 */ function encryptFile(file) {
    return _async_to_generator(function*() {
        const iv = crypto.getRandomValues(new Uint8Array(12));
        const key = yield crypto.subtle.generateKey({
            name: 'AES-GCM',
            length: 256
        }, true, [
            'encrypt',
            'decrypt'
        ]);
        const encrypted = yield crypto.subtle.encrypt({
            name: 'AES-GCM',
            iv
        }, key, (yield file.arrayBuffer()));
        const exported_key = yield window.crypto.subtle.exportKey('raw', key);
        const encrypted_file = new File([
            encrypted
        ], file.name, {
            type: file.type,
            lastModified: file.lastModified
        });
        Object.assign(encrypted_file, {
            xep454_ivkey: arrayBufferToHex(iv) + arrayBufferToHex(exported_key)
        });
        return encrypted_file;
    })();
}
/**
 * @param {import('@converse/headless/types/shared/message').default} message
 * @param {import('@converse/headless/shared/types').FileUploadMessageAttributes} attrs
 */ function setEncryptedFileURL(message, attrs) {
    const url = attrs.oob_url.replace(/^https?:/, 'aesgcm:') + '#' + message.file.xep454_ivkey;
    return Object.assign(attrs, {
        oob_url: null,
        message: url,
        body: url
    });
}
/**
 * @param {string} iv
 * @param {string} key
 * @param {ArrayBuffer} cipher
 */ function decryptFile(iv, key, cipher) {
    return _async_to_generator(function*() {
        const key_obj = yield crypto.subtle.importKey('raw', hexToArrayBuffer(key), 'AES-GCM', false, [
            'decrypt'
        ]);
        const algo = /** @type {AesGcmParams} */ {
            name: 'AES-GCM',
            iv: hexToArrayBuffer(iv)
        };
        return crypto.subtle.decrypt(algo, key_obj, cipher);
    })();
}
/**
 * @param {string} url
 * @returns {Promise<ArrayBuffer|null>}
 */ function downloadFile(url) {
    return _async_to_generator(function*() {
        let response;
        try {
            response = yield fetch(url);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`${e.name}: Failed to download encrypted media: ${url}`);
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
            return null;
        }
        if (response.status >= 200 && response.status < 400) {
            return response.arrayBuffer();
        }
    })();
}
/**
 * @param {string} url_text
 * @returns {Promise<string|Error|null>}
 */ function getAndDecryptFile(url_text) {
    return _async_to_generator(function*() {
        const url = new URL(url_text);
        const protocol = window.location.hostname === 'localhost' && url.hostname === 'localhost' ? 'http' : 'https';
        const http_url = url.toString().replace(/^aesgcm/, protocol);
        const cipher = yield downloadFile(http_url);
        if (cipher === null) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`Could not decrypt a received encrypted file ${url.toString()} since it could not be downloaded`);
            return new Error((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error: could not decrypt a received encrypted file, because it could not be downloaded'));
        }
        const hash = url.hash.slice(1);
        const key = hash.substring(hash.length - 64);
        const iv = hash.replace(key, '');
        let content;
        try {
            content = yield decryptFile(iv, key, cipher);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`Could not decrypt file ${url.toString()}`);
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
            return null;
        }
        const [filename, extension] = url.pathname.split('/').pop().split('.');
        const mimetype = utils_file_js__WEBPACK_IMPORTED_MODULE_9__.MIMETYPES_MAP[extension];
        try {
            const file = new File([
                content
            ], filename, {
                'type': mimetype
            });
            return URL.createObjectURL(file);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`Could not decrypt file ${url.toString()}`);
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
            return null;
        }
    })();
}
/**
 * @param {string} file_url
 * @param {string|Error} obj_url
 * @param {import('shared/texture/texture.js').Texture} richtext
 * @returns {import("lit").TemplateResult}
 */ function getTemplateForObjectURL(file_url, obj_url, richtext) {
    if (isError(obj_url)) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="error">${obj_url.message}</p>`;
    }
    if (isImageURL(file_url)) {
        return (0,shared_texture_templates_image_js__WEBPACK_IMPORTED_MODULE_6__["default"])({
            src: obj_url,
            onClick: richtext.onImgClick,
            onLoad: richtext.onImgLoad
        });
    } else if (isAudioURL(file_url)) {
        return (0,shared_texture_templates_audio_js__WEBPACK_IMPORTED_MODULE_4__["default"])(/** @type {string} */ obj_url);
    } else if (isVideoURL(file_url)) {
        return (0,shared_texture_templates_video_js__WEBPACK_IMPORTED_MODULE_7__["default"])(/** @type {string} */ obj_url);
    } else {
        return (0,templates_file_js__WEBPACK_IMPORTED_MODULE_5__["default"])(obj_url, (0,utils_html_js__WEBPACK_IMPORTED_MODULE_12__.getFileName)(file_url));
    }
}
/**
 * @param {string} text
 * @param {number} offset
 * @param {import('shared/texture/texture.js').Texture} richtext
 */ function addEncryptedFiles(text, offset, richtext) {
    const objs = [];
    try {
        const parse_options = {
            start: /\b(aesgcm:\/\/)/gi
        };
        _converse_headless__WEBPACK_IMPORTED_MODULE_3__.u.withinString(text, /**
             * @param {string} url
             * @param {number} start
             * @param {number} end
             */ (url, start, end)=>{
            objs.push({
                url,
                start,
                end
            });
            return url;
        }, parse_options);
    } catch (error) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.debug(error);
        return;
    }
    objs.forEach((o)=>{
        const promise = getAndDecryptFile(o.url).then((obj_url)=>getTemplateForObjectURL(o.url, obj_url, richtext));
        const template = (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__.until)(promise, '')}`;
        richtext.addTemplateResult(o.start + offset, o.end + offset, template);
    });
}
/**
 * @param {import('shared/texture/texture.js').Texture} richtext
 */ function handleEncryptedFiles(richtext) {
    if (!_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.config.get('trusted')) {
        return;
    }
    richtext.addAnnotations(/**
         * @param {string} text
         * @param {number} offset
         */ (text, offset)=>addEncryptedFiles(text, offset, richtext));
}
/**
 * Hook handler for {@link parseMessage} and {@link parseMUCMessage}, which
 * parses the passed in `message` stanza for OMEMO attributes and then sets
 * them on the attrs object.
 * @param {Element} stanza - The message stanza
 * @param {MUCMessageAttributes|MessageAttributes} attrs
 * @returns {Promise<MUCMessageAttributes| MessageAttributes|
        import('./types').MUCMessageAttrsWithEncryption|import('./types').MessageAttrsWithEncryption>}
 */ function parseEncryptedMessage(stanza, attrs) {
    return _async_to_generator(function*() {
        var _api_omemo;
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get('clear_cache_on_logout') || !attrs.is_encrypted || attrs.encryption_namespace !== Strophe.NS.OMEMO) {
            return attrs;
        }
        const encrypted_el = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, stanza).pop();
        const header = encrypted_el.querySelector('header');
        attrs.encrypted = {
            'device_id': header.getAttribute('sid')
        };
        const device_id = yield (_api_omemo = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo) === null || _api_omemo === void 0 ? void 0 : _api_omemo.getDeviceID();
        const key = device_id && sizzle(`key[rid="${device_id}"]`, encrypted_el).pop();
        if (key) {
            var _encrypted_el_querySelector;
            Object.assign(attrs.encrypted, {
                iv: header.querySelector('iv').textContent,
                key: key.textContent,
                payload: ((_encrypted_el_querySelector = encrypted_el.querySelector('payload')) === null || _encrypted_el_querySelector === void 0 ? void 0 : _encrypted_el_querySelector.textContent) || null,
                prekey: [
                    'true',
                    '1'
                ].includes(key.getAttribute('prekey'))
            });
        } else {
            return Object.assign(attrs, {
                error_condition: 'not-encrypted-for-this-device',
                error_type: 'Decryption',
                is_ephemeral: true,
                is_error: true,
                type: 'error'
            });
        }
        // https://xmpp.org/extensions/xep-0384.html#usecases-receiving
        if (attrs.encrypted.prekey === true) {
            return decryptPrekeyWhisperMessage(attrs);
        } else {
            return decryptWhisperMessage(attrs);
        }
    })();
}
function onChatInitialized(chatbox) {
    checkOMEMOSupported(chatbox);
    if (chatbox.get('type') === CHATROOMS_TYPE) {
        chatbox.occupants.on('add', (o)=>onOccupantAdded(chatbox, o));
        chatbox.features.on('change', ()=>checkOMEMOSupported(chatbox));
    }
}
function onChatComponentInitialized(el) {
    el.listenTo(el.model.messages, 'add', (message)=>{
        if (message.get('is_encrypted') && !message.get('is_error')) {
            el.model.save('omemo_supported', true);
        }
    });
    el.listenTo(el.model, 'change:omemo_supported', ()=>{
        if (!el.model.get('omemo_supported') && el.model.get('omemo_active')) {
            el.model.set('omemo_active', false);
        } else {
            var // Manually trigger an update, setting omemo_active to
            // false above will automatically trigger one.
            _el_querySelector;
            (_el_querySelector = el.querySelector('converse-chat-toolbar')) === null || _el_querySelector === void 0 ? void 0 : _el_querySelector.requestUpdate();
        }
    });
    el.listenTo(el.model, 'change:omemo_active', ()=>{
        el.querySelector('converse-chat-toolbar').requestUpdate();
    });
}
/**
 * @param {string} jid
 * @param {number} id
 */ function getSessionCipher(jid, id) {
    const { libsignal } = /** @type WindowWithLibsignal */ window;
    const address = new libsignal.SignalProtocolAddress(jid, id);
    return new libsignal.SessionCipher(_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store, address);
}
/**
 * We use the bare, real (i.e. non-MUC) JID as encrypted session identifier.
 * @param {MUCMessageAttributes|MessageAttributes} attrs
 */ function getJIDForDecryption(attrs) {
    let from_jid;
    if (attrs.sender === 'me') {
        from_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
    } else if (attrs.contact_jid) {
        from_jid = attrs.contact_jid;
    } else if ('from_real_jid' in attrs) {
        from_jid = attrs.from_real_jid;
    } else {
        from_jid = attrs.from;
    }
    if (!from_jid) {
        Object.assign(attrs, {
            error_text: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sorry, could not decrypt a received OMEMO ' + "message because we don't have the XMPP address for that user."),
            error_type: 'Decryption',
            is_ephemeral: true,
            is_error: true,
            type: 'error'
        });
        throw new Error('Could not find JID to decrypt OMEMO message for');
    }
    return from_jid;
}
function handleDecryptedWhisperMessage(attrs, key_and_tag) {
    return _async_to_generator(function*() {
        const from_jid = getJIDForDecryption(attrs);
        const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(from_jid, true);
        const encrypted = attrs.encrypted;
        let device = devicelist.devices.get(encrypted.device_id);
        if (!device) {
            device = yield devicelist.devices.create({
                'id': encrypted.device_id,
                'jid': from_jid
            }, {
                'promise': true
            });
        }
        if (encrypted.payload) {
            const key = key_and_tag.slice(0, 16);
            const tag = key_and_tag.slice(16);
            const result = yield omemo.decryptMessage(Object.assign(encrypted, {
                key,
                tag
            }));
            device.save('active', true);
            return result;
        }
    })();
}
function getDecryptionErrorAttributes(e) {
    return {
        'error_text': (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sorry, could not decrypt a received OMEMO message due to an error.') + ` ${e.name} ${e.message}`,
        'error_condition': e.name,
        'error_message': e.message,
        'error_type': 'Decryption',
        'is_ephemeral': true,
        'is_error': true,
        'type': 'error'
    };
}
/**
 * @param {MUCMessageAttributes|MessageAttributes} attrs
 */ function decryptPrekeyWhisperMessage(attrs) {
    return _async_to_generator(function*() {
        const from_jid = getJIDForDecryption(attrs);
        const session_cipher = getSessionCipher(from_jid, parseInt(attrs.encrypted.device_id, 10));
        const key = base64ToArrayBuffer(attrs.encrypted.key);
        let key_and_tag;
        try {
            key_and_tag = yield session_cipher.decryptPreKeyWhisperMessage(key, 'binary');
        } catch (e) {
            // TODO from the XEP:
            // There are various reasons why decryption of an
            // OMEMOKeyExchange or an OMEMOAuthenticatedMessage
            // could fail. One reason is if the message was
            // received twice and already decrypted once, in this
            // case the client MUST ignore the decryption failure
            // and not show any warnings/errors. In all other cases
            // of decryption failure, clients SHOULD respond by
            // forcibly doing a new key exchange and sending a new
            // OMEMOKeyExchange with a potentially empty SCE
            // payload. By building a new session with the original
            // sender this way, the invalid session of the original
            // sender will get overwritten with this newly created,
            // valid session.
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`${e.name} ${e.message}`);
            return Object.assign(attrs, getDecryptionErrorAttributes(e));
        }
        // TODO from the XEP:
        // When a client receives the first message for a given
        // ratchet key with a counter of 53 or higher, it MUST send
        // a heartbeat message. Heartbeat messages are normal OMEMO
        // encrypted messages where the SCE payload does not include
        // any elements. These heartbeat messages cause the ratchet
        // to forward, thus consequent messages will have the
        // counter restarted from 0.
        try {
            const plaintext = yield handleDecryptedWhisperMessage(attrs, key_and_tag);
            const { omemo_store } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state;
            yield omemo_store.generateMissingPreKeys();
            yield omemo_store.publishBundle();
            if (plaintext) {
                return Object.assign(attrs, {
                    'plaintext': plaintext
                });
            } else {
                return Object.assign(attrs, {
                    'is_only_key': true
                });
            }
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`${e.name} ${e.message}`);
            return Object.assign(attrs, getDecryptionErrorAttributes(e));
        }
    })();
}
/**
 * @param {MUCMessageAttributes|MessageAttributes} attrs
 */ function decryptWhisperMessage(attrs) {
    return _async_to_generator(function*() {
        const from_jid = getJIDForDecryption(attrs);
        const session_cipher = getSessionCipher(from_jid, parseInt(attrs.encrypted.device_id, 10));
        const key = base64ToArrayBuffer(attrs.encrypted.key);
        try {
            const key_and_tag = yield session_cipher.decryptWhisperMessage(key, 'binary');
            const plaintext = yield handleDecryptedWhisperMessage(attrs, key_and_tag);
            return Object.assign(attrs, {
                'plaintext': plaintext
            });
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`${e.name} ${e.message}`);
            return Object.assign(attrs, getDecryptionErrorAttributes(e));
        }
    })();
}
/**
 * Given an XML element representing a user's OMEMO bundle, parse it
 * and return a map.
 * @param {Element} bundle_el
 * @returns {import('./types').Bundle}
 */ function parseBundle(bundle_el) {
    const signed_prekey_public_el = bundle_el.querySelector('signedPreKeyPublic');
    const signed_prekey_signature_el = bundle_el.querySelector('signedPreKeySignature');
    const prekeys = sizzle(`prekeys > preKeyPublic`, bundle_el).map(/** @param {Element} el */ (el)=>({
            id: parseInt(el.getAttribute('preKeyId'), 10),
            key: el.textContent
        }));
    return {
        identity_key: bundle_el.querySelector('identityKey').textContent.trim(),
        signed_prekey: {
            id: parseInt(signed_prekey_public_el.getAttribute('signedPreKeyId'), 10),
            public_key: signed_prekey_public_el.textContent,
            signature: signed_prekey_signature_el.textContent
        },
        prekeys
    };
}
/**
 * @param {string} jid
 */ function generateFingerprints(jid) {
    return _async_to_generator(function*() {
        const devices = yield getDevicesForContact(jid);
        return Promise.all(devices.map((d)=>generateFingerprint(d)));
    })();
}
/**
 * @param {import('./device.js').default} device
 */ function generateFingerprint(device) {
    return _async_to_generator(function*() {
        var _device_get;
        if ((_device_get = device.get('bundle')) === null || _device_get === void 0 ? void 0 : _device_get.fingerprint) {
            return;
        }
        const bundle = yield device.getBundle();
        bundle['fingerprint'] = arrayBufferToHex(base64ToArrayBuffer(bundle['identity_key']));
        device.save('bundle', bundle);
        device.trigger('change:bundle'); // Doesn't get triggered automatically due to pass-by-reference
    })();
}
/**
 * @param {string} jid
 * @returns {Promise<import('./devices.js').default>}
 */ function getDevicesForContact(jid) {
    return _async_to_generator(function*() {
        yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.waitUntil('OMEMOInitialized');
        const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(jid, true);
        yield devicelist.fetchDevices();
        return devicelist.devices;
    })();
}
/**
 * @param {string} jid
 * @param {string} device_id
 * @returns {Promise<import('./device.js').default[]>}
 */ function getDeviceForContact(jid, device_id) {
    return _async_to_generator(function*() {
        const devices = yield getDevicesForContact(jid);
        return devices.get(device_id);
    })();
}
function generateDeviceID() {
    return _async_to_generator(function*() {
        const { libsignal } = /** @type WindowWithLibsignal */ window;
        /* Generates a device ID, making sure that it's unique */ const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
        const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(bare_jid, true);
        const existing_ids = devicelist.devices.pluck('id');
        let device_id = libsignal.KeyHelper.generateRegistrationId();
        // Before publishing a freshly generated device id for the first time,
        // a device MUST check whether that device id already exists, and if so, generate a new one.
        let i = 0;
        while(existing_ids.includes(device_id)){
            device_id = libsignal.KeyHelper.generateRegistrationId();
            i++;
            if (i === 10) {
                throw new Error('Unable to generate a unique device ID');
            }
        }
        return device_id.toString();
    })();
}
/**
 * @param {import('./device.js').default} device
 */ function buildSession(device) {
    return _async_to_generator(function*() {
        const { libsignal } = /** @type WindowWithLibsignal */ window;
        const address = new libsignal.SignalProtocolAddress(device.get('jid'), device.get('id'));
        const sessionBuilder = new libsignal.SessionBuilder(_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store, address);
        const prekey = device.getRandomPreKey();
        const bundle = yield device.getBundle();
        return sessionBuilder.processPreKey({
            registrationId: parseInt(device.get('id'), 10),
            identityKey: base64ToArrayBuffer(bundle.identity_key),
            signedPreKey: {
                keyId: bundle.signed_prekey.id,
                publicKey: base64ToArrayBuffer(bundle.signed_prekey.public_key),
                signature: base64ToArrayBuffer(bundle.signed_prekey.signature)
            },
            preKey: {
                keyId: prekey.id,
                publicKey: base64ToArrayBuffer(prekey.key)
            }
        });
    })();
}
/**
 * @param {import('./device.js').default} device
 */ function getSession(device) {
    return _async_to_generator(function*() {
        if (!device.get('bundle')) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`Could not build an OMEMO session for device ${device.get('id')} because we don't have its bundle`);
            return null;
        }
        const { libsignal } = /** @type WindowWithLibsignal */ window;
        const address = new libsignal.SignalProtocolAddress(device.get('jid'), device.get('id'));
        const session = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store.loadSession(address.toString());
        if (session) {
            return session;
        } else {
            try {
                return yield buildSession(device);
            } catch (e) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(`Could not build an OMEMO session for device ${device.get('id')}`);
                _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
                return null;
            }
        }
    })();
}
/**
 * @param {Element} stanza
 */ function updateBundleFromStanza(stanza) {
    return _async_to_generator(function*() {
        const items_el = sizzle(`items`, stanza).pop();
        if (!items_el || !items_el.getAttribute('node').startsWith(Strophe.NS.OMEMO_BUNDLES)) {
            return;
        }
        const device_id = items_el.getAttribute('node').split(':')[1];
        const jid = stanza.getAttribute('from');
        const bundle_el = sizzle(`item > bundle`, items_el).pop();
        const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(jid, true);
        const device = devicelist.devices.get(device_id) || devicelist.devices.create({
            'id': device_id,
            jid
        });
        device.save({
            'bundle': parseBundle(bundle_el)
        });
    })();
}
/**
 * @param {Element} stanza
 */ function updateDevicesFromStanza(stanza) {
    return _async_to_generator(function*() {
        const items_el = sizzle(`items[node="${Strophe.NS.OMEMO_DEVICELIST}"]`, stanza).pop();
        if (!items_el) return;
        const device_selector = `item list[xmlns="${Strophe.NS.OMEMO}"] device`;
        const device_ids = sizzle(device_selector, items_el).map((d)=>d.getAttribute('id'));
        const jid = stanza.getAttribute('from');
        const devicelist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(jid, true);
        const devices = devicelist.devices;
        const removed_ids = devices.pluck('id').filter((id)=>!device_ids.includes(id));
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
        removed_ids.forEach(/** @param {string} id */ (id)=>{
            if (jid === bare_jid && id === _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store.get('device_id')) {
                return; // We don't set the current device as inactive
            }
            devices.get(id).save('active', false);
        });
        device_ids.forEach(/** @param {string} device_id */ (device_id)=>{
            const device = devices.get(device_id);
            if (device) {
                device.save('active', true);
            } else {
                devices.create({
                    id: device_id,
                    jid
                });
            }
        });
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_3__.u.isSameBareJID(bare_jid, jid)) {
            // Make sure our own device is on the list
            // (i.e. if it was removed, add it again).
            devicelist.publishCurrentDevice(device_ids);
        }
    })();
}
/**
 * @param {Element} message
 */ function handlePEPPush(message) {
    return _async_to_generator(function*() {
        try {
            if (sizzle(`event[xmlns="${Strophe.NS.PUBSUB}#event"]`, message).length) {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.waitUntil('OMEMOInitialized');
                yield updateDevicesFromStanza(message);
                yield updateBundleFromStanza(message);
            }
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
        }
    })();
}
/**
 * Register a pubsub handler for devices pushed from other connected clients
 */ function registerPEPPushHandler() {
    _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.connection.get().addHandler(/** @param {Element} message */ (message)=>{
        handlePEPPush(message);
        return true;
    }, null, 'message', 'headline');
}
function restoreOMEMOSession() {
    return _async_to_generator(function*() {})();
}
function fetchDeviceLists() {
    return _async_to_generator(function*() {
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
        _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.devicelists = new _devicelists_js__WEBPACK_IMPORTED_MODULE_11__["default"]();
        const id = `converse.devicelists-${bare_jid}`;
        initStorage(_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.devicelists, id);
        yield new Promise((resolve)=>{
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.devicelists.fetch({
                success: resolve,
                error: (_m, e)=>{
                    _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
                    resolve();
                }
            });
        });
        // Call API method to wait for our own device list to be fetched from the
        // server or to be created. If we have no pre-existing OMEMO session, this
        // will cause a new device and bundle to be generated and published.
        yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(bare_jid, true);
    })();
}
/**
 * @param {boolean} reconnecting
 */ function initOMEMO(reconnecting) {
    return _async_to_generator(function*() {
        if (reconnecting) {
            return;
        }
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.config.get('trusted') || _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get('clear_cache_on_logout')) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.warn('Not initializing OMEMO, since this browser is not trusted or clear_cache_on_logout is set to true');
            return;
        }
        try {
            yield fetchDeviceLists();
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.session.restore();
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store.publishBundle();
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error('Could not initialize OMEMO support');
            _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(e);
            return;
        }
        /**
     * Triggered once OMEMO support has been initialized
     * @event _converse#OMEMOInitialized
     * @example _converse.api.listen.on('OMEMOInitialized', () => { ... });
     */ _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.trigger('OMEMOInitialized');
    })();
}
/**
 * @param {MUC} chatroom
 * @param {import('@converse/headless/types/plugins/muc/occupant').default} occupant
 */ function onOccupantAdded(chatroom, occupant) {
    return _async_to_generator(function*() {
        if (occupant.isSelf() || !chatroom.features.get('nonanonymous') || !chatroom.features.get('membersonly')) {
            return;
        }
        if (chatroom.get('omemo_active')) {
            const supported = yield contactHasOMEMOSupport(occupant.get('jid'));
            if (!supported) {
                chatroom.createMessage({
                    'message': (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("%1$s doesn't appear to have a client that supports OMEMO. " + 'Encrypted chat will no longer be possible in this grouchat.', occupant.get('nick')),
                    'type': 'error'
                });
                chatroom.save({
                    'omemo_active': false,
                    'omemo_supported': false
                });
            }
        }
    })();
}
function checkOMEMOSupported(chatbox) {
    return _async_to_generator(function*() {
        let supported;
        if (chatbox.get('type') === CHATROOMS_TYPE) {
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.waitUntil('OMEMOInitialized');
            supported = chatbox.features.get('nonanonymous') && chatbox.features.get('membersonly');
        } else if (chatbox.get('type') === PRIVATE_CHAT_TYPE) {
            supported = yield contactHasOMEMOSupport(chatbox.get('jid'));
        }
        chatbox.set('omemo_supported', !!supported);
        if (supported && _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get('omemo_default')) {
            chatbox.set('omemo_active', true);
        }
    })();
}
/**
 * @param {MouseEvent} ev
 */ function toggleOMEMO(ev) {
    ev.stopPropagation();
    ev.preventDefault();
    const toolbar_el = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.u.ancestor(ev.target, 'converse-chat-toolbar');
    if (!toolbar_el.model.get('omemo_supported')) {
        let messages;
        if (toolbar_el.model.get('type') === CHATROOMS_TYPE) {
            messages = [
                (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cannot use end-to-end encryption in this groupchat, ' + 'either the groupchat has some anonymity or not all participants support OMEMO.')
            ];
        } else {
            messages = [
                (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Cannot use end-to-end encryption because %1$s uses a client that doesn't support OMEMO.", toolbar_el.model.contact.getDisplayName())
            ];
        }
        return _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error'), messages);
    }
    toolbar_el.model.save({
        'omemo_active': !toolbar_el.model.get('omemo_active')
    });
}
/**
 * @param {import('shared/chat/toolbar').ChatToolbar} toolbar_el
 * @param {Array<import('lit').TemplateResult>} buttons
 */ function getOMEMOToolbarButton(toolbar_el, buttons) {
    const model = toolbar_el.model;
    const is_muc = model.get('type') === CHATROOMS_TYPE;
    let title;
    if (model.get('omemo_supported')) {
        const i18n_plaintext = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Messages are being sent in plaintext');
        const i18n_encrypted = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Messages are sent encrypted');
        title = model.get('omemo_active') ? i18n_encrypted : i18n_plaintext;
    } else if (is_muc) {
        title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This groupchat needs to be members-only and non-anonymous in ' + 'order to support OMEMO encrypted messages');
    } else {
        title = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('OMEMO encryption is not supported');
    }
    let color;
    if (model.get('omemo_supported')) {
        if (model.get('omemo_active')) {
            color = is_muc ? `var(--muc-color)` : `var(--chat-color)`;
        } else {
            color = `var(--error-color)`;
        }
    } else {
        color = `var(--disabled-color)`;
    }
    buttons.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn toggle-omemo" title="${title}" data-disabled="${!model.get('omemo_supported')}" @click="${toggleOMEMO}"><converse-icon class="fa ${model.get('omemo_active') ? `fa-lock` : `fa-unlock`}" path-prefix="${_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get('assets_path')}" size="1em" color="${color}"></converse-icon></button>`);
    return buttons;
}
/**
 * @param {MUC|ChatBox} chatbox
 * @returns {Promise<import('./device.js').default[]>}
 */ function getBundlesAndBuildSessions(chatbox) {
    return _async_to_generator(function*() {
        const no_devices_err = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sorry, no devices found to which we can send an OMEMO encrypted message.');
        let devices;
        if (chatbox instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_3__.MUC) {
            const collections = yield Promise.all(chatbox.occupants.map(/** @param {import('@converse/headless/types/plugins/muc/occupant').default} o */ (o)=>getDevicesForContact(o.get('jid'))));
            devices = collections.reduce((a, b)=>a.concat(b.models), []);
        } else if (chatbox.get('type') === PRIVATE_CHAT_TYPE) {
            const their_devices = yield getDevicesForContact(chatbox.get('jid'));
            if (their_devices.length === 0) {
                throw new shared_errors_js__WEBPACK_IMPORTED_MODULE_10__.UserFacingError(no_devices_err);
            }
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('bare_jid');
            const own_list = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.omemo.devicelists.get(bare_jid);
            const own_devices = own_list.devices;
            devices = [
                ...own_devices.models,
                ...their_devices.models
            ];
        }
        // Filter out our own device
        const id = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store.get('device_id');
        devices = devices.filter(/** @param {import('./device.js').default} d */ (d)=>d.get('id') !== id);
        // Fetch bundles if necessary
        yield Promise.all(devices.map((d)=>d.getBundle()));
        const sessions = devices.filter((d)=>d).map((d)=>getSession(d));
        yield Promise.all(sessions);
        if (sessions.includes(null)) {
            // We couldn't build a session for certain devices.
            devices = devices.filter((d)=>sessions[devices.indexOf(d)]);
            if (devices.length === 0) {
                throw new shared_errors_js__WEBPACK_IMPORTED_MODULE_10__.UserFacingError(no_devices_err);
            }
        }
        return devices;
    })();
}
/**
 * @param {ArrayBuffer} key_and_tag
 * @param {import('./device.js').default} device
 */ function encryptKey(key_and_tag, device) {
    return getSessionCipher(device.get('jid'), device.get('id')).encrypt(key_and_tag).then((payload)=>({
            payload,
            device
        }));
}
/**
 * @param {MUC|ChatBox} chat
 * @param {{ message: BaseMessage, stanza: import('strophe.js').Builder }} data
 * @return {Promise<{ message: BaseMessage, stanza: import('strophe.js').Builder }>}
 */ function createOMEMOMessageStanza(chat, data) {
    return _async_to_generator(function*() {
        let { stanza } = data;
        const { message } = data;
        if (!message.get('is_encrypted')) {
            return data;
        }
        if (!message.get('body')) {
            throw new Error('No message body to encrypt!');
        }
        const devices = yield getBundlesAndBuildSessions(chat);
        const { key_and_tag, iv, payload } = yield omemo.encryptMessage(message.get('plaintext'));
        // The 16 bytes key and the GCM authentication tag (The tag
        // SHOULD have at least 128 bit) are concatenated and for each
        // intended recipient device, i.e. both own devices as well as
        // devices associated with the contact, the result of this
        // concatenation is encrypted using the corresponding
        // long-standing SignalProtocol session.
        const dicts = yield Promise.all(devices.filter((device)=>device.get('trusted') != _consts_js__WEBPACK_IMPORTED_MODULE_8__.UNTRUSTED && device.get('active')).map((device)=>encryptKey(key_and_tag, device)));
        // An encrypted header is added to the message for
        // each device that is supposed to receive it.
        // These headers simply contain the key that the
        // payload message is encrypted with,
        // and they are separately encrypted using the
        // session corresponding to the counterpart device.
        stanza.cnode(stx`
            <encrypted xmlns="${Strophe.NS.OMEMO}">
                <header sid="${_converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.state.omemo_store.get('device_id')}">
                    ${dicts.map(({ payload, device })=>{
            const prekey = 3 == parseInt(payload.type, 10);
            if (prekey) {
                return stx`<key rid="${device.get('id')}" prekey="true">${btoa(payload.body)}</key>`;
            }
            return stx`<key rid="${device.get('id')}">${btoa(payload.body)}</key>`;
        })}
                    <iv>${iv}</iv>
                </header>
                <payload>${payload}</payload>
            </encrypted>`).root();
        stanza.cnode(stx`<store xmlns="${Strophe.NS.HINTS}"/>`).root();
        stanza.cnode(stx`<encryption xmlns="${Strophe.NS.EME}" namespace="${Strophe.NS.OMEMO}"/>`).root();
        return {
            message,
            stanza
        };
    })();
}
const omemo = {
    decryptMessage,
    encryptMessage,
    formatFingerprint
};


/***/ }),

/***/ "./src/plugins/profile/index.js":
/*!**************************************!*\
  !*** ./src/plugins/profile/index.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _modal_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modal/index.js */ "./src/plugins/modal/index.js");
/* harmony import */ var _modals_profile_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modals/profile.js */ "./src/plugins/profile/modals/profile.js");
/* harmony import */ var _modals_user_settings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modals/user-settings.js */ "./src/plugins/profile/modals/user-settings.js");
/* harmony import */ var _statusview_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./statusview.js */ "./src/plugins/profile/statusview.js");
/**
 * @copyright The Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 




_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-profile', {
    dependencies: [
        'converse-status',
        'converse-modal',
        'converse-vcard',
        'converse-chatboxviews',
        'converse-adhoc-views'
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            show_client_info: true
        });
    }
});


/***/ }),

/***/ "./src/plugins/profile/modals/profile.js":
/*!***********************************************!*\
  !*** ./src/plugins/profile/modals/profile.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ProfileModal)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var utils_file_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! utils/file.js */ "./src/utils/file.js");
/* harmony import */ var _password_reset_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../password-reset.js */ "./src/plugins/profile/password-reset.js");
/* harmony import */ var plugins_modal_templates_buttons_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! plugins/modal/templates/buttons.js */ "./src/plugins/modal/templates/buttons.js");
/* harmony import */ var _templates_logout_button_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../templates/logout_button.js */ "./src/plugins/profile/templates/logout_button.js");
/* harmony import */ var _templates_profile_modal_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../templates/profile_modal.js */ "./src/plugins/profile/templates/profile_modal.js");
/* harmony import */ var _styles_profile_scss__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./styles/profile.scss */ "./src/plugins/profile/modals/styles/profile.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}











class ProfileModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_4__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.model, 'change', this.render);
        this.addEventListener('shown.bs.modal', ()=>{
            var /** @type {HTMLInputElement} */ _this_querySelector;
            (_this_querySelector = this.querySelector('input[name="status_message"]')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
        }, false);
        /**
         * Triggered when the _converse.ProfileModal has been created and initialized.
         * @event _converse#profileModalInitialized
         * @type {Profile}
         * @example _converse.api.listen.on('profileModalInitialized', status => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.trigger('profileModalInitialized', this.model);
    }
    /**
     * @param {Map<string, boolean>} changed - A map of changed properties.
     */ willUpdate(changed) {
        if (changed.has('model')) {
            this._show_clear_button = !!this.model.get('status_message');
        }
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Your Profile');
    }
    /**
     * @returns {TemplateResult}
     */ renderModal() {
        return (0,_templates_profile_modal_js__WEBPACK_IMPORTED_MODULE_9__["default"])(this);
    }
    /**
     * @returns {TemplateResult|String}
     */ renderModalFooter() {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_logout') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="modal-footer d-flex justify-content-between">${plugins_modal_templates_buttons_js__WEBPACK_IMPORTED_MODULE_7__.modal_close_button} ${(0,_templates_logout_button_js__WEBPACK_IMPORTED_MODULE_8__["default"])(this)}</div>` : '';
    }
    /**
     * @param {VCardData} data
     */ setVCard(data) {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get('bare_jid');
            try {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.vcard.set(bare_jid, data);
            } catch (err) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.fatal(err);
                this.alert([
                    (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Sorry, an error happened while trying to save your profile data.'),
                    (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)("You can check your browser's developer console for any error output.")
                ].join(' '));
                return false;
            }
            return true;
        }).call(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ onProfileFormSubmitted(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            this._submitting = true;
            const form_data = new FormData(/** @type {HTMLFormElement} */ ev.target);
            const image_file = /** @type {File} */ form_data.get('avatar_image');
            const data = /** @type {VCardData} */ {
                fn: form_data.get('fn'),
                nickname: form_data.get('nickname'),
                role: form_data.get('role'),
                email: form_data.get('email'),
                url: form_data.get('url')
            };
            if (image_file === null || image_file === void 0 ? void 0 : image_file.size) {
                const image_data = yield (0,utils_file_js__WEBPACK_IMPORTED_MODULE_5__.compressImage)(image_file);
                const reader = new FileReader();
                reader.onloadend = ()=>_async_to_generator(function*() {
                        Object.assign(data, {
                            image: btoa(/** @type {string} */ reader.result),
                            image_type: image_file.type
                        });
                        if (yield this.setVCard(data)) {
                            this._submitting = false;
                            this.modal.hide();
                        }
                    }).call(this);
                reader.readAsBinaryString(image_data);
            } else {
                Object.assign(data, {
                    image: this.model.vcard.get('image'),
                    image_type: this.model.vcard.get('image_type')
                });
                if (yield this.setVCard(data)) {
                    this.modal.hide();
                    _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.toast.show('vcard-updated', {
                        type: 'success',
                        body: (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Profile updated successfully')
                    });
                }
                this._submitting = false;
            }
        }).call(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ onStatusFormSubmitted(ev) {
        ev.preventDefault();
        const data = new FormData(/** @type {HTMLFormElement} */ ev.target);
        let show, presence;
        const chat_status = data.get('chat_status');
        if (chat_status === 'online') {
            presence = 'online';
        } else {
            show = chat_status;
        }
        this.model.save({
            status_message: data.get('status_message'),
            presence,
            show
        });
        this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Status updated'), 'info');
    }
    /**
     * @param {MouseEvent} ev
     */ clearStatusMessage(ev) {
        if (ev && ev.preventDefault) {
            ev.preventDefault();
        }
        this._show_clear_button = false;
        const roster_filter = /** @type {HTMLInputElement} */ this.querySelector('input[name="status_message"]');
        roster_filter.value = '';
    }
    /**
     * @param {MouseEvent} ev
     */ logOut(ev) {
        return _async_to_generator(function*() {
            ev === null || ev === void 0 ? void 0 : ev.preventDefault();
            this.close();
            const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Confirm'), (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Are you sure you want to log out?'));
            if (result) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.user.logout();
            }
        }).call(this);
    }
    /**
     * @param {Object} options
     */ constructor(options){
        super(options);
        this.tab = 'status';
        this._show_clear_button = false;
    }
}
/**
     * @typedef {import('@converse/headless/types/plugins/vcard/types').VCardData} VCardData
     * @typedef {import("@converse/headless").Profile} Profile
     * @typedef {import("lit").TemplateResult} TemplateResult
     */ _define_property(ProfileModal, "properties", {
    _submitting: {
        state: true
    },
    _show_clear_button: {
        type: Boolean,
        state: true
    },
    model: {
        type: _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.Model
    },
    tab: {
        type: String
    }
});

_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-profile-modal', ProfileModal);


/***/ }),

/***/ "./src/plugins/profile/modals/styles/profile.scss":
/*!********************************************************!*\
  !*** ./src/plugins/profile/modals/styles/profile.scss ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./profile.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/modals/styles/profile.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/profile/modals/styles/user-settings.scss":
/*!**************************************************************!*\
  !*** ./src/plugins/profile/modals/styles/user-settings.scss ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_settings_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./user-settings.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/modals/styles/user-settings.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_settings_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_settings_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_settings_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_settings_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/profile/modals/templates/user-settings.js":
/*!***************************************************************!*\
  !*** ./src/plugins/profile/modals/templates/user-settings.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.es.mjs");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit/directives/unsafe-html.js */ "./node_modules/lit/directives/unsafe-html.js");





/**
 * @param {import('../user-settings').default} el
 */ const tplNavigation = (el)=>{
    var _converse_pluggable_plugins_conversediscoviews;
    const i18n_about = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('About');
    const i18n_commands = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Commands');
    const i18n_services = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Services');
    const show_client_info = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_client_info');
    const allow_adhoc_commands = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_adhoc_commands');
    const has_disco_browser = (_converse_pluggable_plugins_conversediscoviews = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.pluggable.plugins['converse-disco-views']) === null || _converse_pluggable_plugins_conversediscoviews === void 0 ? void 0 : _converse_pluggable_plugins_conversediscoviews.enabled(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse);
    const show_tabs = (show_client_info ? 1 : 0) + (allow_adhoc_commands ? 1 : 0) + (has_disco_browser ? 1 : 0) >= 2;
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`${show_tabs ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<ul class="nav nav-pills justify-content-center">${show_client_info ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'about' ? 'active' : ''}" id="about-tab" href="#about-tabpanel" aria-controls="about-tabpanel" role="tab" data-toggle="tab" data-name="about" @click="${(ev)=>el.switchTab(ev)}">${i18n_about}</a></li>` : ''} ${allow_adhoc_commands ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'commands' ? 'active' : ''}" id="commands-tab" href="#commands-tabpanel" aria-controls="commands-tabpanel" role="tab" data-toggle="tab" data-name="commands" @click="${(ev)=>el.switchTab(ev)}">${i18n_commands}</a></li>` : ''} ${has_disco_browser ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'disco' ? 'active' : ''}" id="server-tab" href="#server-tabpanel" aria-controls="server-tabpanel" role="tab" data-toggle="tab" data-name="disco" @click="${(ev)=>el.switchTab(ev)}">${i18n_services}</a></li>` : ''}</ul>` : ''}`;
};
/**
 * @param {import('../user-settings').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _converse_pluggable_plugins_conversediscoviews;
    const first_subtitle = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('%1$s Open Source %2$s XMPP chat client brought to you by %3$s Opkode %2$s', '<a target="_blank" rel="nofollow" href="https://conversejs.org">', '</a>', '<a target="_blank" rel="nofollow" href="https://opkode.com">');
    const second_subtitle = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('%1$s Translate %2$s it into your own language', '<a target="_blank" rel="nofollow" href="https://hosted.weblate.org/projects/conversejs/#languages">', '</a>');
    const show_client_info = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_client_info');
    const allow_adhoc_commands = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_adhoc_commands');
    const show_both_tabs = show_client_info && allow_adhoc_commands;
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`${show_both_tabs ? tplNavigation(el) : ''}<div class="tab-content">${show_client_info ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="tab-pane tab-pane--columns ${el.tab === 'about' ? 'active' : ''}" id="about-tabpanel" role="tabpanel" aria-labelledby="about-tab"><div class="container"><converse-brand-logo class="d-flex justify-content-center mt-3" hide_byline></converse-brand-logo><p class="text-center brand-subtitle">${_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.VERSION_NAME}</p><p class="text-center brand-subtitle">${(0,lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_4__.unsafeHTML)(dompurify__WEBPACK_IMPORTED_MODULE_0__["default"].sanitize(first_subtitle))}</p><p class="text-center brand-subtitle">${(0,lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_4__.unsafeHTML)(dompurify__WEBPACK_IMPORTED_MODULE_0__["default"].sanitize(second_subtitle))}</p></div></div>` : ''} ${allow_adhoc_commands ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="tab-pane tab-pane--columns ${el.tab === 'commands' ? 'active' : ''}" id="commands-tabpanel" role="tabpanel" aria-labelledby="commands-tab"><converse-adhoc-commands></div>` : ''} ${((_converse_pluggable_plugins_conversediscoviews = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.pluggable.plugins['converse-disco-views']) === null || _converse_pluggable_plugins_conversediscoviews === void 0 ? void 0 : _converse_pluggable_plugins_conversediscoviews.enabled(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse)) ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="tab-pane tab-pane--columns ${el.tab === 'disco' ? 'active' : ''}" id="server-tabpanel" role="tabpanel" aria-labelledby="server-tab">${el.tab === 'disco' ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<converse-disco-browser></converse-disco-browser>` : ''}</div>` : ''}</div>`;
});


/***/ }),

/***/ "./src/plugins/profile/modals/user-settings.js":
/*!*****************************************************!*\
  !*** ./src/plugins/profile/modals/user-settings.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ UserSettingsModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_user_settings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/user-settings.js */ "./src/plugins/profile/modals/templates/user-settings.js");
/* harmony import */ var _styles_user_settings_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/user-settings.scss */ "./src/plugins/profile/modals/styles/user-settings.scss");





class UserSettingsModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    renderModal() {
        return (0,_templates_user_settings_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Settings');
    }
    constructor(options){
        super(options);
        const show_client_info = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('show_client_info');
        const allow_adhoc_commands = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_adhoc_commands');
        const show_both_tabs = show_client_info && allow_adhoc_commands;
        if (show_both_tabs || show_client_info) {
            this.tab = 'about';
        } else if (allow_adhoc_commands) {
            this.tab = 'commands';
        }
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-user-settings-modal', UserSettingsModal);


/***/ }),

/***/ "./src/plugins/profile/password-reset.js":
/*!***********************************************!*\
  !*** ./src/plugins/profile/password-reset.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _templates_password_reset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/password-reset.js */ "./src/plugins/profile/templates/password-reset.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




const { Strophe, $iq, sizzle, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.converse.env;
class PasswordReset extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            passwords_mismatched: {
                type: Boolean
            },
            alert_message: {
                type: String
            }
        };
    }
    initialize() {
        this.passwords_mismatched = false;
        this.alert_message = '';
    }
    render() {
        return (0,_templates_password_reset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
    }
    checkPasswordsMatch(ev) {
        var _ev_target_form;
        const form_data = new FormData((_ev_target_form = ev.target.form) !== null && _ev_target_form !== void 0 ? _ev_target_form : ev.target);
        const password = form_data.get('password');
        const password_check = form_data.get('password_check');
        this.passwords_mismatched = password && password !== password_check;
        return this.passwords_mismatched;
    }
    onSubmit(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            if (this.checkPasswordsMatch(ev)) return;
            const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_3__._converse.session.get('domain');
            const iq = $iq({
                'type': 'get',
                'to': domain
            }).c('query', {
                'xmlns': Strophe.NS.REGISTER
            });
            const iq_response = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.sendIQ(iq);
            if (iq_response === null) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Timeout error');
                return;
            } else if (sizzle(`error service-unavailable[xmlns="${Strophe.NS.STANZAS}"]`, iq_response).length) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your server does not support password reset');
                return;
            } else if (u.isErrorStanza(iq_response)) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your server responded with an unknown error, check the console for details');
                _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error("Could not set password");
                _converse_headless__WEBPACK_IMPORTED_MODULE_3__.log.error(iq_response);
                return;
            }
            const username = iq_response.querySelector('username').textContent;
            const data = new FormData(ev.target);
            const password = data.get('password');
            const reset_iq = $iq({
                'type': 'set',
                'to': domain
            }).c('query', {
                'xmlns': Strophe.NS.REGISTER
            }).c('username', {}, username).c('password', {}, password);
            const iq_result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.sendIQ(reset_iq);
            if (iq_result === null) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Timeout error while trying to set your password');
            } else if (sizzle(`error not-allowed[xmlns="${Strophe.NS.STANZAS}"]`, iq_result).length) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your server does not allow password reset');
            } else if (sizzle(`error forbidden[xmlns="${Strophe.NS.STANZAS}"]`, iq_result).length) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You are not allowed to change your password');
            } else if (u.isErrorStanza(iq_result)) {
                this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You are not allowed to change your password');
            } else {
                _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.alert('info', (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Success'), [
                    (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your new password has been set')
                ]);
            }
        }).call(this);
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-change-password-form', PasswordReset);


/***/ }),

/***/ "./src/plugins/profile/statusview.js":
/*!*******************************************!*\
  !*** ./src/plugins/profile/statusview.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_profile_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/profile.js */ "./src/plugins/profile/templates/profile.js");
/* harmony import */ var _styles_profile_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/profile.scss */ "./src/plugins/profile/styles/profile.scss");




class Profile extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    initialize() {
        this.model = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.profile;
        this.listenTo(this.model, "change", ()=>this.requestUpdate());
        this.listenTo(this.model, "vcard:add", ()=>this.requestUpdate());
        this.listenTo(this.model, "vcard:change", ()=>this.requestUpdate());
    }
    render() {
        return (0,_templates_profile_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     * @param {'status'|'profile'} tab
     */ showProfileModal(ev, tab = 'status') {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-profile-modal', {
            model: this.model,
            tab
        }, ev);
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-user-profile', Profile);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Profile);


/***/ }),

/***/ "./src/plugins/profile/styles/profile.scss":
/*!*************************************************!*\
  !*** ./src/plugins/profile/styles/profile.scss ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./profile.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/profile/styles/profile.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_profile_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/profile/templates/chat-status-form.js":
/*!***********************************************************!*\
  !*** ./src/plugins/profile/templates/chat-status-form.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import('../modals/profile').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_away = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Away');
    const i18n_busy = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Busy');
    const i18n_online = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Online');
    const i18n_save = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set status');
    const i18n_xa = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Away for long');
    const placeholder_status_message = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Personal status message');
    const status = el.model.get('show') || el.model.get('presence');
    const status_message = el.model.get('status_message');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="converse-form set-xmpp-status" id="set-xmpp-status" @submit="${(ev)=>el.onStatusFormSubmitted(ev)}"><div class="mb-3"><div class="form-check"><input ?checked="${status === 'online'}" type="radio" id="radio-online" value="online" name="chat_status" class="form-check-input"> <label class="form-check-label" for="radio-online"><converse-icon size="1em" class="fa fa-circle chat-status chat-status--online"></converse-icon> ${i18n_online}</label></div><div class="form-check"><input ?checked="${status === 'busy'}" type="radio" id="radio-busy" value="dnd" name="chat_status" class="form-check-input"> <label class="form-check-label" for="radio-busy"><converse-icon size="1em" class="fa fa-minus-circle chat-status chat-status--busy"></converse-icon> ${i18n_busy}</label></div><div class="form-check"><input ?checked="${status === 'away'}" type="radio" id="radio-away" value="away" name="chat_status" class="form-check-input"> <label class="form-check-label" for="radio-away"><converse-icon size="1em" class="fa fa-circle chat-status chat-status--away"></converse-icon> ${i18n_away}</label></div><div class="form-check"><input ?checked="${status === 'xa'}" type="radio" id="radio-xa" value="xa" name="chat_status" class="form-check-input"> <label class="form-check-label" for="radio-xa"><converse-icon size="1em" class="far fa-circle chat-status chat-status--xa"></converse-icon> ${i18n_xa}</label></div></div><div class="mb-3"><div class="${el._show_clear_button ? 'input-group' : ''}"><input name="status_message" type="text" class="form-control" autofocus value="${status_message || ''}" placeholder="${placeholder_status_message}" @input="${(ev)=>el._show_clear_button = !!ev.target.value}"> <button type="button" class="btn btn-outline-secondary" @click="${(ev)=>el.clearStatusMessage(ev)}" title="${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Clear status message')}" ?hidden="${!el._show_clear_button}"><converse-icon size="1em" class="fa fa-times"></converse-icon></button></div></div><button type="submit" class="btn btn-primary">${i18n_save}</button></form>`;
});


/***/ }),

/***/ "./src/plugins/profile/templates/logout_button.js":
/*!********************************************************!*\
  !*** ./src/plugins/profile/templates/logout_button.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");



/**
 * @param {import('../modals/profile').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_logout = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Log out');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.logOut(ev)}" class="btn btn-danger">${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_logout') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-icon class="fas fa-sign-out-alt" color="var(--background-color)" size="1em"></converse-icon> ${i18n_logout}` : ''}</button>`;
});


/***/ }),

/***/ "./src/plugins/profile/templates/password-reset.js":
/*!*********************************************************!*\
  !*** ./src/plugins/profile/templates/password-reset.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_submit = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Submit');
    const i18n_passwords_must_match = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The new passwords must match');
    const i18n_new_password = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('New password');
    const i18n_confirm_password = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Confirm new password');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<form class="converse-form passwordreset-form" method="POST" @submit="${(ev)=>el.onSubmit(ev)}">${el.alert_message ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="alert alert-danger" role="alert">${el.alert_message}</div>` : ''}<div class="py-2"><label for="converse_password_reset_new" class="form-label">${i18n_new_password}</label> <input class="form-control ${el.passwords_mismatched ? 'error' : ''}" type="password" name="password" required="required" id="converse_password_reset_new" autocomplete="new-password" minlength="8" ?disabled="${el.alert_message}"></div><div class="py-2"><label for="converse_password_reset_check" class="form-label">${i18n_confirm_password}</label> <input class="form-control ${el.passwords_mismatched ? 'error' : ''}" type="password" name="password_check" required="required" id="converse_password_reset_check" autocomplete="new-password" minlength="8" ?disabled="${el.alert_message}" @input="${(ev)=>el.checkPasswordsMatch(ev)}"> ${el.passwords_mismatched ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<span class="error">${i18n_passwords_must_match}</span>` : ''}</div><input class="save-form btn btn-primary" type="submit" value="${i18n_submit}" ?disabled="${el.alert_message}"></form>`;
});


/***/ }),

/***/ "./src/plugins/profile/templates/profile.js":
/*!**************************************************!*\
  !*** ./src/plugins/profile/templates/profile.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var shared_avatar_avatar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/avatar/avatar.js */ "./src/shared/avatar/avatar.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/profile/utils.js");




/**
 * @param {import('../statusview').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_vcard;
    const show = el.model.get('show');
    const presence = el.model.get('presence') || 'online';
    const chat_status = show || presence;
    const status_message = el.model.get('status_message') || (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)("I am %1$s", (0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.getPrettyStatus)(chat_status));
    const i18n_change_profile = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Update your profile');
    const i18n_change_status = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Click to change your chat status');
    let classes, color;
    if (show === 'chat' || !show && presence === 'online') {
        [classes, color] = [
            'fa fa-circle chat-status',
            'chat-status-online'
        ];
    } else if (show === 'dnd') {
        [classes, color] = [
            'fa fa-minus-circle chat-status',
            'chat-status-busy'
        ];
    } else if (show === 'away' || show === 'xa') {
        [classes, color] = [
            'fa fa-circle chat-status',
            'chat-status-away'
        ];
    } else {
        [classes, color] = [
            'fa fa-circle chat-status',
            'comment'
        ];
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="userinfo"><div class="controlbox-section profile d-flex justify-content-between"><a class="show-profile" href="#" @click="${(ev)=>el.showProfileModal(ev, 'profile')}" title="${i18n_change_profile}"><converse-avatar class="avatar align-self-center" .model="${el.model}" name="${el.model.getDisplayName()}" nonce="${(_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.get('vcard_updated')}" height="40" width="40"></converse-avatar><span class="username align-self-center w-100" role="heading" aria-level="2">${el.model.getDisplayName()}</span></a><converse-controlbox-buttons></converse-controlbox-buttons></div><div class="d-flex xmpp-status"><a class="change-status" title="${i18n_change_status}" data-toggle="modal" data-target="#changeStatusModal" @click="${(ev)=>el.showProfileModal(ev)}"><span class="${chat_status} w-100" data-value="${chat_status}"><converse-icon color="var(--${color})" css="margin-top: -0.1em" size="0.82em" class="${classes}"></converse-icon><span class="xmpp-status__msg">${status_message}</span></span></a></div></div>`;
});


/***/ }),

/***/ "./src/plugins/profile/templates/profile_modal.js":
/*!********************************************************!*\
  !*** ./src/plugins/profile/templates/profile_modal.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_image_picker_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/image-picker.js */ "./src/shared/components/image-picker.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./src/plugins/profile/utils.js");
/* harmony import */ var _chat_status_form_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chat-status-form.js */ "./src/plugins/profile/templates/chat-status-form.js");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}






/**
 * @param {import('../modals/profile').default} el
 */ function tplOmemoPage(el) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="tab-pane ${el.tab === 'omemo' ? 'active' : ''}" id="omemo-tabpanel" role="tabpanel" aria-labelledby="omemo-tab">${el.tab === 'omemo' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-omemo-profile></converse-omemo-profile>` : ''}</div>`;
}
/**
 * @param {import('../modals/profile').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_vcard, _converse_pluggable_plugins_converseomemo;
    const o = _object_spread({}, el.model.toJSON(), (_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.toJSON());
    const i18n_email = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Email');
    const i18n_fullname = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Full Name');
    const i18n_jid = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('XMPP Address');
    const i18n_nickname = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Nickname');
    const i18n_role = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Role');
    const i18n_save = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Save and close');
    const i18n_role_help = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages.');
    const i18n_url = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('URL');
    const i18n_status = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Status');
    const i18n_omemo = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('OMEMO');
    const i18n_profile = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Profile');
    const ii18n_reset_password = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Reset Password');
    // Initialize navigation_tabs as a Map
    const navigation_tabs = new Map();
    navigation_tabs.set('status', (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'status' ? 'active' : ''}" id="status-tab" href="#status-tabpanel" aria-controls="status-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="status" data-toggle="tab">${i18n_status}</a></li>`);
    navigation_tabs.set('profile', (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'profile' ? 'active' : ''}" id="profile-tab" href="#profile-tabpanel" aria-controls="profile-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="profile" data-toggle="tab">${i18n_profile}</a></li>`);
    if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.shouldShowPasswordResetForm)()) {
        navigation_tabs.set('passwordreset', (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'passwordreset' ? 'active' : ''}" id="passwordreset-tab" href="#passwordreset-tabpanel" aria-controls="passwordreset-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="passwordreset" data-toggle="tab">${ii18n_reset_password}</a></li>`);
    }
    if ((_converse_pluggable_plugins_converseomemo = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.pluggable.plugins['converse-omemo']) === null || _converse_pluggable_plugins_converseomemo === void 0 ? void 0 : _converse_pluggable_plugins_converseomemo.enabled(_converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse)) {
        navigation_tabs.set('omemo', (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'omemo' ? 'active' : ''}" id="omemo-tab" href="#omemo-tabpanel" aria-controls="omemo-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="omemo" data-toggle="tab">${i18n_omemo}</a></li>`);
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${navigation_tabs.size ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<ul class="nav nav-pills justify-content-center">${Array.from(navigation_tabs.values())}</ul>` : ''}<div class="tab-content">${navigation_tabs.get('passwordreset') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="tab-pane ${el.tab === 'status' ? 'active' : ''}" id="status-tabpanel" role="tabpanel" aria-labelledby="status-tab">${el.tab === 'status' ? (0,_chat_status_form_js__WEBPACK_IMPORTED_MODULE_5__["default"])(el) : ''}</div>` : ''}<div class="tab-pane ${el.tab === 'profile' ? 'active' : ''}" id="profile-tabpanel" role="tabpanel" aria-labelledby="profile-tab"><form class="converse-form converse-form--modal" action="#" @submit="${(ev)=>el.onProfileFormSubmitted(ev)}"><div class="row py-2"><div class="col-auto"><converse-image-picker .model="${el.model}" width="128" height="128"></converse-image-picker></div><div class="col"><div class="px-3"><label class="col-form-label">${i18n_jid}:</label><div>${o.jid}</div></div></div></div><div><label for="vcard-fullname" class="col-form-label">${i18n_fullname}:</label> <input id="vcard-fullname" type="text" class="form-control" name="fn" value="${o.fullname || ''}"></div><div><label for="vcard-nickname" class="col-form-label">${i18n_nickname}:</label> <input id="vcard-nickname" type="text" class="form-control" name="nickname" value="${o.nickname || ''}"></div><div><label for="vcard-url" class="col-form-label">${i18n_url}:</label> <input id="vcard-url" type="url" class="form-control" name="url" value="${o.url || ''}"></div><div><label for="vcard-email" class="col-form-label">${i18n_email}:</label> <input id="vcard-email" type="email" class="form-control" name="email" value="${o.email || ''}"></div><div><label for="vcard-role" class="col-form-label pb-0">${i18n_role}:</label> <small id="vcard-role-help" class="d-block pb-1 form-text text-muted">${i18n_role_help}</small> <input id="vcard-role" type="text" class="form-control" name="role" value="${o.role || ''}" aria-describedby="vcard-role-help"></div><div class="mt-3">${el._submitting ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-spinner></converse-spinner>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="submit" class="save-form btn btn-primary">${i18n_save}</button>`}</div></form></div>${navigation_tabs.get('passwordreset') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="tab-pane ${el.tab === 'passwordreset' ? 'active' : ''}" id="passwordreset-tabpanel" role="tabpanel" aria-labelledby="passwordreset-tab">${el.tab === 'passwordreset' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-change-password-form></converse-change-password-form>` : ''}</div>` : ''} ${navigation_tabs.get('omemo') ? tplOmemoPage(el) : ''}</div>`;
});


/***/ }),

/***/ "./src/plugins/profile/utils.js":
/*!**************************************!*\
  !*** ./src/plugins/profile/utils.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getPrettyStatus: () => (/* binding */ getPrettyStatus),
/* harmony export */   shouldShowPasswordResetForm: () => (/* binding */ shouldShowPasswordResetForm)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


/**
 * @param {string} stat
 */ function getPrettyStatus(stat) {
    if (stat === 'chat') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('online');
    } else if (stat === 'dnd') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('busy');
    } else if (stat === 'xa') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('away for long');
    } else if (stat === 'away') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('away');
    } else if (stat === 'offline') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('offline');
    } else {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)(stat) || (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('online');
    }
}
/**
 * For certain auth mechanisms, it doesn't make sense to show the password
 * form.
 */ function shouldShowPasswordResetForm() {
    const conn = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.api.connection.get();
    const mechanism = conn._sasl_mechanism;
    if (mechanism.mechname === 'EXTERNAL' || mechanism.mechname === 'ANONYMOUS' || mechanism.mechname === 'X-OAUTH2' || mechanism.mechname === 'OAUTHBEARER') {
        return false;
    }
    return true;
}


/***/ }),

/***/ "./src/plugins/push/index.js":
/*!***********************************!*\
  !*** ./src/plugins/push/index.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/push/utils.js");
/**
 * @description
 * Converse.js plugin which add support for registering
 * an "App Server" as defined in  XEP-0357
 * @copyright 2021, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 

const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
Strophe.addNamespace('PUSH', 'urn:xmpp:push:0');
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-push', {
    initialize () {
        /* The initialize function gets called as soon as the plugin is
         * loaded by converse.js's plugin machinery.
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            'push_app_servers': [],
            'enable_muc_push': false
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('statusInitialized', ()=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.enablePush)());
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('enable_muc_push')) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxesInitialized', ()=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.on('add', _utils_js__WEBPACK_IMPORTED_MODULE_1__.onChatBoxAdded));
        }
    }
});


/***/ }),

/***/ "./src/plugins/push/utils.js":
/*!***********************************!*\
  !*** ./src/plugins/push/utils.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   enablePush: () => (/* binding */ enablePush),
/* harmony export */   onChatBoxAdded: () => (/* binding */ onChatBoxAdded)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

const { Strophe, $iq } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
function disablePushAppServer(domain, push_app_server) {
    return _async_to_generator(function*() {
        if (!push_app_server.jid) {
            return;
        }
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
        if (!(yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.supports(Strophe.NS.PUSH, domain || bare_jid))) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.warn(`Not disabling push app server "${push_app_server.jid}", no disco support from your server.`);
            return;
        }
        const stanza = $iq({
            'type': 'set'
        });
        if (domain !== bare_jid) {
            stanza.attrs({
                'to': domain
            });
        }
        stanza.c('disable', {
            'xmlns': Strophe.NS.PUSH,
            'jid': push_app_server.jid
        });
        if (push_app_server.node) {
            stanza.attrs({
                'node': push_app_server.node
            });
        }
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.sendIQ(stanza).catch((e)=>{
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(`Could not disable push app server for ${push_app_server.jid}`);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
        });
    })();
}
function enablePushAppServer(domain, push_app_server) {
    return _async_to_generator(function*() {
        if (!push_app_server.jid || !push_app_server.node) {
            return;
        }
        const identity = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.getIdentity('pubsub', 'push', push_app_server.jid);
        if (!identity) {
            return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.warn(`Not enabling push the service "${push_app_server.jid}", it doesn't have the right disco identtiy.`);
        }
        const result = yield Promise.all([
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.supports(Strophe.NS.PUSH, push_app_server.jid),
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.disco.supports(Strophe.NS.PUSH, domain)
        ]);
        if (!result[0] && !result[1]) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.warn(`Not enabling push app server "${push_app_server.jid}", no disco support from your server.`);
            return;
        }
        const stanza = $iq({
            'type': 'set'
        });
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
        if (domain !== bare_jid) {
            stanza.attrs({
                'to': domain
            });
        }
        stanza.c('enable', {
            'xmlns': Strophe.NS.PUSH,
            'jid': push_app_server.jid,
            'node': push_app_server.node
        });
        if (push_app_server.secret) {
            stanza.c('x', {
                'xmlns': Strophe.NS.XFORM,
                'type': 'submit'
            }).c('field', {
                'var': 'FORM_TYPE'
            }).c('value').t(`${Strophe.NS.PUBSUB}#publish-options`).up().up().c('field', {
                'var': 'secret'
            }).c('value').t(push_app_server.secret);
        }
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.sendIQ(stanza);
    })();
}
/**
 * @param {string} [domain]
 */ function enablePush(domain) {
    return _async_to_generator(function*() {
        if (!domain) {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
            domain = bare_jid;
        }
        const push_enabled = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('push_enabled') || [];
        if (push_enabled.includes(domain)) {
            return;
        }
        const enabled_services = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('push_app_servers').filter((s)=>!s.disable);
        const disabled_services = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('push_app_servers').filter((s)=>s.disable);
        const enabled = enabled_services.map((s)=>enablePushAppServer(domain, s));
        const disabled = disabled_services.map((s)=>disablePushAppServer(domain, s));
        try {
            yield Promise.all(enabled.concat(disabled));
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error('Could not enable or disable push App Server');
            if (e) _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
        } finally{
            push_enabled.push(domain);
        }
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.save('push_enabled', push_enabled);
    })();
}
function onChatBoxAdded(model) {
    if (model.get('type') == CHATROOMS_TYPE) {
        enablePush(Strophe.getDomainFromJid(model.get('jid')));
    }
}


/***/ }),

/***/ "./src/plugins/register/form.js":
/*!**************************************!*\
  !*** ./src/plugins/register/form.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var templates_form_input_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! templates/form_input.js */ "./src/templates/form_input.js");
/* harmony import */ var templates_form_url_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/form_url.js */ "./src/templates/form_url.js");
/* harmony import */ var templates_form_username_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/form_username.js */ "./src/templates/form_username.js");
/* harmony import */ var _templates_choose_provider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/choose_provider.js */ "./src/plugins/register/templates/choose_provider.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/register/utils.js");
/* harmony import */ var _styles_register_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles/register.scss */ "./src/plugins/register/styles/register.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_private_method_get(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
}
function _class_private_method_init(obj, privateSet) {
    _check_private_redeclaration(obj, privateSet);
    privateSet.add(obj);
}









// Strophe methods for building stanzas
const { Strophe, sizzle, $iq } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { CONNECTION_STATUS } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
const CHOOSE_PROVIDER = 0;
const FETCHING_FORM = 1;
const REGISTRATION_FORM = 2;
const REGISTRATION_FORM_ERROR = 3;
var /**
     * Callback method that gets called when a return IQ stanza
     * is received from the XMPP server, after attempting to
     * register a new user.
     * @param {Element} stanza - The IQ stanza.
     */ _onRegisterIQ = /*#__PURE__*/ new WeakSet();
class RegistrationForm extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_5__.CustomElement {
    /**
     * @typedef {import('strophe.js').Request} Request
     */ static get properties() {
        return {
            status: {
                type: String
            },
            domain: {
                type: String
            },
            service_url: {
                type: String
            },
            alert_message: {
                type: String
            },
            alert_type: {
                type: String
            }
        };
    }
    initialize() {
        this.reset();
        this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, 'connectionInitialized', ()=>this.registerHooks());
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
        this.listenTo(settings, 'change:show_connection_url_input', ()=>this.requestUpdate());
        const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('registration_domain');
        if (domain) {
            this.fetchRegistrationForm(domain);
        } else {
            this.status = CHOOSE_PROVIDER;
        }
    }
    render() {
        return (0,_templates_choose_provider_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    /**
     * @param {string} message
     * @param {'info'|'danger'} type
     */ setMessage(message, type) {
        this.alert_type = type;
        this.alert_message = message;
    }
    /**
     * Hook into Strophe's _connect_cb, so that we can send an IQ
     * requesting the registration fields.
     */ registerHooks() {
        const conn = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
        const connect_cb = conn._connect_cb.bind(conn);
        conn._connect_cb = (req, callback, raw)=>{
            if (!this._registering) {
                connect_cb(req, callback, raw);
            } else if (this.getRegistrationFields(req, callback)) {
                this._registering = false;
            }
        };
    }
    /**
     * Send an IQ stanza to the XMPP server asking for the registration fields.
     * @method _converse.RegistrationForm#getRegistrationFields
     * @param {Request} req - The current request
     * @param {Function} callback - The callback function
     */ getRegistrationFields(req, callback) {
        const conn = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
        conn.connected = true;
        const body = /** @type {Element} */ '_reqToData' in conn._proto ? conn._proto._reqToData(/** @type {Request} */ req) : req;
        if (!body) {
            return;
        }
        if (conn._proto._connect_cb(body) === Strophe.Status.CONNFAIL) {
            this.status = CHOOSE_PROVIDER;
            this.setErrorMessage((0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)("Sorry, we're unable to connect to your chosen provider."));
            return false;
        }
        const register = body.getElementsByTagName("register");
        const mechanisms = body.getElementsByTagName("mechanism");
        if (register.length === 0 && mechanisms.length === 0) {
            conn._proto._no_auth_received(callback);
            return false;
        }
        if (register.length === 0) {
            conn._changeConnectStatus(Strophe.Status.REGIFAIL);
            this.alert_type = 'danger';
            this.setErrorMessage((0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)("Sorry, the given provider does not support in " + "band account registration. Please try with a " + "different provider."));
            return true;
        }
        // Send an IQ stanza to get all required data fields
        conn._addSysHandler((s)=>this.onRegistrationFields(s), null, "iq", null, null);
        const stanza = $iq({
            type: "get"
        }).c("query", {
            xmlns: Strophe.NS.REGISTER
        }).tree();
        stanza.setAttribute("id", conn.getUniqueId("sendIQ"));
        conn.send(stanza);
        conn.connected = false;
        return true;
    }
    /**
     * Handler for {@link _converse.RegistrationForm#getRegistrationFields}
     * @method _converse.RegistrationForm#onRegistrationFields
     * @param {Element} stanza - The query stanza.
     */ onRegistrationFields(stanza) {
        if (stanza.getAttribute("type") === "error") {
            this.reportErrors(stanza);
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('registration_domain')) {
                this.status = REGISTRATION_FORM_ERROR;
            } else {
                this.status = CHOOSE_PROVIDER;
            }
            return false;
        }
        this.setFields(stanza);
        if (this.status === FETCHING_FORM) {
            this.renderRegistrationForm(stanza);
        }
        return false;
    }
    reset(settings) {
        const defaults = {
            fields: {},
            urls: [],
            title: "",
            instructions: "",
            registered: false,
            _registering: false,
            domain: null,
            form_type: null
        };
        Object.assign(this, defaults);
        if (settings) Object.assign(this, settings);
    }
    /**
     * Event handler when the #converse-register form is submitted.
     * Depending on the available input fields, we delegate to other methods.
     * @param {Event} ev
     */ onFormSubmission(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const form = /** @type {HTMLFormElement} */ ev.target;
        const domain_input = /** @type {HTMLInputElement} */ form.querySelector('input[name=domain]');
        if (domain_input === null) {
            this.submitRegistrationForm(form);
        } else {
            this.onProviderChosen(form);
        }
    }
    /**
     * Callback method that gets called when the user has chosen an XMPP provider
     * @param {HTMLFormElement} form - The form that was submitted
     */ onProviderChosen(form) {
        var /** @type {HTMLInputElement} */ _form_querySelector;
        const domain = (_form_querySelector = form.querySelector('input[name=domain]')) === null || _form_querySelector === void 0 ? void 0 : _form_querySelector.value;
        if (domain) {
            const form_data = new FormData(form);
            let service_url = null;
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('show_connection_url_input')) {
                service_url = /** @type {string} */ form_data.get('connection-url');
                if (service_url.startsWith('wss:')) {
                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.set("websocket_url", service_url);
                } else if (service_url.startsWith('https:')) {
                    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.set('bosh_service_url', service_url);
                } else {
                    this.alert_message = (0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Invalid connection URL, only HTTPS and WSS accepted');
                    this.alert_type = 'danger';
                    this.status = CHOOSE_PROVIDER;
                    this.requestUpdate();
                    return;
                }
            }
            this.fetchRegistrationForm(domain.trim(), service_url === null || service_url === void 0 ? void 0 : service_url.trim());
        } else {
            this.status = CHOOSE_PROVIDER;
        }
    }
    /**
     * Fetch a registration form from the requested domain
     * @param {string} domain_name - XMPP server domain
     * @param {string|null} [service_url]
     */ fetchRegistrationForm(domain_name, service_url) {
        var // When testing, the test tears down before the async function
        // above finishes. So we use optional chaining here
        _api_connection_get;
        this.status = FETCHING_FORM;
        this.reset({
            _registering: true,
            domain: Strophe.getDomainFromJid(domain_name),
            service_url
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.init();
        (_api_connection_get = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get()) === null || _api_connection_get === void 0 ? void 0 : _api_connection_get.connect(this.domain, '', /**
             * @param {number} s
             * @param {string} m
             */ (s, m)=>this.onConnectStatusChanged(s, m));
        return false;
    }
    /**
     * Callback function called by Strophe whenever the connection status changes.
     * Passed to Strophe specifically during a registration attempt.
     * @param {number} status_code - The Strophe.Status status code
     * @param {string} message
     */ onConnectStatusChanged(status_code, message) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.debug('converse-register: onConnectStatusChanged');
        if ([
            Strophe.Status.DISCONNECTED,
            Strophe.Status.CONNFAIL,
            Strophe.Status.REGIFAIL,
            Strophe.Status.NOTACCEPTABLE,
            Strophe.Status.CONFLICT
        ].includes(status_code)) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.warn(`Problem during registration: Strophe.Status is ${CONNECTION_STATUS[status_code]}`);
            this.abortRegistration(message);
        } else if (status_code === Strophe.Status.REGISTERED) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.debug("Registered successfully.");
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get().reset();
            if ([
                "converse/login",
                "converse/register"
            ].includes(window.location.hash)) {
                history.pushState(null, '', window.location.pathname);
            }
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_7__.setActiveForm)('login');
            if (this.fields.password && this.fields.username) {
                const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
                // automatically log the user in
                connection.connect(this.fields.username.toLowerCase() + '@' + this.domain.toLowerCase(), this.fields.password, connection.onConnectStatusChanged);
                this.setFeedbackMessage((0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Now logging you in'));
            } else {
                this.setFeedbackMessage((0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Registered successfully'));
            }
            this.reset();
        }
    }
    getLegacyFormFields() {
        const input_fields = Object.keys(this.fields).map((key)=>{
            if (key === "username") {
                return (0,templates_form_username_js__WEBPACK_IMPORTED_MODULE_3__["default"])({
                    'domain': ` @${this.domain}`,
                    'name': key,
                    'type': "text",
                    'label': key,
                    'value': '',
                    'required': true
                });
            } else {
                return (0,templates_form_input_js__WEBPACK_IMPORTED_MODULE_1__["default"])({
                    'label': key,
                    'name': key,
                    'placeholder': key,
                    'required': true,
                    'type': key === 'password' || key === 'email' ? key : "text",
                    'value': ''
                });
            }
        });
        const urls = this.urls.map((u)=>(0,templates_form_url_js__WEBPACK_IMPORTED_MODULE_2__["default"])({
                'label': '',
                'value': u
            }));
        return [
            ...input_fields,
            ...urls
        ];
    }
    /**
     * @param {Element} stanza
     */ getFormFields(stanza) {
        if (this.form_type === 'xform') {
            const { fields } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.parsers.parseXForm(stanza);
            var _fields_map;
            return (_fields_map = fields === null || fields === void 0 ? void 0 : fields.map((f)=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.xFormField2TemplateResult(f, {
                    domain: this.domain
                }))) !== null && _fields_map !== void 0 ? _fields_map : [];
        } else {
            return this.getLegacyFormFields();
        }
    }
    /**
     * Renders the registration form based on the XForm fields
     * received from the XMPP server.
     * @param {Element} stanza - The IQ stanza received from the XMPP server.
     */ renderRegistrationForm(stanza) {
        this.form_fields = this.getFormFields(stanza);
        this.status = REGISTRATION_FORM;
    }
    /**
     * Report back to the user any error messages received from the
     * XMPP server after attempted registration.
     * @param {Element} stanza - The IQ stanza received from the XMPP server
     */ reportErrors(stanza) {
        return _async_to_generator(function*() {
            const error = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.parsers.parseErrorStanza(stanza);
            if (error instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_0__.errors.ConflictError) {
                this.setErrorMessage(`${(0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Registration failed.')} ${(0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Please try a different username.')}`);
                return;
            }
            const error_els = Array.from(stanza.querySelectorAll('error'));
            if (error_els.length) {
                this.setErrorMessage(`${(0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Registration failed.')}${error_els.reduce((result, e)=>`${result}\n${e.textContent}`, '')}`);
            } else {
                this.setErrorMessage((0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)('The provider rejected your registration attempt. ' + 'Please check the values you entered for correctness.'));
            }
        }).call(this);
    }
    /**
     * @param {Event} ev
     */ renderProviderChoiceForm(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
        connection._proto._abortAllRequests();
        connection.reset();
        this.status = CHOOSE_PROVIDER;
    }
    /**
     * @param {string} message
     */ abortRegistration(message) {
        const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
        connection._proto._abortAllRequests();
        connection.reset();
        if ([
            FETCHING_FORM,
            REGISTRATION_FORM
        ].includes(this.status)) {
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('registration_domain')) {
                this.fetchRegistrationForm(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('registration_domain'));
                return;
            }
        }
        this.alert_message = message;
        this.alert_type = 'danger';
        this.status = CHOOSE_PROVIDER;
        this.requestUpdate();
    }
    /**
     * Handler, when the user submits the registration form.
     * Provides form error feedback or starts the registration process.
     * @method _converse.RegistrationForm#submitRegistrationForm
     * @param {HTMLElement} form - The HTML form that was submitted
     */ submitRegistrationForm(form) {
        const /** @type {HTMLInputElement[]} */ inputs = sizzle(':input:not([type=button]):not([type=submit])', form);
        const iq = $iq({
            'type': 'set',
            'id': _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getUniqueId()
        }).c("query", {
            xmlns: Strophe.NS.REGISTER
        });
        if (this.form_type === 'xform') {
            iq.c("x", {
                xmlns: Strophe.NS.XFORM,
                type: 'submit'
            });
            const xml_nodes = inputs.map((i)=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.webForm2xForm(i)).filter((n)=>n);
            xml_nodes.forEach((n)=>iq.cnode(n).up());
        } else {
            inputs.forEach((input)=>iq.c(input.getAttribute('name'), {}, input.value));
        }
        const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
        connection._addSysHandler(/** @param {Element} iq */ (iq)=>_class_private_method_get(this, _onRegisterIQ, onRegisterIQ).call(this, iq), null, "iq", null, null);
        connection.send(iq);
        this.setFields(iq.tree());
    }
    /**
     * Stores the values that will be sent to the XMPP server during attempted registration.
     * @method _converse.RegistrationForm#setFields
     * @param {Element} stanza - the IQ stanza that will be sent to the XMPP server.
     */ setFields(stanza) {
        const query = stanza.querySelector('query');
        const xform = sizzle(`x[xmlns="${Strophe.NS.XFORM}"]`, query);
        if (xform.length > 0) {
            this.setFieldsFromXForm(xform.pop());
        } else {
            this.setFieldsFromLegacy(query);
        }
    }
    /**
     * @param {Element} query
     */ setFieldsFromLegacy(query) {
        [].forEach.call(query.children, /** @param {Element} field */ (field)=>{
            if (field.tagName.toLowerCase() === 'instructions') {
                this.instructions = Strophe.getText(field);
                return;
            } else if (field.tagName.toLowerCase() === 'x') {
                if (field.getAttribute('xmlns') === 'jabber:x:oob') {
                    this.urls.concat(sizzle('url', field).map((u)=>u.textContent));
                }
                return;
            }
            this.fields[field.tagName.toLowerCase()] = Strophe.getText(field);
        });
        this.form_type = 'legacy';
    }
    /**
     * @param {Element} xform
     */ setFieldsFromXForm(xform) {
        var _xform_querySelector, _xform_querySelector1;
        var _xform_querySelector_textContent;
        this.title = (_xform_querySelector_textContent = (_xform_querySelector = xform.querySelector('title')) === null || _xform_querySelector === void 0 ? void 0 : _xform_querySelector.textContent) !== null && _xform_querySelector_textContent !== void 0 ? _xform_querySelector_textContent : '';
        var _xform_querySelector_textContent1;
        this.instructions = (_xform_querySelector_textContent1 = (_xform_querySelector1 = xform.querySelector('instructions')) === null || _xform_querySelector1 === void 0 ? void 0 : _xform_querySelector1.textContent) !== null && _xform_querySelector_textContent1 !== void 0 ? _xform_querySelector_textContent1 : '';
        xform.querySelectorAll('field').forEach((field)=>{
            const _var = field.getAttribute('var');
            if (_var) {
                var _field_querySelector;
                var _field_querySelector_textContent;
                this.fields[_var.toLowerCase()] = (_field_querySelector_textContent = (_field_querySelector = field.querySelector('value')) === null || _field_querySelector === void 0 ? void 0 : _field_querySelector.textContent) !== null && _field_querySelector_textContent !== void 0 ? _field_querySelector_textContent : '';
            } else {
                // TODO: other option seems to be type="fixed"
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.warn("Found field we couldn't parse");
            }
        });
        this.form_type = 'xform';
    }
    constructor(){
        super(), _class_private_method_init(this, _onRegisterIQ);
        this.urls = [];
        this.fields = {};
        this.domain = null;
        this.alert_type = 'info';
        this.setErrorMessage = /** @param {string} m */ (m)=>this.setMessage(m, 'danger');
        this.setFeedbackMessage = /** @param {string} m */ (m)=>this.setMessage(m, 'info');
    }
}
function onRegisterIQ(stanza) {
    const connection = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.connection.get();
    if (stanza.getAttribute("type") === "error") {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.info("Registration failed.");
        this.reportErrors(stanza);
        const error_els = stanza.getElementsByTagName("error");
        if (error_els.length !== 1) {
            connection._changeConnectStatus(Strophe.Status.REGIFAIL, "unknown");
            return false;
        }
        const error = error_els[0].firstElementChild.tagName.toLowerCase();
        if (error === 'conflict') {
            connection._changeConnectStatus(Strophe.Status.CONFLICT, error);
        } else if (error === 'not-acceptable') {
            connection._changeConnectStatus(Strophe.Status.NOTACCEPTABLE, error);
        } else {
            connection._changeConnectStatus(Strophe.Status.REGIFAIL, error);
        }
    } else {
        connection._changeConnectStatus(Strophe.Status.REGISTERED, null);
    }
    return false;
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-registration-form', RegistrationForm);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RegistrationForm);


/***/ }),

/***/ "./src/plugins/register/index.js":
/*!***************************************!*\
  !*** ./src/plugins/register/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/register/utils.js");
/* harmony import */ var _form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./form.js */ "./src/plugins/register/form.js");
/* harmony import */ var _register_link_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./register_link.js */ "./src/plugins/register/register_link.js");
/**
 * @description
 * This is a Converse.js plugin which add support for in-band registration
 * as specified in XEP-0077.
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 




// Strophe methods for building stanzas
const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { CONNECTION_STATUS } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
// Add Strophe Namespaces
Strophe.addNamespace('REGISTER', 'jabber:iq:register');
// Add Strophe Statuses
const i = Object.keys(Strophe.Status).reduce((max, k)=>Math.max(max, Strophe.Status[k]), 0);
Strophe.Status.REGIFAIL = i + 1;
Strophe.Status.REGISTERED = i + 2;
Strophe.Status.CONFLICT = i + 3;
Strophe.Status.NOTACCEPTABLE = i + 5;
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-register', {
    dependencies: [
        'converse-controlbox'
    ],
    enabled () {
        return true;
    },
    initialize () {
        CONNECTION_STATUS[Strophe.Status.REGIFAIL] = 'REGIFAIL';
        CONNECTION_STATUS[Strophe.Status.REGISTERED] = 'REGISTERED';
        CONNECTION_STATUS[Strophe.Status.CONFLICT] = 'CONFLICT';
        CONNECTION_STATUS[Strophe.Status.NOTACCEPTABLE] = 'NOTACCEPTABLE';
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            allow_registration: true,
            domain_placeholder: (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)(' e.g. conversejs.org'),
            providers_link: 'https://compliance.conversations.im/',
            registration_domain: ''
        });
        const exports = {
            RegisterLink: _register_link_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            RegistrationForm: _form_js__WEBPACK_IMPORTED_MODULE_3__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, exports);
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.routeToForm)();
        addEventListener('hashchange', _utils_js__WEBPACK_IMPORTED_MODULE_2__.routeToForm);
    }
});


/***/ }),

/***/ "./src/plugins/register/register_link.js":
/*!***********************************************!*\
  !*** ./src/plugins/register/register_link.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");




class RegisterLink extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    render() {
        const i18n_create_account = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create an account');
        const i18n_hint_no_account = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Don't have a chat account?");
        return this.shouldShow() ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mt-3 text-center switch-form"><p class="mb-1">${i18n_hint_no_account}</p><a class="register-account toggle-register-login" href="#converse/register">${i18n_create_account}</a></div>` : '';
    }
    shouldShow() {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_registration') && !_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('auto_login') && _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.pluggable.plugins['converse-register'].enabled(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse);
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-register-link', RegisterLink);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RegisterLink);


/***/ }),

/***/ "./src/plugins/register/styles/register.scss":
/*!***************************************************!*\
  !*** ./src/plugins/register/styles/register.scss ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_register_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./register.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/register/styles/register.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_register_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_register_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_register_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_register_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/register/templates/choose_provider.js":
/*!***********************************************************!*\
  !*** ./src/plugins/register/templates/choose_provider.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _controlbox_templates_loginform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../controlbox/templates/loginform.js */ "./src/plugins/controlbox/templates/loginform.js");
/* harmony import */ var _switch_form_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./switch_form.js */ "./src/plugins/register/templates/switch_form.js");
/* harmony import */ var _registration_form_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./registration_form.js */ "./src/plugins/register/templates/registration_form.js");







/**
 * @param {import('../form.js').default} el
 */ function tplFormRequest(el) {
    const default_domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('registration_domain');
    const i18n_cancel = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cancel');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form id="converse-register" class="converse-form no-scrolling" @submit="${(ev)=>el.onFormSubmission(ev)}">${(0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__["default"])({
        'classes': 'hor_centered'
    })} ${default_domain ? '' : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button class="btn btn-secondary button-cancel hor_centered" @click="${(ev)=>el.renderProviderChoiceForm(ev)}">${i18n_cancel}</button>`}</form>`;
}
/**
 * @param {import('../form.js').default} el
 */ function tplDomainInput(el) {
    const domain_placeholder = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('domain_placeholder');
    const i18n_providers = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Tip: A list of public XMPP providers is available');
    const i18n_providers_link = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('here');
    const href_providers = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('providers_link');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input class="form-control" required="required" type="text" name="domain" placeholder="${domain_placeholder}" value="${el.domain}"><p class="form-text text-muted">${i18n_providers} <a href="${href_providers}" class="url" target="_blank" rel="noopener">${i18n_providers_link}</a>.</p>${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_connection_url_input') ? (0,_controlbox_templates_loginform_js__WEBPACK_IMPORTED_MODULE_4__.tplConnectionURLInput)() : ''}`;
}
function tplFetchFormButtons() {
    const i18n_register = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Fetch registration form');
    const i18n_existing_account = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Already have a chat account?');
    const i18n_login = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Go back to login');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<fieldset class="form-group buttons"><input class="btn btn-primary" type="submit" value="${i18n_register}"></fieldset><div class="switch-form"><p class="mb-1">${i18n_existing_account}</p><a class="login-here toggle-register-login" href="#converse/login">${i18n_login}</a></div>`;
}
/**
 * @param {import('../form.js').default} el
 */ function tplChooseProvider(el) {
    const default_domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('registration_domain');
    const i18n_create_account = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Create your account');
    const i18n_choose_provider = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please enter the XMPP provider to register with:');
    const show_form_buttons = !default_domain && el.status === CHOOSE_PROVIDER;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form id="converse-register" class="converse-form" @submit="${(ev)=>el.onFormSubmission(ev)}"><legend class="col-form-label">${i18n_create_account}</legend><div class="pt-3"><label class="form-label">${i18n_choose_provider}</label> ${default_domain ? default_domain : tplDomainInput(el)}</div>${show_form_buttons ? tplFetchFormButtons() : ''}</form>`;
}
const CHOOSE_PROVIDER = 0;
const FETCHING_FORM = 1;
const REGISTRATION_FORM = 2;
const REGISTRATION_FORM_ERROR = 3;
/**
 * @param {import('../form.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${el.alert_message ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-${el.alert_type}" role="alert">${el.alert_message}</div>` : ''} ${el.status === CHOOSE_PROVIDER ? tplChooseProvider(el) : ''} ${el.status === FETCHING_FORM ? tplFormRequest(el) : ''} ${el.status === REGISTRATION_FORM ? (0,_registration_form_js__WEBPACK_IMPORTED_MODULE_6__["default"])(el) : ''} ${el.status === REGISTRATION_FORM_ERROR ? (0,_switch_form_js__WEBPACK_IMPORTED_MODULE_5__["default"])() : ''}`;
});


/***/ }),

/***/ "./src/plugins/register/templates/registration_form.js":
/*!*************************************************************!*\
  !*** ./src/plugins/register/templates/registration_form.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _switch_form_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./switch_form.js */ "./src/plugins/register/templates/switch_form.js");




/**
 * @param {import('../form').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_choose_provider = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Choose a different provider');
    const i18n_legend = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Account Registration:');
    const i18n_register = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Register');
    const registration_domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('registration_domain');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form id="converse-register" class="converse-form rounded" @submit="${(ev)=>el.onFormSubmission(ev)}"><legend class="col-form-label">${i18n_legend} ${el.domain}</legend><p class="title">${el.title}</p><p class="form-help instructions">${el.instructions}</p><div class="form-errors hidden"></div>${el.form_fields}<fieldset class="buttons form-group">${el.fields ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input type="submit" class="btn btn-primary" value="${i18n_register}">` : ''} ${registration_domain ? '' : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input type="button" class="btn btn-secondary button-cancel" value="${i18n_choose_provider}" @click="${(ev)=>el.renderProviderChoiceForm(ev)}">`} ${(0,_switch_form_js__WEBPACK_IMPORTED_MODULE_3__["default"])()}</fieldset></form>`;
});


/***/ }),

/***/ "./src/plugins/register/templates/switch_form.js":
/*!*******************************************************!*\
  !*** ./src/plugins/register/templates/switch_form.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (()=>{
    const i18n_has_account = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Already have a chat account?');
    const i18n_login = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Go back to login');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="switch-form"><p class="mb-1">${i18n_has_account}</p><a class="login-here toggle-register-login" href="#converse/login">${i18n_login}</a></div>`;
});


/***/ }),

/***/ "./src/plugins/register/utils.js":
/*!***************************************!*\
  !*** ./src/plugins/register/utils.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   routeToForm: () => (/* binding */ routeToForm),
/* harmony export */   setActiveForm: () => (/* binding */ setActiveForm)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

function setActiveForm(value) {
    return _async_to_generator(function*() {
        yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.waitUntil('controlBoxInitialized');
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        const controlbox = chatboxes.get('controlbox');
        controlbox.set({
            'active-form': value
        });
    })();
}
function routeToForm(event) {
    if (location.hash === '#converse/login') {
        event === null || event === void 0 ? void 0 : event.preventDefault();
        setActiveForm('login');
    } else if (location.hash === '#converse/register') {
        event === null || event === void 0 ? void 0 : event.preventDefault();
        setActiveForm('register');
    }
}


/***/ }),

/***/ "./src/plugins/roomslist/index.js":
/*!****************************************!*\
  !*** ./src/plugins/roomslist/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _view_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view.js */ "./src/plugins/roomslist/view.js");
/**
 * @description
 *  Converse.js plugin which shows a list of currently open
 *  rooms in the "Rooms Panel" of the ControlBox.
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-roomslist', {
    dependencies: [
        "converse-singleton",
        "converse-controlbox",
        "converse-muc",
        "converse-bookmarks"
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            muc_grouped_by_domain: false
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('clearSession', ()=>{
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.shouldClearCache(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse)) {
                var _converse_state_roomslist;
                (_converse_state_roomslist = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.roomslist) === null || _converse_state_roomslist === void 0 ? void 0 : _converse_state_roomslist.destroy();
            }
        });
    }
});


/***/ }),

/***/ "./src/plugins/roomslist/model.js":
/*!****************************************!*\
  !*** ./src/plugins/roomslist/model.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const { OPENED } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
class RoomsListModel extends _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model {
    defaults() {
        return {
            muc_domain: _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_domain'),
            toggle_state: OPENED,
            collapsed_domains: []
        };
    }
    initialize() {
        super.initialize();
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.listen.on('change:muc_domain', /** @param {string} muc_domain */ (muc_domain)=>this.setDomain(muc_domain));
    }
    /**
     * @param {string} jid
     */ setDomain(jid) {
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('locked_muc_domain')) {
            this.save('muc_domain', Strophe.getDomainFromJid(jid));
        }
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RoomsListModel);


/***/ }),

/***/ "./src/plugins/roomslist/styles/roomsgroups.scss":
/*!*******************************************************!*\
  !*** ./src/plugins/roomslist/styles/roomsgroups.scss ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roomsgroups_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./roomsgroups.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/roomslist/styles/roomsgroups.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roomsgroups_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roomsgroups_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roomsgroups_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roomsgroups_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/roomslist/templates/roomslist.js":
/*!******************************************************!*\
  !*** ./src/plugins/roomslist/templates/roomslist.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_muc_views_modals_add_muc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/muc-views/modals/add-muc.js */ "./src/plugins/muc-views/modals/add-muc.js");
/* harmony import */ var plugins_muc_views_modals_muc_list_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/muc-views/modals/muc-list.js */ "./src/plugins/muc-views/modals/muc-list.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_chat_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/chat/utils */ "./src/shared/chat/utils.js");
/* harmony import */ var _styles_roomsgroups_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../styles/roomsgroups.scss */ "./src/plugins/roomslist/styles/roomsgroups.scss");
/**
 * @typedef {import('../view').RoomsList} RoomsList
 * @typedef {import('@converse/headless').MUC} MUC
 */ 






const { CLOSED } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
const { isUniView } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u;
/** @param {MUC} room */ function isCurrentlyOpen(room) {
    return isUniView() && !room.get('hidden');
}
/** @param {MUC} room */ function tplUnreadIndicator(room) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="list-item-badge badge badge--muc msgs-indicator">${(0,shared_chat_utils__WEBPACK_IMPORTED_MODULE_5__.getUnreadMsgsDisplay)(room)}</span>`;
}
function tplActivityIndicator() {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="list-item-badge badge badge--muc msgs-indicator"></span>`;
}
/**
 * @param {RoomsList} el
 * @param {MUC} room
 */ function tplRoomItem(el, room) {
    var _room_vcard;
    const i18n_leave_room = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Leave this groupchat');
    const has_unread_msgs = room.get('num_unread_general') || room.get('has_activity');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="list-item controlbox-padded available-chatroom d-flex flex-row ${isCurrentlyOpen(room) ? 'open' : ''} ${has_unread_msgs ? 'unread-msgs' : ''}" data-room-jid="${room.get('jid')}"><a class="list-item-link open-room available-room w-100" data-room-jid="${room.get('jid')}" data-room-name="${room.getDisplayName()}" title="${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Click to open this groupchat')}" @click="${(ev)=>el.openRoom(ev)}"><converse-avatar .model="${room}" class="avatar avatar-muc" name="${room.getDisplayName()}" nonce="${(_room_vcard = room.vcard) === null || _room_vcard === void 0 ? void 0 : _room_vcard.get('vcard_updated')}" height="30" width="30"></converse-avatar><span>${room.get('num_unread') ? tplUnreadIndicator(room) : room.get('has_activity') ? tplActivityIndicator() : ''} ${room.getDisplayName()}</span> </a><a class="list-item-action close-room" tabindex="0" data-room-jid="${room.get('jid')}" data-room-name="${room.getDisplayName()}" title="${i18n_leave_room}" @click="${(ev)=>el.closeRoom(ev)}"><converse-icon class="fa fa-sign-out-alt" size="1.2em" color="${isCurrentlyOpen(room) ? 'var(--foreground-color)' : ''}"></converse-icon></a></li>`;
}
/**
 * @param {RoomsList} el
 * @param {string} domain
 * @param {MUC[]} rooms
 */ function tplRoomDomainGroup(el, domain, rooms) {
    const i18n_title = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Click to hide these rooms');
    const collapsed = el.model.get('collapsed_domains');
    const is_collapsed = collapsed.includes(domain);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="muc-domain-group" data-domain="${domain}"><a href="#" class="list-toggle muc-domain-group-toggle controlbox-padded" title="${i18n_title}" @click="${(ev)=>el.toggleDomainList(ev, domain)}"><converse-icon class="fa ${is_collapsed ? 'fa-caret-right' : 'fa-caret-down'}" size="1em" color="var(--muc-color)"></converse-icon>${domain}</a><ul class="items-list muc-domain-group-rooms ${is_collapsed ? 'collapsed' : ''}" data-domain="${domain}">${rooms.map((room)=>tplRoomItem(el, room))}</ul></div>`;
}
/**
 * @param {RoomsList} el
 * @param {MUC[]} rooms
 */ function tplRoomDomainGroupList(el, rooms) {
    // The rooms should stay sorted as they are iterated and added in order
    const grouped_rooms = new Map();
    for (const room of rooms){
        const roomdomain = room.get('jid').split('@').at(-1).toLowerCase();
        if (grouped_rooms.has(roomdomain)) {
            grouped_rooms.get(roomdomain).push(room);
        } else {
            grouped_rooms.set(roomdomain, [
                room
            ]);
        }
    }
    const sorted_domains = Array.from(grouped_rooms.keys());
    sorted_domains.sort();
    return sorted_domains.map((domain)=>tplRoomDomainGroup(el, domain, grouped_rooms.get(domain)));
}
/**
 * @param {RoomsList} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const group_by_domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('muc_grouped_by_domain');
    const rooms = el.getRoomsToShow();
    const i18n_desc_rooms = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Click to toggle the list of open groupchats');
    const i18n_heading_chatrooms = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Groupchats');
    const i18n_title_list_rooms = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Query server');
    const i18n_title_new_room = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Add groupchat');
    const i18n_show_bookmarks = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Bookmarks');
    const is_closed = el.model.get('toggle_state') === CLOSED;
    const btns = [
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="dropdown-item show-add-muc-modal" role="button" @click="${(ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-add-muc-modal', {
                'model': el.model
            }, ev)}" data-toggle="modal" data-target="#add-chatrooms-modal"><converse-icon class="fa fa-plus" size="1em"></converse-icon>${i18n_title_new_room}</a>`,
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="dropdown-item show-list-muc-modal" role="button" @click="${(ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-muc-list-modal', {
                'model': el.model
            }, ev)}" data-toggle="modal" data-target="#muc-list-modal"><converse-icon class="fa fa-list-ul" size="1em"></converse-icon>${i18n_title_list_rooms}</a>`,
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="dropdown-item show-bookmark-list-modal" role="button" @click="${(ev)=>_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-bookmark-list-modal', {
                'model': el.model
            }, ev)}" data-toggle="modal"><converse-icon class="fa fa-bookmark" size="1em"></converse-icon>${i18n_show_bookmarks}</a>`
    ];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="d-flex controlbox-padded"><span class="w-100 controlbox-heading controlbox-heading--groupchats"><a class="list-toggle open-rooms-toggle" role="heading" aria-level="3" title="${i18n_desc_rooms}" @click="${(ev)=>el.toggleRoomsList(ev)}">${i18n_heading_chatrooms} ${rooms.length ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-icon class="fa ${is_closed ? 'fa-caret-right' : 'fa-caret-down'}" size="1em" color="var(--muc-color)"></converse-icon>` : ''}</a></span><converse-dropdown class="btn-group dropstart" .items="${btns}"></converse-dropdown></div><div class="list-container list-container--openrooms ${rooms.length ? '' : 'hidden'}"><ul class="items-list rooms-list open-rooms-list ${is_closed ? 'collapsed' : ''}">${group_by_domain ? tplRoomDomainGroupList(el, rooms) : rooms.map(/** @param {MUC} room */ (room)=>tplRoomItem(el, room))}</ul></div>`;
});


/***/ }),

/***/ "./src/plugins/roomslist/view.js":
/*!***************************************!*\
  !*** ./src/plugins/roomslist/view.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RoomsList: () => (/* binding */ RoomsList)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var plugins_muc_views_modals_muc_details_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/muc-views/modals/muc-details.js */ "./src/plugins/muc-views/modals/muc-details.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _model_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./model.js */ "./src/plugins/roomslist/model.js");
/* harmony import */ var _templates_roomslist_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./templates/roomslist.js */ "./src/plugins/roomslist/templates/roomslist.js");
/**
 * @typedef {import('@converse/skeletor').Model} Model
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { initStorage } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u;
const { CHATROOMS_TYPE, CLOSED, OPENED } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class RoomsList extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    initialize() {
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.session.get('bare_jid');
        const id = `converse.roomspanel${bare_jid}`;
        this.model = new _model_js__WEBPACK_IMPORTED_MODULE_4__["default"]({
            id
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.roomslist = this.model;
        initStorage(this.model, id);
        this.model.fetch();
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        this.listenTo(chatboxes, 'add', this.renderIfChatRoom);
        this.listenTo(chatboxes, 'remove', this.renderIfChatRoom);
        this.listenTo(chatboxes, 'destroy', this.renderIfChatRoom);
        this.listenTo(chatboxes, 'change', this.renderIfRelevantChange);
        this.listenTo(chatboxes, 'vcard:add', ()=>this.requestUpdate());
        this.listenTo(chatboxes, 'vcard:change', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.requestUpdate();
    }
    render() {
        return (0,_templates_roomslist_js__WEBPACK_IMPORTED_MODULE_5__["default"])(this);
    }
    /** @param {Model} model */ renderIfChatRoom(model) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.muc.isChatRoom(model) && this.requestUpdate();
    }
    /** @param {Model} model */ renderIfRelevantChange(model) {
        const attrs = [
            'bookmarked',
            'hidden',
            'name',
            'num_unread',
            'num_unread_general',
            'has_activity'
        ];
        const changed = model.changed || {};
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.muc.isChatRoom(model) && Object.keys(changed).filter((m)=>attrs.includes(m)).length) {
            this.requestUpdate();
        }
    }
    /** @returns {import('@converse/headless').MUC[]} */ getRoomsToShow() {
        const { chatboxes } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state;
        const rooms = chatboxes.filter((m)=>m.get('type') === CHATROOMS_TYPE && !m.get('closed'));
        rooms.sort((a, b)=>a.getDisplayName().toLowerCase() <= b.getDisplayName().toLowerCase() ? -1 : 1);
        return rooms;
    }
    /** @param {Event} ev */ openRoom(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const target = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.ancestor(/** @type {HTMLElement} */ ev.target, '.open-room');
            const name = target.getAttribute('data-room-name');
            const jid = target.getAttribute('data-room-jid');
            const data = {
                'name': name || Strophe.unescapeNode(Strophe.getNodeFromJid(jid)) || jid
            };
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.open(jid, data, true);
        })();
    }
    /** @param {Event} ev */ closeRoom(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const target = /** @type {HTMLElement} */ ev.currentTarget;
            const name = target.getAttribute('data-room-name');
            const jid = target.getAttribute('data-room-jid');
            const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Confirm'), (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Are you sure you want to leave the groupchat %1$s?', name));
            if (result) {
                const room = yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.get(jid);
                room.close();
            }
        })();
    }
    /** @param {Event} [ev] */ toggleRoomsList(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const list_el = this.querySelector('.open-rooms-list');
        if (this.model.get('toggle_state') === CLOSED) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.slideOut(list_el).then(()=>this.model.save({
                    'toggle_state': OPENED
                }));
        } else {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.slideIn(list_el).then(()=>this.model.save({
                    'toggle_state': CLOSED
                }));
        }
    }
    /**
     * @param {Event} ev
     * @param {string} domain
     */ toggleDomainList(ev, domain) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const collapsed = this.model.get('collapsed_domains');
        if (collapsed.includes(domain)) {
            this.model.save({
                'collapsed_domains': collapsed.filter((d)=>d !== domain)
            });
        } else {
            this.model.save({
                'collapsed_domains': [
                    ...collapsed,
                    domain
                ]
            });
        }
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-rooms-list', RoomsList);


/***/ }),

/***/ "./src/plugins/rootview/background.js":
/*!********************************************!*\
  !*** ./src/plugins/rootview/background.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_background_logo_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/background_logo.js */ "./src/plugins/rootview/templates/background_logo.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/rootview/utils.js");
/* harmony import */ var _styles_background_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/background.scss */ "./src/plugins/rootview/styles/background.scss");





class ConverseBackground extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            logo: {
                type: Boolean
            }
        };
    }
    initialize() {
        this.setThemeAttributes();
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
        this.listenTo(settings, 'change:view_mode', ()=>this.setThemeAttributes());
        this.listenTo(settings, 'change:singleton', ()=>this.setThemeAttributes());
        window.matchMedia('(prefers-color-scheme: dark)').addListener(()=>this.setThemeAttributes());
        window.matchMedia('(prefers-color-scheme: light)').addListener(()=>this.setThemeAttributes());
    }
    render() {
        return (0,_templates_background_logo_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    setThemeAttributes() {
        const theme = (0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.getTheme)();
        this.classList.add(`theme-${theme}`);
        this.setAttribute('data-converse-theme', theme);
        this.setAttribute('data-bs-theme', theme);
        this.requestUpdate();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-bg', ConverseBackground);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConverseBackground);


/***/ }),

/***/ "./src/plugins/rootview/index.js":
/*!***************************************!*\
  !*** ./src/plugins/rootview/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./root.js */ "./src/plugins/rootview/root.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/rootview/utils.js");
/* harmony import */ var _background_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./background.js */ "./src/plugins/rootview/background.js");




_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-rootview', {
    initialize () {
        // Configuration values for this plugin
        // ====================================
        // Refer to docs/source/configuration.rst for explanations of these
        // configuration settings.
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            auto_insert: true,
            dark_theme: 'dracula',
            // Languages for which the UI is right-to-left
            rtl_langs: [
                "ar",
                "fa",
                "he",
                "ug"
            ],
            show_background: false,
            theme: 'classic'
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxesInitialized', _utils_js__WEBPACK_IMPORTED_MODULE_2__.ensureElement);
        // Only define the element now, otherwise it it's already in the DOM
        // before `converse.initialized` has been called it will render too
        // early.
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-root', _root_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
    }
});


/***/ }),

/***/ "./src/plugins/rootview/root.js":
/*!**************************************!*\
  !*** ./src/plugins/rootview/root.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ConverseRoot)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _templates_root_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/root.js */ "./src/plugins/rootview/templates/root.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/rootview/utils.js");
/* harmony import */ var _styles_root_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/root.scss */ "./src/plugins/rootview/styles/root.scss");






class ConverseRoot extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    render() {
        return (0,_templates_root_js__WEBPACK_IMPORTED_MODULE_2__["default"])();
    }
    initialize() {
        this.setAttribute('id', 'conversejs');
        this.setThemeAttributes();
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get();
        this.listenTo(settings, 'change:view_mode', ()=>this.setThemeAttributes());
        this.listenTo(settings, 'change:singleton', ()=>this.setThemeAttributes());
        window.matchMedia('(prefers-color-scheme: dark)').addListener(()=>this.setThemeAttributes());
        window.matchMedia('(prefers-color-scheme: light)').addListener(()=>this.setThemeAttributes());
    }
    setThemeAttributes() {
        const theme = (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getTheme)();
        this.className = "";
        this.classList.add('container-fluid');
        this.classList.add('g-0');
        this.classList.add('conversejs');
        this.classList.add(`converse-${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode')}`);
        this.classList.add(`theme-${theme}`);
        this.setAttribute('data-bs-theme', theme);
        this.setAttribute('data-converse-theme', theme);
        const lang = i18n__WEBPACK_IMPORTED_MODULE_0__.i18n.getLocale();
        this.setAttribute('lang', lang);
        const rtl_langs = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('rtl_langs');
        if (rtl_langs.includes(lang)) {
            this.setAttribute('dir', 'rtl');
        } else {
            this.setAttribute('dir', 'ltr');
        }
        this.requestUpdate();
    }
}
/**
 * `converse-root` is an optional custom element which can be used to
 * declaratively insert the Converse UI into the DOM.
 *
 * It can be inserted into the DOM before or after Converse has loaded or been
 * initialized.
 */ 


/***/ }),

/***/ "./src/plugins/rootview/styles/background.scss":
/*!*****************************************************!*\
  !*** ./src/plugins/rootview/styles/background.scss ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_background_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./background.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rootview/styles/background.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_background_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_background_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_background_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_background_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/rootview/styles/root.scss":
/*!***********************************************!*\
  !*** ./src/plugins/rootview/styles/root.scss ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_root_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./root.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rootview/styles/root.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_root_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_root_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_root_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_root_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/rootview/templates/background_logo.js":
/*!***********************************************************!*\
  !*** ./src/plugins/rootview/templates/background_logo.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* eslint-disable max-len */ 

/**
 * @param {import('../background').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('theme') === 'cyberpunk' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<section class="moving-grid"><div class="container"><div class="static-lines">${[
        ...Array(20).keys()
    ].map(()=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="vert"></div>`)}</div><div class="moving-lines">${[
        ...Array(60).keys()
    ].map(()=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="horz"></div>`)}</div></div></section>` : ''} ${el.hasAttribute('logo') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="inner-content converse-brand row"><div class="converse-brand__heading"><converse-logo></converse-logo><span class="converse-brand__text"><span>converse<span class="subdued">.js</span></span><p class="byline">messaging freedom</p></span></div>${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode') === 'overlayed' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="converse-brand__padding"></div>` : ''}</div>` : ''}`);


/***/ }),

/***/ "./src/plugins/rootview/templates/root.js":
/*!************************************************!*\
  !*** ./src/plugins/rootview/templates/root.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_font_awesome_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/font-awesome.js */ "./src/shared/components/font-awesome.js");



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (()=>{
    const extra_classes = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('singleton') ? [
        'converse-singleton'
    ] : [];
    extra_classes.push(`converse-${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode')}`);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('show_background') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-bg logo></converse-bg>` : ''}<converse-chats class="converse-chatboxes row justify-content-start g-0 ${extra_classes.join(' ')}"></converse-chats><converse-modals id="converse-modals" class="modals"></converse-modals><converse-toasts></converse-toasts><converse-fontawesome></converse-fontawesome>`;
});


/***/ }),

/***/ "./src/plugins/rootview/utils.js":
/*!***************************************!*\
  !*** ./src/plugins/rootview/utils.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ensureElement: () => (/* binding */ ensureElement),
/* harmony export */   getTheme: () => (/* binding */ getTheme)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");

function getTheme() {
    if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("dark_theme");
    } else {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("theme");
    }
}
function ensureElement() {
    var _root_matches;
    if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("auto_insert")) {
        return;
    }
    const root = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("root");
    if (!root.querySelector("converse-root") && !((_root_matches = root.matches) === null || _root_matches === void 0 ? void 0 : _root_matches.call(root, "converse-root"))) {
        const el = document.createElement("converse-root");
        const body = root.querySelector("body");
        if (body) {
            body.appendChild(el);
        } else {
            root.appendChild(el); // Perhaps inside a web component?
        }
    }
}


/***/ }),

/***/ "./src/plugins/rosterview/approval-alert.js":
/*!**************************************************!*\
  !*** ./src/plugins/rosterview/approval-alert.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ContactApprovalAlert)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/rosterview/utils.js */ "./src/plugins/rosterview/utils.js");
/* harmony import */ var _templates_approval_alert_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/approval-alert.js */ "./src/plugins/rosterview/templates/approval-alert.js");
/* harmony import */ var _styles_approval_alert_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/approval-alert.scss */ "./src/plugins/rosterview/styles/approval-alert.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}





class ContactApprovalAlert extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    render() {
        return (0,_templates_approval_alert_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     */ acceptRequest(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-accept-contact-request-modal', {
                contact: this.contact
            }, ev);
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ declineRequest(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            (0,plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_2__.declineContactRequest)(this.contact);
        }).call(this);
    }
    constructor(){
        super();
        this.contact = null;
    }
}
_define_property(ContactApprovalAlert, "properties", {
    contact: {
        type: _converse_headless__WEBPACK_IMPORTED_MODULE_0__.RosterContact
    }
});

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-contact-approval-alert', ContactApprovalAlert);


/***/ }),

/***/ "./src/plugins/rosterview/constants.js":
/*!*********************************************!*\
  !*** ./src/plugins/rosterview/constants.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   STATUSES: () => (/* binding */ STATUSES)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");

const STATUSES = {
    'dnd': (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This contact is busy'),
    'online': (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This contact is online'),
    'offline': (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This contact is offline'),
    'unavailable': (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This contact is unavailable'),
    'xa': (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This contact is away for an extended period'),
    'away': (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This contact is away')
};


/***/ }),

/***/ "./src/plugins/rosterview/contactview.js":
/*!***********************************************!*\
  !*** ./src/plugins/rosterview/contactview.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ RosterContactView)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/observable.js */ "./src/shared/components/observable.js");
/* harmony import */ var _templates_requesting_contact_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/requesting_contact.js */ "./src/plugins/rosterview/templates/requesting_contact.js");
/* harmony import */ var _templates_roster_item_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/roster_item.js */ "./src/plugins/rosterview/templates/roster_item.js");
/* harmony import */ var _templates_unsaved_contact_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/unsaved_contact.js */ "./src/plugins/rosterview/templates/unsaved_contact.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/rosterview/utils.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}







class RosterContactView extends shared_components_observable_js__WEBPACK_IMPORTED_MODULE_1__.ObservableElement {
    static get properties() {
        return _object_spread_props(_object_spread({}, super.properties), {
            model: {
                type: Object
            }
        });
    }
    initialize() {
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.listenTo(this.model, 'highlight', ()=>this.requestUpdate());
        this.listenTo(this.model, 'vcard:add', ()=>this.requestUpdate());
        this.listenTo(this.model, 'vcard:change', ()=>this.requestUpdate());
        this.listenTo(this.model, 'presence:change', ()=>this.requestUpdate());
    }
    render() {
        if (this.model instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.RosterContact) {
            if (this.model.get('requesting') === true) {
                return (0,_templates_requesting_contact_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
            } else if (!this.model.get('subscription')) {
                return (0,_templates_unsaved_contact_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
            }
        }
        return (0,_templates_roster_item_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    /**
     * @param {MouseEvent} ev
     */ openChat(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.chats.open(this.model.get('jid'), {}, true);
    }
    /**
     * @param {MouseEvent} ev
     */ addContact(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-add-contact-modal', {
            contact: this.model
        }, ev);
    }
    /**
     * @param {MouseEvent} ev
     */ removeContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.removeContact)(this.model, true);
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ showUserDetailsModal(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            ev.preventDefault();
            if (this.model instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.Profile) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-profile-modal', {
                    model: this.model
                }, ev);
            } else {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-user-details-modal', {
                    model: this.model
                }, ev);
            }
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ blockContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            yield (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.blockContact)(this.model);
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ acceptRequest(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-accept-contact-request-modal', {
                contact: this.model
            }, ev);
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ declineRequest(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            (0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.declineContactRequest)(this.model);
        }).call(this);
    }
    /**
     * @typedef {import('shared/components/types').ObservableProperty} ObservableProperty
     */ constructor(){
        super();
        this.model = null;
        this.observable = /** @type {ObservableProperty} */ 'once';
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-roster-contact', RosterContactView);


/***/ }),

/***/ "./src/plugins/rosterview/index.js":
/*!*****************************************!*\
  !*** ./src/plugins/rosterview/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _contactview_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contactview.js */ "./src/plugins/rosterview/contactview.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/plugins/rosterview/utils.js");
/* harmony import */ var _modal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modal */ "./src/plugins/modal/index.js");
/* harmony import */ var _modals_add_contact_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modals/add-contact.js */ "./src/plugins/rosterview/modals/add-contact.js");
/* harmony import */ var _modals_accept_contact_request_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modals/accept-contact-request.js */ "./src/plugins/rosterview/modals/accept-contact-request.js");
/* harmony import */ var _modals_new_chat_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modals/new-chat.js */ "./src/plugins/rosterview/modals/new-chat.js");
/* harmony import */ var _modals_blocklist_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modals/blocklist.js */ "./src/plugins/rosterview/modals/blocklist.js");
/* harmony import */ var _rosterview_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rosterview.js */ "./src/plugins/rosterview/rosterview.js");
/* harmony import */ var _approval_alert_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./approval-alert.js */ "./src/plugins/rosterview/approval-alert.js");
/* harmony import */ var shared_styles_status_scss__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! shared/styles/status.scss */ "./src/shared/styles/status.scss");
/* harmony import */ var _styles_roster_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./styles/roster.scss */ "./src/plugins/rosterview/styles/roster.scss");
/**
 * @copyright 2025, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 */ 











_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-rosterview', {
    dependencies: [
        'converse-roster',
        'converse-modal',
        'converse-chatboxviews',
        'converse-blocklist'
    ],
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            allow_contact_removal: true,
            hide_offline_users: false,
            roster_groups: true,
            xhr_user_search_url: null
        });
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.promises.add('rosterViewInitialized');
        const exports = {
            AcceptContactRequestModal: _modals_accept_contact_request_js__WEBPACK_IMPORTED_MODULE_5__["default"],
            AddContactModal: _modals_add_contact_js__WEBPACK_IMPORTED_MODULE_4__["default"],
            BlockListModal: _modals_blocklist_js__WEBPACK_IMPORTED_MODULE_7__["default"],
            NewChatModal: _modals_new_chat_js__WEBPACK_IMPORTED_MODULE_6__["default"],
            RosterContactView: _contactview_js__WEBPACK_IMPORTED_MODULE_1__["default"],
            RosterFilter: _converse_headless__WEBPACK_IMPORTED_MODULE_0__.RosterFilter,
            RosterView: _rosterview_js__WEBPACK_IMPORTED_MODULE_8__["default"]
        };
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse, exports); // DEPRECATED
        Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports, exports);
        /* -------- Event Handlers ----------- */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.listen.on('chatBoxesInitialized', ()=>{
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.on('destroy', (c)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.highlightRosterItem)(c.get('jid')));
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxes.on('change:hidden', (c)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.highlightRosterItem)(c.get('jid')));
        });
    }
});


/***/ }),

/***/ "./src/plugins/rosterview/modals/accept-contact-request.js":
/*!*****************************************************************!*\
  !*** ./src/plugins/rosterview/modals/accept-contact-request.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AcceptContactRequestModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_accept_contact_request_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/accept-contact-request.js */ "./src/plugins/rosterview/modals/templates/accept-contact-request.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





class AcceptContactRequestModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.contact, 'change', ()=>this.requestUpdate());
        this.requestUpdate();
        this.addEventListener('shown.bs.modal', ()=>{
            var /** @type {HTMLInputElement} */ _this_querySelector;
            return (_this_querySelector = this.querySelector('input[name="name"]')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
        }, false);
    }
    renderModal() {
        return (0,_templates_accept_contact_request_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Contact Request');
    }
    /**
     * @param {Event} ev
     */ acceptContactRequest(ev) {
        return _async_to_generator(function*() {
            var /** @type {string} */ _data_get;
            ev.preventDefault();
            const form = /** @type {HTMLFormElement} */ ev.target;
            const data = new FormData(form);
            const name = /** @type {string} */ (data.get('name') || '').trim();
            const groups = ((_data_get = data.get('groups')) === null || _data_get === void 0 ? void 0 : _data_get.split(',').map((g)=>g.trim()).filter((g)=>g)) || [];
            try {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.roster.sendContactAddIQ({
                    jid: this.contact.get('jid'),
                    name,
                    groups
                });
                this.contact.authorize().subscribe();
            } catch (e) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.toast.show('accept-request-error', {
                    type: 'danger',
                    body: (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Sorry, something went wrong while accepting the contact request')
                });
                return;
            }
            this.contact.save({
                nickname: name,
                groups
            });
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.toast.show('accept-request-success', {
                type: 'success',
                body: (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Successfully accepted the contact request')
            });
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {Object} options
     */ constructor(options){
        super(options);
        this.contact = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-accept-contact-request-modal', AcceptContactRequestModal);


/***/ }),

/***/ "./src/plugins/rosterview/modals/add-contact.js":
/*!******************************************************!*\
  !*** ./src/plugins/rosterview/modals/add-contact.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AddContactModal)
/* harmony export */ });
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_add_contact_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/add-contact.js */ "./src/plugins/rosterview/modals/templates/add-contact.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _styles_add_contact_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/add-contact.scss */ "./src/plugins/rosterview/modals/styles/add-contact.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class AddContactModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.contact, 'change', ()=>this.requestUpdate());
        this.requestUpdate();
        this.addEventListener('shown.bs.modal', ()=>{
            var /** @type {HTMLInputElement} */ _this_querySelector;
            return (_this_querySelector = this.querySelector('input[name="jid"]')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
        }, false);
    }
    renderModal() {
        return (0,_templates_add_contact_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Add a Contact');
    }
    /**
     * @param {string} jid
     */ validateSubmission(jid) {
        if (!jid || jid.split('@').filter((s)=>!!s).length < 2) {
            this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Please enter a valid XMPP address'), 'danger', false);
            return false;
        } else if (!this.contact && _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.roster.get(strophe_js__WEBPACK_IMPORTED_MODULE_0__.Strophe.getBareJidFromJid(jid))) {
            this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('This contact has already been added'), 'danger', false);
            return false;
        }
        this.alert(null); // Clear the alert
        return true;
    }
    /**
     * @param {string} jid
     * @param {string} name
     * @param {string[]} groups
     */ afterSubmission(jid, name, groups) {
        return _async_to_generator(function*() {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.contacts.add({
                jid,
                name,
                groups
            }).catch((e)=>{
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.show('contact-add-error', {
                    type: 'danger',
                    body: (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Sorry, something went wrong while adding the contact')
                });
                return;
            });
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.chats.open(jid, {}, true);
            this.alert(null); // clear alert
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.show('contact-added', {
                type: 'success',
                body: (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Contact added successfully')
            });
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {Event} ev
     */ addContactFromForm(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const form = /** @type {HTMLFormElement} */ ev.target;
            const data = new FormData(form);
            let jid = /** @type {string} */ (data.get('jid') || '').trim();
            let name;
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('xhr_user_search_url')) {
                // In this case, the value of `jid` is something like `John Doe <john@chat.com>`
                // So we want to get `name` which is `John Doe` and reset `jid` to
                // what's inside the arrow brackets, so in this case
                // `john@chat.com`.
                const match = jid.match(/^(.*) <(.*)>$/);
                if (match) {
                    name = match[1].trim();
                    jid = match[2].trim();
                } else {
                    this.alert((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Invalid value for the name and XMPP address. Please use the format "Name <username@example.org>".'), 'danger', false);
                    return;
                }
            } else {
                name = /** @type {string} */ (data.get('name') || '').trim();
            }
            if (this.validateSubmission(jid)) {
                var /** @type {string} */ _data_get;
                const groups = ((_data_get = data.get('groups')) === null || _data_get === void 0 ? void 0 : _data_get.split(',').map((g)=>g.trim()).filter((g)=>g)) || [];
                this.afterSubmission(jid, name, groups);
                form.reset();
            }
        }).call(this);
    }
    constructor(){
        super();
        this.contact = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-add-contact-modal', AddContactModal);


/***/ }),

/***/ "./src/plugins/rosterview/modals/blocklist.js":
/*!****************************************************!*\
  !*** ./src/plugins/rosterview/modals/blocklist.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ BlockListModal)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_blocklist_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/blocklist.js */ "./src/plugins/rosterview/modals/templates/blocklist.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}





class BlockListModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    static get properties() {
        return _object_spread_props(_object_spread({}, super.properties), {
            filter_text: {
                type: String
            }
        });
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            this.blocklist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.blocklist.get();
            this.listenTo(this.blocklist, 'add', ()=>this.requestUpdate());
            this.listenTo(this.blocklist, 'remove', ()=>this.requestUpdate());
            this.listenTo(this.blocklist, 'change', ()=>this.requestUpdate());
            this.addEventListener('shown.bs.modal', ()=>{
                var /** @type {HTMLInputElement} */ _this_querySelector;
                (_this_querySelector = this.querySelector('input[name="blocklist_filter"]')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
            }, false);
            this.requestUpdate();
        }).call(this);
    }
    renderModal() {
        if (this.blocklist) {
            return (0,_templates_blocklist_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this);
        } else {
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-spinner></converse-spinner>`;
        }
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Blocklist');
    }
    /**
     * @param {MouseEvent} ev
     */ unblockUsers(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const form = /** @type {HTMLFormElement} */ ev.target;
            const data = new FormData(form);
            const jids = [
                ...data.entries()
            ].filter((e)=>e[1] === 'on').map((e)=>e[0]);
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.blocklist.remove(jids);
            const body = jids.length > 1 ? (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Successfully unblocked %1$s XMPP addresses', jids.length) : (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Successfully unblocked one XMPP address');
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.show('blocked', {
                type: 'success',
                body
            });
        })();
    }
    /**
     * @param {MouseEvent} ev
     */ toggleSelectAll(ev) {
        const value = /** @type {HTMLInputElement} */ ev.target.checked;
        const checkboxes = /** @type {NodeListOf<HTMLInputElement>} */ this.querySelectorAll('input[type="checkbox"]');
        checkboxes.forEach((cb)=>cb.checked = value);
    }
    constructor(){
        super();
        this.filter_text = '';
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-blocklist-modal', BlockListModal);


/***/ }),

/***/ "./src/plugins/rosterview/modals/new-chat.js":
/*!***************************************************!*\
  !*** ./src/plugins/rosterview/modals/new-chat.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ NewChatModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_new_chat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/new-chat.js */ "./src/plugins/rosterview/modals/templates/new-chat.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class NewChatModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    initialize() {
        super.initialize();
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        this.requestUpdate();
        this.addEventListener('shown.bs.modal', ()=>{
            var /** @type {HTMLInputElement} */ _this_querySelector;
            return (_this_querySelector = this.querySelector('input[name="jid"]')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
        }, false);
    }
    renderModal() {
        return (0,_templates_new_chat_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Start a new chat');
    }
    /**
     * @param {string} jid
     */ validateSubmission(jid) {
        if (!jid || jid.split('@').filter((s)=>!!s).length < 2) {
            this.model.set('error', (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Please enter a valid XMPP address'));
            return false;
        }
        this.model.set('error', null);
        return true;
    }
    /**
     * @param {HTMLFormElement} _form
     * @param {string} jid
     */ afterSubmission(_form, jid) {
        return _async_to_generator(function*() {
            try {
                yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.chats.open(jid, {}, true);
            } catch (e) {
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.error(e);
                this.model.set('error', (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Sorry, something went wrong'));
                return;
            }
            this.model.clear();
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {SubmitEvent} ev
     */ startChatFromForm(ev) {
        return _async_to_generator(function*() {
            ev.preventDefault();
            const form = /** @type {HTMLFormElement} */ ev.target;
            const data = new FormData(form);
            const jid = /** @type {string} */ (data.get('jid') || '').trim();
            if (this.validateSubmission(jid)) {
                this.afterSubmission(form, jid);
            }
        }).call(this);
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-new-chat-modal', NewChatModal);


/***/ }),

/***/ "./src/plugins/rosterview/modals/styles/add-contact.scss":
/*!***************************************************************!*\
  !*** ./src/plugins/rosterview/modals/styles/add-contact.scss ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_contact_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./add-contact.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/modals/styles/add-contact.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_contact_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_contact_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_contact_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_add_contact_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/rosterview/modals/templates/accept-contact-request.js":
/*!***************************************************************************!*\
  !*** ./src/plugins/rosterview/modals/templates/accept-contact-request.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils.js */ "./src/plugins/rosterview/utils.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");



/**
 * @param {import('../accept-contact-request.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_contact_vcard;
    const i18n_accept = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Accept');
    const i18n_groups = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Groups');
    const i18n_groups_help = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Use commas to separate multiple values');
    const i18n_nickname = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Name');
    const i18n_xmpp_address = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('XMPP Address');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="modal-body"><form class="converse-form" @submit="${(ev)=>el.acceptContactRequest(ev)}"><div class="mb-3"><label class="form-label clearfix" for="name">${i18n_nickname}:</label> <input type="text" name="name" value="${((_el_contact_vcard = el.contact.vcard) === null || _el_contact_vcard === void 0 ? void 0 : _el_contact_vcard.get('fullname')) || ''}" class="form-control"></div><div class="mb-3"><label class="form-label clearfix" for="name">${i18n_groups}:</label><div class="mb-1"><small class="form-text text-muted">${i18n_groups_help}</small></div><converse-autocomplete .list="${(0,_utils_js__WEBPACK_IMPORTED_MODULE_1__.getGroupsAutoCompleteList)()}" name="groups"></converse-autocomplete></div><div class="mb-3 d-flex justify-content-between"><label class="form-label clearfix w-100" for="jid-display">${i18n_xmpp_address}:</label><p class="form-control-plaintext text-end" id="jid-display">${el.contact.get('jid')}</p></div><button type="submit" class="btn btn-primary">${i18n_accept}</button></form></div>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/modals/templates/add-contact.js":
/*!****************************************************************!*\
  !*** ./src/plugins/rosterview/modals/templates/add-contact.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils.js */ "./src/plugins/rosterview/utils.js");
/* harmony import */ var shared_autocomplete_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/autocomplete/index.js */ "./src/shared/autocomplete/index.js");





/**
 * @param {import('../add-contact.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_add = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Add');
    const i18n_contact_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('name@example.org');
    const i18n_groups = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Groups');
    const i18n_groups_help = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Use commas to separate multiple values');
    const i18n_nickname = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Name');
    const using_xhr = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('xhr_user_search_url');
    const i18n_xmpp_address = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('XMPP Address');
    const i18n_search_or_address = using_xhr ? (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search name or XMPP address') : i18n_xmpp_address;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="modal-body"><form class="converse-form add-xmpp-contact" @submit="${(ev)=>el.addContactFromForm(ev)}">${el.contact ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input type="hidden" name="jid" value="${el.contact.get('jid')}">` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label class="form-label clearfix" for="jid">${i18n_search_or_address}:</label> ${using_xhr ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-autocomplete .getAutoCompleteList="${_utils_js__WEBPACK_IMPORTED_MODULE_3__.getNamesAutoCompleteList}" position="below" min_chars="2" filter="contains" ?required="${true}" value="${el.state.get('jid') || ''}" placeholder="${i18n_contact_placeholder}" name="jid"></converse-autocomplete>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-autocomplete .list="${(0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.getJIDsAutoCompleteList)()}" .data="${(text, input)=>`${input.slice(0, input.indexOf('@'))}@${text}`}" position="below" min_chars="2" filter="startswith" ?required="${!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('xhr_user_search_url')}" value="${el.state.get('jid') || ''}" placeholder="${i18n_contact_placeholder}" name="jid"></converse-autocomplete>`}</div>`} ${!using_xhr ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label class="form-label clearfix" for="name">${i18n_nickname}:</label> <input type="text" name="name" value="${el.state.get('nickname') || ''}" class="form-control"></div>` : ''}<div class="mb-3"><label class="form-label clearfix" for="name">${i18n_groups}:</label><div class="mb-1"><small class="form-text text-muted">${i18n_groups_help}</small></div><converse-autocomplete .list="${(0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.getGroupsAutoCompleteList)()}" name="groups"></converse-autocomplete></div>${el.contact ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3 d-flex justify-content-between"><label class="form-label clearfix w-100" for="jid-display">${i18n_xmpp_address}:</label><p class="form-control-plaintext text-end" id="jid-display">${el.contact.get('jid')}</p></div>` : ''} <button type="submit" class="btn btn-primary">${i18n_add}</button></form></div>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/modals/templates/blocklist.js":
/*!**************************************************************!*\
  !*** ./src/plugins/rosterview/modals/templates/blocklist.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");



/**
 * @param {import('../blocklist.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    if (el.blocklist.length) {
        const filtered_blocklist = el.filter_text ? el.blocklist.filter((b)=>b.get('jid').toLowerCase().includes(el.filter_text.toLowerCase())) : el.blocklist;
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<form @submit="${(ev)=>el.unblockUsers(ev)}"><div class="d-flex justify-content-between">${el.blocklist.length > 5 ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p style="line-height:3em">${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('%1$s blocked users shown', filtered_blocklist.length)}</p>` : ''} ${filtered_blocklist.length ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="text-end"><button type="submit" class="btn btn-danger mt-2 mb-2">${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Unblock selected users')}</button></div>` : ''}</div>${el.blocklist.length > 5 ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="mb-3 ${el.filter_text ? 'input-group' : ''}"><input autofocus name="blocklist_filter" type="text" class="form-control" value="${el.filter_text}" placeholder="${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Filter blocked users')}" @input="${(ev)=>el.filter_text = ev.target.value}"> <button type="button" class="btn btn-outline-secondary ${!el.filter_text ? 'hidden' : ''}" @click="${()=>{
            el.filter_text = '';
            const input = /** @type {HTMLInputElement} */ el.querySelector('input[name="blocklist_filter"]');
            input.value = '';
        }}"><converse-icon size="1em" class="fa fa-times"></converse-icon>${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('clear')}</button></div><div class="form-check mb-1"><input class="form-check-input" type="checkbox" id="select-all" @change="${(ev)=>el.toggleSelectAll(ev)}"> <label class="form-check-label" for="select-all"><strong>${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select All')}</strong></label></div>` : ''}<ul class="items-list">${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__.repeat)(filtered_blocklist, (b)=>b.get('jid'), (b)=>(0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<li class="list-item" @click="${(ev)=>{
                if (ev.target.type === 'checkbox') return;
                ev.preventDefault();
                const checkbox = /** @type {HTMLInputElement} */ document.getElementById(`blocklist-${b.get('jid')}`);
                checkbox.checked = !checkbox.checked;
            }}"><div class="form-check"><input class="form-check-input" type="checkbox" id="blocklist-${b.get('jid')}" name="${b.get('jid')}"> <label class="form-check-label w-100" for="blocklist-${b.get('jid')}">${b.get('jid')}</label></div></li>`)}</ul></form>`;
    } else {
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<p>${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No blocked XMPP addresses')}</p>`;
    }
});


/***/ }),

/***/ "./src/plugins/rosterview/modals/templates/new-chat.js":
/*!*************************************************************!*\
  !*** ./src/plugins/rosterview/modals/templates/new-chat.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/**
 * @param {import('../new-chat.js').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_start_chat = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Start Chat');
    const i18n_xmpp_address = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('XMPP Address');
    const error = el.model.get('error');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="modal-body">${error ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<div class="alert alert-danger" role="alert">${error}</div>` : ''}<form @submit="${(ev)=>el.startChatFromForm(ev)}"><div class="mb-3"><label class="form-label" for="jid">${i18n_xmpp_address}</label> <input type="text" name="jid" class="form-control" required></div><button type="submit" class="btn btn-primary">${i18n_start_chat}</button></form></div>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/rosterview.js":
/*!**********************************************!*\
  !*** ./src/plugins/rosterview/rosterview.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ RosterView)
/* harmony export */ });
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");
/* harmony import */ var _templates_roster_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/roster.js */ "./src/plugins/rosterview/templates/roster.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { initStorage } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u;
const { CLOSED, OPENED } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
class RosterView extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    initialize() {
        return _async_to_generator(function*() {
            const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('bare_jid');
            const id = `converse.contacts-panel${bare_jid}`;
            this.model = new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model({
                id
            });
            initStorage(this.model, id);
            this.model.fetch();
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.waitUntil('rosterInitialized');
            const { chatboxes, presences, roster } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
            this.listenTo(_converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse, 'rosterContactsFetched', ()=>this.requestUpdate());
            this.listenTo(presences, 'change:show', ()=>this.requestUpdate());
            this.listenTo(chatboxes, 'change:hidden', ()=>this.requestUpdate());
            this.listenTo(roster, 'add', ()=>this.requestUpdate());
            this.listenTo(roster, 'destroy', ()=>this.requestUpdate());
            this.listenTo(roster, 'remove', ()=>this.requestUpdate());
            this.listenTo(roster, 'change', ()=>this.requestUpdate());
            this.listenTo(roster, 'presence:change', ()=>this.requestUpdate());
            this.listenTo(roster.state, 'change', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change', ()=>this.requestUpdate());
            /**
         * Triggered once the _converse.RosterView instance has been created and initialized.
         * @event _converse#rosterViewInitialized
         * @example _converse.api.listen.on('rosterViewInitialized', () => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.trigger('rosterViewInitialized');
        }).call(this);
    }
    render() {
        return (0,_templates_roster_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this);
    }
    /** @param {MouseEvent} ev */ showAddContactModal(ev) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-add-contact-modal', {
            model: new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model()
        }, ev);
    }
    /** @param {MouseEvent} ev */ showNewChatModal(ev) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-new-chat-modal', {
            model: new _converse_skeletor__WEBPACK_IMPORTED_MODULE_0__.Model()
        }, ev);
    }
    /** @param {MouseEvent} ev */ showBlocklistModal(ev) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.modal.show('converse-blocklist-modal', {}, ev);
    }
    /** @param {MouseEvent} [ev] */ syncContacts(ev) {
        return _async_to_generator(function*() {
            ev === null || ev === void 0 ? void 0 : ev.preventDefault();
            const { roster } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
            this.syncing_contacts = true;
            this.requestUpdate();
            roster.data.save('version', null);
            yield roster.fetchFromServer();
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.user.presence.send();
            this.syncing_contacts = false;
            this.requestUpdate();
        }).call(this);
    }
    /** @param {MouseEvent} [ev] */ toggleRoster(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const list_el = /** @type {HTMLElement} */ this.querySelector('.list-container.roster-contacts');
        if (this.model.get('toggle_state') === CLOSED) {
            (0,utils_html_js__WEBPACK_IMPORTED_MODULE_3__.slideOut)(list_el).then(()=>this.model.save({
                    'toggle_state': OPENED
                }));
        } else {
            (0,utils_html_js__WEBPACK_IMPORTED_MODULE_3__.slideIn)(list_el).then(()=>this.model.save({
                    'toggle_state': CLOSED
                }));
        }
    }
    /** @param {MouseEvent} [ev] */ toggleFilter(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        this.model.save({
            filter_visible: !this.model.get('filter_visible')
        });
    }
}
/**
 * @class
 * @namespace _converse.RosterView
 * @memberOf _converse
 */ 
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-roster', RosterView);


/***/ }),

/***/ "./src/plugins/rosterview/styles/approval-alert.scss":
/*!***********************************************************!*\
  !*** ./src/plugins/rosterview/styles/approval-alert.scss ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_approval_alert_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./approval-alert.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/styles/approval-alert.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_approval_alert_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_approval_alert_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_approval_alert_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_approval_alert_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/rosterview/styles/roster.scss":
/*!***************************************************!*\
  !*** ./src/plugins/rosterview/styles/roster.scss ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roster_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./roster.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/rosterview/styles/roster.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roster_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roster_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roster_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_roster_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/plugins/rosterview/templates/approval-alert.js":
/*!************************************************************!*\
  !*** ./src/plugins/rosterview/templates/approval-alert.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");


/**
 * @param {import('../approval-alert').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    return el.contact ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="alert alert-info d-flex flex-column align-items-center mb-0 p-3 text-center"><p class="mb-2">${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s would like to be your contact', el.contact.getDisplayName())}</p><div class="btn-group"><button type="button" class="btn btn-sm btn-success" @click="${(ev)=>el.acceptRequest(ev)}">${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Approve')}</button> <button type="button" class="btn btn-sm btn-danger" @click="${(ev)=>el.declineRequest(ev)}">${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Deny')}</button></div></div>` : '';
});


/***/ }),

/***/ "./src/plugins/rosterview/templates/group.js":
/*!***************************************************!*\
  !*** ./src/plugins/rosterview/templates/group.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_icons_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/icons.js */ "./src/shared/components/icons.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/rosterview/utils.js");






const { isUniView } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u;
/**
 * @param {import('@converse/headless/types/plugins/roster/contact').default} contact
 */ function renderContact(contact) {
    const jid = contact.get('jid');
    const extra_classes = [];
    if (isUniView()) {
        const chatbox = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.chatboxes.get(jid);
        if (chatbox && !chatbox.get('hidden')) {
            extra_classes.push('open');
        }
    }
    const ask = contact.get('ask');
    const requesting = contact.get('requesting');
    const subscription = contact.get('subscription');
    if (ask === 'subscribe' || subscription === 'from') {
        /* ask === 'subscribe'
         *      Means we have asked to subscribe to them.
         *
         * subscription === 'from'
         *      They are subscribed to us, but not vice versa.
         *      We assume that there is a pending subscription
         *      from us to them (otherwise we're in a state not
         *      supported by converse.js).
         *
         *  So in both cases the user is a "pending" contact.
         */ extra_classes.push('pending-xmpp-contact');
    } else if (requesting === true) {
        extra_classes.push('requesting-xmpp-contact');
    } else if (subscription === 'both' || subscription === 'to' || _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.isSameBareJID(jid, _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.connection.get().jid)) {
        extra_classes.push('current-xmpp-contact');
        extra_classes.push(subscription);
        extra_classes.push(contact.getStatus());
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li class="list-item d-flex controlbox-padded ${extra_classes.join(' ')}" data-status="${contact.getStatus()}"><converse-roster-contact .model="${contact}"></converse-roster-contact></li>`;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    const i18n_title = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Click to hide these contacts');
    const collapsed = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.roster.state.get('collapsed_groups');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="roster-group" data-group="${o.name}"><a href="#" class="list-toggle group-toggle controlbox-padded" title="${i18n_title}" @click="${(ev)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.toggleGroup)(ev, o.name)}"><converse-icon color="var(--chat-color)" size="1em" class="fa ${collapsed.includes(o.name) ? 'fa-caret-right' : 'fa-caret-down'}"></converse-icon>${o.name}  ${o.contacts[0].get('requesting') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-icon color="var(--chat-color)" size="1.2em" class="fa fa-bell-alt"></converse-icon>` : ``}</a><ul class="items-list roster-group-contacts ${collapsed.includes(o.name) ? 'collapsed' : ''}" data-group="${o.name}">${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(o.contacts, (c)=>c.get('jid'), renderContact)}</ul></div>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/templates/requesting_contact.js":
/*!****************************************************************!*\
  !*** ./src/plugins/rosterview/templates/requesting_contact.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _roster_item_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./roster_item.js */ "./src/plugins/rosterview/templates/roster_item.js");




/**
 * @param {import('../contactview').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_vcard;
    const num_unread = (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_2__.getUnreadMsgsDisplay)(el.model);
    const jid = el.model.get('jid');
    const display_name = el.model.getDisplayName();
    const i18n_accept = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Click to accept the contact request from %1$s (XMPP address: %2$s)', display_name, jid);
    const i18n_decline = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Click to decline the contact request from %1$s (XMPP address: %2$s)', display_name, jid);
    const i18n_chat = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Click to chat with %1$s (XMPP address: %2$s)', display_name, jid);
    const btns = [
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="dropdown-item accept-xmpp-request" role="button" @click="${(ev)=>el.acceptRequest(ev)}" aria-label="${i18n_accept}" title="${i18n_accept}" href="#"><converse-icon class="fa fa-check" size="1em"></converse-icon>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Accept as contact')}</a>`,
        (0,_roster_item_js__WEBPACK_IMPORTED_MODULE_3__.tplDetailsButton)(el),
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="dropdown-item decline-xmpp-request" role="button" @click="${(ev)=>el.declineRequest(ev)}" aria-label="${i18n_decline}" title="${i18n_decline}"><converse-icon class="fa fa-times" size="1em"></converse-icon>${(0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove')}</a>`
    ];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="list-item-link cbox-list-item open-chat ${num_unread ? 'unread-msgs' : ''}" title="${i18n_chat}" href="#" data-jid="${jid}" @click="${el.openChat}"><span><converse-avatar .model="${el.model}" class="avatar" name="${el.model.getDisplayName()}" nonce="${(_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.get('vcard_updated')}" height="30" width="30"></converse-avatar></span>${num_unread ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="msgs-indicator badge">${num_unread}</span>` : ''} <span class="contact-name ${num_unread ? 'unread-msgs' : ''}">${display_name}</span> </a><span class="contact-actions"><converse-dropdown class="btn-group dropstart list-item-action" .items="${btns}"></converse-dropdown></span>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/templates/roster.js":
/*!****************************************************!*\
  !*** ./src/plugins/rosterview/templates/roster.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _group_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./group.js */ "./src/plugins/rosterview/templates/group.js");
/* harmony import */ var _roster_filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./roster_filter.js */ "./src/plugins/rosterview/templates/roster_filter.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils.js */ "./src/plugins/rosterview/utils.js");







const { CLOSED } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.constants;
/**
 * @param {import('../rosterview').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_heading_contacts = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Contacts');
    const i18n_toggle_contacts = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Click to toggle contacts');
    const i18n_title_add_contact = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Add a contact');
    const i18n_title_new_chat = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Start a new chat');
    const i18n_show_blocklist = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show block list');
    const { state } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse;
    const roster = [
        ...state.roster || [],
        ..._converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_self_in_roster') ? [
            state.xmppstatus
        ] : []
    ];
    const contacts_map = roster.reduce((acc, contact)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.populateContactsMap)(acc, contact), {});
    const groupnames = Object.keys(contacts_map).filter((contact)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.shouldShowGroup)(contact, el.model));
    const is_closed = el.model.get('toggle_state') === CLOSED;
    groupnames.sort(_utils_js__WEBPACK_IMPORTED_MODULE_6__.groupsComparator);
    const i18n_show_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Show filter');
    const i18n_hide_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Hide filter');
    const is_filter_visible = el.model.get('filter_visible');
    const btns = /** @type {TemplateResult[]} */ [];
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_contact_requests')) {
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item add-contact" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.showAddContactModal(ev)}" title="${i18n_title_add_contact}" data-toggle="modal" data-target="#add-contact-modal"><converse-icon class="fa fa-user-plus" size="1em"></converse-icon>${i18n_title_add_contact}</a>`);
    }
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_non_roster_messaging')) {
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item new-chat" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.showNewChatModal(ev)}" title="${i18n_title_new_chat}" data-toggle="modal" data-target="#new-chat-modal"><converse-icon class="fa fa-user-plus" size="1em"></converse-icon>${i18n_title_new_chat}</a>`);
    }
    btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.showBlocklistModal(ev)}" title="${i18n_show_blocklist}"><converse-icon class="fa fa-list-ul" size="1em"></converse-icon>${i18n_show_blocklist}</a>`);
    if (roster.length > 5) {
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item toggle-filter" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.toggleFilter(ev)}"><converse-icon size="1em" class="fa fa-filter"></converse-icon>${is_filter_visible ? i18n_hide_filter : i18n_show_filter}</a>`);
    }
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get("loglevel") === 'debug') {
        const i18n_title_sync_contacts = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Re-sync contacts');
        btns.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="#" class="dropdown-item" role="button" @click="${(/** @type {MouseEvent} */ ev)=>el.syncContacts(ev)}" title="${i18n_title_sync_contacts}"><converse-icon class="fa fa-sync sync-contacts" size="1em"></converse-icon>${i18n_title_sync_contacts}</a>`);
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="d-flex controlbox-padded"><span class="w-100 controlbox-heading controlbox-heading--contacts"><a class="list-toggle open-contacts-toggle" title="${i18n_toggle_contacts}" role="heading" aria-level="3" @click="${el.toggleRoster}">${i18n_heading_contacts} ${roster.length ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-icon class="fa ${is_closed ? 'fa-caret-right' : 'fa-caret-down'}" size="1em" color="var(--chat-color)"></converse-icon>` : ''}</a></span><converse-dropdown class="chatbox-btn btn-group dropstart dropdown--contacts" .items="${btns}"></converse-dropdown></div><div class="list-container roster-contacts ${is_closed ? 'hidden' : ''}">${is_filter_visible ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-list-filter @update="${()=>el.requestUpdate()}" .promise="${_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.waitUntil('rosterInitialized')}" .items="${_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.roster}" .template="${_roster_filter_js__WEBPACK_IMPORTED_MODULE_4__["default"]}" .model="${_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.state.roster_filter}"></converse-list-filter>` : ''} ${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(groupnames, (n)=>n, (name)=>{
        const contacts = contacts_map[name].filter((c)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_6__.shouldShowContact)(c, name, el.model));
        contacts.sort(_utils_js__WEBPACK_IMPORTED_MODULE_6__.contactsComparator);
        return contacts.length ? (0,_group_js__WEBPACK_IMPORTED_MODULE_3__["default"])({
            contacts,
            name
        }) : '';
    })}</div>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/templates/roster_filter.js":
/*!***********************************************************!*\
  !*** ./src/plugins/rosterview/templates/roster_filter.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/constants */ "./src/shared/constants.js");
/**
 * @typedef {import('shared/components/list-filter').default} ListFilter
 */ 


/**
 * @param {ListFilter} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_placeholder = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter');
    const title_contact_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter by contact name');
    const title_group_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter by group name');
    const title_status_filter = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Filter by status');
    const label_any = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Any');
    const label_unread_messages = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Unread');
    const { offline: label_offline, xa: label_xa, away: label_away, dnd: label_dnd, chat: label_chatty, online: label_online } = shared_constants__WEBPACK_IMPORTED_MODULE_2__.PRETTY_CHAT_STATUS;
    const chat_state = el.model.get('state');
    const filter_text = el.model.get('text');
    const filter_type = el.model.get('type');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="controlbox-padded items-filter-form input-button-group ${!el.shouldBeVisible() ? 'hidden' : 'fade-in'}" @submit="${(ev)=>el.submitFilter(ev)}"><div class="flex-nowrap"><div class="filter-by d-flex flex-nowrap"><converse-icon size="1em" @click="${(ev)=>el.changeTypeFilter(ev)}" class="fa fa-user clickable ${filter_type === 'items' ? 'selected' : ''}" data-type="items" title="${title_contact_filter}"></converse-icon><converse-icon size="1em" @click="${(ev)=>el.changeTypeFilter(ev)}" class="fa fa-users clickable ${filter_type === 'groups' ? 'selected' : ''}" data-type="groups" title="${title_group_filter}"></converse-icon><converse-icon size="1em" @click="${(ev)=>el.changeTypeFilter(ev)}" class="fa fa-circle clickable ${filter_type === 'state' ? 'selected' : ''}" data-type="state" title="${title_status_filter}"></converse-icon></div><div class="btn-group"><input .value="${filter_text || ''}" @keydown="${(ev)=>el.liveFilter(ev)}" class="items-filter form-control ${filter_type === 'state' ? 'hidden' : ''}" placeholder="${i18n_placeholder}"><converse-icon size="1em" class="fa fa-times clear-input ${!filter_text || filter_type === 'state' ? 'hidden' : ''}" @click="${(ev)=>el.clearFilter(ev)}"></converse-icon></div><select class="form-control state-type ${filter_type !== 'state' ? 'hidden' : ''}" @change="${(ev)=>el.changeChatStateFilter(ev)}"><option value="">${label_any}</option><option ?selected="${chat_state === 'unread_messages'}" value="unread_messages">${label_unread_messages}</option><option ?selected="${chat_state === 'online'}" value="online">${label_online}</option><option ?selected="${chat_state === 'chat'}" value="chat">${label_chatty}</option><option ?selected="${chat_state === 'dnd'}" value="dnd">${label_dnd}</option><option ?selected="${chat_state === 'away'}" value="away">${label_away}</option><option ?selected="${chat_state === 'xa'}" value="xa">${label_xa}</option><option ?selected="${chat_state === 'offline'}" value="offline">${label_offline}</option></select></div></form>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/templates/roster_item.js":
/*!*********************************************************!*\
  !*** ./src/plugins/rosterview/templates/roster_item.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   tplDetailsButton: () => (/* binding */ tplDetailsButton),
/* harmony export */   tplRemoveButton: () => (/* binding */ tplRemoveButton)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants.js */ "./src/plugins/rosterview/constants.js");





/**
 * @param {import('../contactview').default} el
 */ function tplRemoveButton(el) {
    const display_name = el.model.getDisplayName();
    const i18n_remove = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to remove %1$s as a contact', display_name);
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="dropdown-item remove-xmpp-contact" role="button" @click="${(ev)=>el.removeContact(ev)}" title="${i18n_remove}" data-toggle="modal"><converse-icon class="fa fa-trash-alt" size="1em"></converse-icon>${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove')}</a>`;
}
/**
 * @param {import('../contactview').default} el
 */ function tplDetailsButton(el) {
    const display_name = el.model.getDisplayName();
    const i18n_remove = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to show more details about %1$s', display_name);
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="dropdown-item" role="button" @click="${(ev)=>el.showUserDetailsModal(ev)}" title="${i18n_remove}" data-toggle="modal"><converse-icon class="fa fa-id-card" size="1em"></converse-icon>${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Details')}</a>`;
}
/**
 * @param {import('../contactview').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_vcard;
    const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('bare_jid');
    const show = el.model.getStatus() || 'offline';
    let classes, color;
    if (show === 'online') {
        [classes, color] = [
            'fa fa-circle',
            'chat-status-online'
        ];
    } else if (show === 'dnd') {
        [classes, color] = [
            'fa fa-minus-circle',
            'chat-status-busy'
        ];
    } else if (show === 'away') {
        [classes, color] = [
            'fa fa-circle',
            'chat-status-away'
        ];
    } else {
        [classes, color] = [
            'fa fa-circle',
            'chat-status-offline'
        ];
    }
    const is_self = bare_jid === el.model.get('jid');
    const desc_status = _constants_js__WEBPACK_IMPORTED_MODULE_4__.STATUSES[show];
    const num_unread = (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__.getUnreadMsgsDisplay)(el.model);
    const display_name = el.model.getDisplayName({
        context: 'roster'
    });
    const jid = el.model.get('jid');
    const i18n_chat = is_self ? (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to chat with yourself') : (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to chat with %1$s (XMPP address: %2$s)', display_name, jid);
    const btns = [
        tplDetailsButton(el),
        ..._converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_contact_removal') && !is_self ? [
            tplRemoveButton(el)
        ] : []
    ];
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="list-item-link cbox-list-item open-chat ${num_unread ? 'unread-msgs' : ''}" title="${i18n_chat}" href="#" data-jid="${jid}" @click="${el.openChat}"><span><converse-avatar .model="${el.model}" class="avatar" name="${el.model.getDisplayName()}" nonce="${(_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.get('vcard_updated')}" height="30" width="30"></converse-avatar>${[
        'both',
        'to'
    ].includes(el.model.get('subscription')) ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-icon title="${desc_status}" color="var(--${color})" size="1em" class="${classes} chat-status chat-status--avatar"></converse-icon>` : ''} </span>${num_unread ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<span class="msgs-indicator badge">${num_unread}</span>` : ''} <span class="contact-name contact-name--${show} ${num_unread ? 'unread-msgs' : ''}">${display_name}</span> </a><span class="contact-actions"><converse-dropdown class="btn-group dropstart list-item-action" .items="${btns}"></converse-dropdown></span>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/templates/unsaved_contact.js":
/*!*************************************************************!*\
  !*** ./src/plugins/rosterview/templates/unsaved_contact.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _roster_item__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./roster_item */ "./src/plugins/rosterview/templates/roster_item.js");





/**
 * @param {import('../contactview').default} el
 */ function tplAddContactButton(el) {
    const display_name = el.model.getDisplayName();
    const i18n_add_contact = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to add %1$s as a contact', display_name);
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="dropdown-item add-contact" role="button" @click="${(ev)=>el.addContact(ev)}" title="${i18n_add_contact}" data-toggle="modal"><converse-icon class="fa fa-user-plus" size="1.5em"></converse-icon>${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Save as contact')}</a>`;
}
/**
 * @param {import('../contactview').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_vcard;
    const num_unread = (0,shared_chat_utils_js__WEBPACK_IMPORTED_MODULE_3__.getUnreadMsgsDisplay)(el.model);
    const display_name = el.model.getDisplayName();
    const jid = el.model.get('jid');
    const i18n_chat = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Click to chat with %1$s (XMPP address: %2$s)', display_name, jid);
    const btns = [
        (0,_roster_item__WEBPACK_IMPORTED_MODULE_4__.tplDetailsButton)(el),
        tplAddContactButton(el),
        ..._converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_contact_removal') ? [
            (0,_roster_item__WEBPACK_IMPORTED_MODULE_4__.tplRemoveButton)(el)
        ] : []
    ];
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="list-item-link cbox-list-item open-chat ${num_unread ? 'unread-msgs' : ''}" title="${i18n_chat}" href="#" data-jid="${jid}" @click="${el.openChat}"><span><converse-avatar .model="${el.model}" class="avatar" name="${el.model.getDisplayName()}" nonce="${(_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.get('vcard_updated')}" height="30" width="30"></converse-avatar></span>${num_unread ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<span class="msgs-indicator badge">${num_unread}</span>` : ''} <span class="contact-name ${num_unread ? 'unread-msgs' : ''}">${display_name}</span> </a><span class="contact-actions"><converse-dropdown class="btn-group dropstart list-item-action" .items="${btns}"></converse-dropdown></span>`;
});


/***/ }),

/***/ "./src/plugins/rosterview/utils.js":
/*!*****************************************!*\
  !*** ./src/plugins/rosterview/utils.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   blockContact: () => (/* binding */ blockContact),
/* harmony export */   contactsComparator: () => (/* binding */ contactsComparator),
/* harmony export */   declineContactRequest: () => (/* binding */ declineContactRequest),
/* harmony export */   getGroupsAutoCompleteList: () => (/* binding */ getGroupsAutoCompleteList),
/* harmony export */   getJIDsAutoCompleteList: () => (/* binding */ getJIDsAutoCompleteList),
/* harmony export */   getNamesAutoCompleteList: () => (/* binding */ getNamesAutoCompleteList),
/* harmony export */   groupsComparator: () => (/* binding */ groupsComparator),
/* harmony export */   highlightRosterItem: () => (/* binding */ highlightRosterItem),
/* harmony export */   isContactFiltered: () => (/* binding */ isContactFiltered),
/* harmony export */   populateContactsMap: () => (/* binding */ populateContactsMap),
/* harmony export */   removeContact: () => (/* binding */ removeContact),
/* harmony export */   shouldShowContact: () => (/* binding */ shouldShowContact),
/* harmony export */   shouldShowGroup: () => (/* binding */ shouldShowGroup),
/* harmony export */   toggleGroup: () => (/* binding */ toggleGroup),
/* harmony export */   unblockContact: () => (/* binding */ unblockContact)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @typedef {import('@converse/skeletor').Model} Model
 * @typedef {import('@converse/headless').RosterContact} RosterContact
 * @typedef {import('@converse/headless').RosterContacts} RosterContacts
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}


const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const { STATUS_WEIGHTS } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
/**
 * @param {RosterContact} contact
 * @param {boolean} [unauthorize]
 * @returns {Promise<boolean>}
 */ function removeContact(contact, unauthorize = false) {
    return _async_to_generator(function*() {
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('allow_contact_removal')) return;
        const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Confirm'), (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Are you sure you want to remove this contact?'));
        if (!result) return false;
        const chat = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.chats.get(contact.get('jid'));
        chat === null || chat === void 0 ? void 0 : chat.close();
        try {
            yield contact.remove(unauthorize);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error'), [
                (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sorry, an error occurred while trying to remove %1$s as a contact', contact.getDisplayName())
            ]);
        }
        return true;
    })();
}
/**
 * @param {RosterContact} contact
 */ function declineContactRequest(contact) {
    return _async_to_generator(function*() {
        const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('domain');
        const blocking_supported = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.disco.supports(Strophe.NS.BLOCKING, domain);
        const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove and decline contact request'), [
            (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Are you sure you want to decline the contact request from %1$s?', contact.getDisplayName())
        ], blocking_supported ? [
            {
                label: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Also block this user from sending you further messages'),
                name: 'block',
                type: 'checkbox'
            }
        ] : []);
        if (result) {
            var _result_find;
            const chat = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.chats.get(contact.get('jid'));
            contact.unauthorize();
            if (blocking_supported && Array.isArray(result) && ((_result_find = result.find((i)=>i.name === 'block')) === null || _result_find === void 0 ? void 0 : _result_find.value) === 'on') {
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.blocklist.add(contact.get('jid'));
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.show('declined-and-blocked', {
                    type: 'success',
                    body: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact request declined and user blocked')
                });
                chat === null || chat === void 0 ? void 0 : chat.close();
            } else {
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.toast.show('request-declined', {
                    type: 'success',
                    body: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Contact request declined')
                });
            }
            if (!chat) contact.destroy();
        }
        return this;
    }).call(this);
}
/**
 * @param {RosterContact} contact
 * @returns {Promise<boolean>}
 */ function blockContact(contact) {
    return _async_to_generator(function*() {
        var _this;
        const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('domain');
        if (!(yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.disco.supports(Strophe.NS.BLOCKING, domain))) return false;
        const i18n_confirm = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Do you want to block this contact, so they cannot send you messages?');
        if (!(yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Confirm'), i18n_confirm))) return false;
        (_this = yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.chats.get(contact.get('jid'))) === null || _this === void 0 ? void 0 : _this.close();
        try {
            yield Promise.all([
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.blocklist.add(contact.get('jid')),
                contact.remove(true)
            ]);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error'), [
                (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sorry, an error occurred while trying to block %1$s', contact.getDisplayName())
            ]);
        }
    })();
}
/**
 * @param {RosterContact} contact
 * @returns {Promise<boolean>}
 */ function unblockContact(contact) {
    return _async_to_generator(function*() {
        const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('domain');
        if (!(yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.disco.supports(Strophe.NS.BLOCKING, domain))) return false;
        const i18n_confirm = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Do you want to unblock this contact, so they can send you messages?');
        if (!(yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.confirm(i18n_confirm))) return false;
        try {
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.blocklist.remove(contact.get('jid'));
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error'), [
                (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sorry, an error occurred while trying to unblock %1$s', contact.getDisplayName())
            ]);
        }
    })();
}
/**
 * @param {string} jid
 */ function highlightRosterItem(jid) {
    var _converse_state_roster_get, _converse_state_roster;
    (_converse_state_roster = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.roster) === null || _converse_state_roster === void 0 ? void 0 : (_converse_state_roster_get = _converse_state_roster.get(jid)) === null || _converse_state_roster_get === void 0 ? void 0 : _converse_state_roster_get.trigger('highlight');
}
/**
 * @param {Event} ev
 * @param {string} name
 */ function toggleGroup(ev, name) {
    var _ev_preventDefault;
    ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
    const { roster } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state;
    const collapsed = roster.state.get('collapsed_groups');
    if (collapsed.includes(name)) {
        roster.state.save('collapsed_groups', collapsed.filter((n)=>n !== name));
    } else {
        roster.state.save('collapsed_groups', [
            ...collapsed,
            name
        ]);
    }
}
/**
 * Return a string of tab-separated values that are to be used when
 * matching against filter text.
 *
 * The goal is to be able to filter against the VCard fullname,
 * roster nickname and JID.
 * @param {RosterContact|Profile} contact
 * @returns {string} Lower-cased, tab-separated values
 */ function getFilterCriteria(contact) {
    const nick = contact instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_1__.Profile ? contact.getNickname() : contact.get('nickname');
    const jid = contact.get('jid');
    let criteria = contact.getDisplayName({
        context: 'roster'
    });
    criteria = !criteria.includes(jid) ? criteria.concat(`   ${jid}`) : criteria;
    criteria = !criteria.includes(nick) ? criteria.concat(`   ${nick}`) : criteria;
    return criteria.toLowerCase();
}
/**
 * @param {RosterContact|Profile} contact
 * @param {string} groupname
 * @returns {boolean}
 */ function isContactFiltered(contact, groupname) {
    const filter = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.roster_filter;
    const type = filter.get('type');
    const q = type === 'state' ? filter.get('state').toLowerCase() : filter.get('text').toLowerCase();
    if (!q) return false;
    if (type === 'state') {
        const sticky_groups = [
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.labels.HEADER_REQUESTING_CONTACTS,
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.labels.HEADER_UNREAD
        ];
        if (sticky_groups.includes(groupname)) {
            // When filtering by chat state, we still want to
            // show sticky groups, even though they don't
            // match the state in question.
            return false;
        } else if (q === 'unread_messages') {
            return contact.get('num_unread') === 0;
        } else if (q === 'online') {
            return [
                'offline',
                'unavailable',
                'dnd',
                'away',
                'xa'
            ].includes(contact.getStatus());
        } else {
            return !contact.getStatus().includes(q);
        }
    } else if (type === 'items') {
        return !getFilterCriteria(contact).includes(q);
    }
}
/**
 * @param {RosterContact} contact
 * @param {string} groupname
 * @param {Model} model
 * @returns {boolean}
 */ function shouldShowContact(contact, groupname, model) {
    if (!model.get('filter_visible')) return true;
    const chat_status = contact.getStatus();
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('hide_offline_users') && chat_status === 'offline') {
        // If pending or requesting, show
        if (contact.get('ask') === 'subscribe' || contact.get('subscription') === 'from' || contact.get('requesting') === true) {
            return !isContactFiltered(contact, groupname);
        }
        return false;
    }
    return !isContactFiltered(contact, groupname);
}
/**
 * @param {string} group
 * @param {Model} model
 */ function shouldShowGroup(group, model) {
    if (!model.get('filter_visible')) return true;
    const filter = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.roster_filter;
    const type = filter.get('type');
    if (type === 'groups') {
        var _filter_get;
        const q = (_filter_get = filter.get('text')) === null || _filter_get === void 0 ? void 0 : _filter_get.toLowerCase();
        if (!q) {
            return true;
        }
        if (!group.toLowerCase().includes(q)) {
            return false;
        }
    }
    return true;
}
/**
 * Populates a contacts map with the given contact, categorizing it into appropriate groups.
 * @param {import('./types').ContactsMap} contacts_map
 * @param {RosterContact} contact
 * @returns {import('./types').ContactsMap}
 */ function populateContactsMap(contacts_map, contact) {
    const { labels } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse;
    var _contact_get;
    const contact_groups = /** @type {string[]} */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.unique((_contact_get = contact.get('groups')) !== null && _contact_get !== void 0 ? _contact_get : []);
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isOwnJID(contact.get('jid')) && !contact_groups.length) {
        contact_groups.push(/** @type {string} */ labels.HEADER_UNGROUPED);
    } else if (contact.get('requesting')) {
        contact_groups.push(/** @type {string} */ labels.HEADER_REQUESTING_CONTACTS);
    } else if (contact.get('ask') === 'subscribe') {
        contact_groups.push(/** @type {string} */ labels.HEADER_PENDING_CONTACTS);
    } else if (contact.get('subscription') === undefined) {
        contact_groups.push(/** @type {string} */ labels.HEADER_UNSAVED_CONTACTS);
    } else if (!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('roster_groups')) {
        contact_groups.push(/** @type {string} */ labels.HEADER_CURRENT_CONTACTS);
    } else if (!contact_groups.length) {
        contact_groups.push(/** @type {string} */ labels.HEADER_UNGROUPED);
    }
    for (const name of contact_groups){
        var _contacts_map_name;
        if ((_contacts_map_name = contacts_map[name]) === null || _contacts_map_name === void 0 ? void 0 : _contacts_map_name.includes(contact)) {
            continue;
        }
        contacts_map[name] ? contacts_map[name].push(contact) : contacts_map[name] = [
            contact
        ];
    }
    if (contact.get('num_unread')) {
        const name = /** @type {string} */ labels.HEADER_UNREAD;
        contacts_map[name] ? contacts_map[name].push(contact) : contacts_map[name] = [
            contact
        ];
    }
    return contacts_map;
}
/**
 * @param {RosterContact|Profile} contact1
 * @param {RosterContact|Profile} contact2
 * @returns {(-1|0|1)}
 */ function contactsComparator(contact1, contact2) {
    const status1 = contact1.getStatus();
    const status2 = contact2.getStatus();
    if (STATUS_WEIGHTS[status1] === STATUS_WEIGHTS[status2]) {
        const name1 = contact1.getDisplayName().toLowerCase();
        const name2 = contact2.getDisplayName().toLowerCase();
        return name1 < name2 ? -1 : name1 > name2 ? 1 : 0;
    } else {
        return STATUS_WEIGHTS[status1] < STATUS_WEIGHTS[status2] ? -1 : 1;
    }
}
/**
 * @param {string} a
 * @param {string} b
 */ function groupsComparator(a, b) {
    const HEADER_WEIGHTS = {};
    const { HEADER_CURRENT_CONTACTS, HEADER_REQUESTING_CONTACTS, HEADER_UNGROUPED, HEADER_UNREAD, HEADER_PENDING_CONTACTS, HEADER_UNSAVED_CONTACTS } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.labels;
    HEADER_WEIGHTS[HEADER_UNREAD] = 0;
    HEADER_WEIGHTS[HEADER_UNSAVED_CONTACTS] = 1;
    HEADER_WEIGHTS[HEADER_REQUESTING_CONTACTS] = 2;
    HEADER_WEIGHTS[HEADER_CURRENT_CONTACTS] = 3;
    HEADER_WEIGHTS[HEADER_UNGROUPED] = 4;
    HEADER_WEIGHTS[HEADER_PENDING_CONTACTS] = 5;
    const WEIGHTS = HEADER_WEIGHTS;
    const special_groups = Object.keys(HEADER_WEIGHTS);
    const a_is_special = special_groups.includes(a);
    const b_is_special = special_groups.includes(b);
    if (!a_is_special && !b_is_special) {
        return a.toLowerCase() < b.toLowerCase() ? -1 : a.toLowerCase() > b.toLowerCase() ? 1 : 0;
    } else if (a_is_special && b_is_special) {
        return WEIGHTS[a] < WEIGHTS[b] ? -1 : WEIGHTS[a] > WEIGHTS[b] ? 1 : 0;
    } else if (!a_is_special && b_is_special) {
        const a_header = HEADER_CURRENT_CONTACTS;
        return WEIGHTS[a_header] < WEIGHTS[b] ? -1 : WEIGHTS[a_header] > WEIGHTS[b] ? 1 : 0;
    } else if (a_is_special && !b_is_special) {
        const b_header = HEADER_CURRENT_CONTACTS;
        return WEIGHTS[a] < WEIGHTS[b_header] ? -1 : WEIGHTS[a] > WEIGHTS[b_header] ? 1 : 0;
    }
}
function getGroupsAutoCompleteList() {
    const roster = /** @type {RosterContacts} */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.roster;
    const groups = roster.reduce((groups, contact)=>groups.concat(contact.get('groups')), []);
    return [
        ...new Set(groups.filter((i)=>i))
    ];
}
function getJIDsAutoCompleteList() {
    const roster = /** @type {RosterContacts} */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.state.roster;
    return [
        ...new Set([
            ...roster.map((item)=>Strophe.getDomainFromJid(item.get('jid'))),
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('domain')
        ])
    ];
}
/**
 * @param {string} query
 */ function getNamesAutoCompleteList(query) {
    return _async_to_generator(function*() {
        const options = {
            mode: /** @type {RequestMode} */ 'cors',
            headers: {
                Accept: 'text/json'
            }
        };
        const url = `${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('xhr_user_search_url')}q=${encodeURIComponent(query)}`;
        let response;
        try {
            response = yield fetch(url, options);
        } catch (e) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(`Failed to fetch names for query "${query}"`);
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(e);
            return [];
        }
        const json = yield response.json();
        if (!Array.isArray(json)) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_1__.log.error(`Invalid JSON returned"`);
            return [];
        }
        return json.map((i)=>_object_spread({
                label: `${i.fullname} <${i.jid}>`,
                value: `${i.fullname} <${i.jid}>`
            }, i));
    })();
}
Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u, {
    rosterview: {
        removeContact,
        declineContactRequest,
        blockContact,
        unblockContact,
        highlightRosterItem,
        toggleGroup,
        getFilterCriteria,
        isContactFiltered,
        shouldShowContact,
        shouldShowGroup,
        populateContactsMap,
        contactsComparator,
        groupsComparator,
        getGroupsAutoCompleteList,
        getJIDsAutoCompleteList,
        getNamesAutoCompleteList
    }
});


/***/ }),

/***/ "./src/plugins/singleton/index.js":
/*!****************************************!*\
  !*** ./src/plugins/singleton/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _singleton_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./singleton.scss */ "./src/plugins/singleton/singleton.scss");
/**
 * @copyright JC Brand
 * @license Mozilla Public License (MPLv2)
 * @description A plugin which restricts Converse to only one chat.
 */ 

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.plugins.add('converse-singleton', {
    enabled (_converse) {
        return _converse.api.settings.get("singleton");
    },
    initialize () {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.extend({
            'allow_logout': false,
            'allow_muc_invitations': false,
            // roster contacts can be invited
            'hide_muc_server': true
        });
        const auto_join_rooms = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('auto_join_rooms');
        const auto_join_private_chats = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('auto_join_private_chats');
        if (!Array.isArray(auto_join_rooms) && !Array.isArray(auto_join_private_chats)) {
            throw new Error("converse-singleton: auto_join_rooms must be an Array");
        }
        if (auto_join_rooms.length === 0 && auto_join_private_chats.length === 0) {
            throw new Error("If you set singleton set to true, you need " + "to specify auto_join_rooms or auto_join_private_chats");
        }
        if (auto_join_rooms.length > 0 && auto_join_private_chats.length > 0) {
            throw new Error("It doesn't make sense to have singleton set to true and " + "auto_join_rooms or auto_join_private_chats set to more then one, " + "since only one chat room may be open at any time.");
        }
    }
});


/***/ }),

/***/ "./src/plugins/singleton/singleton.scss":
/*!**********************************************!*\
  !*** ./src/plugins/singleton/singleton.scss ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_singleton_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./singleton.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/plugins/singleton/singleton.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_singleton_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_singleton_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_singleton_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_singleton_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/autocomplete/autocomplete.js":
/*!*************************************************!*\
  !*** ./src/shared/autocomplete/autocomplete.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AutoComplete: () => (/* binding */ AutoComplete),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _suggestion_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./suggestion.js */ "./src/shared/autocomplete/suggestion.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/shared/autocomplete/utils.js");
/**
 * @copyright Lea Verou and the Converse.js contributors
 * @description Started as a fork of Lea Verou's "Awesomplete"
 * @license Mozilla Public License (MPLv2)
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { siblingIndex } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u;
class AutoComplete extends (0,_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.EventEmitter)(Object) {
    bindEvents() {
        this._events = {
            input: {
                'blur': ()=>this.close({
                        reason: 'blur'
                    })
            },
            form: {
                'submit': ()=>this.close({
                        reason: 'submit'
                    })
            },
            ul: {
                'mousedown': (ev)=>this.onMouseDown(ev),
                'mouseover': (ev)=>this.onMouseOver(ev)
            }
        };
        _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.bind(this.input, this._events.input);
        _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.bind(this.input.form, this._events.form);
        _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.bind(this.ul, this._events.ul);
    }
    set list(list) {
        if (Array.isArray(list) || typeof list === 'function') {
            this._list = list;
        } else if (typeof list === 'string' && list.includes(',')) {
            this._list = list.split(/\s*,\s*/);
        } else {
            var _helpers_getElement;
            // Element or CSS selector
            const children = ((_helpers_getElement = _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.getElement(list)) === null || _helpers_getElement === void 0 ? void 0 : _helpers_getElement.children) || [];
            this._list = Array.from(children).filter((el)=>!el.disabled).map((el)=>{
                const text = el.textContent.trim();
                const value = el.value || text;
                const label = el.label || text;
                return value !== '' ? {
                    label,
                    value
                } : null;
            }).filter((i)=>i);
        }
        if (document.activeElement === this.input) {
            this.evaluate();
        }
    }
    get list() {
        return this._list;
    }
    get selected() {
        return this.index > -1;
    }
    get opened() {
        return this.is_opened;
    }
    /**
     * @param {import('./types').closeParam} o
     */ close(o) {
        if (!this.opened) {
            return;
        }
        this.ul.setAttribute('hidden', '');
        this.is_opened = false;
        this.index = -1;
        this.trigger('suggestion-box-close', o || {});
    }
    /**
     * @param {Suggestion} suggestion
     */ insertValue(suggestion) {
        if (this.match_current_word) {
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.replaceCurrentWord(this.input, suggestion.value);
        } else {
            this.input.value = suggestion.value;
        }
    }
    open() {
        this.ul.removeAttribute('hidden');
        this.is_opened = true;
        if (this.auto_first && this.index === -1) {
            this.goto(0);
        }
        this.trigger('suggestion-box-open');
    }
    destroy() {
        //remove events from the input and its form
        _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.unbind(this.input, this._events.input);
        _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.unbind(this.input.form, this._events.form);
        this.input.removeAttribute('aria-autocomplete');
    }
    next() {
        const count = this.ul.children.length;
        this.goto(this.index < count - 1 ? this.index + 1 : count ? 0 : -1);
    }
    previous() {
        const count = this.ul.children.length, pos = this.index - 1;
        this.goto(this.selected && pos !== -1 ? pos : count - 1);
    }
    /**
     * @param {number} i
     * @param {boolean} scroll=true
     */ goto(i, scroll = true) {
        // Should not be used directly, highlights specific item without any checks!
        const list = /** @type HTMLElement[] */ Array.from(this.ul.children).filter((el)=>el instanceof HTMLElement);
        if (this.selected) {
            list[this.index].setAttribute('aria-selected', 'false');
        }
        this.index = i;
        if (i > -1 && list.length > 0) {
            list[i].setAttribute('aria-selected', 'true');
            list[i].focus();
            this.status.textContent = list[i].textContent;
            if (scroll) {
                // scroll to highlighted element in case parent's height is fixed
                this.ul.scrollTop = list[i].offsetTop - this.ul.clientHeight + list[i].clientHeight;
            }
            this.trigger('suggestion-box-highlight', {
                text: this.suggestions[this.index]
            });
        }
    }
    /**
     * @param {Element} [selected]
     */ select(selected) {
        if (selected) {
            this.index = siblingIndex(selected);
        } else {
            selected = this.ul.children[this.index];
        }
        if (selected) {
            const suggestion = this.suggestions[this.index];
            this.insertValue(suggestion);
            this.close({
                reason: 'select'
            });
            this.auto_completing = false;
            this.trigger('suggestion-box-selectcomplete', {
                text: suggestion,
                suggestion
            });
        }
    }
    /**
     * @param {Event} ev
     */ onMouseOver(ev) {
        const li = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.ancestor(ev.target, 'li');
        if (li) {
            const index = Array.prototype.slice.call(this.ul.children).indexOf(li);
            this.goto(index, false);
        }
    }
    /**
     * @param {MouseEvent} ev
     */ onMouseDown(ev) {
        if (ev.button !== 0) {
            return; // Only select on left click
        }
        const li = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.ancestor(ev.target, 'li');
        if (li) {
            ev.preventDefault();
            this.select(li);
        }
    }
    /**
     * @param {KeyboardEvent} [ev]
     */ onKeyDown(ev) {
        if (this.opened) {
            if ([
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.ENTER,
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.TAB
            ].includes(ev.key) && this.selected) {
                ev.preventDefault();
                ev.stopPropagation();
                this.select();
                return true;
            } else if (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.ESCAPE) {
                this.close({
                    reason: 'esc'
                });
                return true;
            } else if ([
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.UP_ARROW,
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.DOWN_ARROW
            ].includes(ev.key)) {
                ev.preventDefault();
                ev.stopPropagation();
                this[ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.UP_ARROW ? 'previous' : 'next']();
                return true;
            }
        }
        if ([
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.SHIFT,
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.META,
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.ESCAPE,
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.ALT
        ].includes(ev.key)) {
            return;
        }
        if (this.ac_triggers.includes(ev.key)) {
            if (ev.key === 'Tab') {
                if (ev.shiftKey) {
                    // TAB + shift should give the focus to previous focusable element.
                    return;
                }
                // If the input is empty (and min_chars > 0), TAB should give focus to next focusable element.
                if (this.min_chars > 0 && this.input.value === '') {
                    return;
                }
                ev.preventDefault();
            }
            this.auto_completing = true;
        } else if (ev.key === 'Backspace') {
            const target = /** @type {HTMLInputElement} */ ev.target;
            const word = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getCurrentWord(target, target.selectionEnd - 1);
            if (_utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.isMention(word, this.ac_triggers)) {
                this.auto_completing = true;
            }
        }
    }
    /**
     * @param {KeyboardEvent} [ev]
     */ evaluate(ev) {
        return _async_to_generator(function*() {
            const selecting = this.selected && ev && (ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.UP_ARROW || ev.key === _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.keycodes.DOWN_ARROW);
            if (selecting) return;
            let value = this.match_current_word ? _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getCurrentWord(this.input) : this.input.value;
            const contains_trigger = _utils_js__WEBPACK_IMPORTED_MODULE_4__.helpers.isMention(value, this.ac_triggers);
            if (contains_trigger && !this.include_triggers.includes(ev.key)) {
                value = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.isMentionBoundary(value[0]) ? value.slice(2) : value.slice(1);
            }
            const is_long_enough = value.length && value.length >= this.min_chars;
            if (contains_trigger || is_long_enough) {
                this.auto_completing = true;
                const list = typeof this._list === 'function' ? yield this._list(value) : this._list;
                if (list.length === 0 || !this.auto_completing) {
                    this.close({
                        reason: 'nomatches'
                    });
                    return;
                }
                this.index = -1;
                this.suggestions = list.map(/** @param {import('./types').XHRResultItem} item */ (item)=>new _suggestion_js__WEBPACK_IMPORTED_MODULE_3__["default"](this.data(item, value), value)).filter(/** @param {Suggestion} item */ ({ value: text })=>this.filter(text, value));
                if (this.sort) {
                    this.suggestions = this.suggestions.sort(this.sort);
                }
                this.suggestions = this.suggestions.slice(0, this.max_items);
                (0,lit__WEBPACK_IMPORTED_MODULE_0__.render)((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${this.suggestions.map((text)=>this.item(text, value))}`, this.ul);
                if (this.suggestions.length === 0) {
                    this.close({
                        reason: 'nomatches'
                    });
                } else {
                    this.open();
                }
            } else {
                this.close({
                    reason: 'nomatches'
                });
                if (!contains_trigger) {
                    this.auto_completing = false;
                }
            }
        }).call(this);
    }
    /**
     * @param {HTMLElement} el
     * @param {any} config
     */ constructor(el, config = {}){
        super();
        this.suggestions = [];
        this.is_opened = false;
        this.match_current_word = false; // Match only the current word, otherwise all input is matched
        this.sort = config.sort === false ? null : _utils_js__WEBPACK_IMPORTED_MODULE_4__.SORT_BY_QUERY_POSITION;
        this.filter = _utils_js__WEBPACK_IMPORTED_MODULE_4__.FILTER_CONTAINS;
        this.ac_triggers = []; // Array of keys (`ev.key`) values that will trigger auto-complete
        this.include_triggers = []; // Array of trigger keys which should be included in the returned value
        this.min_chars = 2;
        this.max_items = 10;
        this.auto_first = false; // Should the first element be automatically selected?
        this.data = (a, _v)=>a;
        this.item = _utils_js__WEBPACK_IMPORTED_MODULE_4__.getAutoCompleteItem;
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.hasClass('suggestion-box', el)) {
            this.container = el;
        } else {
            this.container = el.querySelector('.suggestion-box');
        }
        this.input = /** @type {HTMLInputElement} */ this.container.querySelector('.suggestion-box__input');
        this.input.setAttribute('aria-autocomplete', 'list');
        this.ul = /** @type {HTMLElement} */ this.container.querySelector('.suggestion-box__results');
        this.status = this.container.querySelector('.suggestion-box__additions');
        Object.assign(this, config);
        this.index = -1;
        this.bindEvents();
        if (this.input.hasAttribute('list')) {
            this.list = '#' + this.input.getAttribute('list');
            this.input.removeAttribute('list');
        } else {
            this.list = this.input.getAttribute('data-list') || config.list || [];
        }
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AutoComplete);


/***/ }),

/***/ "./src/shared/autocomplete/component.js":
/*!**********************************************!*\
  !*** ./src/shared/autocomplete/component.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AutoCompleteComponent)
/* harmony export */ });
/* harmony import */ var _autocomplete_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./autocomplete.js */ "./src/shared/autocomplete/autocomplete.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ "./src/shared/autocomplete/utils.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





class AutoCompleteComponent extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            auto_evaluate: {
                type: Boolean
            },
            auto_first: {
                type: Boolean
            },
            autofocus: {
                type: Boolean
            },
            data: {
                type: Function
            },
            error_message: {
                type: String
            },
            filter: {
                type: String
            },
            getAutoCompleteList: {
                type: Function
            },
            include_triggers: {
                type: String
            },
            list: {
                type: Array
            },
            min_chars: {
                type: Number
            },
            name: {
                type: String
            },
            placeholder: {
                type: String
            },
            position: {
                type: String
            },
            renderItem: {
                type: Function
            },
            required: {
                type: Boolean
            },
            triggers: {
                type: String
            },
            validate: {
                type: Function
            },
            value: {
                type: String
            }
        };
    }
    render() {
        const position_class = `suggestion-box__results--${this.position}`;
        return (0,lit__WEBPACK_IMPORTED_MODULE_4__.html)`<div class="suggestion-box suggestion-box__name"><ul class="suggestion-box__results ${position_class}" hidden=""></ul><input .validate="${this.validate}" ?autofocus="${this.autofocus}" ?required="${this.required}" @change="${this.onChange}" @keydown="${this.onKeyDown}" @input="${this.evaluate}" autocomplete="off" class="form-control suggestion-box__input ${this.error_message ? "is-invalid error" : ""}" name="${this.name}" placeholder="${this.placeholder}" type="text" value="${this.value}"> <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span></div>${this.error_message ? (0,lit__WEBPACK_IMPORTED_MODULE_4__.html)`<div class="invalid-feedback">${this.error_message}</div>` : ""}`;
    }
    firstUpdated() {
        var _this_list;
        this.auto_complete = new _autocomplete_js__WEBPACK_IMPORTED_MODULE_0__["default"](/** @type HTMLElement */ this.firstElementChild, {
            ac_triggers: this.triggers.split(" "),
            auto_first: this.auto_first,
            filter: this.filter == "contains" ? _utils_js__WEBPACK_IMPORTED_MODULE_2__.FILTER_CONTAINS : _utils_js__WEBPACK_IMPORTED_MODULE_2__.FILTER_STARTSWITH,
            include_triggers: [],
            list: (_this_list = this.list) !== null && _this_list !== void 0 ? _this_list : /** @param {string} q */ (q)=>this.getAutoCompleteList(q),
            data: this.data,
            match_current_word: true,
            max_items: this.max_items,
            min_chars: this.min_chars,
            item: this.renderItem
        });
        this.auto_complete.on("suggestion-box-selectcomplete", ({ suggestion })=>{
            this.auto_completing = false;
            this.dispatchEvent(new CustomEvent('autocomplete-select', {
                detail: {
                    suggestion
                },
                bubbles: true,
                composed: true
            }));
        });
    }
    /** @param {KeyboardEvent} ev */ onKeyDown(ev) {
        this.auto_complete.onKeyDown(ev);
    }
    onChange() {
        return _async_to_generator(function*() {
            var _this_validate, _this;
            const input = this.querySelector("input");
            this.error_message = yield (_this_validate = (_this = this).validate) === null || _this_validate === void 0 ? void 0 : _this_validate.call(_this, input.value);
            if (this.error_message) this.requestUpdate();
            return this;
        }).call(this);
    }
    constructor(){
        super();
        this.auto_evaluate = true;
        this.auto_first = false;
        this.data = (a)=>a;
        this.error_message = "";
        this.filter = "contains";
        this.getAutoCompleteList = null;
        this.include_triggers = "";
        this.list = null;
        this.match_current_word = false; // Match only the current word, otherwise all input is matched
        this.max_items = 10;
        this.min_chars = 1;
        this.name = "";
        this.placeholder = "";
        this.position = "above";
        this.renderItem = _utils_js__WEBPACK_IMPORTED_MODULE_2__.getAutoCompleteItem;
        this.required = false;
        this.triggers = "";
        this.validate = null;
        this.value = "";
        this.evaluate = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.u.debounce(/** @param {KeyboardEvent} ev */ (ev)=>{
            this.auto_evaluate && this.auto_complete.evaluate(ev);
        }, 250);
    }
}
/**
 * A custom element that can be used to add auto-completion suggestions to a form input.
 * @class AutoCompleteComponent
 *
 * @property {"above" | "below"} [position="above"]
 *  Should the autocomplete list show above or below the input element?
 * @property {Boolean} [autofocus=false]
 *  Should the `focus` attribute be set on the input element?
 * @property {Function} getAutoCompleteList
 *  A function that returns the list of autocomplete suggestions
 * @property {Function} data
 *  A function that maps the returned matches into the correct format
 * @property {Array} list
 *  An array of suggestions, to be used instead of the `getAutoCompleteList` *  function
 * @property {Boolean} [auto_evaluate=true]
 *  Should evaluation happen automatically without any particular key as trigger?
 * @property {Boolean} [auto_first=false]
 *  Should the first element automatically be selected?
 * @property { "contains" | "startswith" } [filter="contains"]
 *  Provide matches which contain the entered text, or which starts with the entered text
 * @property {String} [include_triggers=""]
 *  Space separated characters which should be included in the returned value
 * @property {Number} [min_chars=1]
 *  The minimum number of characters to be entered into the input before autocomplete starts.
 * @property {String} [name]
 *  The `name` attribute of the `input` element
 * @property {String} [placeholder]
 *  The `placeholder` attribute of the `input` element
 * @property {Function} [renderItem]
 *  Optional function which must return a lit TemplateResult which renders an
 *  suggestion item in the autocomplete list.
 * @property {String} [triggers]
 *  String of space separated characters which trigger autocomplete
 * @property {Function} [validate]
 *  A validation function that returns a string containing a validation error
 *  message in case the validation failed.
 *
 * @example
 *     <converse-autocomplete
 *         .getAutoCompleteList="${getAutoCompleteList}"
 *         placeholder="${placeholder_text}"
 *         name="foo">
 *     </converse-autocomplete>
 */ 
_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define("converse-autocomplete", AutoCompleteComponent);


/***/ }),

/***/ "./src/shared/autocomplete/index.js":
/*!******************************************!*\
  !*** ./src/shared/autocomplete/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _component_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./component.js */ "./src/shared/autocomplete/component.js");
/* harmony import */ var _autocomplete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./autocomplete.js */ "./src/shared/autocomplete/autocomplete.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_autocomplete_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/_autocomplete.scss */ "./src/shared/autocomplete/styles/_autocomplete.scss");




const exports = {
    AutoComplete: _autocomplete_js__WEBPACK_IMPORTED_MODULE_1__["default"]
};
Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse, exports); // DEPRECATED
Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.exports, exports);


/***/ }),

/***/ "./src/shared/autocomplete/styles/_autocomplete.scss":
/*!***********************************************************!*\
  !*** ./src/shared/autocomplete/styles/_autocomplete.scss ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_autocomplete_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./_autocomplete.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/autocomplete/styles/_autocomplete.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_autocomplete_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_autocomplete_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_autocomplete_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_autocomplete_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/autocomplete/suggestion.js":
/*!***********************************************!*\
  !*** ./src/shared/autocomplete/suggestion.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * An autocomplete suggestion
 */ class Suggestion extends String {
    get lenth() {
        return this.label.length;
    }
    toString() {
        return `${this.label}`;
    }
    valueOf() {
        return this.toString();
    }
    /**
     * @param {any} data - The auto-complete data. Ideally an object e.g. { label, value },
     *      which specifies the value and human-presentable label of the suggestion.
     * @param {string} query - The query string being auto-completed
     */ constructor(data, query){
        super();
        const o = Array.isArray(data) ? {
            label: data[0],
            value: data[1]
        } : typeof data === 'object' && 'label' in data && 'value' in data ? data : {
            label: data,
            value: data
        };
        this.label = o.label || o.value;
        this.value = o.value;
        this.query = query;
        this.data = data;
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Suggestion);


/***/ }),

/***/ "./src/shared/autocomplete/utils.js":
/*!******************************************!*\
  !*** ./src/shared/autocomplete/utils.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FILTER_CONTAINS: () => (/* binding */ FILTER_CONTAINS),
/* harmony export */   FILTER_STARTSWITH: () => (/* binding */ FILTER_STARTSWITH),
/* harmony export */   SORT_BY_LENGTH: () => (/* binding */ SORT_BY_LENGTH),
/* harmony export */   SORT_BY_QUERY_POSITION: () => (/* binding */ SORT_BY_QUERY_POSITION),
/* harmony export */   getAutoCompleteItem: () => (/* binding */ getAutoCompleteItem),
/* harmony export */   helpers: () => (/* binding */ helpers),
/* harmony export */   regExpEscape: () => (/* binding */ regExpEscape)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


const u = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env.utils;
const helpers = {
    getElement (expr, el) {
        return typeof expr === 'string' ? (el || document).querySelector(expr) : expr || null;
    },
    bind (element, o) {
        if (element) {
            for(var event in o){
                if (!Object.prototype.hasOwnProperty.call(o, event)) {
                    continue;
                }
                const callback = o[event];
                event.split(/\s+/).forEach((event)=>element.addEventListener(event, callback));
            }
        }
    },
    unbind (element, o) {
        if (element) {
            for(var event in o){
                if (!Object.prototype.hasOwnProperty.call(o, event)) {
                    continue;
                }
                const callback = o[event];
                event.split(/\s+/).forEach((event)=>element.removeEventListener(event, callback));
            }
        }
    },
    isMention (word, ac_triggers) {
        return ac_triggers.includes(word[0]) || u.isMentionBoundary(word[0]) && ac_triggers.includes(word[1]);
    }
};
/**
 * Escapes special characters in a string to be used in a regular expression.
 * This function takes a string and returns a new string with all special characters
 * escaped, ensuring that the string can be safely used in a RegExp constructor.
 * @param {string} s - The string to escape.
 */ function regExpEscape(s) {
    return s.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
}
/**
 * @param {string} text
 * @param {string} input
 * @returns {boolean}
 */ function FILTER_CONTAINS(text, input) {
    return RegExp(regExpEscape(input.trim()), 'i').test(text);
}
/**
 * @param {string} text
 * @param {string} input
 * @returns {boolean}
 */ function FILTER_STARTSWITH(text, input) {
    return RegExp('^' + regExpEscape(input.trim()), 'i').test(text);
}
/**
 * @param {string} a
 * @param {string} b
 * @returns {number}
 */ function SORT_BY_LENGTH(a, b) {
    if (a.length !== b.length) {
        return a.length - b.length;
    }
    return a < b ? -1 : 1;
}
const SORT_BY_QUERY_POSITION = function(a, b) {
    const query = a.query.toLowerCase();
    const x = a.label.toLowerCase().indexOf(query);
    const y = b.label.toLowerCase().indexOf(query);
    if (x === y) {
        return SORT_BY_LENGTH(a, b);
    }
    return (x === -1 ? Infinity : x) < (y === -1 ? Infinity : y) ? -1 : 1;
};
/**
 * Renders an item for display in a list.
 * @param {string} text - The text to display.
 * @param {string} input - The input string to highlight.
 * @returns {import('lit').TemplateResult} The rendered HTML for the item.
 */ function getAutoCompleteItem(text, input) {
    input = input.trim();
    const regex = new RegExp('(' + regExpEscape(input) + ')', 'ig');
    const parts = input ? text.split(regex) : [
        text
    ];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li aria-selected="false">${parts.map((txt)=>input && txt.match(regex) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<mark>${txt}</mark>` : txt)}</li>`;
}
Object.assign(u, {
    autocomplete: {
        regExpEscape,
        getAutoCompleteItem
    }
});


/***/ }),

/***/ "./src/shared/avatar/avatar.js":
/*!*************************************!*\
  !*** ./src/shared/avatar/avatar.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Avatar)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_avatar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./templates/avatar.js */ "./src/shared/avatar/templates/avatar.js");
/* harmony import */ var _avatar_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./avatar.scss */ "./src/shared/avatar/avatar.scss");







class Avatar extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            },
            pickerdata: {
                type: Object
            },
            name: {
                type: String
            },
            width: {
                type: String
            },
            height: {
                type: String
            },
            nonce: {
                type: String
            }
        };
    }
    render() {
        let image_type;
        let image;
        let data_uri;
        if (this.pickerdata) {
            image_type = this.pickerdata.image_type;
            data_uri = this.pickerdata.data_uri;
        } else {
            var _this_model_vcard, _this_model, _this_model_vcard1, _this_model1;
            image_type = (_this_model = this.model) === null || _this_model === void 0 ? void 0 : (_this_model_vcard = _this_model.vcard) === null || _this_model_vcard === void 0 ? void 0 : _this_model_vcard.get('image_type');
            image = (_this_model1 = this.model) === null || _this_model1 === void 0 ? void 0 : (_this_model_vcard1 = _this_model1.vcard) === null || _this_model_vcard1 === void 0 ? void 0 : _this_model_vcard1.get('image');
        }
        if (image_type && (image || data_uri)) {
            return (0,_templates_avatar_js__WEBPACK_IMPORTED_MODULE_5__["default"])({
                classes: this.getAttribute('class'),
                height: this.height,
                width: this.width,
                image: data_uri || `data:${image_type};base64,${image}`,
                image_type,
                alt_text: (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('The profile picture of %1$s', this.name)
            });
        }
        const default_bg_css = `background-color: gray;`;
        const css = `
            width: ${this.width}px;
            height: ${this.height}px;
            font: ${this.width / 2}px Arial;
            line-height: ${this.height}px;`;
        const author_style = this.model.getAvatarStyle(css);
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="avatar-initials" style="${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(author_style, default_bg_css + css)}" aria-label="${this.name}">${this.getInitials(this.name)}</div>`;
    }
    /**
     * @param {string} name
     * @returns {string}
     */ getInitials(name) {
        const names = name === null || name === void 0 ? void 0 : name.split(' ');
        if ((names === null || names === void 0 ? void 0 : names.length) > 1) {
            return names[0].charAt(0).toUpperCase() + names[names.length - 1].charAt(0).toUpperCase();
        } else if ((names === null || names === void 0 ? void 0 : names.length) === 1) {
            return names[0].charAt(0).toUpperCase();
        }
        return '';
    }
    constructor(){
        super();
        this.model = null;
        this.pickerdata = null;
        this.width = 36;
        this.height = 36;
        this.name = '';
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-avatar', Avatar);


/***/ }),

/***/ "./src/shared/avatar/avatar.scss":
/*!***************************************!*\
  !*** ./src/shared/avatar/avatar.scss ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_avatar_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./avatar.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/avatar/avatar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_avatar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_avatar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_avatar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_avatar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/avatar/templates/avatar.js":
/*!***********************************************!*\
  !*** ./src/shared/avatar/templates/avatar.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/**
 * @param {string} image
 * @param {string} image_type
 */ const getImgHref = (image, image_type)=>{
    return image.startsWith('data:') ? image : `data:${image_type};base64,${image}`;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    if (o.image) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<svg xmlns="http://www.w3.org/2000/svg" class="avatar ${o.classes}" width="${o.width}" height="${o.height}" aria-label="${o.alt_text}" role="${o.alt_text ? lit__WEBPACK_IMPORTED_MODULE_0__.nothing : 'presentation'}"><image width="${o.width}" height="${o.height}" preserveAspectRatio="xMidYMid meet" href="${getImgHref(o.image, o.image_type)}"/></svg>`;
    } else {
        return '';
    }
});


/***/ }),

/***/ "./src/shared/chat/baseview.js":
/*!*************************************!*\
  !*** ./src/shared/chat/baseview.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ BaseChatView)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var shared_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/constants.js */ "./src/shared/constants.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils.js */ "./src/shared/chat/utils.js");




const { CHATROOMS_TYPE, INACTIVE } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class BaseChatView extends _components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            jid: {
                type: String
            },
            model: {
                state: true
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        this.viewportMediaQuery.addEventListener('change', this.renderOnViewportChange);
    }
    disconnectedCallback() {
        super.disconnectedCallback();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.remove(this.jid, this);
        this.viewportMediaQuery.removeEventListener('change', this.renderOnViewportChange);
    }
    /**
     * Called when the element's properties change.
     * @param {import('lit').PropertyValues} changed
     */ updated(changed) {
        super.updated(changed);
        if (changed.has('jid') && this.model && this.jid !== this.model.get('jid')) {
            this.stopListening();
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.chatboxviews.remove(this.model.get('jid'), this);
            this.initialize();
        }
    }
    /**
     * @param {MouseEvent} ev
     */ close(ev) {
        var _ev_preventDefault, _this_model;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        return (_this_model = this.model) === null || _this_model === void 0 ? void 0 : _this_model.close(ev);
    }
    maybeFocus() {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('auto_focus') && this.focus();
    }
    focus() {
        const textarea_el = this.getElementsByClassName('chat-textarea')[0];
        if (textarea_el && document.activeElement !== textarea_el) {
            /** @type {HTMLTextAreaElement} */ textarea_el.focus();
        }
        return this;
    }
    getBottomPanel() {
        if (this.model.get('type') === CHATROOMS_TYPE) {
            return this.querySelector('converse-muc-bottom-panel');
        } else {
            return this.querySelector('converse-chat-bottom-panel');
        }
    }
    getMessageForm() {
        if (this.model.get('type') === CHATROOMS_TYPE) {
            return this.querySelector('converse-muc-message-form');
        } else {
            return this.querySelector('converse-message-form');
        }
    }
    /**
     * Scrolls the chat down.
     *
     * This method will always scroll the chat down, regardless of
     * whether the user scrolled up manually or not.
     * @param { Event } [ev] - An optional event that is the cause for needing to scroll down.
     */ scrollDown(ev) {
        var _ev_preventDefault, _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        if (this.model.ui.get('scrolled')) {
            this.model.ui.set({
                'scrolled': false
            });
        }
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_3__.onScrolledDown)(this.model);
    }
    onWindowStateChanged() {
        if (document.hidden) {
            this.model.setChatState(INACTIVE, {
                'silent': true
            });
        } else {
            if (!this.model.isHidden()) {
                this.model.clearUnreadMsgCounter();
            }
        }
    }
    constructor(){
        super();
        this.jid = /** @type {string} */ null;
        this.model = /** @type {import('@converse/skeletor').Model} */ null;
        this.viewportMediaQuery = window.matchMedia(`(max-width: ${shared_constants_js__WEBPACK_IMPORTED_MODULE_2__.MOBILE_CUTOFF}px)`);
        this.renderOnViewportChange = ()=>this.requestUpdate();
    }
}



/***/ }),

/***/ "./src/shared/chat/chat-content.js":
/*!*****************************************!*\
  !*** ./src/shared/chat/chat-content.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChatContent)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var _components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _message_history__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./message-history */ "./src/shared/chat/message-history.js");
/* harmony import */ var _styles_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles/chat-content.scss */ "./src/shared/chat/styles/chat-content.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_private_method_get(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
}
function _class_private_method_init(obj, privateSet) {
    _check_private_redeclaration(obj, privateSet);
    privateSet.add(obj);
}







const WINDOW_DELTA = 5; // How much the window should move at a time.
const WINDOW_SIZE = 100;
var _onNumMessagesChanged = /*#__PURE__*/ new WeakSet(), /**
     * Called when the chat content is scrolled up or down.
     * We want to record when the user has scrolled away from
     * the bottom, so that we don't automatically scroll away
     * from what the user is reading when new messages are received.
     * @param {Event} ev
     */ _markScrolled = /*#__PURE__*/ new WeakSet(), /**
     * Scroll event handler, which sets new window bounds based on whether the
     * scrollbar is at the top or bottom, or otherwise based on which
     * messages are visible within the scrollable area.
     */ _setWindow = /*#__PURE__*/ new WeakSet();
class ChatContent extends _components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            },
            window_top: {
                state: true
            },
            window_bottom: {
                state: true
            }
        };
    }
    initialize() {
        return _async_to_generator(function*() {
            yield this.model.initialized;
            this.listenTo(this.model.messages, "add", ()=>_class_private_method_get(this, _onNumMessagesChanged, onNumMessagesChanged).call(this));
            this.listenTo(this.model.messages, "remove", ()=>_class_private_method_get(this, _onNumMessagesChanged, onNumMessagesChanged).call(this));
            this.listenTo(this.model.messages, "reset", ()=>_class_private_method_get(this, _onNumMessagesChanged, onNumMessagesChanged).call(this));
            this.listenTo(this.model.messages, "change", ()=>this.requestUpdate());
            this.listenTo(this.model.messages, "rendered", ()=>this.requestUpdate());
            this.listenTo(this.model, "historyPruned", ()=>_class_private_method_get(this, _setWindow, setWindow).call(this));
            this.listenTo(this.model.notifications, "change", ()=>this.requestUpdate());
            this.listenTo(this.model.ui, "change", ()=>this.requestUpdate());
            this.listenTo(this.model.ui, "change:scrolled", ()=>this.scrollDown());
            this.window_bottom = this.model.messages.length - 1;
            this.window_top = Math.max(0, this.window_bottom - WINDOW_SIZE);
            this.requestUpdate();
        }).call(this);
    }
    render() {
        var _this_model_ui;
        if (!this.model) return "";
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="chat-content__messages" @scroll="${(ev)=>this.scrollHandler(ev)}"><div class="chat-content__notifications">${this.model.getNotificationsText()}</div><converse-message-history .model="${this.model}" .messages="${this.model.messages.slice(this.window_top, this.window_bottom + 1)}"></converse-message-history></div>${((_this_model_ui = this.model.ui) === null || _this_model_ui === void 0 ? void 0 : _this_model_ui.get("chat-content-spinner-top")) ? (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_2__["default"])() : ""}`;
    }
    scrollDown() {
        if (this.model.ui.get("scrolled")) {
            return;
        }
        if (this.scrollTo) {
            const behavior = this.scrollTop ? "smooth" : "auto";
            this.scrollTo({
                top: 0,
                behavior
            });
        } else {
            this.scrollTop = 0;
        }
        /**
         * Triggered once the converse-chat-content element has been scrolled down to the bottom.
         * @event _converse#chatBoxScrolledDown
         * @type {object}
         * @property { _converse.ChatBox | _converse.ChatRoom } chatbox - The chat model
         * @example _converse.api.listen.on('chatBoxScrolledDown', obj => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.trigger("chatBoxScrolledDown", {
            chatbox: this.model
        });
    }
    constructor(){
        super(), _class_private_method_init(this, _onNumMessagesChanged), _class_private_method_init(this, _markScrolled), _class_private_method_init(this, _setWindow);
        this.model = null;
        this.scrollTop = 0;
        this.scroll_debounce = null;
        // Index of the top message in the virtualized list window.
        // If all messages are shown, this value is equal to zero.
        this.window_top = 0;
        // Index of the bottom message in the virtualized list window.
        // If all messages are shown, this value is equal to the total minus one.
        this.window_bottom = 0;
        this.scrollHandler = /** @param {Event} ev */ (ev)=>{
            if (this.mark_scrolled_debounce) {
                clearTimeout(this.scroll_debounce);
            }
            this.mark_scrolled_debounce = setTimeout(()=>{
                _class_private_method_get(this, _markScrolled, markScrolled).call(this, ev);
            }, 250);
            requestAnimationFrame(()=>_class_private_method_get(this, _setWindow, setWindow).call(this));
        };
    }
}
function onNumMessagesChanged() {
    _class_private_method_get(this, _setWindow, setWindow).call(this);
    this.requestUpdate();
}
function markScrolled(ev) {
    let scrolled = true;
    const el = /** @type {HTMLElement} */ ev.target;
    const is_at_bottom = Math.floor(el.scrollTop) === 0;
    const is_at_top = Math.ceil(el.clientHeight - el.scrollTop) >= el.scrollHeight - Math.ceil(el.scrollHeight / 20);
    if (is_at_bottom) {
        scrolled = false;
        (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.onScrolledDown)(this.model);
    } else if (is_at_top) {
        /**
             * Triggered once the chat's message area has been scrolled to the top
             * @event _converse#chatBoxScrolledUp
             * @property { _converse.ChatBoxView | MUCView } view
             * @example _converse.api.listen.on('chatBoxScrolledUp', obj => { ... });
             */ _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.trigger("chatBoxScrolledUp", el);
    }
    if (this.model.get("scolled") !== scrolled) {
        this.model.ui.set({
            scrolled
        });
    }
}
function setWindow() {
    const total_messages = this.model.messages.length;
    const container = /** @type {HTMLElement} */ this.querySelector(".chat-content__messages");
    // The amount before the actual top/bottom where we are close enough to
    // want to update the window. Set to 25% of the scrollable container.
    const delta = Math.ceil(container.scrollHeight / 5);
    const is_at_top = Math.ceil(container.clientHeight - container.scrollTop) >= container.scrollHeight - delta;
    if (is_at_top) {
        this.window_top = Math.max(0, this.window_top - WINDOW_DELTA);
        this.window_bottom = this.window_top + WINDOW_SIZE;
        return;
    }
    const is_at_bottom = Math.floor(container.scrollTop) === 0;
    if (is_at_bottom) {
        this.window_bottom = total_messages - 1;
        this.window_top = Math.max(0, this.window_bottom - WINDOW_SIZE);
        return;
    }
    const is_close_to_bottom = Math.floor(Math.abs(container.scrollTop)) < delta;
    if (is_close_to_bottom) {
        this.window_bottom = Math.min(total_messages - 1, this.window_bottom + WINDOW_DELTA);
        this.window_top = Math.max(0, this.window_bottom - WINDOW_SIZE);
        return;
    }
}
/**
 * Implements a virtualized list of chat messages, which means only a subset of
 * messages, the `WINDOW_SIZE`, gets rendered to the DOM, and this subset
 * gets updated as the user scrolls up and down.
 */ 
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define("converse-chat-content", ChatContent);


/***/ }),

/***/ "./src/shared/chat/emoji-dropdown.js":
/*!*******************************************!*\
  !*** ./src/shared/chat/emoji-dropdown.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ EmojiDropdown)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_components_dropdown_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/dropdown.js */ "./src/shared/components/dropdown.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.constants;
const { initStorage } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u;
class EmojiDropdown extends shared_components_dropdown_js__WEBPACK_IMPORTED_MODULE_3__["default"] {
    static get properties() {
        return {
            icon_classes: {
                type: String
            },
            items: {
                type: Array
            },
            model: {
                type: Object
            }
        };
    }
    initModel() {
        if (!this.init_promise) {
            this.init_promise = (()=>_async_to_generator(function*() {
                    yield _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.emojis.initialize();
                    const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_1__._converse.session.get('bare_jid');
                    const id = `converse.emoji-${bare_jid}-${this.model.get('jid')}`;
                    this.state = new _converse_headless__WEBPACK_IMPORTED_MODULE_1__.EmojiPicker({
                        id
                    });
                    initStorage(this.state, id);
                    yield new Promise((resolve)=>this.state.fetch({
                            'success': resolve,
                            'error': resolve
                        }));
                    // We never want still be in the autocompleting state upon page load
                    this.state.set({
                        'autocompleting': null,
                        'ac_position': null
                    });
                }).call(this))();
        }
        return this.init_promise;
    }
    render() {
        const is_groupchat = this.model.get('type') === CHATROOMS_TYPE;
        const color = is_groupchat ? '--muc-color' : '--chat-color';
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button class="btn dropdown-toggle dropdown-toggle--no-caret toggle-emojis" type="button" id="${this.id}" title="${(0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Insert emojis')}" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><converse-icon color="var(${color})" class="fa fa-smile" path-prefix="${_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('assets_path')}" size="1em"></converse-icon></button><ul class="dropdown-menu" aria-labelledby="${this.id}"><li>${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_4__.until)(this.initModel().then(()=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-emoji-picker .state="${this.state}" .model="${this.model}" @emojiSelected="${()=>this.dropdown.hide()}" ?render_emojis="${this.render_emojis}" current_category="${this.state.get('current_category') || ''}" current_skintone="${this.state.get('current_skintone') || ''}" query="${this.state.get('query') || ''}"></converse-emoji-picker>`), '')}</li></ul>`;
    }
    connectedCallback() {
        super.connectedCallback();
        this.render_emojis = false;
    }
    onShown() {
        return _async_to_generator(function*() {
            yield this.initModel();
            if (!this.render_emojis) {
                // Trigger an update so that emojis are rendered
                this.render_emojis = true;
                this.requestUpdate();
                yield this.updateComplete;
            }
            setTimeout(()=>{
                var /** @type {HTMLInputElement} */ _this_querySelector;
                return (_this_querySelector = this.querySelector('.emoji-search')) === null || _this_querySelector === void 0 ? void 0 : _this_querySelector.focus();
            });
        }).call(this);
    }
    constructor(){
        super();
        this.id = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getUniqueId();
        // This is an optimization, we lazily render the emoji picker, otherwise tests slow to a crawl.
        this.render_emojis = false;
        this.state = null;
        this.model = null;
        this.addEventListener('shown.bs.dropdown', ()=>this.onShown());
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-emoji-dropdown', EmojiDropdown);


/***/ }),

/***/ "./src/shared/chat/emoji-picker-content.js":
/*!*************************************************!*\
  !*** ./src/shared/chat/emoji-picker-content.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ EmojiPickerContent)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_emoji_picker_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templates/emoji-picker.js */ "./src/shared/chat/templates/emoji-picker.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/autocomplete/utils.js */ "./src/shared/autocomplete/utils.js");
/**
 * @typedef {module:emoji-picker.EmojiPicker} EmojiPicker
 */ 





const { sizzle } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
class EmojiPickerContent extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            'search_results': {
                type: Array
            },
            'current_skintone': {
                type: String
            },
            'model': {
                type: Object
            },
            'query': {
                type: String
            }
        };
    }
    render() {
        const props = {
            'current_skintone': this.current_skintone,
            'insertEmoji': /** @param {MouseEvent} ev */ (ev)=>this.insertEmoji(ev),
            'query': this.query,
            'search_results': this.search_results,
            'shouldBeHidden': /** @param {string} shortname */ (shortname)=>this.shouldBeHidden(shortname)
        };
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="emoji-picker__lists">${(0,_templates_emoji_picker_js__WEBPACK_IMPORTED_MODULE_3__.tplSearchResults)(props)} ${(0,_templates_emoji_picker_js__WEBPACK_IMPORTED_MODULE_3__.tplAllEmojis)(props)}</div>`;
    }
    firstUpdated() {
        this.initIntersectionObserver();
    }
    initIntersectionObserver() {
        if (!window.IntersectionObserver) {
            return;
        }
        if (this.observer) {
            this.observer.disconnect();
        } else {
            const options = {
                root: this.querySelector('.emoji-picker__lists'),
                threshold: [
                    0.1
                ]
            };
            const handler = (ev)=>this.setCategoryOnVisibilityChange(ev);
            this.observer = new IntersectionObserver(handler, options);
        }
        sizzle('.emoji-picker', this).forEach((a)=>this.observer.observe(a));
    }
    setCategoryOnVisibilityChange(entries) {
        const selected = /** @type {EmojiPicker} */ this.parentElement.navigator.selected;
        const intersection_with_selected = entries.filter((i)=>i.target.contains(selected)).pop();
        let current;
        // Choose the intersection that contains the currently selected
        // element, or otherwise the one with the largest ratio.
        if (intersection_with_selected) {
            current = intersection_with_selected;
        } else {
            current = entries.reduce((p, c)=>c.intersectionRatio >= ((p === null || p === void 0 ? void 0 : p.intersectionRatio) || 0) ? c : p, null);
        }
        if (current && current.isIntersecting) {
            const category = current.target.getAttribute('data-category');
            if (category !== this.model.get('current_category')) {
                /** @type {EmojiPicker} */ this.parentElement.preserve_scroll = true;
                _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.safeSave(this.model, {
                    'current_category': category
                });
            }
        }
    }
    /**
     * @param {MouseEvent} ev
     */ insertEmoji(ev) {
        ev.preventDefault();
        ev.stopPropagation();
        const target = /** @type {HTMLElement} */ ev.target;
        const emoji_el = target.nodeName === 'IMG' ? target.parentElement : target;
        /** @type EmojiPicker */ this.parentElement.selectEmoji(emoji_el.getAttribute('data-emoji'));
    }
    /**
     * @param {string} shortname
     */ shouldBeHidden(shortname) {
        // Helper method for the template which decides whether an
        // emoji should be hidden, based on which skin tone is
        // currently being applied.
        if (shortname.includes('_tone')) {
            if (!this.current_skintone || !shortname.includes(this.current_skintone)) {
                return true;
            }
        } else {
            if (this.current_skintone && (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getTonedEmojis)().includes(shortname)) {
                return true;
            }
        }
        if (this.query && !(0,shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_5__.FILTER_CONTAINS)(shortname, this.query)) {
            return true;
        }
        return false;
    }
    constructor(){
        super();
        this.model = null;
        this.current_skintone = null;
        this.query = null;
        this.search_results = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-emoji-picker-content', EmojiPickerContent);


/***/ }),

/***/ "./src/shared/chat/emoji-picker.js":
/*!*****************************************!*\
  !*** ./src/shared/chat/emoji-picker.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ EmojiPicker)
/* harmony export */ });
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_dom_navigator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/dom-navigator */ "./src/shared/dom-navigator/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/autocomplete/utils.js */ "./src/shared/autocomplete/utils.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _templates_emoji_picker_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./templates/emoji-picker.js */ "./src/shared/chat/templates/emoji-picker.js");
/* harmony import */ var _emoji_picker_content_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./emoji-picker-content.js */ "./src/shared/chat/emoji-picker-content.js");
/* harmony import */ var _emoji_dropdown_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./emoji-dropdown.js */ "./src/shared/chat/emoji-dropdown.js");
/* harmony import */ var _styles_emoji_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles/emoji.scss */ "./src/shared/chat/styles/emoji.scss");
/**
 * @module emoji-picker
 * @typedef {module:dom-navigator.DOMNavigatorOptions} DOMNavigatorOptions
 * @typedef {module:dom-navigator.DOMNavigatorDirection} DOMNavigatorDirection
 */ function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_private_method_get(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
}
function _class_private_method_init(obj, privateSet) {
    _check_private_redeclaration(obj, privateSet);
    privateSet.add(obj);
}










const { KEYCODES } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
var /**
     * @param {KeyboardEvent} ev
     */ _onKeyDown = /*#__PURE__*/ new WeakSet();
class EmojiPicker extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            current_category: {
                type: String,
                "reflect": true
            },
            current_skintone: {
                type: String,
                "reflect": true
            },
            model: {
                type: Object
            },
            query: {
                type: String,
                "reflect": true
            },
            state: {
                type: Object
            },
            // This is an optimization to lazily render the emoji picker
            render_emojis: {
                type: Boolean
            }
        };
    }
    initialize() {
        super.initialize();
        this.dropdown = this.closest("converse-emoji-dropdown");
    }
    firstUpdated(changed) {
        super.firstUpdated(changed);
        this.listenTo(this.state, "change", (o)=>this.onModelChanged(o.changed));
        this.initArrowNavigation();
    }
    get search_results() {
        return this._search_results;
    }
    set search_results(value) {
        this._search_results = value;
        this.requestUpdate();
    }
    render() {
        return (0,_templates_emoji_picker_js__WEBPACK_IMPORTED_MODULE_5__.tplEmojiPicker)(this, {
            current_category: this.current_category,
            current_skintone: this.current_skintone,
            onCategoryPicked: (ev)=>this.chooseCategory(ev),
            onSearchInputFocus: ()=>this.disableArrowNavigation(),
            onSearchInputKeyDown: (ev)=>this.onSearchInputKeyDown(ev),
            onSkintonePicked: (ev)=>this.chooseSkinTone(ev),
            query: this.query,
            search_results: this.search_results,
            render_emojis: this.render_emojis,
            sn2Emoji: /** @param {string} sn */ (sn)=>_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.shortnamesToEmojis(this.getTonedShortname(sn))
        });
    }
    updated(changed) {
        changed.has("query") && this.updateSearchResults(changed);
        changed.has("current_category") && this.setScrollPosition();
    }
    onModelChanged(changed) {
        if ("current_category" in changed) this.current_category = changed.current_category;
        if ("current_skintone" in changed) this.current_skintone = changed.current_skintone;
        if ("query" in changed) this.query = changed.query;
    }
    setScrollPosition() {
        if (this.preserve_scroll) {
            this.preserve_scroll = false;
            return;
        }
        const el = this.querySelector(".emoji-lists__container--browse");
        const heading = this.querySelector(`#emoji-picker-${this.current_category}`);
        if (heading instanceof HTMLElement) {
            // +4 due to 2px padding on list elements
            el.scrollTop = heading.offsetTop - heading.offsetHeight * 3 + 4;
        }
    }
    updateSearchResults(changed) {
        const old_query = changed.get("query");
        const contains = shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_3__.FILTER_CONTAINS;
        if (this.query) {
            if (this.query === old_query) {
                return this.search_results;
            } else if (old_query && this.query.includes(old_query)) {
                this.search_results = this.search_results.filter((e)=>contains(e.sn, this.query));
            } else {
                this.search_results = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.list.filter((e)=>contains(e.sn, this.query));
            }
        } else if (this.search_results.length) {
            // Avoid re-rendering by only setting to new empty array if it wasn't empty before
            this.search_results = [];
        }
    }
    registerEvents() {
        this.onKeyDown = (ev)=>_class_private_method_get(this, _onKeyDown, onKeyDown).call(this, ev);
        this.dropdown.addEventListener("hide.bs.dropdown", ()=>this.onDropdownHide());
        this.addEventListener("keydown", this.onKeyDown);
    }
    connectedCallback() {
        super.connectedCallback();
        this.registerEvents();
    }
    disconnectedCallback() {
        this.removeEventListener("keydown", this.onKeyDown);
        this.disableArrowNavigation();
        super.disconnectedCallback();
    }
    onDropdownHide() {
        this.disableArrowNavigation();
        this.dispatchEvent(new CustomEvent("emojipickerblur", {
            bubbles: true
        }));
    }
    /**
     * @param {HTMLElement} el
     */ setCategoryForElement(el) {
        const old_category = this.current_category;
        const category = (el === null || el === void 0 ? void 0 : el.getAttribute("data-category")) || old_category;
        if (old_category !== category) {
            this.state.save({
                "current_category": category
            });
        }
    }
    /**
     * @param {string} value
     */ selectEmoji(value) {
        const autocompleting = this.state.get("autocompleting");
        const ac_position = this.state.get("ac_position");
        this.state.set({
            "autocompleting": null,
            "query": "",
            "ac_position": null
        });
        this.disableArrowNavigation();
        const jid = this.model.get("jid");
        const options = {
            "bubbles": true,
            "detail": {
                value,
                autocompleting,
                ac_position,
                jid
            }
        };
        this.dispatchEvent(new CustomEvent("emojiSelected", options));
    }
    /**
     * @param {MouseEvent} ev
     */ chooseSkinTone(ev) {
        ev.preventDefault();
        ev.stopPropagation();
        const target = /** @type {Element} */ ev.target;
        const el = target.nodeName === "IMG" ? target.parentElement : target;
        const skintone = el.getAttribute("data-skintone").trim();
        if (this.current_skintone === skintone) {
            this.state.save({
                "current_skintone": ""
            });
        } else {
            this.state.save({
                "current_skintone": skintone
            });
        }
    }
    /**
     * @param {MouseEvent} ev
     */ chooseCategory(ev) {
        ev.preventDefault && ev.preventDefault();
        ev.stopPropagation && ev.stopPropagation();
        var /** @type {Element} */ _ev_target;
        const target = (_ev_target = ev.target) !== null && _ev_target !== void 0 ? _ev_target : ev.relatedTarget;
        const el = target.matches("li") ? target : _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.ancestor(target, "li");
        this.setCategoryForElement(el);
        this.navigator.select(el);
        !this.navigator.enabled && this.navigator.enable();
    }
    /**
     * @param {KeyboardEvent} ev
     */ onSearchInputKeyDown(ev) {
        const target = /** @type {HTMLInputElement} */ ev.target;
        if (ev.key === KEYCODES.TAB) {
            if (target.value) {
                ev.preventDefault();
                const match = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.shortnames.find((sn)=>(0,shared_autocomplete_utils_js__WEBPACK_IMPORTED_MODULE_3__.FILTER_CONTAINS)(sn, target.value));
                match && this.state.set({
                    "query": match
                });
            } else if (!this.navigator.enabled) {
                this.enableArrowNavigation(ev);
            }
        } else if (ev.key === KEYCODES.DOWN_ARROW && !this.navigator.enabled) {
            this.enableArrowNavigation(ev);
        } else if (ev.key !== KEYCODES.ENTER && ev.key !== KEYCODES.DOWN_ARROW) {
            this.debouncedFilter(target);
        }
    }
    /**
     * @param {KeyboardEvent} ev
     */ onEnterPressed(ev) {
        ev.preventDefault();
        ev.stopPropagation();
        const target = /** @type {HTMLInputElement} */ ev.target;
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.shortnames.includes(target.value)) {
            this.selectEmoji(target.value);
        } else if (this.search_results.length === 1) {
            this.selectEmoji(this.search_results[0].sn);
        } else if (this.navigator.selected && this.navigator.selected.matches(".insert-emoji")) {
            this.selectEmoji(this.navigator.selected.getAttribute("data-emoji"));
        } else if (this.navigator.selected && this.navigator.selected.matches(".emoji-category")) {
            this.chooseCategory(new MouseEvent("click", {
                relatedTarget: this.navigator.selected
            }));
        }
    }
    /**
     * @param {string} shortname
     */ getTonedShortname(shortname) {
        if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getTonedEmojis)().includes(shortname) && this.current_skintone) {
            return `${shortname.slice(0, shortname.length - 1)}_${this.current_skintone}:`;
        }
        return shortname;
    }
    initArrowNavigation() {
        if (!this.navigator) {
            const default_selector = "li:not(.hidden):not(.emoji-skintone), .emoji-search";
            const options = /** @type DOMNavigatorOptions */ {
                jump_to_picked: ".emoji-category",
                jump_to_picked_selector: ".emoji-category.picked",
                jump_to_picked_direction: shared_dom_navigator__WEBPACK_IMPORTED_MODULE_1__.DOMNavigator.DIRECTION.down,
                picked_selector: ".picked",
                scroll_container: this.querySelector(".emoji-picker__lists"),
                getSelector: /** @param {keyof(DOMNavigatorDirection)} dir */ (dir)=>{
                    if (dir === shared_dom_navigator__WEBPACK_IMPORTED_MODULE_1__.DOMNavigator.DIRECTION.down) {
                        const c = this.navigator.selected && this.navigator.selected.getAttribute("data-category");
                        return c ? `ul[data-category="${c}"] li:not(.hidden):not(.emoji-skintone), .emoji-search` : default_selector;
                    } else {
                        return default_selector;
                    }
                },
                onSelected: /** @param {HTMLElement} el */ (el)=>{
                    if (el.matches(".insert-emoji")) this.setCategoryForElement(el.parentElement);
                    if (el.matches(".insert-emoji, .emoji-category")) {
                        /** @type {HTMLInputElement} */ el.firstElementChild.focus();
                    }
                    if (el.matches(".emoji-search")) el.focus();
                }
            };
            this.navigator = new shared_dom_navigator__WEBPACK_IMPORTED_MODULE_1__.DOMNavigator(this, options);
        }
    }
    disableArrowNavigation() {
        var _this_navigator;
        (_this_navigator = this.navigator) === null || _this_navigator === void 0 ? void 0 : _this_navigator.disable();
    }
    /**
     * @param {KeyboardEvent} ev
     */ enableArrowNavigation(ev) {
        var _ev_preventDefault, _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        this.disableArrowNavigation();
        this.navigator.enable();
        this.navigator.handleKeydown(ev);
    }
    constructor(){
        super(), _class_private_method_init(this, _onKeyDown);
        this.state = null;
        this.model = null;
        this.query = "";
        this.render_emojis = null;
        this._search_results = [];
        this.debouncedFilter = (0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_9__["default"])(/** @param {HTMLInputElement} input */ (input)=>this.state.set({
                "query": input.value
            }), 250);
    }
}
function onKeyDown(ev) {
    if (!this.navigator || !_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.isVisible(this)) return;
    if (ev.key === KEYCODES.ENTER) {
        this.onEnterPressed(ev);
    } else if (ev.key === KEYCODES.DOWN_ARROW && !this.navigator.enabled) {
        this.enableArrowNavigation(ev);
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define("converse-emoji-picker", EmojiPicker);


/***/ }),

/***/ "./src/shared/chat/help-messages.js":
/*!******************************************!*\
  !*** ./src/shared/chat/help-messages.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChatHelp)
/* harmony export */ });
/* harmony import */ var shared_components_icons_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/components/icons.js */ "./src/shared/components/icons.js");
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.es.mjs");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lit/directives/unsafe-html.js */ "./node_modules/lit/directives/unsafe-html.js");






class ChatHelp extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            chat_type: {
                type: String
            },
            messages: {
                type: Array
            },
            model: {
                type: Object
            },
            type: {
                type: String
            }
        };
    }
    render() {
        const isodate = new Date().toISOString();
        return [
            (0,lit__WEBPACK_IMPORTED_MODULE_4__.html)`<converse-icon class="fas fa-times close-chat-help" @click="${this.close}" path-prefix="${_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get("assets_path")}" size="1em"></converse-icon>`,
            ...this.messages.map((m)=>this.renderHelpMessage({
                    isodate,
                    'markup': dompurify__WEBPACK_IMPORTED_MODULE_1__["default"].sanitize(m, {
                        'ALLOWED_TAGS': [
                            'strong'
                        ]
                    })
                }))
        ];
    }
    close() {
        this.model.set({
            'show_help_messages': false
        });
    }
    renderHelpMessage(o) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_4__.html)`<div class="message chat-${this.type}" data-isodate="${o.isodate}">${(0,lit_directives_unsafe_html_js__WEBPACK_IMPORTED_MODULE_5__.unsafeHTML)(o.markup)}</div>`;
    }
    constructor(){
        super();
        this.messages = [];
        this.model = null;
        this.type = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-chat-help', ChatHelp);


/***/ }),

/***/ "./src/shared/chat/message-actions.js":
/*!********************************************!*\
  !*** ./src/shared/chat/message-actions.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var utils_url_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! utils/url.js */ "./src/utils/url.js");
/* harmony import */ var _styles_message_actions_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles/message-actions.scss */ "./src/shared/chat/styles/message-actions.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}







const { getMediaURLs } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u;
const { CHATROOMS_TYPE } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.constants;
/**
 * @typedef {Object} MessageActionAttributes
 * An object which represents a message action (as shown in the message dropdown);
 * @property {String} i18n_text
 * @property {Function} handler
 * @property {String} button_class
 * @property {String} icon_class
 * @property {String} name
 */ class MessageActions extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    /**
     * @typedef {import('@converse/headless/types/utils/types').MediaURLMetadata} MediaURLMetadata
     */ static get properties() {
        return {
            is_retracted: {
                type: Boolean
            },
            model: {
                type: Object
            }
        };
    }
    initialize() {
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get();
        this.listenTo(settings, 'change:allowed_audio_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:allowed_image_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:allowed_video_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:render_media', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        // This may change the ability to send messages, and therefore the presence of the quote button.
        // See plugins/muc-views/bottom-panel.js
        this.listenTo(this.model.chatbox.features, 'change:moderated', ()=>this.requestUpdate());
        this.listenTo(this.model.chatbox.occupants, 'add', this.updateIfOwnOccupant);
        this.listenTo(this.model.chatbox.occupants, 'change:role', this.updateIfOwnOccupant);
        this.listenTo(this.model.chatbox.session, 'change:connection_status', ()=>this.requestUpdate());
    }
    updateIfOwnOccupant(o) {
        const bare_jid = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get('bare_jid');
        if (o.get('jid') === bare_jid) {
            this.requestUpdate();
        }
    }
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(this.renderActions(), '')}`;
    }
    renderActions() {
        return _async_to_generator(function*() {
            // This can be called before the model has been added to the collection
            // when requesting an update on change:connection_status.
            // This line allows us to pass tests.
            if (!this.model.collection) return '';
            const buttons = yield this.getActionButtons();
            const items = buttons.map((b)=>MessageActions.getActionsDropdownItem(b));
            if (items.length) {
                return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-dropdown class="chat-msg__actions btn-group dropstart" .items="${items}"></converse-dropdown>`;
            } else {
                return '';
            }
        }).call(this);
    }
    static getActionsDropdownItem(o) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="dropdown-item chat-msg__action ${o.button_class}" @click="${o.handler}"><converse-icon class="${o.icon_class}" color="var(--foreground-color)" size="1em"></converse-icon> ${o.i18n_text}</button>`;
    }
    /** @param {MouseEvent} ev */ onMessageEditButtonClicked(ev) {
        return _async_to_generator(function*() {
            var _u_ancestor_querySelector, _u_ancestor;
            ev.preventDefault();
            const currently_correcting = this.model.collection.findWhere('correcting');
            // TODO: Use state intead of DOM querying
            // Then this code can also be put on the model
            const unsent_text = (_u_ancestor = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.ancestor(this, '.chatbox')) === null || _u_ancestor === void 0 ? void 0 : (_u_ancestor_querySelector = _u_ancestor.querySelector('.chat-textarea')) === null || _u_ancestor_querySelector === void 0 ? void 0 : _u_ancestor_querySelector.value;
            if (unsent_text && (!currently_correcting || currently_correcting.getMessageText() !== unsent_text)) {
                const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Confirm'), (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('You have an unsent message which will be lost if you continue. Are you sure?'));
                if (!result) return;
            }
            if (currently_correcting !== this.model) {
                currently_correcting === null || currently_correcting === void 0 ? void 0 : currently_correcting.save('correcting', false);
                this.model.save('correcting', true);
            } else {
                this.model.save('correcting', false);
            }
        }).call(this);
    }
    onDirectMessageRetractButtonClicked() {
        return _async_to_generator(function*() {
            if (this.model.get('sender') !== 'me') {
                return _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error("onMessageRetractButtonClicked called for someone else's message!");
            }
            const retraction_warning = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Be aware that other XMPP/Jabber clients (and servers) may ' + 'not yet support retractions and that this message may not ' + 'be removed everywhere.');
            const messages = [
                (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Are you sure you want to retract this message?')
            ];
            if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_retraction_warning')) {
                messages[1] = retraction_warning;
            }
            const result = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Confirm'), messages);
            if (result) {
                const chatbox = this.model.collection.chatbox;
                chatbox.retractOwnMessage(this.model);
            }
        }).call(this);
    }
    /**
     * Retract someone else's message in this groupchat.
     * @param {string} [reason] - The reason for retracting the message.
     */ retractOtherMessage(reason) {
        return _async_to_generator(function*() {
            const chatbox = this.model.collection.chatbox;
            const result = yield chatbox.retractOtherMessage(this.model, reason);
            if (result === null) {
                const err_msg = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)(`A timeout occurred while trying to retract the message`);
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Error'), err_msg);
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.warn(err_msg);
            } else if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.isErrorStanza(result)) {
                const err_msg = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)(`Sorry, you're not allowed to retract this message.`);
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Error'), err_msg);
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.warn(err_msg);
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.error(result);
            }
        }).call(this);
    }
    onMUCMessageRetractButtonClicked() {
        return _async_to_generator(function*() {
            const retraction_warning = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Be aware that other XMPP/Jabber clients (and servers) may ' + 'not yet support retractions and that this message may not ' + 'be removed everywhere.');
            if (this.model.mayBeRetracted()) {
                const messages = [
                    (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Are you sure you want to retract this message?')
                ];
                if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_retraction_warning')) {
                    messages[1] = retraction_warning;
                }
                if (yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Confirm'), messages)) {
                    const chatbox = this.model.collection.chatbox;
                    chatbox.retractOwnMessage(this.model);
                }
            } else if (yield this.model.mayBeModerated()) {
                if (this.model.get('sender') === 'me') {
                    let messages = [
                        (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Are you sure you want to retract this message?')
                    ];
                    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_retraction_warning')) {
                        messages = [
                            messages[0],
                            retraction_warning,
                            messages[1]
                        ];
                    }
                    !!(yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.confirm((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Confirm'), messages)) && this.retractOtherMessage();
                } else {
                    let messages = [
                        (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('You are about to retract this message.'),
                        (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('You may optionally include a message, explaining the reason for the retraction.')
                    ];
                    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('show_retraction_warning')) {
                        messages = [
                            messages[0],
                            retraction_warning,
                            messages[1]
                        ];
                    }
                    const reason = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.prompt((0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Message Retraction'), messages, (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Optional reason'));
                    reason !== false && this.retractOtherMessage(reason);
                }
            } else {
                const err_msg = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)(`Sorry, you're not allowed to retract this message`);
                _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.alert('error', (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Error'), err_msg);
            }
        }).call(this);
    }
    /** @param {MouseEvent} [ev] */ onMessageRetractButtonClicked(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const chatbox = this.model.collection.chatbox;
        if (chatbox.get('type') === CHATROOMS_TYPE) {
            this.onMUCMessageRetractButtonClicked();
        } else {
            this.onDirectMessageRetractButtonClicked();
        }
    }
    /** @param {MouseEvent} [ev] */ onMediaToggleClicked(ev) {
        var _ev_preventDefault;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        if (this.hasHiddenMedia(this.getMediaURLs())) {
            this.model.save({
                'hide_url_previews': false,
                'url_preview_transition': 'fade-in'
            });
        } else {
            const ogp_metadata = this.model.get('ogp_metadata') || [];
            if (ogp_metadata.length) {
                this.model.set('url_preview_transition', 'fade-out');
            } else {
                this.model.save({
                    'hide_url_previews': true,
                    'url_preview_transition': 'fade-in'
                });
            }
        }
    }
    /**
     * Check whether media is hidden or shown, which is used to determine the toggle text.
     *
     * If `render_media` is an array, check if there are media URLs outside
     * of that array, in which case we consider message media on the whole to be hidden (since
     * those excluded by the whitelist will be, even if the render_media whitelisted URLs are shown).
     * @param { Array<String> } media_urls
     * @returns { Boolean }
     */ hasHiddenMedia(media_urls) {
        if (typeof this.model.get('hide_url_previews') === 'boolean') {
            return this.model.get('hide_url_previews');
        }
        const render_media = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('render_media');
        if (Array.isArray(render_media)) {
            return media_urls.reduce((acc, url)=>acc || !(0,utils_url_js__WEBPACK_IMPORTED_MODULE_5__.isDomainWhitelisted)(render_media, url), false);
        } else {
            return !render_media;
        }
    }
    getMediaURLs() {
        const unfurls_to_show = (this.model.get('ogp_metadata') || []).map((o)=>({
                'url': o['og:image'],
                'is_image': true
            })).filter((o)=>(0,utils_url_js__WEBPACK_IMPORTED_MODULE_5__.isMediaURLDomainAllowed)(o));
        const url_strings = getMediaURLs(this.model.get('media_urls') || [], this.model.get('body'));
        const media_urls = /** @type {MediaURLMetadata[]} */ url_strings.filter((o)=>(0,utils_url_js__WEBPACK_IMPORTED_MODULE_5__.isMediaURLDomainAllowed)(o));
        return [
            ...new Set([
                ...media_urls.map((o)=>o.url),
                ...unfurls_to_show.map((o)=>o.url)
            ])
        ];
    }
    /**
     * Adds a media rendering toggle to this message's action buttons if necessary.
     *
     * The toggle is only added if the message contains media URLs and if the
     * user is allowed to show or hide media for those URLs.
     *
     * Whether a user is allowed to show or hide domains depends on the config settings:
     * * allowed_audio_domains
     * * allowed_video_domains
     * * allowed_image_domains
     *
     * Whether media is currently shown or hidden is determined by the { @link hasHiddenMedia } method.
     *
     * @param { Array<MessageActionAttributes> } buttons - An array of objects representing action buttons
     */ addMediaRenderingToggle(buttons) {
        const urls = this.getMediaURLs();
        if (urls.length) {
            const hidden = this.hasHiddenMedia(urls);
            buttons.push({
                'i18n_text': hidden ? (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Show media') : (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Hide media'),
                'handler': (ev)=>this.onMediaToggleClicked(ev),
                'button_class': 'chat-msg__action-hide-previews',
                'icon_class': hidden ? 'fas fa-eye' : 'fas fa-eye-slash',
                'name': 'hide'
            });
        }
    }
    /** @param {MouseEvent} [ev] */ onMessageCopyButtonClicked(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            yield navigator.clipboard.writeText(this.model.getMessageText());
        }).call(this);
    }
    /** @param {MouseEvent} [ev] */ onMessageQuoteButtonClicked(ev) {
        var _ev_preventDefault, _u_ancestor_querySelector, _u_ancestor;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        const chatbox = this.model.collection.chatbox;
        const idx = (_u_ancestor = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.ancestor(this, '.chatbox')) === null || _u_ancestor === void 0 ? void 0 : (_u_ancestor_querySelector = _u_ancestor.querySelector('.chat-textarea')) === null || _u_ancestor_querySelector === void 0 ? void 0 : _u_ancestor_querySelector.selectionEnd;
        const new_text = this.model.getMessageText().replaceAll(/^/gm, '> ');
        var _chatbox_get;
        let draft = (_chatbox_get = chatbox.get('draft')) !== null && _chatbox_get !== void 0 ? _chatbox_get : '';
        if (idx) {
            draft = `${draft.slice(0, idx)}\n${new_text}\n${draft.slice(idx)}`;
        } else {
            draft += new_text;
        }
        chatbox.save({
            draft
        });
    }
    getActionButtons() {
        return _async_to_generator(function*() {
            const buttons = [];
            if (this.model.get('editable')) {
                buttons.push(/** @type {MessageActionAttributes} */ {
                    'i18n_text': this.model.get('correcting') ? (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Cancel Editing') : (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Edit'),
                    'handler': (ev)=>this.onMessageEditButtonClicked(ev),
                    'button_class': 'chat-msg__action-edit',
                    'icon_class': 'fa fa-pencil-alt',
                    'name': 'edit'
                });
            }
            const may_be_moderated = [
                'groupchat',
                'mep'
            ].includes(this.model.get('type')) && (yield this.model.mayBeModerated());
            const retractable = !this.is_retracted && (this.model.mayBeRetracted() || may_be_moderated);
            if (retractable) {
                buttons.push({
                    'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Retract'),
                    'handler': (ev)=>this.onMessageRetractButtonClicked(ev),
                    'button_class': 'chat-msg__action-retract',
                    'icon_class': 'fas fa-trash-alt',
                    'name': 'retract'
                });
            }
            if (!this.model.collection) {
                // While we were awaiting, this model got removed from the
                // collection (happens during tests)
                return [];
            }
            this.addMediaRenderingToggle(buttons);
            buttons.push({
                'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Copy'),
                'handler': (ev)=>this.onMessageCopyButtonClicked(ev),
                'button_class': 'chat-msg__action-copy',
                'icon_class': 'fas fa-copy',
                'name': 'copy'
            });
            if (this.model.collection.chatbox.canPostMessages()) {
                buttons.push({
                    'i18n_text': (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Quote'),
                    'handler': (ev)=>this.onMessageQuoteButtonClicked(ev),
                    'button_class': 'chat-msg__action-quote',
                    'icon_class': 'fas fa-quote-right',
                    'name': 'quote'
                });
            }
            /**
         * *Hook* which allows plugins to add more message action buttons
         * @event _converse#getMessageActionButtons
         * @example
         *  api.listen.on('getMessageActionButtons', (el, buttons) => {
         *      buttons.push({
         *          'i18n_text': 'Foo',
         *          'handler': ev => alert('Foo!'),
         *          'button_class': 'chat-msg__action-foo',
         *          'icon_class': 'fa fa-check',
         *          'name': 'foo'
         *      });
         *      return buttons;
         *  });
         */ return _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.hook('getMessageActionButtons', this, buttons);
        }).call(this);
    }
    constructor(){
        super();
        this.model = null;
        this.is_retracted = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-message-actions', MessageActions);


/***/ }),

/***/ "./src/shared/chat/message-body.js":
/*!*****************************************!*\
  !*** ./src/shared/chat/message-body.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MessageBody)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_registry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/registry.js */ "./src/shared/registry.js");
/* harmony import */ var shared_modals_image_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/modals/image.js */ "./src/shared/modals/image.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var shared_texture_directives_texture_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/texture/directives/texture.js */ "./src/shared/texture/directives/texture.js");
/* harmony import */ var _styles_message_body_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/message-body.scss */ "./src/shared/chat/styles/message-body.scss");






class MessageBody extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_3__.CustomElement {
    static get properties() {
        return {
            // We make this a string instead of a boolean, since we want to
            // distinguish between true, false and undefined states
            hide_url_previews: {
                type: String
            },
            is_me_message: {
                type: Boolean
            },
            model: {
                type: Object
            },
            text: {
                type: String
            }
        };
    }
    initialize() {
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
        this.listenTo(settings, 'change:allowed_audio_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:allowed_image_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:allowed_video_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:render_media', ()=>this.requestUpdate());
    }
    onImgClick(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-image-modal', {
            src: ev.target.src
        }, ev);
    }
    onImgLoad() {
        this.dispatchEvent(new CustomEvent('imageLoaded', {
            detail: this,
            bubbles: true
        }));
    }
    render() {
        const callback = ()=>{
            var _this_model_collection;
            return (_this_model_collection = this.model.collection) === null || _this_model_collection === void 0 ? void 0 : _this_model_collection.trigger('rendered', this.model);
        };
        const offset = 0;
        const options = {
            media_urls: this.model.get('media_urls'),
            mentions: this.model.get('references'),
            nick: this.model.chatbox.get('nick'),
            onImgClick: (ev)=>this.onImgClick(ev),
            onImgLoad: ()=>this.onImgLoad(),
            render_styling: !this.model.get('is_unstyled') && _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_message_styling'),
            show_me_message: true
        };
        if (this.hide_url_previews === "false") {
            options.embed_audio = true;
            options.embed_videos = true;
            options.show_images = true;
        } else if (this.hide_url_previews === "true") {
            options.embed_audio = false;
            options.embed_videos = false;
            options.show_images = false;
        }
        return (0,shared_texture_directives_texture_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.text, offset, options, callback);
    }
    constructor(){
        super();
        this.text = null;
        this.model = null;
        this.hide_url_previews = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-chat-message-body', MessageBody);


/***/ }),

/***/ "./src/shared/chat/message-history.js":
/*!********************************************!*\
  !*** ./src/shared/chat/message-history.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MessageHistory)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/repeat.js */ "./node_modules/lit/directives/repeat.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _message__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./message */ "./src/shared/chat/message.js");







class MessageHistory extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_4__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            },
            messages: {
                type: Array
            }
        };
    }
    render() {
        const msgs = this.messages;
        if (msgs.length) {
            return (0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(msgs, (m)=>m.get('id'), (m)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${this.renderMessage(m)}`);
        } else {
            return '';
        }
    }
    /**
     * @param {(Message)} model
     */ renderMessage(model) {
        if (model.get('dangling_retraction') || model.get('dangling_moderation') || model.get('is_only_key')) {
            return '';
        }
        const template_hook = model.get('template_hook');
        if (typeof template_hook === 'string') {
            const template_promise = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.hook(template_hook, model, '');
            return (0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__.until)(template_promise, '');
        } else {
            const template = (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-chat-message .model_with_messages="${this.model}" .model="${model}"></converse-chat-message>`;
            const day = (0,_utils_js__WEBPACK_IMPORTED_MODULE_5__.getDayIndicator)(model);
            return day ? [
                day,
                template
            ] : template;
        }
    }
    /**
     * @typedef {import('@converse/headless/types/plugins/chat/message').default} Message
     */ constructor(){
        super();
        this.model = null;
        this.messages = [];
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-message-history', MessageHistory);


/***/ }),

/***/ "./src/shared/chat/message-limit.js":
/*!******************************************!*\
  !*** ./src/shared/chat/message-limit.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MessageLimitIndicator)
/* harmony export */ });
/* harmony import */ var _templates_message_limit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/message-limit.js */ "./src/shared/chat/templates/message-limit.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



class MessageLimitIndicator extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            },
            _draft_length: {
                state: true
            }
        };
    }
    connectedCallback() {
        var _this_model_get;
        super.connectedCallback();
        var _this_model_get_length;
        this._draft_length = (_this_model_get_length = (_this_model_get = this.model.get('draft')) === null || _this_model_get === void 0 ? void 0 : _this_model_get.length) !== null && _this_model_get_length !== void 0 ? _this_model_get_length : 0;
        this.listenTo(this.model, 'change:draft', ()=>{
            var _this_model_get;
            var _this_model_get_length;
            this._draft_length = (_this_model_get_length = (_this_model_get = this.model.get('draft')) === null || _this_model_get === void 0 ? void 0 : _this_model_get.length) !== null && _this_model_get_length !== void 0 ? _this_model_get_length : 0;
        });
        this.listenTo(this.model, 'event:keyup', ({ ev })=>{
            const textarea = /** @type {HTMLTextAreaElement} */ ev.target;
            this._draft_length = textarea.value.length;
        });
    }
    render() {
        const limit = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('message_limit');
        if (!limit) return '';
        return (0,_templates_message_limit_js__WEBPACK_IMPORTED_MODULE_0__["default"])(limit - this._draft_length);
    }
    constructor(){
        super();
        this.model = null;
        this._draft_length = 0;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-message-limit-indicator', MessageLimitIndicator);


/***/ }),

/***/ "./src/shared/chat/message.js":
/*!************************************!*\
  !*** ./src/shared/chat/message.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Message)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _message_actions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./message-actions.js */ "./src/shared/chat/message-actions.js");
/* harmony import */ var _message_body_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./message-body.js */ "./src/shared/chat/message-body.js");
/* harmony import */ var shared_components_dropdown_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/dropdown.js */ "./src/shared/components/dropdown.js");
/* harmony import */ var shared_modals_message_versions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/modals/message-versions.js */ "./src/shared/modals/message-versions.js");
/* harmony import */ var shared_modals_user_details_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/modals/user-details.js */ "./src/shared/modals/user-details.js");
/* harmony import */ var shared_registry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/registry */ "./src/shared/registry.js");
/* harmony import */ var plugins_muc_views_modals_occupant_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! plugins/muc-views/modals/occupant.js */ "./src/plugins/muc-views/modals/occupant.js");
/* harmony import */ var _templates_file_progress_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./templates/file-progress.js */ "./src/shared/chat/templates/file-progress.js");
/* harmony import */ var _templates_info_message_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./templates/info-message.js */ "./src/shared/chat/templates/info-message.js");
/* harmony import */ var plugins_muc_views_templates_mep_message_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! plugins/muc-views/templates/mep-message.js */ "./src/plugins/muc-views/templates/mep-message.js");
/* harmony import */ var _templates_message_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./templates/message.js */ "./src/shared/chat/templates/message.js");
/* harmony import */ var _templates_message_text_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./templates/message-text.js */ "./src/shared/chat/templates/message-text.js");
/* harmony import */ var _templates_retraction_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./templates/retraction.js */ "./src/shared/chat/templates/retraction.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var shared_components_observable_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! shared/components/observable.js */ "./src/shared/components/observable.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}

















const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { SUCCESS } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.constants;
class Message extends shared_components_observable_js__WEBPACK_IMPORTED_MODULE_15__.ObservableElement {
    static get properties() {
        return _object_spread_props(_object_spread({}, super.properties), {
            model_with_messages: {
                type: Object
            },
            model: {
                type: Object
            }
        });
    }
    initialize() {
        var _this = this, _superprop_get_initialize = ()=>super.initialize;
        return _async_to_generator(function*() {
            _superprop_get_initialize().call(_this);
            yield this.model_with_messages.initialized;
            yield this.model_with_messages.messages.fetched;
            const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
            this.listenTo(settings, 'change:render_media', ()=>{
                // Reset individual show/hide state of media
                this.model.save('hide_url_previews', undefined);
                this.requestUpdate();
            });
            this.listenTo(this.model_with_messages, 'change:first_unread_id', ()=>this.requestUpdate());
            this.listenTo(this.model, 'change', ()=>this.requestUpdate());
            this.listenTo(this.model, 'contact:change', ()=>this.requestUpdate());
            this.listenTo(this.model, 'occupant:add', ()=>this.requestUpdate());
            this.listenTo(this.model, 'occupant:change', ()=>this.requestUpdate());
            this.listenTo(this.model, 'vcard:add', ()=>this.requestUpdate());
            this.listenTo(this.model, 'vcard:change', ()=>this.requestUpdate());
            this.requestUpdate();
        }).call(this);
    }
    render() {
        if (!this.model) {
            return '';
        } else if (this.show_spinner) {
            return (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_14__["default"])();
        } else if (this.model.get('file') && this.model.get('upload') !== SUCCESS) {
            return this.renderFileProgress();
        } else if ([
            'mep'
        ].includes(this.model.get('type'))) {
            return this.renderMEPMessage();
        } else if ([
            'error',
            'info'
        ].includes(this.model.get('type'))) {
            return this.renderInfoMessage();
        } else {
            return this.renderChatMessage();
        }
    }
    renderRetraction() {
        return (0,_templates_retraction_js__WEBPACK_IMPORTED_MODULE_13__["default"])(this);
    }
    renderMessageText() {
        return (0,_templates_message_text_js__WEBPACK_IMPORTED_MODULE_12__["default"])(this);
    }
    renderMEPMessage() {
        return (0,plugins_muc_views_templates_mep_message_js__WEBPACK_IMPORTED_MODULE_10__["default"])(this);
    }
    renderInfoMessage() {
        return (0,_templates_info_message_js__WEBPACK_IMPORTED_MODULE_9__["default"])(this);
    }
    renderFileProgress() {
        if (!this.model.file) {
            // Can happen when file upload failed and page was reloaded
            return '';
        }
        return (0,_templates_file_progress_js__WEBPACK_IMPORTED_MODULE_8__["default"])(this);
    }
    renderChatMessage() {
        return (0,_templates_message_js__WEBPACK_IMPORTED_MODULE_11__["default"])(this);
    }
    shouldShowAvatar() {
        return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('show_message_avatar') && !this.model.isMeCommand() && [
            'chat',
            'groupchat',
            'normal'
        ].includes(this.model.get('type'));
    }
    onImgClick(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-image-modal', {
            src: ev.target.src
        }, ev);
    }
    onUnfurlAnimationEnd() {
        if (this.model.get('url_preview_transition') === 'fade-out') {
            this.model.save({
                'hide_url_previews': true,
                'url_preview_transition': 'fade-in'
            });
        }
    }
    onRetryClicked() {
        return _async_to_generator(function*() {
            this.show_spinner = true;
            this.requestUpdate();
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger(this.model.get('retry_event_id'), {
                'synchronous': true
            });
            this.model.destroy();
            this.parentElement.removeChild(this);
        }).call(this);
    }
    hasMentions() {
        const is_groupchat = this.model.get('type') === 'groupchat';
        return is_groupchat && this.model.get('sender') === 'them' && this.model_with_messages.isUserMentioned(this.model);
    }
    getOccupantAffiliation() {
        var _this_model_occupant;
        return (_this_model_occupant = this.model.occupant) === null || _this_model_occupant === void 0 ? void 0 : _this_model_occupant.get('affiliation');
    }
    getOccupantRole() {
        var _this_model_occupant;
        return (_this_model_occupant = this.model.occupant) === null || _this_model_occupant === void 0 ? void 0 : _this_model_occupant.get('role');
    }
    getExtraMessageClasses() {
        const is_action = this.model.isMeCommand() || this.model.isRetracted();
        const extra_classes = [
            this.model.isFollowup() ? 'chat-msg--followup' : null,
            this.model.get('is_delayed') ? 'delayed' : null,
            is_action ? 'chat-msg--action' : null,
            this.model.isRetracted() ? 'chat-msg--retracted' : null,
            this.model.get('type'),
            this.shouldShowAvatar() ? 'chat-msg--with-avatar' : null
        ].map((c)=>c);
        if (this.model.get('type') === 'groupchat') {
            var _this_getOccupantRole;
            extra_classes.push((_this_getOccupantRole = this.getOccupantRole()) !== null && _this_getOccupantRole !== void 0 ? _this_getOccupantRole : '');
            var _this_getOccupantAffiliation;
            extra_classes.push((_this_getOccupantAffiliation = this.getOccupantAffiliation()) !== null && _this_getOccupantAffiliation !== void 0 ? _this_getOccupantAffiliation : '');
            if (this.model.get('sender') === 'them' && this.hasMentions()) {
                extra_classes.push('mentioned');
            }
        }
        this.model.get('correcting') && extra_classes.push('correcting');
        return extra_classes.filter((c)=>c).join(" ");
    }
    getRetractionText() {
        if ([
            'groupchat',
            'mep'
        ].includes(this.model.get('type')) && this.model.get('moderated_by')) {
            const retracted_by_mod = this.model.get('moderated_by');
            if (!this.model.mod) {
                const { occupants } = this.model_with_messages;
                this.model.mod = occupants.findOccupant({
                    'jid': retracted_by_mod
                }) || occupants.findOccupant({
                    'nick': Strophe.getResourceFromJid(retracted_by_mod)
                });
            }
            const modname = this.model.mod ? this.model.mod.getDisplayName() : (0,i18n__WEBPACK_IMPORTED_MODULE_16__.__)('A moderator');
            return (0,i18n__WEBPACK_IMPORTED_MODULE_16__.__)('%1$s has removed a message', modname);
        } else {
            return this.model.get('sender') === 'me' ? (0,i18n__WEBPACK_IMPORTED_MODULE_16__.__)('You have removed a message') : (0,i18n__WEBPACK_IMPORTED_MODULE_16__.__)('%1$s has removed a message', this.model.getDisplayName());
        }
    }
    showUserModal(ev) {
        if (this.model.get('sender') === 'me') {
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-profile-modal', {
                model: _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.state.xmppstatus
            }, ev);
        } else if (this.model.get('type') === 'groupchat') {
            ev.preventDefault();
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-muc-occupant-modal', {
                model: this.model.getOccupant(),
                message: this.model
            }, ev);
        } else {
            ev.preventDefault();
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-user-details-modal', {
                model: this.model_with_messages
            }, ev);
        }
    }
    showMessageVersionsModal(ev) {
        ev.preventDefault();
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-message-versions-modal', {
            'model': this.model
        }, ev);
    }
    toggleSpoilerMessage(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        this.model.save({
            'is_spoiler_visible': !this.model.get('is_spoiler_visible')
        });
    }
    /**
     * @typedef {import('shared/components/types').ObservableProperty} ObservableProperty
     */ constructor(){
        super();
        this.model_with_messages = null;
        this.model = null;
        this.observable = /** @type {ObservableProperty} */ "once";
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-chat-message', Message);


/***/ }),

/***/ "./src/shared/chat/styles/chat-content.scss":
/*!**************************************************!*\
  !*** ./src/shared/chat/styles/chat-content.scss ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./chat-content.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/chat-content.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_chat_content_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/styles/emoji.scss":
/*!*******************************************!*\
  !*** ./src/shared/chat/styles/emoji.scss ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_emoji_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./emoji.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/emoji.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_emoji_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_emoji_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_emoji_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_emoji_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/styles/message-actions.scss":
/*!*****************************************************!*\
  !*** ./src/shared/chat/styles/message-actions.scss ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_actions_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./message-actions.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/message-actions.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_actions_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_actions_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_actions_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_actions_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/styles/message-body.scss":
/*!**************************************************!*\
  !*** ./src/shared/chat/styles/message-body.scss ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_body_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./message-body.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/message-body.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_body_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_body_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_body_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_body_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/styles/retraction.scss":
/*!************************************************!*\
  !*** ./src/shared/chat/styles/retraction.scss ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_retraction_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./retraction.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/retraction.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_retraction_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_retraction_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_retraction_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_retraction_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/styles/toolbar.scss":
/*!*********************************************!*\
  !*** ./src/shared/chat/styles/toolbar.scss ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toolbar_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./toolbar.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/toolbar.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toolbar_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toolbar_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toolbar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_toolbar_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/styles/unfurl.scss":
/*!********************************************!*\
  !*** ./src/shared/chat/styles/unfurl.scss ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_unfurl_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./unfurl.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/chat/styles/unfurl.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_unfurl_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_unfurl_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_unfurl_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_unfurl_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/chat/templates/emoji-picker.js":
/*!***************************************************!*\
  !*** ./src/shared/chat/templates/emoji-picker.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   tplAllEmojis: () => (/* binding */ tplAllEmojis),
/* harmony export */   tplEmojiPicker: () => (/* binding */ tplEmojiPicker),
/* harmony export */   tplSearchResults: () => (/* binding */ tplSearchResults)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");



const u = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env.utils;
const emoji_category = (o)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li data-category="${o.category}" class="emoji-category ${o.category} ${o.current_category === o.category ? 'picked' : ''}" title="${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)(_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('emoji_category_labels')[o.category])}"><a class="btn pick-category" @click="${o.onCategoryPicked}" href="#emoji-picker-${o.category}" data-category="${o.category}">${o.emoji}</a></li>`;
};
const emoji_picker_header = (o)=>{
    const cats = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('emoji_categories');
    const transform = (c)=>cats[c] ? emoji_category(Object.assign({
            'category': c,
            'emoji': o.sn2Emoji(cats[c])
        }, o)) : '';
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<ul>${Object.keys(cats).map(transform)}</ul>`;
};
const emoji_item = (o)=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li class="emoji insert-emoji ${o.shouldBeHidden(o.emoji.sn) ? 'hidden' : ''}" data-emoji="${o.emoji.sn}" title="${o.emoji.sn}"><a href="#" @click="${o.insertEmoji}" data-emoji="${o.emoji.sn}">${u.shortnamesToEmojis(o.emoji.sn)}</a></li>`;
};
function tplSearchResults(o) {
    const i18n_search_results = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Search results');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<span ?hidden="${!o.query}" class="emoji-lists__container emojis-lists__container--search"><a id="emoji-picker-search-results" class="emoji-category__heading">${i18n_search_results}</a><ul class="emoji-picker">${o.search_results.map((emoji)=>emoji_item(Object.assign({
            emoji
        }, o)))}</ul></span>`;
}
function emojis_for_category(o) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a id="emoji-picker-${o.category}" class="emoji-category__heading" data-category="${o.category}">${(0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)(_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('emoji_category_labels')[o.category])}</a><ul class="emoji-picker" data-category="${o.category}">${Object.values(_converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.emojis.json[o.category]).map((emoji)=>emoji_item(Object.assign({
            emoji
        }, o)))}</ul>`;
}
function tplAllEmojis(o) {
    const cats = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('emoji_categories');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<span ?hidden="${o.query}" class="emoji-lists__container emoji-lists__container--browse">${Object.keys(cats).map((c)=>cats[c] ? emojis_for_category(Object.assign({
            'category': c
        }, o)) : '')}</span>`;
}
function skintone_emoji(o, skintone, skintone_emoji) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<li data-skintone="${skintone_emoji}" class="emoji-skintone ${o.current_skintone === skintone ? 'picked' : ''}"><a class="pick-skintone" href="#" data-skintone="${skintone}" @click="${o.onSkintonePicked}">${u.shortnamesToEmojis(skintone_emoji)}</a></li>`;
}
/**
 * @param {import('../emoji-picker').default} el
 * @param {Object} o
 */ function tplEmojiPicker(el, o) {
    const i18n_search = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Search');
    const skintones = {
        "tone1": ":raised_hand_tone1:",
        "tone2": ":raised_hand_tone2:",
        "tone3": ":raised_hand_tone3:",
        "tone4": ":raised_hand_tone4:",
        "tone5": ":raised_hand_tone5:"
    };
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="emoji-picker__header"><input class="form-control emoji-search" name="emoji-search" placeholder="${i18n_search}" .value="${o.query || ''}" @keydown="${o.onSearchInputKeyDown}" @blur="${o.onSearchInputBlurred}" @focus="${o.onSearchInputFocus}"> ${o.query ? '' : emoji_picker_header(o)}</div>${o.render_emojis ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-emoji-picker-content .model="${el.state}" .search_results="${o.search_results}" current_skintone="${o.current_skintone}" query="${o.query}"></converse-emoji-picker-content>` : ''}<div class="emoji-skintone-picker">Skin tone:<ul>${Object.keys(skintones).map((k)=>skintone_emoji(o, k, skintones[k]))}</ul></div>`;
}


/***/ }),

/***/ "./src/shared/chat/templates/file-progress.js":
/*!****************************************************!*\
  !*** ./src/shared/chat/templates/file-progress.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var shared_avatar_avatar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/avatar/avatar.js */ "./src/shared/avatar/avatar.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");




const { filesize } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _el_model_vcard;
    const i18n_uploading = (0,i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Uploading file:');
    const filename = el.model.file.name;
    const size = filesize(el.model.file.size);
    const contact = el.model.occupant || el.model.contact;
    return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<div class="message chat-msg">${el.shouldShowAvatar() ? (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<a class="show-msg-author-modal" @click="${el.showUserModal}"><converse-avatar .model="${contact || el.model}" class="avatar align-self-center" name="${el.model.getDisplayName()}" nonce="${(_el_model_vcard = el.model.vcard) === null || _el_model_vcard === void 0 ? void 0 : _el_model_vcard.get('vcard_updated')}" height="40" width="40"></converse-avatar></a>` : ''}<div class="chat-msg__content"><span class="chat-msg__text">${i18n_uploading} <strong>${filename}</strong>, ${size}</span><progress value="${el.model.get('progress')}"></div></div>`;
});


/***/ }),

/***/ "./src/shared/chat/templates/info-message.js":
/*!***************************************************!*\
  !*** ./src/shared/chat/templates/info-message.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");



const { dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const isodate = dayjs(el.model.get('time')).toISOString();
    const i18n_retry = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Retry');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="message chat-info chat-${el.model.get('type')}" data-isodate="${isodate}" data-type="${el.data_name}" data-value="${el.data_value}"><div class="chat-info__message"><converse-texture .mentions="${el.model.get('references')}" render_styling text="${el.model.getMessageText()}"></converse-texture></div>${el.model.get('reason') ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<q class="reason">${el.model.get('reason')}</q>` : ``} ${el.model.get('error_text') ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<q class="reason">${el.model.get('error_text')}</q>` : ``} ${el.model.get('retry_event_id') ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="retry" @click="${el.onRetryClicked}">${i18n_retry}</a>` : ''}</div>`;
});


/***/ }),

/***/ "./src/shared/chat/templates/message-limit.js":
/*!****************************************************!*\
  !*** ./src/shared/chat/templates/message-limit.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((counter)=>{
    const i18n_chars_remaining = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Message characters remaining');
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<span class="message-limit ${counter < 1 ? 'error' : ''}" title="${i18n_chars_remaining}">${counter}</span>`;
});


/***/ }),

/***/ "./src/shared/chat/templates/message-text.js":
/*!***************************************************!*\
  !*** ./src/shared/chat/templates/message-text.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var i18n_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18n/index.js */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");



/**
 * @param {import('../message').default} el
 */ function tplEditedIcon(el) {
    const i18n_edited = (0,i18n_index_js__WEBPACK_IMPORTED_MODULE_1__.__)('This message has been edited');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-icon title="${i18n_edited}" class="fa fa-edit chat-msg__edit-modal" @click="${el.showMessageVersionsModal}" size="1em"></converse-icon>`;
}
function tplCheckmark() {
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<converse-icon size="0.75em" color="var(--chat-color)" class="fa fa-check chat-msg__receipt"></converse-icon>`;
}
/**
 * @param {import('../message').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const i18n_show = (0,i18n_index_js__WEBPACK_IMPORTED_MODULE_1__.__)('Show more');
    const is_groupchat_message = el.model.get('type') === 'groupchat';
    const i18n_show_less = (0,i18n_index_js__WEBPACK_IMPORTED_MODULE_1__.__)('Show less');
    const error_text = el.model.get('error_text') || el.model.get('error');
    const i18n_error = `${(0,i18n_index_js__WEBPACK_IMPORTED_MODULE_1__.__)('Message delivery failed.')}\n${error_text}`;
    const tplSpoilerHint = (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="chat-msg__spoiler-hint"><span class="spoiler-hint">${el.model.get('spoiler_hint')}</span> <a class="badge badge-info spoiler-toggle" href="#" @click="${el.toggleSpoilerMessage}"><converse-icon size="1em" color="var(--background-color)" class="fa ${el.model.get('is_spoiler_visible') ? 'fa-eye-slash' : 'fa-eye'}"></converse-icon>${el.model.get('is_spoiler_visible') ? i18n_show_less : i18n_show}</a></div>`;
    const spoiler_classes = el.model.get('is_spoiler') ? `spoiler ${el.model.get('is_spoiler_visible') ? '' : 'hidden'}` : '';
    const text = el.model.getMessageText();
    const show_oob = el.model.get('oob_url') && text !== el.model.get('oob_url');
    const render_media = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('render_media');
    return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`${el.model.get('is_spoiler') ? tplSpoilerHint : ''} ${el.model.get('subject') ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="chat-msg__subject">${el.model.get('subject')}</div>` : ''} <span class="chat-msg__body--wrapper ${error_text ? 'error' : ''}"><converse-chat-message-body class="chat-msg__text ${el.model.get('is_only_emojis') ? 'chat-msg__text--larger' : ''} ${spoiler_classes}" .model="${el.model}" hide_url_previews="${el.model.get('hide_url_previews')}" ?is_me_message="${el.model.isMeCommand()}" text="${text}"></converse-chat-message-body>${el.model.get('received') && !el.model.isMeCommand() && !is_groupchat_message ? tplCheckmark() : ''} ${el.model.get('edited') ? tplEditedIcon(el) : ''} </span>${show_oob ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="chat-msg__media"><converse-texture text="${el.model.get('oob_url')}" .onImgClick="${(ev)=>el.onImgClick(ev)}" ?embed_audio="${render_media}" ?embed_videos="${render_media}" ?show_images="${render_media}"></div>` : ''} ${error_text ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<div class="chat-msg__error">${i18n_error}</div>` : ''}`;
});


/***/ }),

/***/ "./src/shared/chat/templates/message.js":
/*!**********************************************!*\
  !*** ./src/shared/chat/templates/message.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils_url_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../utils/url.js */ "./src/utils/url.js");
/* harmony import */ var _utils_color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/color.js */ "./src/utils/color.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var shared_avatar_avatar_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/avatar/avatar.js */ "./src/shared/avatar/avatar.js");
/* harmony import */ var shared_chat_unfurl_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! shared/chat/unfurl.js */ "./src/shared/chat/unfurl.js");








const { dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
/**
 * @param {import('../message').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    var _avatar_model_vcard, _el_model_get;
    const i18n_new_messages = (0,i18n__WEBPACK_IMPORTED_MODULE_5__.__)('New messages');
    const edited = el.model.get('edited');
    const is_first_unread = el.model_with_messages.get('first_unread_id') === el.model.get('id');
    const is_followup = el.model.isFollowup();
    const is_me_message = el.model.isMeCommand();
    const is_retracted = el.model.isRetracted();
    const msgid = el.model.get('msgid');
    const sender = el.model.get('sender');
    const time = el.model.get('time');
    const contact = el.model.occupant || el.model.contact;
    const author_style = (0,_utils_color_js__WEBPACK_IMPORTED_MODULE_3__.getAuthorStyle)(contact);
    const format = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('time_format');
    const pretty_time = dayjs(edited || time).format(format);
    const hats = (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getHats)(el.model);
    const username = el.model.getDisplayName();
    const is_action = is_me_message || is_retracted;
    const should_show_header = !is_action && !is_followup;
    const should_show_avatar = el.shouldShowAvatar() && should_show_header;
    // The model to use for the avatar.
    // Note: it can happen that the contact has not the vcard attribute but the message has.
    const avatar_model = (contact === null || contact === void 0 ? void 0 : contact.vcard) ? contact : el.model;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${is_first_unread ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="message separator"><hr class="separator"><span class="separator-text">${i18n_new_messages}</span></div>` : ''}<div class="message chat-msg ${el.getExtraMessageClasses()}" data-isodate="${time}" data-msgid="${msgid}" data-from="${el.model.get('from')}" data-encrypted="${el.model.get('is_encrypted')}"><a id="${msgid}"></a> ${should_show_avatar ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a class="show-msg-author-modal" @click="${el.showUserModal}"><converse-avatar .model="${avatar_model}" class="avatar align-self-center" name="${el.model.getDisplayName()}" nonce="${(_avatar_model_vcard = avatar_model.vcard) === null || _avatar_model_vcard === void 0 ? void 0 : _avatar_model_vcard.get('vcard_updated')}" height="40" width="40"></converse-avatar></a>` : ''}<div class="chat-msg__content chat-msg__content--${sender} ${is_action ? 'chat-msg__content--action' : ''}">${should_show_header ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="chat-msg__heading"><span class="chat-msg__author"><a class="show-msg-author-modal" @click="${el.showUserModal}" style="${author_style}">${username}</a> </span>${hats.map((h)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="badge badge-secondary">${h.title}</span>`)} <time timestamp="${edited || time}" class="chat-msg__time">${pretty_time}</time> ${el.model.get('is_encrypted') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-icon class="fa fa-lock" size="1.1em"></converse-icon>` : ''}</span>` : ''}<div class="chat-msg__body chat-msg__body--${el.model.get('message_type')} ${el.model.get('received') ? 'chat-msg__body--received' : ''} ${el.model.get('is_delayed') ? 'chat-msg__body--delayed' : ''}"><div class="chat-msg__message">${is_action ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<time timestamp="${edited || time}" class="chat-msg__time">${pretty_time}</time> ${is_me_message ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="chat-msg__author" style="${author_style}">${is_me_message ? '**' : ''}${username}</span> ` : ''}` : ''} ${is_retracted ? el.renderRetraction() : el.renderMessageText()}</div><converse-message-actions .model="${el.model}" ?is_retracted="${is_retracted}"></converse-message-actions></div>${(_el_model_get = el.model.get('ogp_metadata')) === null || _el_model_get === void 0 ? void 0 : _el_model_get.map((m)=>{
        var _el_model_with_messages;
        if (el.model.get('hide_url_previews') === true) {
            return '';
        }
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-message-unfurl @animationend="${el.onUnfurlAnimationEnd}" class="${el.model.get('url_preview_transition')}" jid="${(_el_model_with_messages = el.model_with_messages) === null || _el_model_with_messages === void 0 ? void 0 : _el_model_with_messages.get('jid')}" description="${m['og:description'] || ''}" title="${m['og:title'] || ''}" image="${m['og:image'] && (0,_utils_url_js__WEBPACK_IMPORTED_MODULE_2__.shouldRenderMediaFromURL)(m['og:image'], 'image') ? m['og:image'] : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}" site_name="${m['og:site_name'] || ''}" url="${m['og:url'] || ''}"></converse-message-unfurl>`;
    })}</div></div>`;
});


/***/ }),

/***/ "./src/shared/chat/templates/new-day.js":
/*!**********************************************!*\
  !*** ./src/shared/chat/templates/new-day.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="message date-separator" data-isodate="${o.time}"><hr class="separator"><time class="separator-text" datetime="${o.time}"><span>${o.datestring}</span></time></div>`);


/***/ }),

/***/ "./src/shared/chat/templates/retraction.js":
/*!*************************************************!*\
  !*** ./src/shared/chat/templates/retraction.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _styles_retraction_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../styles/retraction.scss */ "./src/shared/chat/styles/retraction.scss");


/**
 * @param {import('shared/chat/message').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const retraction_text = el.model.isRetracted() ? el.getRetractionText() : null;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="retraction"><span>${retraction_text}</span> ${el.model.get('moderation_reason') ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<q class="chat-msg--retracted__reason">${el.model.get('moderation_reason')}</q>` : ''}</span>`;
});


/***/ }),

/***/ "./src/shared/chat/templates/toolbar.js":
/*!**********************************************!*\
  !*** ./src/shared/chat/templates/toolbar.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");




function tplSendButton() {
    const i18n_send_message = (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Send the message');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="submit" class="btn send-button" data-action="sendMessage" title="${i18n_send_message}"><converse-icon color="var(--background-color)" class="fa fa-paper-plane" size="1em"></converse-icon></button>`;
}
/**
 * @param {import('../toolbar').ChatToolbar} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const message_limit = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get('message_limit');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="btn-group toolbar-buttons">${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(el.getButtons(), '')}</span> <span>${message_limit ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-message-limit-indicator .model="${el.model}">` : ''} ${el.show_send_button ? tplSendButton() : ''}</span>`;
});


/***/ }),

/***/ "./src/shared/chat/templates/unfurl.js":
/*!*********************************************!*\
  !*** ./src/shared/chat/templates/unfurl.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var utils_url_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! utils/url.js */ "./src/utils/url.js");
/* harmony import */ var shared_texture_components_image_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/texture/components/image.js */ "./src/shared/texture/components/image.js");




/**
 * @param {string} image
 * @returns {boolean}
 */ function isValidImage(image) {
    return image && (0,utils_url_js__WEBPACK_IMPORTED_MODULE_2__.isDomainAllowed)(image, 'allowed_image_domains') && _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isValidURL(image);
}
/**
 * @param {import('../unfurl').default} el
 * @param {(title: string) => import('lit').TemplateResult} wrapped_template
 */ function tplUrlWrapper(el, wrapped_template) {
    const image = el.image || '';
    const url = el.url || '';
    const title = el.title || '';
    return url && _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isValidURL(url) && !_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isGIFURL(image) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="${url}" target="_blank" rel="noopener">${wrapped_template(title)}</a>` : wrapped_template(title !== null && title !== void 0 ? title : '');
}
/**
 * @param {import('../unfurl').default} el
 */ function tplImage(el) {
    const image = el.image || '';
    const url = el.url || '';
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-image class="card-img-top hor_centered" href="${url}" src="${image}" .onImgLoad="${()=>el.onImageLoad()}"></converse-image>`;
}
/**
 * @param {import('../unfurl').default} el
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((el)=>{
    const description = el.description || '';
    const image = el.image || '';
    const title = el.title || '';
    const url = el.url || '';
    const show_image = isValidImage(image);
    const has_body_info = title || description || url;
    if (show_image || has_body_info) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="card card--unfurl">${show_image ? tplImage(el) : ''} ${has_body_info ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="card-body">${title ? tplUrlWrapper(el, /** @param {string} title */ (title)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<h5 class="card-title">${title}</h5>`) : ''} ${description ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="card-text"><converse-texture text="${description}"></converse-texture></p>` : ''} ${url && _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isValidURL(url) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p class="card-text"><a href="${url}" target="_blank" rel="noopener">${new URL(url).hostname}</a></p>` : ''}</div>` : ''}</div>`;
    } else {
        return '';
    }
});


/***/ }),

/***/ "./src/shared/chat/toolbar.js":
/*!************************************!*\
  !*** ./src/shared/chat/toolbar.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ChatToolbar: () => (/* binding */ ChatToolbar)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _emoji_picker_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emoji-picker.js */ "./src/shared/chat/emoji-picker.js");
/* harmony import */ var shared_chat_message_limit_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/chat/message-limit.js */ "./src/shared/chat/message-limit.js");
/* harmony import */ var _templates_toolbar_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./templates/toolbar.js */ "./src/shared/chat/templates/toolbar.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _styles_toolbar_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles/toolbar.scss */ "./src/shared/chat/styles/toolbar.scss");









const Strophe = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env.Strophe;
class ChatToolbar extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_6__.CustomElement {
    static get properties() {
        return {
            hidden_occupants: {
                type: Boolean
            },
            is_groupchat: {
                type: Boolean
            },
            message_limit: {
                type: Number
            },
            model: {
                type: Object
            },
            show_call_button: {
                type: Boolean
            },
            show_emoji_button: {
                type: Boolean
            },
            show_send_button: {
                type: Boolean
            },
            show_spoiler_button: {
                type: Boolean
            }
        };
    }
    connectedCallback() {
        super.connectedCallback();
        this.listenTo(this.model, 'change:composing_spoiler', ()=>this.requestUpdate());
    }
    render() {
        return (0,_templates_toolbar_js__WEBPACK_IMPORTED_MODULE_5__["default"])(this);
    }
    firstUpdated() {
        /**
         * Triggered once the toolbar has been rendered
         * @event _converse#renderToolbar
         * @type { ChatToolbar }
         * @example _converse.api.listen.on('renderToolbar', this => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.trigger('renderToolbar', this);
    }
    getButtons() {
        const buttons = [];
        if (this.show_emoji_button) {
            buttons.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-emoji-dropdown .model="${this.model}"></converse-emoji-dropdown>`);
        }
        if (this.show_call_button) {
            const color = this.is_groupchat ? '--muc-color' : '--chat-color';
            const i18n_start_call = (0,i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Start a call');
            buttons.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn toggle-call" @click="${this.toggleCall}" title="${i18n_start_call}"><converse-icon color="var(${color})" class="fa fa-phone" size="1em"></converse-icon></button>`);
        }
        if (this.show_spoiler_button) {
            buttons.push(this.getSpoilerButton());
        }
        const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get('domain');
        const http_upload_promise = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.disco.supports(Strophe.NS.HTTPUPLOAD, domain);
        buttons.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(http_upload_promise.then((is_supported)=>this.getHTTPUploadButton(!!is_supported)), '')}`);
        /**
         * *Hook* which allows plugins to add more buttons to a chat's toolbar
         * @event _converse#getToolbarButtons
         * @example
         *  api.listen.on('getToolbarButtons', (toolbar_el, buttons) {
         *      buttons.push(html`
         *          <button @click=${() => alert('Foo!')}>Foo</button>`
         *      );
         *      return buttons;
         *  }
         */ return _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.api.hook('getToolbarButtons', this, buttons);
    }
    /**
     * @param {boolean} is_supported
     */ getHTTPUploadButton(is_supported) {
        if (is_supported) {
            const i18n_choose_file = (0,i18n__WEBPACK_IMPORTED_MODULE_7__.__)('Choose a file to send');
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn" title="${i18n_choose_file}" @click="${this.toggleFileUpload}"><converse-icon class="fa fa-paperclip" size="1em"></converse-icon></button> <input type="file" @change="${this.onFileSelection}" class="fileupload" multiple="" style="display:none">`;
        } else {
            return '';
        }
    }
    getSpoilerButton() {
        var _model_presence;
        const model = this.model;
        if (!this.is_groupchat && !((_model_presence = model.presence) === null || _model_presence === void 0 ? void 0 : _model_presence.resources.length)) {
            return;
        }
        let i18n_toggle_spoiler;
        if (model.get('composing_spoiler')) {
            i18n_toggle_spoiler = (0,i18n__WEBPACK_IMPORTED_MODULE_7__.__)("Click to write as a normal (non-spoiler) message");
        } else {
            i18n_toggle_spoiler = (0,i18n__WEBPACK_IMPORTED_MODULE_7__.__)("Click to write your message as a spoiler");
        }
        const color = this.is_groupchat ? '--muc-color' : '--chat-color';
        const markup = (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="btn toggle-compose-spoiler" title="${i18n_toggle_spoiler}" @click="${this.toggleComposeSpoilerMessage}"><converse-icon color="var(${color})" class="fa ${model.get('composing_spoiler') ? 'fa-eye-slash' : 'fa-eye'}" size="1em"></converse-icon></button>`;
        if (this.is_groupchat) {
            return markup;
        } else {
            const contact_jid = model.get('jid');
            const spoilers_promise = Promise.all(model.presence.resources.map((r)=>_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.disco.supports(Strophe.NS.SPOILER, `${contact_jid}/${r.get('name')}`))).then((results)=>results.reduce((acc, val)=>acc && val, true));
            return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(spoilers_promise.then(()=>markup), '')}`;
        }
    }
    /** @param {MouseEvent} ev */ toggleFileUpload(ev) {
        var _ev_preventDefault, _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        /** @type {HTMLInputElement} */ this.querySelector('.fileupload').click();
    }
    /** @param {InputEvent} ev */ onFileSelection(ev) {
        this.model.sendFiles(/** @type {HTMLInputElement} */ ev.target.files);
    }
    /** @param {MouseEvent} ev */ toggleComposeSpoilerMessage(ev) {
        var _ev_preventDefault, _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        this.model.set('composing_spoiler', !this.model.get('composing_spoiler'));
    }
    /** @param {MouseEvent} ev */ toggleCall(ev) {
        var _ev_preventDefault, _ev_stopPropagation;
        ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
        ev === null || ev === void 0 ? void 0 : (_ev_stopPropagation = ev.stopPropagation) === null || _ev_stopPropagation === void 0 ? void 0 : _ev_stopPropagation.call(ev);
        /**
         * When a call button (i.e. with class .toggle-call) on a chatbox has been clicked.
         * @event _converse#callButtonClicked
         * @type { object }
         * @property { Strophe.Connection } connection - The XMPP Connection object
         * @property { _converse.ChatBox | _converse.ChatRoom } model
         * @example _converse.api.listen.on('callButtonClicked', (connection, model) => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.trigger('callButtonClicked', {
            connection: _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.connection.get(),
            model: this.model
        });
    }
    constructor(){
        super();
        this.model = null;
        this.is_groupchat = null;
        this.hidden_occupants = false;
        this.show_send_button = false;
        this.show_spoiler_button = false;
        this.show_call_button = false;
        this.show_emoji_button = false;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-chat-toolbar', ChatToolbar);


/***/ }),

/***/ "./src/shared/chat/unfurl.js":
/*!***********************************!*\
  !*** ./src/shared/chat/unfurl.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MessageUnfurl)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _templates_unfurl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./templates/unfurl.js */ "./src/shared/chat/templates/unfurl.js");
/* harmony import */ var _styles_unfurl_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/unfurl.scss */ "./src/shared/chat/styles/unfurl.scss");




class MessageUnfurl extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            description: {
                type: String
            },
            image: {
                type: String
            },
            jid: {
                type: String
            },
            title: {
                type: String
            },
            url: {
                type: String
            },
            site_name: {
                type: String
            }
        };
    }
    initialize() {
        const settings = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get();
        this.listenTo(settings, 'change:allowed_image_domains', ()=>this.requestUpdate());
        this.listenTo(settings, 'change:render_media', ()=>this.requestUpdate());
    }
    render() {
        return (0,_templates_unfurl_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this);
    }
    onImageLoad() {
        this.dispatchEvent(new CustomEvent('imageLoaded', {
            detail: this,
            bubbles: true
        }));
    }
    constructor(){
        super();
        this.jid = null;
        this.url = null;
        this.title = null;
        this.image = null;
        this.description = null;
        this.site_name = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-message-unfurl', MessageUnfurl);


/***/ }),

/***/ "./src/shared/chat/utils.js":
/*!**********************************!*\
  !*** ./src/shared/chat/utils.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addEmojisMarkup: () => (/* binding */ addEmojisMarkup),
/* harmony export */   getChatStyle: () => (/* binding */ getChatStyle),
/* harmony export */   getDayIndicator: () => (/* binding */ getDayIndicator),
/* harmony export */   getDropdownButtons: () => (/* binding */ getDropdownButtons),
/* harmony export */   getEmojiMarkup: () => (/* binding */ getEmojiMarkup),
/* harmony export */   getHats: () => (/* binding */ getHats),
/* harmony export */   getHeadingDropdownItem: () => (/* binding */ getHeadingDropdownItem),
/* harmony export */   getHeadingStandaloneButton: () => (/* binding */ getHeadingStandaloneButton),
/* harmony export */   getStandaloneButtons: () => (/* binding */ getStandaloneButtons),
/* harmony export */   getTonedEmojis: () => (/* binding */ getTonedEmojis),
/* harmony export */   getUnreadMsgsDisplay: () => (/* binding */ getUnreadMsgsDisplay),
/* harmony export */   isMobileViewport: () => (/* binding */ isMobileViewport),
/* harmony export */   onScrolledDown: () => (/* binding */ onScrolledDown),
/* harmony export */   shortnamesToEmojis: () => (/* binding */ shortnamesToEmojis)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var shared_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/constants.js */ "./src/shared/constants.js");
/* harmony import */ var _templates_new_day_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/new-day.js */ "./src/shared/chat/templates/new-day.js");
/**
 * @typedef {import('plugins/chatview/types').HeadingButtonAttributes} HeadingButtonAttributes
 * @typedef {import('@converse/headless').Message} Message
 * @typedef {import('@converse/headless').MUCMessage} MUCMessage
 * @typedef {import('@converse/skeletor').Model} Model
 * @typedef {import('lit').TemplateResult} TemplateResult
 */ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}





const { dayjs, u } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.env;
const { convertASCII2Emoji, getShortnameReferences, getCodePointReferences } = u;
function isMobileViewport() {
    return window.innerWidth <= shared_constants_js__WEBPACK_IMPORTED_MODULE_3__.MOBILE_CUTOFF;
}
/**
 * @param {import('@converse/headless/types/shared/chatbox').default} model
 */ function getChatStyle(model) {
    if (isMobileViewport()) return '';
    const { height, width } = model.toJSON();
    const is_overlayed = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'overlayed';
    return is_overlayed ? `${width ? `width: ${width}px;` : ''}${height ? `height: ${height}px;` : ''}` : '';
}
/**
 * @param {Model} model
 */ function getUnreadMsgsDisplay(model) {
    const num_unread = model.get('num_unread') || 0;
    return num_unread < 100 ? num_unread : '99+';
}
/**
 * @param {Promise<HeadingButtonAttributes>|HeadingButtonAttributes} promise_or_data
 * @returns {Promise<TemplateResult|''>}
 */ function getHeadingDropdownItem(promise_or_data) {
    return _async_to_generator(function*() {
        const data = yield promise_or_data;
        return data ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<a href="#" role="button" class="dropdown-item ${data.a_class}" @click="${data.handler}" title="${data.i18n_title}"><converse-icon size="1em" class="fa ${data.icon_class}"></converse-icon>${data.i18n_text}</a>` : '';
    })();
}
/**
 * @param {Promise<HeadingButtonAttributes>|HeadingButtonAttributes} promise_or_data
 * @returns {Promise<TemplateResult>}
 */ function getHeadingStandaloneButton(promise_or_data) {
    return _async_to_generator(function*() {
        const data = yield promise_or_data;
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<button type="button" class="btn chatbox-btn ${data.a_class}" @click="${data.handler}" title="${data.i18n_title}"><converse-icon size="1em" class="fa ${data.icon_class}"></converse-icon></button>`;
    })();
}
/**
 * @param {Promise<Array<HeadingButtonAttributes>>} promise
 */ function getStandaloneButtons(promise) {
    return _async_to_generator(function*() {
        const btns = yield promise;
        return btns.filter((b)=>b.standalone).map((b)=>getHeadingStandaloneButton(b)).reverse().map((b)=>(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_2__.until)(b, ''));
    })();
}
/**
 * @param {Promise<Array<object>>} promise
 */ function getDropdownButtons(promise) {
    return _async_to_generator(function*() {
        const btns = yield promise;
        const dropdown_btns = btns.filter((b)=>!b.standalone).map((b)=>getHeadingDropdownItem(b));
        return dropdown_btns.length ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<converse-dropdown class="chatbox-btn btn-group dropstart" .items="${dropdown_btns}"></converse-dropdown>` : '';
    })();
}
function onScrolledDown(model) {
    if (!model.isHidden()) {
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('allow_url_history_change')) {
            // Clear location hash if set to one of the messages in our history
            const hash = window.location.hash;
            if (hash && model.messages.get(hash.slice(1))) {
                history.pushState(null, '', window.location.pathname);
            }
        }
    }
}
/**
 * Given a message object, returns a TemplateResult indicating a new day if
 * the passed in message is more than a day later than its predecessor.
 * @param {Message} message
 * @returns {TemplateResult|undefined}
 */ function getDayIndicator(message) {
    var _message_collection;
    const messages = (_message_collection = message.collection) === null || _message_collection === void 0 ? void 0 : _message_collection.models;
    if (!messages) {
        return;
    }
    const idx = messages.indexOf(message);
    const prev_message = messages[idx - 1];
    if (!prev_message || dayjs(message.get('time')).isAfter(dayjs(prev_message.get('time')), 'day')) {
        const day_date = dayjs(message.get('time')).startOf('day');
        return (0,_templates_new_day_js__WEBPACK_IMPORTED_MODULE_4__["default"])({
            'type': 'date',
            'time': day_date.toISOString(),
            'datestring': day_date.format('dddd MMM Do YYYY')
        });
    }
}
/**
 * @param {MUCMessage} message
 */ function getHats(message) {
    if (message.get('type') === 'groupchat') {
        var _message_occupant;
        const allowed_hats = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('muc_hats').filter((hat)=>hat).map((hat)=>hat.toLowerCase());
        let vcard_roles = [];
        if (allowed_hats.includes('vcard_roles')) {
            vcard_roles = message.vcard ? message.vcard.get('role') : null;
            vcard_roles = vcard_roles ? vcard_roles.split(',').filter((hat)=>hat).map((hat)=>({
                    title: hat
                })) : [];
        }
        const muc_role = message.occupant ? [
            message.occupant.get('role')
        ] : [];
        const muc_affiliation = message.occupant ? [
            message.occupant.get('affiliation')
        ] : [];
        const affiliation_role_hats = [
            ...muc_role,
            ...muc_affiliation
        ].filter((hat)=>hat).filter((hat)=>allowed_hats.includes(hat.toLowerCase())).map((hat)=>({
                title: hat
            }));
        const hats = allowed_hats.includes('xep317') ? ((_message_occupant = message.occupant) === null || _message_occupant === void 0 ? void 0 : _message_occupant.get('hats')) || [] : [];
        return [
            ...hats,
            ...vcard_roles,
            ...affiliation_role_hats
        ];
    }
    return [];
}
function getTonedEmojis() {
    if (!_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.toned) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.toned = u.unique(Object.values(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.json.people).filter((person)=>person.sn.includes('_tone')).map((person)=>person.sn.replace(/_tone[1-5]/, '')));
    }
    return _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.toned;
}
/**
 * @typedef {object} EmojiMarkupOptions
 * @property {boolean} [unicode_only=false]
 * @property {boolean} [add_title_wrapper=false]
 *
 * @param {object} data
 * @param {EmojiMarkupOptions} options
 */ function getEmojiMarkup(data, options = {
    unicode_only: false,
    add_title_wrapper: false
}) {
    const emoji = data.emoji;
    const shortname = data.shortname;
    if (emoji) {
        if (options.unicode_only) {
            return emoji;
        } else if (_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('use_system_emojis')) {
            if (options.add_title_wrapper) {
                return shortname ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<span title="${shortname}">${emoji}</span>` : emoji;
            } else {
                return emoji;
            }
        } else {
            const path = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('emoji_image_path');
            return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<img class="emoji" loading="lazy" draggable="false" title="${shortname}" alt="${emoji}" src="${path}/72x72/${data.cp}.png">`;
        }
    } else if (options.unicode_only) {
        return shortname;
    } else {
        const { url } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.converse.emojis.by_sn[shortname];
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<img class="emoji" loading="lazy" draggable="false" title="${shortname}" alt="${shortname}" src="${url.startsWith('.') ? `${_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('assets_path')}/${url}` : url}">`;
    }
}
/**
 * @param {string} text
 * @param {object} options
 */ function addEmojisMarkup(text, options) {
    let list = [
        text
    ];
    [
        ...getShortnameReferences(text),
        ...getCodePointReferences(text)
    ].sort((a, b)=>b.begin - a.begin).forEach((ref)=>{
        const text = list.shift();
        const emoji = getEmojiMarkup(ref, options);
        if (typeof emoji === 'string') {
            list = [
                text.slice(0, ref.begin) + emoji + text.slice(ref.end),
                ...list
            ];
        } else {
            list = [
                text.slice(0, ref.begin),
                emoji,
                text.slice(ref.end),
                ...list
            ];
        }
    });
    return list;
}
/**
 * Returns an emoji represented by the passed in shortname.
 * Scans the passed in text for shortnames and replaces them with
 * emoji unicode glyphs or alternatively if it's a custom emoji
 * without unicode representation then a lit TemplateResult
 * which represents image tag markup is returned.
 *
 * The shortname needs to be defined in `emojis.json`
 * and needs to have either a `cp` attribute for the codepoint, or
 * an `url` attribute which points to the source for the image.
 *
 * @namespace u
 * @method u.shortnamesToEmojis
 * @param {String} str - String containg the shortname(s)
 * @param {Object} options
 * @param {Boolean} options.unicode_only - Whether emojis are rendered as
 *  unicode codepoints. If so, the returned result will be an array
 *  with containing one string, because the emojis themselves will
 *  also be strings. If set to false, emojis will be represented by
 *  lit TemplateResult objects.
 * @param {Boolean} options.add_title_wrapper - Whether unicode
 *  codepoints should be wrapped with a `<span>` element with a
 *  title, so that the shortname is shown upon hovering with the
 *  mouse.
 * @returns {Array} An array of at least one string, or otherwise
 * strings and lit TemplateResult objects.
 */ function shortnamesToEmojis(str, options = {
    unicode_only: false,
    add_title_wrapper: false
}) {
    str = convertASCII2Emoji(str);
    return addEmojisMarkup(str, options);
}
Object.assign(u, {
    shortnamesToEmojis
});


/***/ }),

/***/ "./src/shared/components/brand-heading.js":
/*!************************************************!*\
  !*** ./src/shared/components/brand-heading.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ConverseBrandHeading: () => (/* binding */ ConverseBrandHeading)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var _brand_logo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./brand-logo.js */ "./src/shared/components/brand-logo.js");




class ConverseBrandHeading extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-brand-logo></converse-brand-logo>`;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-brand-heading', ConverseBrandHeading);


/***/ }),

/***/ "./src/shared/components/brand-logo.js":
/*!*********************************************!*\
  !*** ./src/shared/components/brand-logo.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ConverseBrandLogo: () => (/* binding */ ConverseBrandLogo)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var shared_components_logo_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/components/logo.js */ "./src/shared/components/logo.js");




class ConverseBrandLogo extends _element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            hide_byline: {
                type: Boolean
            }
        };
    }
    render() {
        const is_fullscreen = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'fullscreen';
        return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<a class="brand-heading" href="https://conversejs.org" target="_blank" rel="noopener"><span class="brand-name-wrapper ${is_fullscreen ? 'brand-name-wrapper--fullscreen' : ''}"><converse-logo class="converse-svg-logo"></converse-logo><span class="brand-name"><span class="brand-name__text">converse<span class="subdued">.js</span></span> ${is_fullscreen && !this.hide_byline ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<p class="byline">messaging freedom</p>` : ''}</span></span></a>`;
    }
    constructor(){
        super();
        this.hide_byline = false;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-brand-logo', ConverseBrandLogo);


/***/ }),

/***/ "./src/shared/components/dropdown.js":
/*!*******************************************!*\
  !*** ./src/shared/components/dropdown.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Dropdown)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_dom_navigator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! shared/dom-navigator */ "./src/shared/dom-navigator/index.js");
/* harmony import */ var shared_components_dropdownbase_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! shared/components/dropdownbase.js */ "./src/shared/components/dropdownbase.js");
/* harmony import */ var shared_components_icons_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! shared/components/icons.js */ "./src/shared/components/icons.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _styles_dropdown_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./styles/dropdown.scss */ "./src/shared/components/styles/dropdown.scss");
/**
 * @typedef {module:dom-navigator.DOMNavigatorOptions} DOMNavigatorOptions
 */ function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_private_method_get(receiver, privateSet, fn) {
    if (!privateSet.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return fn;
}
function _class_private_method_init(obj, privateSet) {
    _check_private_redeclaration(obj, privateSet);
    privateSet.add(obj);
}








const { KEYCODES } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.constants;
var /**
     * @param {KeyboardEvent} ev
     */ _onKeyDown = /*#__PURE__*/ new WeakSet();
class Dropdown extends shared_components_dropdownbase_js__WEBPACK_IMPORTED_MODULE_4__["default"] {
    static get properties() {
        return {
            icon_classes: {
                type: String
            },
            items: {
                type: Array
            }
        };
    }
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button class="btn btn--transparent btn--standalone dropdown-toggle dropdown-toggle--no-caret" id="${this.id}" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="${(0,i18n__WEBPACK_IMPORTED_MODULE_6__.__)("Menu")}"><converse-icon aria-hidden="true" size="1em" class="${this.icon_classes}"></converse-icon></button><ul class="dropdown-menu" aria-labelledby="${this.id}">${this.items.map((b)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li>${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(b, "")}</li>`)}</ul>`;
    }
    firstUpdated() {
        super.firstUpdated();
        this.initArrowNavigation();
    }
    connectedCallback() {
        super.connectedCallback();
        this.registerEvents();
    }
    disconnectedCallback() {
        this.removeEventListener("keydown", this.onKeyDown);
        this.disableArrowNavigation();
        super.disconnectedCallback();
    }
    registerEvents() {
        this.onKeyDown = (ev)=>_class_private_method_get(this, _onKeyDown, onKeyDown).call(this, ev);
        this.addEventListener("hide.bs.dropdown", ()=>this.onDropdownHide());
        this.addEventListener("keydown", this.onKeyDown);
    }
    onDropdownHide() {
        this.disableArrowNavigation();
    }
    initArrowNavigation() {
        if (!this.navigator) {
            const options = /** @type DOMNavigatorOptions */ {
                selector: ".dropdown-menu li",
                onSelected: (el)=>el.focus()
            };
            this.navigator = new shared_dom_navigator__WEBPACK_IMPORTED_MODULE_3__.DOMNavigator(/** @type HTMLElement */ this.menu, options);
        }
    }
    disableArrowNavigation() {
        var _this_navigator;
        (_this_navigator = this.navigator) === null || _this_navigator === void 0 ? void 0 : _this_navigator.disable();
    }
    /**
     * @param {KeyboardEvent} [ev]
     */ enableArrowNavigation(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
        this.disableArrowNavigation();
        this.navigator.enable();
        this.navigator.select(/** @type HTMLElement */ this.menu.firstElementChild);
    }
    /**
     * @param {KeyboardEvent} ev
     */ onEnterPressed(ev) {
        var _this_navigator_selected_querySelector, _this_navigator_selected;
        ev.preventDefault();
        ev.stopPropagation();
        (_this_navigator_selected = this.navigator.selected) === null || _this_navigator_selected === void 0 ? void 0 : (_this_navigator_selected_querySelector = _this_navigator_selected.querySelector('a')) === null || _this_navigator_selected_querySelector === void 0 ? void 0 : _this_navigator_selected_querySelector.click();
        this.dropdown.hide();
    }
    constructor(){
        super(), _class_private_method_init(this, _onKeyDown);
        this.icon_classes = "fa fa-bars";
        this.items = [];
        this.id = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getUniqueId();
    }
}
function onKeyDown(ev) {
    if (!this.navigator || !_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.isVisible(this)) return;
    if (ev.key === KEYCODES.ENTER) {
        this.onEnterPressed(ev);
    } else if (ev.key === KEYCODES.DOWN_ARROW && !this.navigator.enabled) {
        this.enableArrowNavigation(ev);
    } else if (ev.key === KEYCODES.ESCAPE) {
        this.dropdown.hide();
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define("converse-dropdown", Dropdown);


/***/ }),

/***/ "./src/shared/components/dropdownbase.js":
/*!***********************************************!*\
  !*** ./src/shared/components/dropdownbase.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DropdownBase)
/* harmony export */ });
/* harmony import */ var bootstrap_js_src_dropdown_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bootstrap/js/src/dropdown.js */ "./node_modules/bootstrap/js/src/dropdown.js");
/* harmony import */ var bootstrap_js_src_dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap/js/src/dom/event-handler.js */ "./node_modules/bootstrap/js/src/dom/event-handler.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");



class DropdownBase extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    firstUpdated(changed) {
        super.firstUpdated(changed);
        this.menu = this.querySelector(".dropdown-menu");
        this.button = this.querySelector("button");
        this.dropdown = new bootstrap_js_src_dropdown_js__WEBPACK_IMPORTED_MODULE_0__["default"](/** @type {HTMLElement} */ this.button);
    }
}

const DATA_KEY = "bs.dropdown";
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = ".data-api";
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`;
bootstrap_js_src_dom_event_handler_js__WEBPACK_IMPORTED_MODULE_1__["default"].off(document, EVENT_KEYDOWN_DATA_API);


/***/ }),

/***/ "./src/shared/components/element.js":
/*!******************************************!*\
  !*** ./src/shared/components/element.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CustomElement: () => (/* binding */ CustomElement)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/skeletor */ "./node_modules/@converse/skeletor/dist/skeletor.js");
/* harmony import */ var _converse_skeletor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__);


class CustomElement extends (0,_converse_skeletor__WEBPACK_IMPORTED_MODULE_1__.EventEmitter)(lit__WEBPACK_IMPORTED_MODULE_0__.LitElement) {
    createRenderRoot() {
        // Render without the shadow DOM
        return this;
    }
    initialize() {
        return null;
    }
    connectedCallback() {
        super.connectedCallback();
        return this.initialize();
    }
    disconnectedCallback() {
        super.disconnectedCallback();
        this.stopListening();
    }
    constructor(){
        super();
    }
}


/***/ }),

/***/ "./src/shared/components/font-awesome.js":
/*!***********************************************!*\
  !*** ./src/shared/components/font-awesome.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FontAwesome: () => (/* binding */ FontAwesome)
/* harmony export */ });
/* harmony import */ var _templates_icons_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/icons.js */ "./src/shared/components/templates/icons.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");



class FontAwesome extends _element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    render() {
        return (0,_templates_icons_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-fontawesome', FontAwesome);


/***/ }),

/***/ "./src/shared/components/footer.js":
/*!*****************************************!*\
  !*** ./src/shared/components/footer.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ConverseFooter: () => (/* binding */ ConverseFooter)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");




class ConverseFooter extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    render() {
        const is_fullscreen = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('view_mode') === 'fullscreen';
        const theme = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get('theme');
        const is_dark_theme = [
            'dracula',
            'cyberpunk'
        ].includes(theme);
        const i18n_sponsors = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('A big thank you to our sponsors 🙏');
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`${is_fullscreen ? (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<footer class="footer mt-auto py-3 pb-3"><div class="container"><div class="row"><div class="col-12 text-center"><p class="brand-subtitle mb-2 subdued">Version: ${_converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.VERSION_NAME}</p><p class="brand-subtitle mb-4"><a target="_blank" rel="nofollow" href="https://github.com/conversejs/converse.js">Open Source</a> XMPP chat client brought to you by <a target="_blank" rel="nofollow" href="https://opkode.com/about">Opkode</a>.</p><div class="sponsors text-center"><p class="byline mb-1">${i18n_sponsors}</p><div class="fs-6 d-flex flex-wrap justify-content-center align-items-center gap-4 mb-2"><div><a href="https://bairesdev.com/sponsoring-open-source-projects/?utm_source=conversejs" target="_blank" rel="noopener"><img style="width:13em" src="https://conversejs.org/media/logos/bairesdev-primary.png" alt="BairesDev"></a></div><div><a href="https://blokt.com?utm_source=conversejs" target="_blank" rel="noopener"><img style="width:12em" src="${is_dark_theme ? 'https://conversejs.org/media/logos/blokt-invert.png' : 'https://conversejs.org/media/logos/blokt.png'}" alt="Blokt Crypto & Privacy"></a></div><div><a href="https://www.keycdn.com?utm_source=conversejs" target="_blank" rel="noopener"><img style="height:3em" src="https://conversejs.org/logo/keycdn.png" alt="KeyCDN"></a></div></div></div><p class="brand-subtitle mb-3">If you'd like to sponsor this project, please visit: <a href="https://github.com/sponsors/jcbrand" target="_blank" rel="noopener">Github</a>, <a href="https://www.patreon.com/jcbrand" target="_blank" rel="noopener">Patreon</a>, <a href="https://liberapay.com/jcbrand" target="_blank" rel="noopener">Liberapay</a> or <a href="https://opkode.com/contact.html" target="_blank" rel="noopener">contact us</a>.</p></div></div></div></footer>` : ''}`;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-footer', ConverseFooter);


/***/ }),

/***/ "./src/shared/components/icons.js":
/*!****************************************!*\
  !*** ./src/shared/components/icons.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var _styles_icon_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/icon.scss */ "./src/shared/components/styles/icon.scss");
/**
 * @copyright Alfredo Medrano Sánchez and the Converse.js contributors
 * @description
 *  Component inspired by the one from fa-icons
 *  https://github.com/obsidiansoft-io/fa-icons/blob/master/LICENSE
 * @license Mozilla Public License (MPLv2)
 */ 



class ConverseIcon extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            color: {
                type: String
            },
            class_name: {
                attribute: "class"
            },
            css: {
                type: String
            },
            size: {
                type: String
            }
        };
    }
    getSource() {
        return `#icon-${this.class_name.trim().split(" ")[1].replace("fa-", "")}`;
    }
    getStyles() {
        var _this_color_match;
        const cssprop = (_this_color_match = this.color.match(/var\((--.*)\)/)) === null || _this_color_match === void 0 ? void 0 : _this_color_match[1];
        const color = cssprop ? getComputedStyle(this).getPropertyValue(cssprop) : this.color;
        return `
            ${this.size ? `width: ${this.size};` : ''}
            ${this.size ? `height: ${this.size};` : ''}
            ${color ? `fill: ${color};` : ''}
            ${this.css}
        `;
    }
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<svg .style="${this.getStyles()}"><use href="${this.getSource()}"></use></svg>`;
    }
    constructor(){
        super();
        this.class_name = "";
        this.css = "";
        this.size = "";
        this.color = "";
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define("converse-icon", ConverseIcon);


/***/ }),

/***/ "./src/shared/components/image-picker.js":
/*!***********************************************!*\
  !*** ./src/shared/components/image-picker.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ImagePicker)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _styles_image_picker_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/image-picker.scss */ "./src/shared/components/styles/image-picker.scss");





const i18n_profile_picture = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Click to set a new picture');
const i18n_clear_picture = (0,i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Clear picture');
class ImagePicker extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            height: {
                type: Number
            },
            model: {
                type: Object
            },
            width: {
                type: Number
            }
        };
    }
    render() {
        var _this_model_vcard, _this_data, _this_model_vcard1, _this_model;
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="image-picker"><a class="change-avatar" @click="${this.openFileSelection}" title="${i18n_profile_picture}"><converse-avatar .model="${this.model}" .pickerdata="${this.data}" class="avatar" name="${this.model.getDisplayName()}" height="${this.height}" nonce="${this.nonce || ((_this_model_vcard = this.model.vcard) === null || _this_model_vcard === void 0 ? void 0 : _this_model_vcard.get('vcard_updated'))}" width="${this.width}"></converse-avatar></a>${((_this_data = this.data) === null || _this_data === void 0 ? void 0 : _this_data.data_uri) || ((_this_model = this.model) === null || _this_model === void 0 ? void 0 : (_this_model_vcard1 = _this_model.vcard) === null || _this_model_vcard1 === void 0 ? void 0 : _this_model_vcard1.get('image')) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button class="clear-image" @click="${this.clearImage}" title="${i18n_clear_picture}"><converse-icon class="fa fa-trash-alt" size="1.5em"></converse-icon></button>` : ''} <input @change="${this.updateFilePreview}" class="hidden" name="avatar_image" type="file"></div>`;
    }
    /**
     * Clears the selected image.
     * @param {Event} ev
     */ clearImage(ev) {
        ev.preventDefault();
        const input = /** @type {HTMLInputElement} */ this.querySelector('input[name="avatar_image');
        input.value = '';
        this.model.vcard.set({
            image: null,
            image_type: null
        });
        this.data = {
            data_uri: null,
            image_type: null
        };
        this.nonce = new Date().toISOString(); // Update nonce to trigger re-render
        this.requestUpdate();
    }
    /**
     * @param {Event} ev
     */ openFileSelection(ev) {
        ev.preventDefault();
        /** @type {HTMLInputElement} */ this.querySelector('input[type="file"]').click();
    }
    /**
     * @param {InputEvent} ev
     */ updateFilePreview(ev) {
        const file = /** @type {HTMLInputElement} */ ev.target.files[0];
        const reader = new FileReader();
        reader.onloadend = ()=>{
            this.data = {
                data_uri: reader.result,
                image_type: file.type
            };
            this.nonce = new Date().toISOString();
            this.requestUpdate();
        };
        reader.readAsDataURL(file);
    }
    constructor(){
        super();
        this.model = null;
        this.width = null;
        this.height = null;
        this.nonce = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-image-picker', ImagePicker);


/***/ }),

/***/ "./src/shared/components/index.js":
/*!****************************************!*\
  !*** ./src/shared/components/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _brand_heading_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./brand-heading.js */ "./src/shared/components/brand-heading.js");
/* harmony import */ var _brand_logo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./brand-logo.js */ "./src/shared/components/brand-logo.js");
/* harmony import */ var _dropdown_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dropdown.js */ "./src/shared/components/dropdown.js");
/* harmony import */ var _font_awesome_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./font-awesome.js */ "./src/shared/components/font-awesome.js");
/* harmony import */ var _icons_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./icons.js */ "./src/shared/components/icons.js");
/* harmony import */ var _image_picker_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./image-picker.js */ "./src/shared/components/image-picker.js");
/* harmony import */ var _list_filter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./list-filter.js */ "./src/shared/components/list-filter.js");
/* harmony import */ var _message_versions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./message-versions.js */ "./src/shared/components/message-versions.js");
/* harmony import */ var _observable_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./observable.js */ "./src/shared/components/observable.js");
/* harmony import */ var _spinner_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./spinner.js */ "./src/shared/components/spinner.js");
/* harmony import */ var _split_resize_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./split-resize.js */ "./src/shared/components/split-resize.js");













/***/ }),

/***/ "./src/shared/components/list-filter.js":
/*!**********************************************!*\
  !*** ./src/shared/components/list-filter.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ListFilter)
/* harmony export */ });
/* harmony import */ var lodash_es_debounce__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es/debounce */ "./node_modules/lodash-es/debounce.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_list_filter_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./styles/list-filter.scss */ "./src/shared/components/styles/list-filter.scss");




class ListFilter extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_0__.CustomElement {
    static get properties() {
        return {
            items: {
                type: Array
            },
            model: {
                type: Object
            },
            promise: {
                type: Promise
            },
            template: {
                type: Object
            }
        };
    }
    initialize() {
        this.liveFilter = (0,lodash_es_debounce__WEBPACK_IMPORTED_MODULE_3__["default"])((ev)=>this.model.save({
                'text': ev.target.value
            }), 250);
        this.listenTo(this.items, 'add', ()=>this.requestUpdate());
        this.listenTo(this.items, 'destroy', ()=>this.requestUpdate());
        this.listenTo(this.items, 'remove', ()=>this.requestUpdate());
        this.listenTo(this.model, 'change', ()=>{
            this.dispatchUpdateEvent();
            this.requestUpdate();
        });
        this.promise.then(()=>this.requestUpdate());
        this.requestUpdate();
    }
    render() {
        return this.shouldBeVisible() ? this.template(this) : '';
    }
    dispatchUpdateEvent() {
        this.dispatchEvent(new CustomEvent('update', {
            'detail': this.model.changed
        }));
    }
    /**
     * @param {Event} ev
     */ changeChatStateFilter(ev) {
        ev && ev.preventDefault();
        const state = /** @type {HTMLInputElement} */ this.querySelector('.state-type').value;
        this.model.save({
            state
        });
    }
    /**
     * @param {Event} ev
     */ changeTypeFilter(ev) {
        var /** @type {HTMLElement} */ _target_closest;
        ev && ev.preventDefault();
        const target = /** @type {HTMLInputElement} */ ev.target;
        const type = ((_target_closest = target.closest('converse-icon')) === null || _target_closest === void 0 ? void 0 : _target_closest.dataset.type) || 'items';
        if (type === 'state') {
            const state = /** @type {HTMLInputElement} */ this.querySelector('.state-type').value;
            this.model.save({
                type,
                state
            });
        } else {
            const text = /** @type {HTMLInputElement} */ this.querySelector('.items-filter').value;
            this.model.save({
                type,
                text
            });
        }
    }
    /**
     * @param {Event} ev
     */ submitFilter(ev) {
        ev === null || ev === void 0 ? void 0 : ev.preventDefault();
        this.liveFilter();
    }
    /**
     * Returns true if the filter is enabled (i.e. if the user
     * has added values to the filter).
     * @returns {boolean}
     */ isActive() {
        return this.model.get('type') === 'state' || this.model.get('text');
    }
    /**
     * @returns {boolean}
     */ shouldBeVisible() {
        var _this_items;
        return ((_this_items = this.items) === null || _this_items === void 0 ? void 0 : _this_items.length) >= 5 || this.isActive();
    }
    /**
     * @param {Event} ev
     */ clearFilter(ev) {
        ev && ev.preventDefault();
        this.model.save({
            'text': ''
        });
    }
    constructor(){
        super();
        this.items = null;
        this.model = null;
        this.template = null;
        this.promise = Promise.resolve();
    }
}
/**
 * A component that exposes a text input to enable filtering of a list of DOM items.
 */ 
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-list-filter', ListFilter);


/***/ }),

/***/ "./src/shared/components/logo.js":
/*!***************************************!*\
  !*** ./src/shared/components/logo.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");



class ConverseLogo extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    render() {
        const view_mode = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.settings.get('view_mode');
        return view_mode === 'overlayed' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<svg class="converse-svg-logo" version="1.1" viewBox="0 0 364 364" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><title>Converse Logo</title><g class="cls-1" id="g904"><g data-name="Layer 2"><g data-name="Layer 7"><path class="cls-3" d="M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z"/><path class="cls-4" d="M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z"/></g></g></g></svg>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<svg class="converse-svg-logo" version="1.1" viewBox="0 0 364 364" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><title>Converse Logo</title><defs><linearGradient id="gradient" x1="92.14" y1="27.64" x2="267.65" y2="331.62" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff1d1"/><stop offset="0.05" stop-color="#fae8c1"/><stop offset="0.15" stop-color="#f0d5a1"/><stop offset="0.27" stop-color="#e7c687"/><stop offset="0.4" stop-color="#e1bb72"/><stop offset="0.54" stop-color="#dcb264"/><stop offset="0.71" stop-color="#daad5c"/><stop offset="1" stop-color="#d9ac59"/></linearGradient><filter id="shadow"><feGaussianBlur in="SourceAlpha" stdDeviation="2.3" result="blur1"/><feOffset in="blur1" dx="3" dy="3" result="blur2"/><feColorMatrix in="blur2" type="matrix" result="blur3" values="1 0 0 0 0.1                            0 1 0 0 0.1                            0 0 1 0 0.1                            0 0 0 1 0"/><feMerge><feMergeNode in="blur3"/><feMergeNode in="SourceGraphic"/></feMerge></filter></defs><g filter="url(#shadow)"><path d="M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z" fill="#d9ac59"/><path d="M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z" fill="url(#gradient)"/></g></svg>`;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-logo', ConverseLogo);


/***/ }),

/***/ "./src/shared/components/message-versions.js":
/*!***************************************************!*\
  !*** ./src/shared/components/message-versions.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MessageVersions: () => (/* binding */ MessageVersions)
/* harmony export */ });
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var i18n_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n/index.js */ "./src/i18n/index.js");
/* harmony import */ var _styles_message_versions_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles/message-versions.scss */ "./src/shared/components/styles/message-versions.scss");





const { dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse.env;
const tplOlderVersion = (k, older_versions)=>(0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<p class="older-msg"><time>${dayjs(k).format('MMM D, YYYY, HH:mm:ss')}</time>: ${older_versions[k]}</p>`;
class MessageVersions extends _element_js__WEBPACK_IMPORTED_MODULE_0__.CustomElement {
    static get properties() {
        return {
            model: {
                type: Object
            }
        };
    }
    render() {
        const older_versions = this.model.get('older_versions');
        const keys = Object.keys(older_versions);
        return (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`${keys.length ? (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<h4>${(0,i18n_index_js__WEBPACK_IMPORTED_MODULE_3__.__)('Older versions')}</h4>${keys.map((k)=>tplOlderVersion(k, older_versions))}` : (0,lit__WEBPACK_IMPORTED_MODULE_2__.html)`<h4>${(0,i18n_index_js__WEBPACK_IMPORTED_MODULE_3__.__)('No older versions found')}</h4>`}<hr><h4>${(0,i18n_index_js__WEBPACK_IMPORTED_MODULE_3__.__)('Current version')}</h4><p><time>${dayjs(this.model.get('time')).format('MMM D, YYYY, HH:mm:ss')}</time>: ${this.model.getMessageText()}</p>`;
    }
    constructor(){
        super();
        this.model = null;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-message-versions', MessageVersions);


/***/ }),

/***/ "./src/shared/components/observable.js":
/*!*********************************************!*\
  !*** ./src/shared/components/observable.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ObservableElement: () => (/* binding */ ObservableElement)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./src/shared/components/element.js");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}


/**
 * An element which triggers a global `visibilityChanged` event when
 * it becomes visible in the viewport. The `observable` property needs to be set.
 */ class ObservableElement extends _element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return _object_spread_props(_object_spread({}, super.properties), {
            observable: {
                type: String
            },
            intersectionRatio: {
                type: Number
            }
        });
    }
    /**
     * @param {import("lit").PropertyValues} changedProperties
     */ firstUpdated(changedProperties) {
        super.firstUpdated(changedProperties);
        this.initIntersectionObserver();
    }
    disconnectedCallback() {
        var _this_intersectionObserver;
        super.disconnectedCallback();
        (_this_intersectionObserver = this.intersectionObserver) === null || _this_intersectionObserver === void 0 ? void 0 : _this_intersectionObserver.disconnect();
    }
    initIntersectionObserver() {
        if (this.observable && !this.isVisible) {
            this.intersectionObserver = new IntersectionObserver((entries)=>this.handleIntersectionCallback(entries), {
                rootMargin: this.observableMargin,
                threshold: this.observableThresholds,
                // @ts-ignore
                delay: this.observableDelay
            });
            this.intersectionObserver.observe(this);
        }
    }
    alreadyHandled() {
        return this.observable === "once" && this.isVisible;
    }
    /**
     * @param {IntersectionObserverEntry[]} entries
     */ handleIntersectionCallback(entries) {
        if (this.alreadyHandled()) return;
        for (const entry of entries){
            const ratio = Number(entry.intersectionRatio.toFixed(2));
            if (ratio >= this.intersectionRatio && !this.alreadyHandled()) {
                if (this.observable === "once") {
                    this.intersectionObserver.disconnect();
                }
                this.isVisible = true;
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger("visibilityChanged", {
                    el: this,
                    entry
                });
                this.onVisibilityChanged(entry);
            }
        }
    }
    /**
     * @param {IntersectionObserverEntry} _entry
     */ onVisibilityChanged(_entry) {
    // override this method in your subclass
    }
    constructor(){
        super();
        this.model = null;
        /**
         * The observable property determines the observability of this element.
         * - 'once': an event will be triggered once when the element becomes visible.
         * - 'always': an event is triggered every time (the IntersectionObserver callback is called).
         * @type {import('./types').ObservableProperty}
         */ this.observable = null;
        this.isVisible = false;
        this.observableThresholds = [
            0.0,
            0.25,
            0.5,
            0.75,
            1.0
        ]; // thresholds to check for, every 25%
        this.observableMargin = "0px"; // margin from root element
        this.intersectionRatio = 0.5; // wait till at least 50% of the item is visible
        this.observableDelay = 100;
    }
}


/***/ }),

/***/ "./src/shared/components/spinner.js":
/*!******************************************!*\
  !*** ./src/shared/components/spinner.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Spinner)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var templates_spinner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! templates/spinner.js */ "./src/templates/spinner.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");



class Spinner extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    render() {
        return (0,templates_spinner_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-spinner', Spinner);


/***/ }),

/***/ "./src/shared/components/split-resize.js":
/*!***********************************************!*\
  !*** ./src/shared/components/split-resize.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SplitResize)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element.js */ "./src/shared/components/element.js");
/* harmony import */ var _styles_split_resize_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./styles/split-resize.scss */ "./src/shared/components/styles/split-resize.scss");
/**
 * @copyright Nathan Cahill and the Converse.js contributors
 * @description Based on the split.js library from Nathan Cahill.
 * @license MIT Licence
 */ 



const gutterStartDragging = '_a';
const aGutterSize = '_b';
const bGutterSize = '_c';
const HORIZONTAL = 'horizontal';
const NOOP = ()=>false;
const global = typeof window !== 'undefined' ? window : null;
class SplitResize extends _element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    initialize() {
        super.initialize();
    }
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="gutter gutter-horizontal"></div>`;
    }
    disconnectedCallback() {
        super.disconnectedCallback();
        this.pair.gutter.removeEventListener('mousedown', this.pair[gutterStartDragging]);
        this.pair.gutter.removeEventListener('touchstart', this.pair[gutterStartDragging]);
    }
    /**
     * @param {Map<string, any>} changed
     */ updated(changed) {
        super.updated(changed);
        if (!this.pair) {
            this.setupSplit([
                /** @type {HTMLElement} */ this.previousElementSibling,
                /** @type {HTMLElement} */ this.nextElementSibling
            ]);
        }
    }
    /**
     * Helper function gets a property from the properties object, with a default fallback
     */ getOption(options, propName, def) {
        const value = options[propName];
        if (value !== undefined) {
            return value;
        }
        return def;
    }
    getElementStyle(dim, size, gutSize) {
        const style = {};
        if (!_converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.isString(size)) {
            style[dim] = `calc(${size}% - ${gutSize}px)`;
        } else {
            style[dim] = size;
        }
        return style;
    }
    defaultGutterStyleFn(dim, gutSize) {
        return {
            [dim]: `${gutSize}px`
        };
    }
    getGutterSize(gutterSize, isFirst, isLast, gutterAlign) {
        if (isFirst) {
            if (gutterAlign === 'end') {
                return 0;
            }
            if (gutterAlign === 'center') {
                return gutterSize / 2;
            }
        } else if (isLast) {
            if (gutterAlign === 'start') {
                return 0;
            }
            if (gutterAlign === 'center') {
                return gutterSize / 2;
            }
        }
        return gutterSize;
    }
    /**
     * @param {HTMLElement} el
     * @param {string} size
     * @param {string} gutSize
     */ setElementSize(el, size, gutSize) {
        // Allows setting sizes via numbers (ideally), or if you must,
        // by string, like '300px'. This is less than ideal, because it breaks
        // the fluid layout that `calc(% - px)` provides. You're on your own if you do that,
        // make sure you calculate the gutter size by hand.
        const style = this.getElementStyle(this.dimension, size, gutSize);
        Object.keys(style).forEach((prop)=>{
            // eslint-disable-next-line no-param-reassign
            el.style[prop] = style[prop];
        });
    }
    getSizes() {
        return this.elements.map((element)=>element.size);
    }
    /**
     * Supports touch events, but not multitouch, so only the first
     * finger `touches[0]` is counted.
     * @param {MouseEvent} e
     */ getMousePosition(e) {
        if ('touches' in e) return e.touches[0][this.clientAxis];
        return e[this.clientAxis];
    }
    /**
     * Actually adjust the size of elements `a` and `b` to `offset` while dragging.
     * calc is used to allow calc(percentage + gutterpx) on the whole split instance,
     * which allows the viewport to be resized without additional logic.
     * Element a's size is the same as offset. b's size is total size - a size.
     * Both sizes are calculated from the initial parent percentage,
     * then the gutter size is subtracted.
     *
     * @param {number} offset
     */ adjust(offset) {
        const a = this.elements[this.pair.a];
        const b = this.elements[this.pair.b];
        const percentage = a.size + b.size;
        a.size = offset / this.pair.size * percentage;
        b.size = percentage - offset / this.pair.size * percentage;
        this.setElementSize(a.element, a.size, this.pair[aGutterSize]);
        this.setElementSize(b.element, b.size, this.pair[bGutterSize]);
    }
    /**
     * Handles the dragging logic for resizing elements.
     *
     * The logic is quite simple:
     *
     * 1. Ignore if the pair is not dragging.
     * 2. Get the offset of the event.
     * 3. Snap offset to min if within snappable range (within min + snapOffset).
     * 4. Actually adjust each element in the pair to offset.
     *
     * ---------------------------------------------------------------------
     * |    | <- a.minSize               ||              b.minSize -> |    |
     * |    |  | <- this.snapOffset      ||     this.snapOffset -> |  |    |
     * |    |  |                         ||                        |  |    |
     * |    |  |                         ||                        |  |    |
     * ---------------------------------------------------------------------
     * | <- this.start                                        this.size -> |
     *
     * @param {MouseEvent} e
     * @param {object} options
     */ drag(e, options) {
        let offset;
        const a = this.elements[this.pair.a];
        const b = this.elements[this.pair.b];
        if (!this.pair.dragging) return;
        // Get the offset of the event from the first side of the
        // pair `pair.start`. Then offset by the initial position of the
        // mouse compared to the gutter size.
        offset = this.getMousePosition(e) - this.pair.start + (this.pair[aGutterSize] - this.pair.dragOffset);
        if (this.dragInterval > 1) {
            offset = Math.round(offset / this.dragInterval) * this.dragInterval;
        }
        // If within snapOffset of min or max, set offset to min or max.
        // snapOffset buffers a.minSize and b.minSize, so logic is opposite for both.
        // Include the appropriate gutter sizes to prevent overflows.
        if (offset <= a.minSize + a.snapOffset + this.pair[aGutterSize]) {
            offset = a.minSize + this.pair[aGutterSize];
        } else if (offset >= this.pair.size - (b.minSize + b.snapOffset + this.pair[bGutterSize])) {
            offset = this.pair.size - (b.minSize + this.pair[bGutterSize]);
        }
        if (offset >= a.maxSize - a.snapOffset + this.pair[aGutterSize]) {
            offset = a.maxSize + this.pair[aGutterSize];
        } else if (offset <= this.pair.size - (b.maxSize - b.snapOffset + this.pair[bGutterSize])) {
            offset = this.pair.size - (b.maxSize + this.pair[bGutterSize]);
        }
        // Actually adjust the size.
        this.adjust(offset);
        // Call the drag callback continously. Don't do anything too intensive
        // in pair callback.
        this.getOption(options, 'onDrag', NOOP)(this.getSizes());
    }
    /**
     * Cache some important sizes when drag starts, so we don't have to do that
     * continuously:
     *
     * `size`: The total size of the pair. First + second + first gutter + second gutter.
     * `start`: The leading side of the first element.
     *
     * ------------------------------------------------
     * |      aGutterSize -> |||                      |
     * |                     |||                      |
     * |                     |||                      |
     * |                     ||| <- bGutterSize       |
     * ------------------------------------------------
     * | <- start                             size -> |
     *
     * @param {ResizablePair} pair
     */ calculateSizes(pair) {
        // Figure out the parent size minus padding.
        const a = this.elements[pair.a].element;
        const b = this.elements[pair.b].element;
        const aBounds = a.getBoundingClientRect();
        const bBounds = b.getBoundingClientRect();
        pair.size = aBounds[this.dimension] + bBounds[this.dimension] + pair[aGutterSize] + pair[bGutterSize];
        pair.start = aBounds[this.position];
        pair.end = aBounds[this.positionEnd];
    }
    /**
     * @param {HTMLElement} el
     */ innerSize(el) {
        // Return nothing if getComputedStyle is not supported (< IE9)
        // Or if parent el has no layout yet
        if (!getComputedStyle) return null;
        const computedStyle = getComputedStyle(el);
        if (!computedStyle) return null;
        let size = el[this.clientSize];
        if (size === 0) return null;
        if (this.direction === HORIZONTAL) {
            size -= parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);
        } else {
            size -= parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);
        }
        return size;
    }
    /**
     * When specifying percentage sizes that are less than the computed
     * size of the element minus the gutter, the lesser percentages must be increased
     * (and decreased from the other elements) to make space for the pixels
     * subtracted by the gutters.
     */ trimToMin(sizesToTrim) {
        // Try to get inner size of parent element.
        // If it's no supported, return original sizes.
        const parentSize = this.innerSize(this.parent);
        if (parentSize === null) {
            return sizesToTrim;
        }
        if (this.minSizes.reduce((a, b)=>a + b, 0) > parentSize) {
            return sizesToTrim;
        }
        // Keep track of the excess pixels, the amount of pixels over the desired percentage
        // Also keep track of the elements with pixels to spare, to decrease after if needed
        let excessPixels = 0;
        const toSpare = [];
        const pixelSizes = sizesToTrim.map((size, i)=>{
            // Convert requested percentages to pixel sizes
            const pixelSize = parentSize * size / 100;
            const elementGutterSize = this.getGutterSize(this.gutterSize, i === 0, i === sizesToTrim.length - 1, this.gutterAlign);
            const elementMinSize = this.minSizes[i] + elementGutterSize;
            // If element is too smal, increase excess pixels by the difference
            // and mark that it has no pixels to spare
            if (pixelSize < elementMinSize) {
                excessPixels += elementMinSize - pixelSize;
                toSpare.push(0);
                return elementMinSize;
            }
            // Otherwise, mark the pixels it has to spare and return it's original size
            toSpare.push(pixelSize - elementMinSize);
            return pixelSize;
        });
        // If nothing was adjusted, return the original sizes
        if (excessPixels === 0) {
            return sizesToTrim;
        }
        return pixelSizes.map((pixelSize, i)=>{
            let newPixelSize = pixelSize;
            // While there's still pixels to take, and there's enough pixels to spare,
            // take as many as possible up to the total excess pixels
            if (excessPixels > 0 && toSpare[i] - excessPixels > 0) {
                const takenPixels = Math.min(excessPixels, toSpare[i] - excessPixels);
                // Subtract the amount taken for the next iteration
                excessPixels -= takenPixels;
                newPixelSize = pixelSize - takenPixels;
            }
            // Return the pixel size adjusted as a percentage
            return newPixelSize / parentSize * 100;
        });
    }
    /**
     * stopDragging is very similar to startDragging in reverse.
     * @param {Object} options
     */ stopDragging(options) {
        const a = this.elements[this.pair.a].element;
        const b = this.elements[this.pair.b].element;
        if (this.pair.dragging) {
            this.getOption(options, 'onDragEnd', NOOP)(this.getSizes());
        }
        this.pair.dragging = false;
        // Remove the stored event listeners. This is why we store them.
        global.removeEventListener('mouseup', this.pair.stop);
        global.removeEventListener('touchend', this.pair.stop);
        global.removeEventListener('touchcancel', this.pair.stop);
        global.removeEventListener('mousemove', this.pair.move);
        global.removeEventListener('touchmove', this.pair.move);
        // Clear bound function references
        this.pair.stop = null;
        this.pair.move = null;
        a.removeEventListener('selectstart', NOOP);
        a.removeEventListener('dragstart', NOOP);
        b.removeEventListener('selectstart', NOOP);
        b.removeEventListener('dragstart', NOOP);
        a.style.userSelect = '';
        a.style.pointerEvents = '';
        b.style.userSelect = '';
        b.style.pointerEvents = '';
        this.pair.gutter.style.cursor = '';
        this.pair.parent.style.cursor = '';
        document.body.style.cursor = '';
    }
    /**
     * startDragging calls `calculateSizes` to store the initial size in the pair object.
     * It also adds event listeners for mouse/touch events,
     * and prevents selection while dragging to avoid selecting text.
     * @param {MouseEvent} e
     * @param {Object} options
     */ startDragging(e, options) {
        // Right-clicking can't start dragging.
        if ('button' in e && e.button !== 0) {
            return;
        }
        // Alias frequently used variables to save space. 200 bytes.
        const a = this.elements[this.pair.a].element;
        const b = this.elements[this.pair.b].element;
        // Call the onDragStart callback.
        if (!this.pair.dragging) {
            this.getOption(options, 'onDragStart', NOOP)(this.getSizes());
        }
        // Don't actually drag the element. We emulate this in the drag function.
        e.preventDefault();
        // Set the dragging property of the this.pair object.
        this.pair.dragging = true;
        // Create two event listeners bound to the same this.pair object and store
        // them in the this.pair object.
        this.pair.stop = ()=>this.stopDragging(options);
        this.pair.move = /** @param {MouseEvent} e */ (e)=>this.drag(e, options);
        // All the binding. `window` gets the stop events in case we drag out of the elements.
        global.addEventListener('mouseup', this.pair.stop);
        global.addEventListener('touchend', this.pair.stop);
        global.addEventListener('touchcancel', this.pair.stop);
        global.addEventListener('mousemove', this.pair.move);
        global.addEventListener('touchmove', this.pair.move);
        // Disable selection. Disable!
        a.addEventListener('selectstart', NOOP);
        a.addEventListener('dragstart', NOOP);
        b.addEventListener('selectstart', NOOP);
        b.addEventListener('dragstart', NOOP);
        a.style.userSelect = 'none';
        a.style.pointerEvents = 'none';
        b.style.userSelect = 'none';
        b.style.pointerEvents = 'none';
        // Set the cursor at multiple levels
        this.pair.gutter.style.cursor = this.cursor;
        this.pair.parent.style.cursor = this.cursor;
        document.body.style.cursor = this.cursor;
        // Cache the initial sizes of the this.pair.
        this.calculateSizes(this.pair);
        // Determine the position of the mouse compared to the gutter
        this.pair.dragOffset = this.getMousePosition(e) - this.pair.end;
    }
    /**
     * @param {Object} element
     */ adjustToMin(element) {
        this.calculateSizes(this.pair);
        this.adjust(this.pair.size - element.minSize - this.pair[bGutterSize]);
    }
    /**
     * @param {Array<number>} newSizes
     */ setSizes(newSizes) {
        const trimmed = this.trimToMin(newSizes);
        trimmed.forEach((newSize, i)=>{
            if (i > 0) {
                const a = this.elements[this.pair.a];
                const b = this.elements[this.pair.b];
                a.size = trimmed[i - 1];
                b.size = newSize;
                this.setElementSize(a.element, a.size, this.pair[aGutterSize]);
                this.setElementSize(b.element, b.size, this.pair[bGutterSize]);
            }
        });
    }
    /**
     * The main function to initialize a split.
     *
     * Each pair of elements, resizable relative to one another, is handled independently.
     * Dragging the gutter between two elements only changes the dimensions of elements in that pair.
     *
     * A pair object is shaped like this:
     *
     * @typedef {Object} ResizablePair
     * @property {(0|1)} a
     * @property {(0|1)} b
     * @property {('horizontal'|'vertical')} direction
     * @property {boolean} dragging
     * @property {number} aMin
     * @property {number} bMin
     * @property {number} dragOffset
     * @property {number} size
     * @property {number} start
     * @property {number} end
     * @property {HTMLElement} gutter
     * @property {HTMLElement} parent
     * @property {(this: Window, ev: Event) => any} stop
     * @property {(this: Window, ev: Event) => any} move
     *
     * The basic sequence:
     *
     * 1. Set defaults to something sane. `options` doesn't have to be passed at all.
     * 2. Initialize a bunch of strings based on the direction we're splitting.
     *    A lot of the behavior in the rest of the library is parameterized down to
     *    rely on CSS strings and classes.
     * 3. Define the dragging helper functions, and a few helpers to go with them.
     * 4. Loop through the elements while pairing them off. Every pair gets an
     *    `pair` object and a gutter.
     * 5. Actually size the pair elements, insert gutters and attach event listeners.
     *
     * @param {HTMLElement[]} els
     */ setupSplit(els, options = {}) {
        // Allow HTMLCollection to be used as an argument
        els = Array.from(els);
        // All DOM elements in the split should have a common parent. We can grab
        // the first elements parent and hope users read the docs because the
        // behavior will be whacky otherwise.
        const firstElement = els[0];
        this.parent = firstElement.parentElement;
        // Standardize minSize and maxSize to an array if it isn't already.
        // This allows minSize and maxSize to be passed as a number.
        const minSize = this.getOption(options, 'minSize', 100);
        this.minSizes = Array.isArray(minSize) ? minSize : els.map(()=>minSize);
        // Get other options
        const expandToMin = this.getOption(options, 'expandToMin', false);
        this.gutterSize = this.getOption(options, 'gutterSize', 5);
        this.gutterAlign = this.getOption(options, 'gutterAlign', 'center');
        this.dragInterval = this.getOption(options, 'dragInterval', 1);
        this.direction = this.getOption(options, 'direction', HORIZONTAL);
        this.cursor = this.getOption(options, 'cursor', this.direction === HORIZONTAL ? 'col-resize' : 'row-resize');
        // 2. Initialize a bunch of strings based on the direction we're splitting.
        // A lot of the behavior in the rest of the library is paramatized down to
        // rely on CSS strings and classes.
        if (this.direction === HORIZONTAL) {
            this.dimension = 'width';
            this.clientAxis = 'clientX';
            this.position = 'left';
            this.positionEnd = 'right';
            this.clientSize = 'clientWidth';
        } else if (this.direction === 'vertical') {
            this.dimension = 'height';
            this.clientAxis = 'clientY';
            this.position = 'top';
            this.positionEnd = 'bottom';
            this.clientSize = 'clientHeight';
        }
        // Create pair and element objects. Each pair has an index reference to
        // elements `a` and `b` of the pair (first and second elements).
        // Loop through the elements while pairing them off. Every pair gets a
        // `pair` object and a gutter.
        //
        // Basic logic:
        //
        // - Starting with the second element `i > 0`, create `pair` objects with
        //   `a = i - 1` and `b = i`
        // - Set gutter sizes based on the _pair_ being first/last. The first and last
        //   pair have gutterSize / 2, since they only have one half gutter, and not two.
        // - Create gutter elements and add event listeners.
        // - Set the size of the elements, minus the gutter sizes.
        //
        // -----------------------------------------------------------------------
        // |     i=0     |         i=1         |        i=2       |      i=3     |
        // |             |                     |                  |              |
        // |           pair 0                pair 1             pair 2           |
        // |             |                     |                  |              |
        // -----------------------------------------------------------------------
        this.elements = els.map((el, i)=>this.createElement(els, el, i, options));
        this.elements.forEach((element)=>{
            const computedSize = element.element.getBoundingClientRect()[this.dimension];
            if (computedSize < element.minSize) {
                if (expandToMin) {
                    this.adjustToMin(element);
                } else {
                    element.minSize = computedSize;
                }
            }
        });
        this.createPair(options);
    }
    /**
     * @param {HTMLElement[]} els
     * @param {HTMLElement} el
     * @param {number} i
     * @param {object} options
     */ createElement(els, el, i, options) {
        // Set default options.sizes to equal percentages of the parent element.
        let sizes = this.getOption(options, 'sizes') || els.map(()=>100 / els.length);
        // adjust sizes to ensure percentage is within min size and gutter.
        sizes = this.trimToMin(sizes);
        const maxSize = this.getOption(options, 'maxSize', Infinity);
        const maxSizes = Array.isArray(maxSize) ? maxSize : els.map(()=>maxSize);
        const snapOffset = this.getOption(options, 'snapOffset', 30);
        const snapOffsets = Array.isArray(snapOffset) ? snapOffset : els.map(()=>snapOffset);
        return {
            element: el,
            size: sizes[i],
            minSize: this.minSizes[i],
            maxSize: maxSizes[i],
            snapOffset: snapOffsets[i],
            i
        };
    }
    /**
     * @param {object} options
     */ createPair(options) {
        const parentStyle = getComputedStyle ? getComputedStyle(this.parent) : null;
        const parentFlexDirection = parentStyle ? parentStyle.flexDirection : null;
        // Create the pair object with its metadata.
        this.pair = /** @type {ResizablePair} */ {
            a: 0,
            b: 1,
            dragging: false,
            direction: this.direction,
            parent: this.parent
        };
        this.pair[aGutterSize] = this.getGutterSize(this.gutterSize, true, false, this.gutterAlign);
        this.pair[bGutterSize] = this.getGutterSize(this.gutterSize, false, true, this.gutterAlign);
        // if the parent has a reverse flex-direction, switch the pair elements.
        if (parentFlexDirection === 'row-reverse' || parentFlexDirection === 'column-reverse') {
            const temp = this.pair.a;
            this.pair.a = this.pair.b;
            this.pair.b = temp;
        }
        const gutterElement = /** @type {HTMLElement} */ this.firstElementChild;
        // Save bound event listener for removal later
        this.pair[gutterStartDragging] = (e)=>this.startDragging(e, options);
        // Attach bound event listener
        this.addEventListener('mousedown', this.pair[gutterStartDragging]);
        this.addEventListener('touchstart', this.pair[gutterStartDragging]);
        this.pair.gutter = gutterElement;
    }
    constructor(){
        super();
        this.pair = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define('converse-split-resize', SplitResize);


/***/ }),

/***/ "./src/shared/components/styles/dropdown.scss":
/*!****************************************************!*\
  !*** ./src/shared/components/styles/dropdown.scss ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_dropdown_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./dropdown.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/dropdown.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_dropdown_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_dropdown_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_dropdown_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_dropdown_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/components/styles/icon.scss":
/*!************************************************!*\
  !*** ./src/shared/components/styles/icon.scss ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_icon_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./icon.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/icon.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_icon_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_icon_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_icon_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_icon_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/components/styles/image-picker.scss":
/*!********************************************************!*\
  !*** ./src/shared/components/styles/image-picker.scss ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_picker_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./image-picker.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/image-picker.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_picker_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_picker_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_picker_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_picker_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/components/styles/list-filter.scss":
/*!*******************************************************!*\
  !*** ./src/shared/components/styles/list-filter.scss ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_list_filter_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./list-filter.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/list-filter.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_list_filter_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_list_filter_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_list_filter_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_list_filter_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/components/styles/message-versions.scss":
/*!************************************************************!*\
  !*** ./src/shared/components/styles/message-versions.scss ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_versions_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./message-versions.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/message-versions.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_versions_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_versions_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_versions_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_message_versions_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/components/styles/split-resize.scss":
/*!********************************************************!*\
  !*** ./src/shared/components/styles/split-resize.scss ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_split_resize_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./split-resize.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/components/styles/split-resize.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_split_resize_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_split_resize_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_split_resize_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_split_resize_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/components/templates/icons.js":
/*!**************************************************!*\
  !*** ./src/shared/components/templates/icons.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (()=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol id="icon-filter" viewBox="0 0 512 512"><path d="M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"/></symbol><symbol id="icon-address-book" viewBox="0 0 448 512"><path d="M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-228-32c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H118.4C106 384 96 375.4 96 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z"></path></symbol><symbol id="icon-angle-double-down" viewBox="0 0 320 512"><path d="M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"></path></symbol><symbol id="icon-angle-double-left" viewBox="0 0 448 512"><path d="M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"></path></symbol><symbol id="icon-angle-double-right" viewBox="0 0 448 512"><path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"></path></symbol><symbol id="icon-angle-double-up" viewBox="0 0 320 512"><path d="M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z"></path></symbol><symbol id="icon-angle-down" viewBox="0 0 320 512"><path d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"></path></symbol><symbol id="icon-angle-left" viewBox="0 0 256 512"><path d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"></path></symbol><symbol id="icon-angle-right" viewBox="0 0 256 512"><path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"></path></symbol><symbol id="icon-angle-up" viewBox="0 0 320 512"><path d="M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"></path></symbol><symbol id="icon-arrow-alt-circle-down" viewBox="0 0 512 512"><path d="M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zM212 140v116h-70.9c-10.7 0-16.1 13-8.5 20.5l114.9 114.3c4.7 4.7 12.2 4.7 16.9 0l114.9-114.3c7.6-7.6 2.2-20.5-8.5-20.5H300V140c0-6.6-5.4-12-12-12h-64c-6.6 0-12 5.4-12 12z"></path></symbol><symbol id="icon-arrow-alt-circle-left" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm116-292H256v-70.9c0-10.7-13-16.1-20.5-8.5L121.2 247.5c-4.7 4.7-4.7 12.2 0 16.9l114.3 114.9c7.6 7.6 20.5 2.2 20.5-8.5V300h116c6.6 0 12-5.4 12-12v-64c0-6.6-5.4-12-12-12z"></path></symbol><symbol id="icon-arrow-alt-circle-right" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zM140 300h116v70.9c0 10.7 13 16.1 20.5 8.5l114.3-114.9c4.7-4.7 4.7-12.2 0-16.9l-114.3-115c-7.6-7.6-20.5-2.2-20.5 8.5V212H140c-6.6 0-12 5.4-12 12v64c0 6.6 5.4 12 12 12z"></path></symbol><symbol id="icon-arrow-alt-circle-up" viewBox="0 0 512 512"><path d="M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm292 116V256h70.9c10.7 0 16.1-13 8.5-20.5L264.5 121.2c-4.7-4.7-12.2-4.7-16.9 0l-115 114.3c-7.6 7.6-2.2 20.5 8.5 20.5H212v116c0 6.6 5.4 12 12 12h64c6.6 0 12-5.4 12-12z"></path></symbol><symbol id="icon-arrow-circle-down" viewBox="0 0 512 512"><path d="M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z"></path></symbol><symbol id="icon-arrow-circle-left" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm28.9-143.6L209.4 288H392c13.3 0 24-10.7 24-24v-16c0-13.3-10.7-24-24-24H209.4l75.5-72.4c9.7-9.3 9.9-24.8.4-34.3l-11-10.9c-9.4-9.4-24.6-9.4-33.9 0L107.7 239c-9.4 9.4-9.4 24.6 0 33.9l132.7 132.7c9.4 9.4 24.6 9.4 33.9 0l11-10.9c9.5-9.5 9.3-25-.4-34.3z"></path></symbol><symbol id="icon-arrow-circle-right" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm-28.9 143.6l75.5 72.4H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h182.6l-75.5 72.4c-9.7 9.3-9.9 24.8-.4 34.3l11 10.9c9.4 9.4 24.6 9.4 33.9 0L404.3 273c9.4-9.4 9.4-24.6 0-33.9L271.6 106.3c-9.4-9.4-24.6-9.4-33.9 0l-11 10.9c-9.5 9.6-9.3 25.1.4 34.4z"></path></symbol><symbol id="icon-arrow-circle-up" viewBox="0 0 512 512"><path d="M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm143.6 28.9l72.4-75.5V392c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V209.4l72.4 75.5c9.3 9.7 24.8 9.9 34.3.4l10.9-11c9.4-9.4 9.4-24.6 0-33.9L273 107.7c-9.4-9.4-24.6-9.4-33.9 0L106.3 240.4c-9.4 9.4-9.4 24.6 0 33.9l10.9 11c9.6 9.5 25.1 9.3 34.4-.4z"></path></symbol><symbol id="icon-arrow-down" viewBox="0 0 448 512"><path d="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"></path></symbol><symbol id="icon-arrow-left" viewBox="0 0 448 512"><path d="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"></path></symbol><symbol id="icon-arrow-right" viewBox="0 0 448 512"><path d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></symbol><symbol id="icon-arrow-up" viewBox="0 0 448 512"><path d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"></path></symbol><symbol id="icon-arrows-alt" viewBox="0 0 512 512"><path d="M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"></path></symbol><symbol id="icon-arrows-alt-h" viewBox="0 0 512 512"><path d="M377.941 169.941V216H134.059v-46.059c0-21.382-25.851-32.09-40.971-16.971L7.029 239.029c-9.373 9.373-9.373 24.568 0 33.941l86.059 86.059c15.119 15.119 40.971 4.411 40.971-16.971V296h243.882v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.568 0-33.941l-86.059-86.059c-15.119-15.12-40.971-4.412-40.971 16.97z"></path></symbol><symbol id="icon-arrows-alt-v" viewBox="0 0 256 512"><path d="M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z"></path></symbol><symbol id="icon-bars" viewBox="0 0 448 512"><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"></path></symbol><symbol id="icon-bookmark" viewBox="0 0 384 512"><path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"></path></symbol><symbol id="icon-bookmark-empty" viewBox="0 0 384 512"><path d="M0 48C0 21.5 21.5 0 48 0l0 48V441.4l130.1-92.9c8.3-6 19.6-6 27.9 0L336 441.4V48H48V0H336c26.5 0 48 21.5 48 48V488c0 9-5 17.2-13 21.3s-17.6 3.4-24.9-1.8L192 397.5 37.9 507.5c-7.3 5.2-16.9 5.9-24.9 1.8S0 497 0 488V48z"/></symbol><symbol id="icon-caret-down" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></symbol><symbol id="icon-caret-right" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"></path></symbol><symbol id="icon-check" viewBox="0 0 512 512"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></symbol><symbol id="icon-circle" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></symbol><symbol id="icon-cog" viewBox="0 0 512 512"><path d="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"></path></symbol><symbol id="icon-database" viewBox="0 0 448 512"><path d="M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z"></path></symbol><symbol id="icon-edit" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"></path></symbol><symbol id="icon-eye" viewBox="0 0 576 512"><path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path></symbol><symbol id="icon-eye-slash" viewBox="0 0 640 512"><path d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"></path></symbol><symbol id="icon-gavel" viewBox="0 0 512 512"><path d="M504.971 199.362l-22.627-22.627c-9.373-9.373-24.569-9.373-33.941 0l-5.657 5.657L329.608 69.255l5.657-5.657c9.373-9.373 9.373-24.569 0-33.941L312.638 7.029c-9.373-9.373-24.569-9.373-33.941 0L154.246 131.48c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l5.657-5.657 39.598 39.598-81.04 81.04-5.657-5.657c-12.497-12.497-32.758-12.497-45.255 0L9.373 412.118c-12.497 12.497-12.497 32.758 0 45.255l45.255 45.255c12.497 12.497 32.758 12.497 45.255 0l114.745-114.745c12.497-12.497 12.497-32.758 0-45.255l-5.657-5.657 81.04-81.04 39.598 39.598-5.657 5.657c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l124.451-124.451c9.372-9.372 9.372-24.568 0-33.941z"></path></symbol><symbol id="icon-globe" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"></path></symbol><symbol id="icon-id-card" viewBox="0 0 576 512"><path d="M528 32H48C21.5 32 0 53.5 0 80v16h576V80c0-26.5-21.5-48-48-48zM0 432c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V128H0v304zm352-232c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zM176 192c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zM67.1 396.2C75.5 370.5 99.6 352 128 352h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.9-5.2 19.8-15.6 19.8H82.7c-10.4 0-18.8-10-15.6-19.8z"></path></symbol><symbol id="icon-id-card-alt" viewBox="0 0 576 512"><path d="M528 64H384v96H192V64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM288 224c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm93.3 224H194.7c-10.4 0-18.8-10-15.6-19.8 8.3-25.6 32.4-44.2 60.9-44.2h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.8-5.2 19.8-15.6 19.8zM352 32c0-17.7-14.3-32-32-32h-64c-17.7 0-32 14.3-32 32v96h128V32z"></path></symbol><symbol id="icon-info" viewBox="0 0 192 512"><path d="M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z"></path></symbol><symbol id="icon-info-circle" viewBox="0 0 512 512"><path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"></path></symbol><symbol id="icon-list-ul" viewBox="0 0 512 512"><path d="M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"></path></symbol><symbol id="icon-lock" viewBox="0 0 448 512"><path d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"></path></symbol><symbol id="icon-lock-open" viewBox="0 0 576 512"><path d="M423.5 0C339.5.3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z"></path></symbol><symbol id="icon-minus" viewBox="0 0 448 512"><path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></symbol><symbol id="icon-minus-circle" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z"></path></symbol><symbol id="icon-minus-square" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM92 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H92z"></path></symbol><symbol id="icon-paper-plane" viewBox="0 0 512 512"><path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"></path></symbol><symbol id="icon-paperclip" viewBox="0 0 448 512"><path d="M43.246 466.142c-58.43-60.289-57.341-157.511 1.386-217.581L254.392 34c44.316-45.332 116.351-45.336 160.671 0 43.89 44.894 43.943 117.329 0 162.276L232.214 383.128c-29.855 30.537-78.633 30.111-107.982-.998-28.275-29.97-27.368-77.473 1.452-106.953l143.743-146.835c6.182-6.314 16.312-6.422 22.626-.241l22.861 22.379c6.315 6.182 6.422 16.312.241 22.626L171.427 319.927c-4.932 5.045-5.236 13.428-.648 18.292 4.372 4.634 11.245 4.711 15.688.165l182.849-186.851c19.613-20.062 19.613-52.725-.011-72.798-19.189-19.627-49.957-19.637-69.154 0L90.39 293.295c-34.763 35.56-35.299 93.12-1.191 128.313 34.01 35.093 88.985 35.137 123.058.286l172.06-175.999c6.177-6.319 16.307-6.433 22.626-.256l22.877 22.364c6.319 6.177 6.434 16.307.256 22.626l-172.06 175.998c-59.576 60.938-155.943 60.216-214.77-.485z"></path></symbol><symbol id="icon-pencil-alt" viewBox="0 0 512 512"><path d="M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"></path></symbol><symbol id="icon-phone" viewBox="0 0 512 512"><path d="M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z"></path></symbol><symbol id="icon-plus" viewBox="0 0 448 512"><path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path></symbol><symbol id="icon-plus-circle" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"></path></symbol><symbol id="icon-plus-square" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"></path></symbol><symbol id="icon-save" viewBox="0 0 448 512"><path d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"></path></symbol><symbol id="icon-sign-out-alt" viewBox="0 0 512 512"><path d="M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"></path></symbol><symbol id="icon-smile" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z"></path></symbol><symbol id="icon-snowflake" viewBox="0 0 448 512"><path d="M440.3 345.2l-33.8-19.5 26-7c8.2-2.2 13.1-10.7 10.9-18.9l-4-14.9c-2.2-8.2-10.7-13.1-18.9-10.9l-70.8 19-63.9-37 63.8-36.9 70.8 19c8.2 2.2 16.7-2.7 18.9-10.9l4-14.9c2.2-8.2-2.7-16.7-10.9-18.9l-26-7 33.8-19.5c7.4-4.3 9.9-13.7 5.7-21.1L430.4 119c-4.3-7.4-13.7-9.9-21.1-5.7l-33.8 19.5 7-26c2.2-8.2-2.7-16.7-10.9-18.9l-14.9-4c-8.2-2.2-16.7 2.7-18.9 10.9l-19 70.8-62.8 36.2v-77.5l53.7-53.7c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0L256 56.4V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v40.4l-19.7-19.7c-6.2-6.2-16.4-6.2-22.6 0L138.3 48c-6.3 6.2-6.3 16.4 0 22.6l53.7 53.7v77.5l-62.8-36.2-19-70.8c-2.2-8.2-10.7-13.1-18.9-10.9l-14.9 4c-8.2 2.2-13.1 10.7-10.9 18.9l7 26-33.8-19.5c-7.4-4.3-16.8-1.7-21.1 5.7L2.1 145.7c-4.3 7.4-1.7 16.8 5.7 21.1l33.8 19.5-26 7c-8.3 2.2-13.2 10.7-11 19l4 14.9c2.2 8.2 10.7 13.1 18.9 10.9l70.8-19 63.8 36.9-63.8 36.9-70.8-19c-8.2-2.2-16.7 2.7-18.9 10.9l-4 14.9c-2.2 8.2 2.7 16.7 10.9 18.9l26 7-33.8 19.6c-7.4 4.3-9.9 13.7-5.7 21.1l15.5 26.8c4.3 7.4 13.7 9.9 21.1 5.7l33.8-19.5-7 26c-2.2 8.2 2.7 16.7 10.9 18.9l14.9 4c8.2 2.2 16.7-2.7 18.9-10.9l19-70.8 62.8-36.2v77.5l-53.7 53.7c-6.3 6.2-6.3 16.4 0 22.6l11.3 11.3c6.2 6.2 16.4 6.2 22.6 0l19.7-19.7V496c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-40.4l19.7 19.7c6.2 6.2 16.4 6.2 22.6 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6L256 387.7v-77.5l62.8 36.2 19 70.8c2.2 8.2 10.7 13.1 18.9 10.9l14.9-4c8.2-2.2 13.1-10.7 10.9-18.9l-7-26 33.8 19.5c7.4 4.3 16.8 1.7 21.1-5.7l15.5-26.8c4.3-7.3 1.8-16.8-5.6-21z"></path></symbol><symbol id="icon-spinner" viewBox="0 0 512 512"><path d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"></path></symbol><symbol id="icon-sync" viewBox="0 0 512 512"><path d="M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"></path></symbol><symbol id="icon-times" viewBox="0 0 352 512"><path d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></symbol><symbol id="icon-times-circle" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"></path></symbol><symbol id="icon-trash" viewBox="0 0 448 512"><path d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"></path></symbol><symbol id="icon-trash-alt" viewBox="0 0 448 512"><path d="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"></path></symbol><symbol id="icon-unlock" viewBox="0 0 448 512"><path d="M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"></path></symbol><symbol id="icon-user" viewBox="0 0 448 512"><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"></path></symbol><symbol id="icon-user-cog" viewBox="0 0 640 512"><path d="M610.5 373.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 400.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm201.2 226.5c-2.3-1.2-4.6-2.6-6.8-3.9l-7.9 4.6c-6 3.4-12.8 5.3-19.6 5.3-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-5.5-17.7 1.9-36.4 17.9-45.7l7.9-4.6c-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-16-9.2-23.4-28-17.9-45.7.9-2.9 2.2-5.8 3.2-8.7-3.8-.3-7.5-1.2-11.4-1.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c10.1 0 19.5-3.2 27.2-8.5-1.2-3.8-2-7.7-2-11.8v-9.2z"></path></symbol><symbol id="icon-user-plus" viewBox="0 0 640 512"><path d="M624 208h-64v-64c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v64h-64c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h64v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-64h64c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm-400 48c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"></path></symbol><symbol id="icon-user-secret" viewBox="0 0 448 512"><path d="M383.9 308.3l23.9-62.6c4-10.5-3.7-21.7-15-21.7h-58.5c11-18.9 17.8-40.6 17.8-64v-.3c39.2-7.8 64-19.1 64-31.7 0-13.3-27.3-25.1-70.1-33-9.2-32.8-27-65.8-40.6-82.8-9.5-11.9-25.9-15.6-39.5-8.8l-27.6 13.8c-9 4.5-19.6 4.5-28.6 0L182.1 3.4c-13.6-6.8-30-3.1-39.5 8.8-13.5 17-31.4 50-40.6 82.8-42.7 7.9-70 19.7-70 33 0 12.6 24.8 23.9 64 31.7v.3c0 23.4 6.8 45.1 17.8 64H56.3c-11.5 0-19.2 11.7-14.7 22.3l25.8 60.2C27.3 329.8 0 372.7 0 422.4v44.8C0 491.9 20.1 512 44.8 512h358.4c24.7 0 44.8-20.1 44.8-44.8v-44.8c0-48.4-25.8-90.4-64.1-114.1zM176 480l-41.6-192 49.6 32 24 40-32 120zm96 0l-32-120 24-40 49.6-32L272 480zm41.7-298.5c-3.9 11.9-7 24.6-16.5 33.4-10.1 9.3-48 22.4-64-25-2.8-8.4-15.4-8.4-18.3 0-17 50.2-56 32.4-64 25-9.5-8.8-12.7-21.5-16.5-33.4-.8-2.5-6.3-5.7-6.3-5.8v-10.8c28.3 3.6 61 5.8 96 5.8s67.7-2.1 96-5.8v10.8c-.1.1-5.6 3.2-6.4 5.8z"></path></symbol><symbol id="icon-users" viewBox="0 0 640 512"><path d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"></path></symbol><symbol id="icon-wrench" viewBox="0 0 512 512"><path d="M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"></path></symbol><symbol id="icon-refresh" viewBox="0 0 512 512"><path d="M464 16c-17.67 0-32 14.31-32 32v74.09C392.1 66.52 327.4 32 256 32C161.5 32 78.59 92.34 49.58 182.2c-5.438 16.81 3.797 34.88 20.61 40.28c16.89 5.5 34.88-3.812 40.3-20.59C130.9 138.5 189.4 96 256 96c50.5 0 96.26 24.55 124.4 64H336c-17.67 0-32 14.31-32 32s14.33 32 32 32h128c17.67 0 32-14.31 32-32V48C496 30.31 481.7 16 464 16zM441.8 289.6c-16.92-5.438-34.88 3.812-40.3 20.59C381.1 373.5 322.6 416 256 416c-50.5 0-96.25-24.55-124.4-64H176c17.67 0 32-14.31 32-32s-14.33-32-32-32h-128c-17.67 0-32 14.31-32 32v144c0 17.69 14.33 32 32 32s32-14.31 32-32v-74.09C119.9 445.5 184.6 480 255.1 480c94.45 0 177.4-60.34 206.4-150.2C467.9 313 458.6 294.1 441.8 289.6z"></path></symbol><symbol id="icon-copy" viewBox="0 0 448 512"><path d="M320 448v40c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V120c0-13.3 10.7-24 24-24h72v296c0 30.9 25.1 56 56 56h168zm0-344V0H152c-13.3 0-24 10.7-24 24v368c0 13.3 10.7 24 24 24h272c13.3 0 24-10.7 24-24V128H344c-13.2 0-24-10.8-24-24zm121-31L375 7A24 24 0 0 0 358.1 0H352v96h96v-6.1a24 24 0 0 0 -7-17z"></path></symbol><symbol id="icon-quote-right" viewBox="0 0 512 512"><path d="M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"></path></symbol><symbol id="icon-bell" viewBox="0 0 512 512"><path d="M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416l384 0c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8l0-18.8c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"></path></symbol><symbol id="icon-bell-alt" viewBox="0 0 512 512"><path d="M224 0c-17.7 0-32 14.3-32 32l0 19.2C119 66 64 130.6 64 208l0 25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416l400 0c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4l0-25.4c0-77.4-55-142-128-156.8L256 32c0-17.7-14.3-32-32-32zm0 96c61.9 0 112 50.1 112 112l0 25.4c0 47.9 13.9 94.6 39.7 134.6L72.3 368C98.1 328 112 281.3 112 233.4l0-25.4c0-61.9 50.1-112 112-112zm64 352l-64 0-64 0c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"></path></symbol></svg>`);


/***/ }),

/***/ "./src/shared/constants.js":
/*!*********************************!*\
  !*** ./src/shared/constants.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MOBILE_CUTOFF: () => (/* binding */ MOBILE_CUTOFF),
/* harmony export */   PRETTY_CHAT_STATUS: () => (/* binding */ PRETTY_CHAT_STATUS),
/* harmony export */   VIEW_PLUGINS: () => (/* binding */ VIEW_PLUGINS)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");

// These are all the view-layer plugins.
//
// For the full Converse build, this list serves
// as a whitelist (see src/converse.js) in addition to the
// CORE_PLUGINS list in src/headless/consts.js.
const VIEW_PLUGINS = [
    'converse-adhoc-views',
    'converse-bookmark-views',
    'converse-chatboxviews',
    'converse-chatview',
    'converse-controlbox',
    'converse-disco-views',
    'converse-dragresize',
    'converse-fullscreen',
    'converse-headlines-view',
    'converse-mam-views',
    'converse-minimize',
    'converse-modal',
    'converse-muc-views',
    'converse-notification',
    'converse-omemo',
    'converse-profile',
    'converse-push',
    'converse-register',
    'converse-roomslist',
    'converse-rootview',
    'converse-rosterview',
    'converse-singleton'
];
/**
 * @typedef {Object} PrettyChatStatus
 * @property {string} offline
 * @property {string} unavailable
 * @property {string} xa
 * @property {string} away
 * @property {string} dnd
 * @property {string} chatty
 * @property {string} online
 */ const PRETTY_CHAT_STATUS = {
    offline: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Offline'),
    unavailable: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Unavailable'),
    xa: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Extended Away'),
    away: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Away'),
    dnd: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Do not disturb'),
    chat: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Chatty'),
    online: (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Online')
};
// The width in pixels below which we're considered on a mobile device and
// above a desktop device.
const MOBILE_CUTOFF = 768;


/***/ }),

/***/ "./src/shared/dom-navigator/dom-navigator.js":
/*!***************************************************!*\
  !*** ./src/shared/dom-navigator/dom-navigator.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var utils_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! utils/html */ "./src/utils/html.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./src/shared/dom-navigator/utils.js");
/**
 * @module dom-navigator
 * @description A class for navigating the DOM with the keyboard
 * This module started as a fork of Rubens Mariuzzo's dom-navigator.
 * @copyright Rubens Mariuzzo, JC Brand
 */ 


const { keycodes } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.converse;
/**
 * Adds the ability to navigate the DOM with the arrow keys
 */ class DOMNavigator {
    /**
     * @typedef {import('./types').DOMNavigatorOptions} DOMNavigatorOptions
     * @typedef {import('./types').DOMNavigatorDirection} DOMNavigatorDirection
     */ /**
     * @returns {DOMNavigatorDirection}
     */ static get DIRECTION() {
        return {
            down: "down",
            end: "end",
            home: "home",
            left: "left",
            right: "right",
            up: "up"
        };
    }
    /**
     * @returns {DOMNavigatorOptions}
     */ static get DEFAULTS() {
        return {
            home: [
                `${keycodes.SHIFT}${keycodes.UP_ARROW}`
            ],
            end: [
                `${keycodes.SHIFT}${keycodes.DOWN_ARROW}`
            ],
            up: [
                keycodes.UP_ARROW
            ],
            down: [
                keycodes.DOWN_ARROW
            ],
            left: [
                keycodes.LEFT_ARROW,
                `${keycodes.SHIFT}${keycodes.TAB}`
            ],
            right: [
                keycodes.RIGHT_ARROW,
                keycodes.TAB
            ],
            getSelector: null,
            jump_to_picked: null,
            jump_to_picked_direction: null,
            jump_to_picked_selector: "picked",
            onSelected: null,
            selected: "selected",
            selector: "li"
        };
    }
    /**
     * Gets the closest element based on the provided distance function.
     * @param {HTMLElement[]} els - The elements to evaluate.
     * @param {function(HTMLElement): number} getDistance - The function to calculate distance.
     * @returns {HTMLElement} The closest element.
     */ static getClosestElement(els, getDistance) {
        const next = els.reduce((prev, curr)=>{
            const current_distance = getDistance(curr);
            if (current_distance < prev.distance) {
                return {
                    distance: current_distance,
                    element: curr
                };
            }
            return prev;
        }, {
            distance: Infinity,
            element: null
        });
        return next.element;
    }
    init() {
        this.selected = null;
        this.keydownHandler = null;
        this.elements = {};
        // Create hotkeys map.
        this.keys = {};
        this.options.down.forEach((key)=>this.keys[key] = DOMNavigator.DIRECTION.down);
        this.options.end.forEach((key)=>this.keys[key] = DOMNavigator.DIRECTION.end);
        this.options.home.forEach((key)=>this.keys[key] = DOMNavigator.DIRECTION.home);
        this.options.left.forEach((key)=>this.keys[key] = DOMNavigator.DIRECTION.left);
        this.options.right.forEach((key)=>this.keys[key] = DOMNavigator.DIRECTION.right);
        this.options.up.forEach((key)=>this.keys[key] = DOMNavigator.DIRECTION.up);
    }
    enable() {
        this.getElements();
        this.keydownHandler = /** @param {KeyboardEvent} ev */ (ev)=>this.handleKeydown(ev);
        const root = utils_html__WEBPACK_IMPORTED_MODULE_0__["default"].getRootElement();
        root.addEventListener("keydown", this.keydownHandler);
        this.enabled = true;
    }
    disable() {
        if (this.keydownHandler) {
            const root = utils_html__WEBPACK_IMPORTED_MODULE_0__["default"].getRootElement();
            root.removeEventListener("keydown", this.keydownHandler);
        }
        this.unselect();
        this.elements = {};
        this.enabled = false;
    }
    destroy() {
        this.disable();
    }
    /**
     * @param {'down'|'right'|'left'|'up'} direction
     * @returns {HTMLElement}
     */ getNextElement(direction) {
        let el;
        if (direction === DOMNavigator.DIRECTION.home) {
            el = this.getElements(direction)[0];
        } else if (direction === DOMNavigator.DIRECTION.end) {
            el = Array.from(this.getElements(direction)).pop();
        } else if (this.selected) {
            if (direction === DOMNavigator.DIRECTION.right) {
                const els = this.getElements(direction);
                el = els.slice(els.indexOf(this.selected))[1];
            } else if (direction == DOMNavigator.DIRECTION.left) {
                const els = this.getElements(direction);
                el = els.slice(0, els.indexOf(this.selected)).pop() || this.selected;
            } else if (direction == DOMNavigator.DIRECTION.down) {
                const left = this.selected.offsetLeft;
                const top = this.selected.offsetTop + this.selected.offsetHeight;
                const els = this.elementsAfter(0, top);
                const getDistance = (el)=>Math.abs(el.offsetLeft - left) + Math.abs(el.offsetTop - top);
                el = DOMNavigator.getClosestElement(els, getDistance);
            } else if (direction == DOMNavigator.DIRECTION.up) {
                const left = this.selected.offsetLeft;
                const top = this.selected.offsetTop - 1;
                const els = this.elementsBefore(Infinity, top);
                const getDistance = (el)=>Math.abs(left - el.offsetLeft) + Math.abs(top - el.offsetTop);
                el = DOMNavigator.getClosestElement(els, getDistance);
            } else {
                throw new Error("getNextElement: invalid direction value");
            }
        } else {
            if (direction === DOMNavigator.DIRECTION.right || direction === DOMNavigator.DIRECTION.down) {
                // If nothing is selected, we pretend that the first element is
                // selected, so we return the next.
                el = this.getElements(direction)[1];
            } else {
                el = this.getElements(direction)[0];
            }
        }
        if (this.options.jump_to_picked && el && el.matches(this.options.jump_to_picked) && direction === this.options.jump_to_picked_direction) {
            el = this.container.querySelector(this.options.jump_to_picked_selector) || el;
        }
        return el;
    }
    /**
     * Select the given element.
     * @param {HTMLElement} el The DOM element to select.
     * @param {string} [direction] The direction.
     */ select(el, direction) {
        if (!el || el === this.selected) {
            return;
        }
        this.unselect();
        direction && this.scrollTo(el, direction);
        if (el.matches("input")) {
            el.focus();
        } else {
            utils_html__WEBPACK_IMPORTED_MODULE_0__["default"].addClass(this.options.selected, el);
        }
        this.selected = el;
        this.options.onSelected && this.options.onSelected(el);
    }
    /**
     * Remove the current selection
     */ unselect() {
        if (this.selected) {
            utils_html__WEBPACK_IMPORTED_MODULE_0__["default"].removeClass(this.options.selected, this.selected);
            delete this.selected;
        }
    }
    /**
     * Scroll the container to an element.
     * @param {HTMLElement} el The destination element.
     * @param {String} direction The direction of the current navigation.
     * @return void.
     */ scrollTo(el, direction) {
        if (!this.inScrollContainerViewport(el)) {
            const container = this.scroll_container;
            if (!container.contains(el)) {
                return;
            }
            switch(direction){
                case DOMNavigator.DIRECTION.left:
                    container.scrollLeft = el.offsetLeft - container.offsetLeft;
                    container.scrollTop = el.offsetTop - container.offsetTop;
                    break;
                case DOMNavigator.DIRECTION.up:
                    container.scrollTop = el.offsetTop - container.offsetTop;
                    break;
                case DOMNavigator.DIRECTION.right:
                    container.scrollLeft = el.offsetLeft - container.offsetLeft - (container.offsetWidth - el.offsetWidth);
                    container.scrollTop = el.offsetTop - container.offsetTop - (container.offsetHeight - el.offsetHeight);
                    break;
                case DOMNavigator.DIRECTION.down:
                    container.scrollTop = el.offsetTop - container.offsetTop - (container.offsetHeight - el.offsetHeight);
                    break;
            }
        } else if (!(0,_utils__WEBPACK_IMPORTED_MODULE_2__.inViewport)(el)) {
            switch(direction){
                case DOMNavigator.DIRECTION.left:
                    document.body.scrollLeft = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.absoluteOffsetLeft)(el) - document.body.offsetLeft;
                    break;
                case DOMNavigator.DIRECTION.up:
                    document.body.scrollTop = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.absoluteOffsetTop)(el) - document.body.offsetTop;
                    break;
                case DOMNavigator.DIRECTION.right:
                    document.body.scrollLeft = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.absoluteOffsetLeft)(el) - document.body.offsetLeft - (document.documentElement.clientWidth - el.offsetWidth);
                    break;
                case DOMNavigator.DIRECTION.down:
                    document.body.scrollTop = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.absoluteOffsetTop)(el) - document.body.offsetTop - (document.documentElement.clientHeight - el.offsetHeight);
                    break;
            }
        }
    }
    /**
     * Indicate if an element is in the container viewport.
     * @param {HTMLElement} el The element to check.
     * @return {Boolean} true if the given element is in the container viewport, otherwise false.
     */ inScrollContainerViewport(el) {
        const container = this.scroll_container;
        // Check on left side.
        if (el.offsetLeft - container.scrollLeft < container.offsetLeft) {
            return false;
        }
        // Check on top side.
        if (el.offsetTop - container.scrollTop < container.offsetTop) {
            return false;
        }
        // Check on right side.
        if (el.offsetLeft + el.offsetWidth - container.scrollLeft > container.offsetLeft + container.offsetWidth) {
            return false;
        }
        // Check on down side.
        if (el.offsetTop + el.offsetHeight - container.scrollTop > container.offsetTop + container.offsetHeight) {
            return false;
        }
        return true;
    }
    /**
     * Finds and stores the navigable elements.
     * @param {string} [direction] - The navigation direction.
     * @returns {HTMLElement[]} The navigable elements.
     */ getElements(direction) {
        const selector = this.options.getSelector ? this.options.getSelector(direction) : this.options.selector;
        if (!this.elements[selector]) {
            this.elements[selector] = Array.from(this.container.querySelectorAll(selector));
        }
        return this.elements[selector];
    }
    /**
     * Gets navigable elements after a specified offset.
     * @param {number} left - The left offset.
     * @param {number} top - The top offset.
     * @returns {HTMLElement[]} An array of elements.
     */ elementsAfter(left, top) {
        return this.getElements(DOMNavigator.DIRECTION.down).filter((el)=>el.offsetLeft >= left && el.offsetTop >= top);
    }
    /**
     * Gets navigable elements before a specified offset.
     * @param {number} left - The left offset.
     * @param {number} top - The top offset.
     * @returns {HTMLElement[]} An array of elements.
     */ elementsBefore(left, top) {
        return this.getElements(DOMNavigator.DIRECTION.up).filter((el)=>el.offsetLeft <= left && el.offsetTop <= top);
    }
    /**
     * Handle the key down event.
     * @param {KeyboardEvent} ev - The event object.
     */ handleKeydown(ev) {
        const keys = keycodes;
        const direction = ev.shiftKey ? this.keys[`${keys.SHIFT}${ev.key}`] : this.keys[ev.key];
        if (direction) {
            ev.preventDefault();
            ev.stopPropagation();
            const next = this.getNextElement(direction);
            this.select(next, direction);
        }
    }
    /**
     * Create a new DOM Navigator.
     * @param {HTMLElement} container The container of the element to navigate.
     * @param {DOMNavigatorOptions} options The options to configure the DOM navigator.
     */ constructor(container, options){
        this.container = container;
        this.scroll_container = options.scroll_container || container;
        /** @type {DOMNavigatorOptions} */ this.options = Object.assign({}, DOMNavigator.DEFAULTS, options);
        this.init();
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DOMNavigator);


/***/ }),

/***/ "./src/shared/dom-navigator/index.js":
/*!*******************************************!*\
  !*** ./src/shared/dom-navigator/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DOMNavigator: () => (/* reexport safe */ _dom_navigator_js__WEBPACK_IMPORTED_MODULE_0__["default"])
/* harmony export */ });
/* harmony import */ var _dom_navigator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom-navigator.js */ "./src/shared/dom-navigator/dom-navigator.js");



/***/ }),

/***/ "./src/shared/dom-navigator/utils.js":
/*!*******************************************!*\
  !*** ./src/shared/dom-navigator/utils.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   absoluteOffsetLeft: () => (/* binding */ absoluteOffsetLeft),
/* harmony export */   absoluteOffsetTop: () => (/* binding */ absoluteOffsetTop),
/* harmony export */   inViewport: () => (/* binding */ inViewport)
/* harmony export */ });
/**
 * @param {Element} el
 * @returns {boolean}
 */ function inViewport(el) {
    const rect = el.getBoundingClientRect();
    return rect.top >= 0 && rect.left >= 0 && rect.bottom <= window.innerHeight && rect.right <= window.innerWidth;
}
/**
 * @param {HTMLElement} el
 * @returns {number}
 */ function absoluteOffsetTop(el) {
    let offsetTop = 0;
    do {
        if (!isNaN(el.offsetTop)) {
            offsetTop += el.offsetTop;
        }
    }while (el = /** @type {HTMLElement} */ el.offsetParent)
    return offsetTop;
}
/**
 * @param {HTMLElement} el
 * @returns {number}
 */ function absoluteOffsetLeft(el) {
    let offsetLeft = 0;
    do {
        if (!isNaN(el.offsetLeft)) {
            offsetLeft += el.offsetLeft;
        }
    }while (el = /** @type {HTMLElement} */ el.offsetParent)
    return offsetLeft;
}


/***/ }),

/***/ "./src/shared/errors.js":
/*!******************************!*\
  !*** ./src/shared/errors.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   IQError: () => (/* binding */ IQError),
/* harmony export */   UserFacingError: () => (/* binding */ UserFacingError)
/* harmony export */ });
class IQError extends Error {
    /**
     * @param {string} message
     * @param {Element} iq
     */ constructor(message, iq){
        super(message);
        this.name = 'IQError';
        this.iq = iq;
    }
}
class UserFacingError extends Error {
    /**
     * @param {string} message
     */ constructor(message){
        super(message);
        this.name = 'UserFacingError';
        this.user_facing = true;
    }
}


/***/ }),

/***/ "./src/shared/gif/component.js":
/*!*************************************!*\
  !*** ./src/shared/gif/component.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ConverseGIFElement)
/* harmony export */ });
/* harmony import */ var shared_gif_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/gif/index.js */ "./src/shared/gif/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles.scss */ "./src/shared/gif/styles.scss");






class ConverseGIFElement extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        /**
         * @typedef { Object } ConverseGIFComponentProperties
         * @property { Boolean } autoplay
         * @property { Boolean } noloop
         * @property { String } progress_color
         * @property { String } nick
         * @property { ('url'|'empty'|'error') } fallback
         * @property { String } src
         */ return {
            'autoplay': {
                type: Boolean
            },
            'noloop': {
                type: Boolean
            },
            'progress_color': {
                type: String
            },
            'fallback': {
                type: String
            },
            'src': {
                type: String
            }
        };
    }
    initGIF() {
        const options = {
            'autoplay': this.autoplay,
            'loop': !this.noloop
        };
        if (this.progress_color) {
            options['progress_color'] = this.progress_color;
        }
        this.supergif = new shared_gif_index_js__WEBPACK_IMPORTED_MODULE_0__["default"](this, options);
    }
    updated(changed) {
        if (!this.supergif || changed.has('src')) {
            this.initGIF();
            return;
        }
        if (changed.has('autoplay')) {
            this.supergif.options.autoplay = this.autoplay;
        }
        if (changed.has('noloop')) {
            this.supergif.options.loop = !this.noloop;
        }
        if (changed.has('progress_color')) {
            this.supergif.options.progress_color = this.progress_color;
        }
    }
    render() {
        var _this_supergif;
        return ((_this_supergif = this.supergif) === null || _this_supergif === void 0 ? void 0 : _this_supergif.load_error) && [
            'url',
            'empty'
        ].includes(this.fallback) ? this.renderErrorFallback() : (0,lit__WEBPACK_IMPORTED_MODULE_4__.html)`<canvas class="gif-canvas" @mouseover="${()=>this.setHover()}" @mouseleave="${()=>this.unsetHover()}" @click="${(ev)=>this.onControlsClicked(ev)}"><img class="gif" src="${this.src}"></canvas>`;
    }
    renderErrorFallback() {
        if (this.fallback === 'url') {
            return (0,utils_html_js__WEBPACK_IMPORTED_MODULE_3__.getHyperlinkTemplate)(this.src);
        } else if (this.fallback === 'empty') {
            return '';
        }
    }
    setHover() {
        if (this.supergif) {
            this.supergif.hovering = true;
            this.hover_timeout && clearTimeout(this.hover_timeout);
            this.hover_timeout = setTimeout(()=>this.unsetHover(), 2000);
        }
    }
    unsetHover() {
        if (this.supergif) this.supergif.hovering = false;
    }
    onControlsClicked(ev) {
        ev.preventDefault();
        if (this.supergif.playing) {
            this.supergif.pause();
        } else if (this.supergif.frames.length > 0) {
            // When the user manually clicks play, we turn on looping
            this.supergif.options.loop = true;
            this.supergif.play();
        }
    }
    constructor(){
        super();
        this.src = null;
        this.autoplay = false;
        this.noloop = false;
        this.fallback = 'url';
        this.progress_color = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.elements.define('converse-gif', ConverseGIFElement);


/***/ }),

/***/ "./src/shared/gif/index.js":
/*!*********************************!*\
  !*** ./src/shared/gif/index.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ConverseGif)
/* harmony export */ });
/* harmony import */ var _converse_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/log */ "./src/log/index.js");
/* harmony import */ var _converse_openpromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/openpromise */ "./node_modules/@converse/openpromise/dist/openpromise.js");
/* harmony import */ var gifuct_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gifuct-js */ "./node_modules/gifuct-js/lib/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



class ConverseGif {
    initialize() {
        return _async_to_generator(function*() {
            if (this.options.width && this.options.height) {
                this.setSizes(this.options.width, this.options.height);
            }
            const data = yield this.fetchGIF(this.gif_el.src);
            requestAnimationFrame(()=>this.handleGIFResponse(data));
        }).call(this);
    }
    initPlayer() {
        if (this.load_error) return;
        if (!(this.options.width && this.options.height)) {
            this.ctx.scale(this.getCanvasScale(), this.getCanvasScale());
        }
        // Show the first frame
        this.frame_idx = 0;
        this.renderImage();
        if (this.options.autoplay) {
            var _this_frames_this_frame_idx;
            var _this_frames_this_frame_idx_delay;
            const delay = (_this_frames_this_frame_idx_delay = (_this_frames_this_frame_idx = this.frames[this.frame_idx]) === null || _this_frames_this_frame_idx === void 0 ? void 0 : _this_frames_this_frame_idx.delay) !== null && _this_frames_this_frame_idx_delay !== void 0 ? _this_frames_this_frame_idx_delay : 0;
            setTimeout(()=>this.play(), delay);
        }
    }
    /**
     * Gets the index of the frame "up next"
     * @returns {number}
     */ getNextFrameNo() {
        if (this.frames.length === 0) {
            return 0;
        }
        return (this.frame_idx + 1 + this.frames.length) % this.frames.length;
    }
    /**
     * Called once we've looped through all frames in the GIF
     * @returns {Boolean} - Returns `true` if the GIF is now paused (i.e. further iterations are not desired)
     */ onIterationEnd() {
        var _this_options_onIterationEnd, _this_options;
        this.iteration_count++;
        (_this_options_onIterationEnd = (_this_options = this.options).onIterationEnd) === null || _this_options_onIterationEnd === void 0 ? void 0 : _this_options_onIterationEnd.call(_this_options, this.el);
        if (!this.options.loop) {
            this.pause();
            return true;
        }
        return false;
    }
    /**
     * Inner callback for the `requestAnimationFrame` function.
     *
     * This method gets wrapped by an arrow function so that the `previous_timestamp` and
     * `frame_delay` parameters can also be passed in. The `timestamp`
     * parameter comes from `requestAnimationFrame`.
     *
     * The purpose of this method is to call `renderImage` with the right delay
     * in order to render the GIF animation.
     *
     * Note, this method will cause the *next* upcoming frame to be rendered,
     * not the current one.
     *
     * This means `this.frame_idx` will be incremented before calling `this.renderImage`, so
     * `renderImage(0)` needs to be called *before* this method, otherwise the
     * animation will incorrectly start from frame #1 (this is done in `initPlayer`).
     *
     * @param {DOMHighResTimeStamp} timestamp - The timestamp as returned by `requestAnimationFrame`
     * @param {DOMHighResTimeStamp} previous_timestamp - The timestamp from the previous iteration of this method.
     * We need this in order to calculate whether we have waited long enough to
     * show the next frame.
     * @param {Number} frame_delay - The delay (in 1/100th of a second)
     * before the currently being shown frame should be replaced by a new one.
     */ onAnimationFrame(timestamp, previous_timestamp, frame_delay) {
        var _this_frames_this_frame_idx;
        if (!this.playing) {
            return;
        }
        if (timestamp - previous_timestamp < frame_delay) {
            this.hovering ? this.drawPauseIcon() : this.renderImage();
            // We need to wait longer
            requestAnimationFrame((ts)=>this.onAnimationFrame(ts, previous_timestamp, frame_delay));
            return;
        }
        const next_frame = this.getNextFrameNo();
        if (next_frame === 0 && this.onIterationEnd()) {
            return;
        }
        this.frame_idx = next_frame;
        this.renderImage();
        const delay = ((_this_frames_this_frame_idx = this.frames[this.frame_idx]) === null || _this_frames_this_frame_idx === void 0 ? void 0 : _this_frames_this_frame_idx.delay) || 8;
        requestAnimationFrame((ts)=>this.onAnimationFrame(ts, timestamp, delay));
    }
    setSizes(w, h) {
        this.canvas.width = w * this.getCanvasScale();
        this.canvas.height = h * this.getCanvasScale();
        this.offscreenCanvas.width = w;
        this.offscreenCanvas.height = h;
        this.offscreenCanvas.style.width = w + "px";
        this.offscreenCanvas.style.height = h + "px";
        this.offscreenCanvas.getContext("2d").setTransform(1, 0, 0, 1, 0, 0);
    }
    doShowProgress(pos, length, draw) {
        if (draw && this.options.show_progress_bar) {
            let height = this.options.progress_bar_height;
            const top = (this.canvas.height - height) / (this.ctx_scaled ? this.getCanvasScale() : 1);
            const mid = pos / length * this.canvas.width / (this.ctx_scaled ? this.getCanvasScale() : 1);
            const width = this.canvas.width / (this.ctx_scaled ? this.getCanvasScale() : 1);
            height /= this.ctx_scaled ? this.getCanvasScale() : 1;
            this.ctx.fillStyle = this.options.progress_bg_color;
            this.ctx.fillRect(mid, top, width - mid, height);
            this.ctx.fillStyle = this.options.progress_color;
            this.ctx.fillRect(0, top, mid, height);
        }
    }
    /**
     * Starts parsing the GIF stream data by calling `parseGIF` and passing in
     * a map of handler functions.
     * @param {ArrayBuffer} data - The GIF file data, as returned by the server
     */ handleGIFResponse(data) {
        try {
            const gif = (0,gifuct_js__WEBPACK_IMPORTED_MODULE_2__.parseGIF)(data);
            this.hdr = gif.header;
            this.lsd = gif.lsd;
            var _this_options_width, _this_options_height;
            this.setSizes((_this_options_width = this.options.width) !== null && _this_options_width !== void 0 ? _this_options_width : this.lsd.width, (_this_options_height = this.options.height) !== null && _this_options_height !== void 0 ? _this_options_height : this.lsd.height);
            this.frames = (0,gifuct_js__WEBPACK_IMPORTED_MODULE_2__.decompressFrames)(gif, true);
        } catch (err) {
            this.showError();
        }
        this.initPlayer();
        !this.options.autoplay && this.drawPlayIcon();
    }
    drawError() {
        this.ctx.fillStyle = "black";
        this.ctx.fillRect(0, 0, this.options.width, this.options.height);
        this.ctx.strokeStyle = "red";
        this.ctx.lineWidth = 3;
        this.ctx.moveTo(0, 0);
        this.ctx.lineTo(this.options.width, this.options.height);
        this.ctx.moveTo(0, this.options.height);
        this.ctx.lineTo(this.options.width, 0);
        this.ctx.stroke();
    }
    showError() {
        this.load_error = true;
        this.hdr = {
            width: this.gif_el.width,
            height: this.gif_el.height
        }; // Fake header.
        this.frames = [];
        this.drawError();
        this.el.requestUpdate();
    }
    manageDisposal(i) {
        if (i <= 0) return;
        const offscreenContext = this.offscreenCanvas.getContext("2d");
        const disposal = this.frames[i - 1].disposalType;
        /*
         *  Disposal method indicates the way in which the graphic is to
         *  be treated after being displayed.
         *
         *  Values :    0 - No disposal specified. The decoder is
         *                  not required to take any action.
         *              1 - Do not dispose. The graphic is to be left
         *                  in place.
         *              2 - Restore to background color. The area used by the
         *                  graphic must be restored to the background color.
         *              3 - Restore to previous. The decoder is required to
         *                  restore the area overwritten by the graphic with
         *                  what was there prior to rendering the graphic.
         *
         *                  Importantly, "previous" means the frame state
         *                  after the last disposal of method 0, 1, or 2.
         */ if (i > 1) {
            if (disposal === 3) {
                // eslint-disable-next-line no-eq-null
                if (this.disposal_restore_from_idx != null) {
                    offscreenContext.putImageData(this.frames[this.disposal_restore_from_idx].data, 0, 0);
                }
            } else {
                this.disposal_restore_from_idx = i - 1;
            }
        }
        if (disposal === 2) {
            // Restore to background color
            // Browser implementations historically restore to transparent; we do the same.
            // http://www.wizards-toolkit.org/discourse-server/viewtopic.php?f=1&t=21172#p86079
            offscreenContext.clearRect(this.last_frame.dims.left, this.last_frame.dims.top, this.last_frame.dims.width, this.last_frame.dims.height);
        }
    }
    /**
     * Draws a gif frame at a specific index inside the canvas.
     * @param {boolean} show_pause_on_hover - The frame index
     */ renderImage(show_pause_on_hover = true) {
        if (!this.frames.length) return;
        let i = this.frame_idx;
        i = parseInt(i.toString(), 10);
        if (i > this.frames.length - 1 || i < 0) {
            i = 0;
        }
        this.manageDisposal(i);
        const frame = this.frames[i];
        const patchContext = this.patchCanvas.getContext("2d");
        const offscreenContext = this.offscreenCanvas.getContext("2d");
        const dims = frame.dims;
        if (!this.frameImageData || dims.width != this.frameImageData.width || dims.height != this.frameImageData.height) {
            this.patchCanvas.width = dims.width;
            this.patchCanvas.height = dims.height;
            this.frameImageData = patchContext.createImageData(dims.width, dims.height);
        }
        // set the patch data as an override
        this.frameImageData.data.set(frame.patch);
        // draw the patch back over the canvas
        patchContext.putImageData(this.frameImageData, 0, 0);
        offscreenContext.drawImage(this.patchCanvas, dims.left, dims.top);
        const imageData = offscreenContext.getImageData(0, 0, this.offscreenCanvas.width, this.offscreenCanvas.height);
        this.ctx.putImageData(imageData, 0, 0);
        this.ctx.drawImage(this.canvas, 0, 0, this.canvas.width, this.canvas.height);
        if (show_pause_on_hover && this.hovering) {
            this.drawPauseIcon();
        }
        this.last_frame = frame;
    }
    /**
     * Start playing the gif
     */ play() {
        this.playing = true;
        requestAnimationFrame((ts)=>this.onAnimationFrame(ts, 0, 0));
    }
    /**
     * Pause the gif
     */ pause() {
        this.playing = false;
        requestAnimationFrame(()=>this.drawPlayIcon());
    }
    drawPauseIcon() {
        if (!this.playing) return;
        // Clear the potential play button by re-rendering the current frame
        this.renderImage(false);
        // Draw dark overlay
        this.ctx.fillStyle = "rgb(0, 0, 0, 0.25)";
        this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
        const icon_size = this.canvas.height * 0.1;
        // Draw bars
        this.ctx.lineWidth = this.canvas.height * 0.04;
        this.ctx.beginPath();
        this.ctx.moveTo(this.canvas.width / 2 - icon_size / 2, this.canvas.height / 2 - icon_size);
        this.ctx.lineTo(this.canvas.width / 2 - icon_size / 2, this.canvas.height / 2 + icon_size);
        this.ctx.fillStyle = "rgb(200, 200, 200, 0.75)";
        this.ctx.stroke();
        this.ctx.beginPath();
        this.ctx.moveTo(this.canvas.width / 2 + icon_size / 2, this.canvas.height / 2 - icon_size);
        this.ctx.lineTo(this.canvas.width / 2 + icon_size / 2, this.canvas.height / 2 + icon_size);
        this.ctx.fillStyle = "rgb(200, 200, 200, 0.75)";
        this.ctx.stroke();
        // Draw circle
        this.ctx.lineWidth = this.canvas.height * 0.02;
        this.ctx.strokeStyle = "rgb(200, 200, 200, 0.75)";
        this.ctx.beginPath();
        this.ctx.arc(this.canvas.width / 2, this.canvas.height / 2, icon_size * 1.5, 0, 2 * Math.PI);
        this.ctx.stroke();
    }
    drawPlayIcon() {
        if (this.playing) return;
        // Clear the potential pause button by re-rendering the current frame
        this.renderImage(false);
        // Draw dark overlay
        this.ctx.fillStyle = "rgb(0, 0, 0, 0.25)";
        this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
        // Draw triangle
        const triangle_size = this.canvas.height * 0.1;
        const region = new Path2D();
        region.moveTo(this.canvas.width / 2 + triangle_size, this.canvas.height / 2); // start at the pointy end
        region.lineTo(this.canvas.width / 2 - triangle_size / 2, this.canvas.height / 2 + triangle_size);
        region.lineTo(this.canvas.width / 2 - triangle_size / 2, this.canvas.height / 2 - triangle_size);
        region.closePath();
        this.ctx.fillStyle = "rgb(200, 200, 200, 0.75)";
        this.ctx.fill(region);
        // Draw circle
        const circle_size = triangle_size * 1.5;
        this.ctx.lineWidth = this.canvas.height * 0.02;
        this.ctx.strokeStyle = "rgb(200, 200, 200, 0.75)";
        this.ctx.beginPath();
        this.ctx.arc(this.canvas.width / 2, this.canvas.height / 2, circle_size, 0, 2 * Math.PI);
        this.ctx.stroke();
    }
    getCanvasScale() {
        let scale;
        if (this.options.max_width && this.hdr && this.lsd.width > this.options.max_width) {
            scale = this.options.max_width / this.lsd.width;
        } else {
            scale = 1;
        }
        return scale;
    }
    /**
     * Makes an HTTP request to fetch a GIF
     * @param {string} url
     * @returns {Promise<ArrayBuffer>} Returns a promise which resolves with the response data.
     */ fetchGIF(url) {
        const promise = (0,_converse_openpromise__WEBPACK_IMPORTED_MODULE_1__.getOpenPromise)();
        const h = new XMLHttpRequest();
        h.open("GET", url, true);
        h.responseType = "arraybuffer";
        h === null || h === void 0 ? void 0 : h.overrideMimeType("text/plain; charset=x-user-defined");
        h.onload = ()=>{
            if (h.status != 200) {
                this.showError();
                return promise.reject();
            }
            promise.resolve(h.response);
        };
        h.onprogress = (e)=>e.lengthComputable && this.doShowProgress(e.loaded, e.total, true);
        h.onerror = (e)=>{
            _converse_log__WEBPACK_IMPORTED_MODULE_0__["default"].error(e);
            this.showError();
        };
        h.send();
        return promise;
    }
    /**
     * Creates a new ConverseGif instance
     * @param {import('lit').LitElement} el
     * @param {import("./types").ConverseGifOptions} opts
     */ constructor(el, opts){
        this.options = Object.assign({
            width: null,
            height: null,
            autoplay: true,
            loop: true,
            show_progress_bar: true,
            progress_bg_color: "rgba(0,0,0,0.4)",
            progress_color: "rgba(255,0,22,.8)",
            progress_bar_height: 5
        }, opts);
        this.el = el;
        this.gif_el = el.querySelector("img");
        this.canvas = el.querySelector("canvas");
        this.ctx = this.canvas.getContext("2d");
        // Offscreen canvas with full gif
        this.offscreenCanvas = document.createElement("canvas");
        // Offscreen canvas for patches
        this.patchCanvas = document.createElement("canvas");
        this.ctx_scaled = false;
        this.frames = [];
        this.load_error = null;
        this.playing = this.options.autoplay;
        this.frame_idx = 0;
        this.iteration_count = 0;
        this.start = null;
        this.hovering = null;
        this.frameImageData = null;
        this.disposal_restore_from_idx = null;
        this.initialize();
    }
}



/***/ }),

/***/ "./src/shared/gif/styles.scss":
/*!************************************!*\
  !*** ./src/shared/gif/styles.scss ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_styles_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./styles.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/gif/styles.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/modals/image.js":
/*!************************************!*\
  !*** ./src/shared/modals/image.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ImageModal)
/* harmony export */ });
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var _templates_image_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/image.js */ "./src/shared/modals/templates/image.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _styles_image_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles/image.scss */ "./src/shared/modals/styles/image.scss");







class ImageModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
    renderModal() {
        return (0,_templates_image_js__WEBPACK_IMPORTED_MODULE_1__["default"])({
            'src': this.src
        });
    }
    getModalTitle() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_5__.html)`${(0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Image: ')}<a target="_blank" rel="noopener" href="${this.src}">${(0,utils_html_js__WEBPACK_IMPORTED_MODULE_4__.getFileName)(this.src)}</a>`;
    }
    constructor(options){
        super(options);
        this.src = options.src;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.elements.define('converse-image-modal', ImageModal);


/***/ }),

/***/ "./src/shared/modals/message-versions.js":
/*!***********************************************!*\
  !*** ./src/shared/modals/message-versions.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MessageVersionsModal)
/* harmony export */ });
/* harmony import */ var shared_components_message_versions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! shared/components/message-versions.js */ "./src/shared/components/message-versions.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");





class MessageVersionsModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_1__["default"] {
    renderModal() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_3__.html)`<converse-message-versions .model="${this.model}"></converse-message-versions>`;
    }
    getModalTitle() {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Message versions');
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_4__.api.elements.define('converse-message-versions-modal', MessageVersionsModal);


/***/ }),

/***/ "./src/shared/modals/styles/image.scss":
/*!*********************************************!*\
  !*** ./src/shared/modals/styles/image.scss ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./image.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/modals/styles/image.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_image_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/modals/styles/user-details.scss":
/*!****************************************************!*\
  !*** ./src/shared/modals/styles/user-details.scss ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_details_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./user-details.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/modals/styles/user-details.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_details_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_details_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_details_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_user_details_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/modals/templates/image.js":
/*!**********************************************!*\
  !*** ./src/shared/modals/templates/image.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<img class="chat-image chat-image--modal" src="${o.src}">`);


/***/ }),

/***/ "./src/shared/modals/templates/user-details.js":
/*!*****************************************************!*\
  !*** ./src/shared/modals/templates/user-details.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   tplUserDetailsModal: () => (/* binding */ tplUserDetailsModal)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! plugins/rosterview/utils.js */ "./src/plugins/rosterview/utils.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}





const { Strophe } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env;
/**
 * @param {import('@converse/headless/types/plugins/roster/contact').default} [contact]
 */ function getPrettySubcription(contact) {
    const s = contact === null || contact === void 0 ? void 0 : contact.get('subscription');
    if (s === 'none') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Neither of you receive presence updates');
    } else if (s === 'to') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Only you receive presence updates');
    } else if (s === 'from') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Only they receive presence updates');
    } else if (s === 'both') {
        return (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Both of you receive presence updates');
    } else {
        return '';
    }
}
/**
 * @param {import('../user-details').default} el
 */ function tplUnblockButton(el) {
    const i18n_block = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Remove from blocklist');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.unblockContact(ev)}" class="btn btn-danger"><converse-icon class="fas fa-times" color="var(--background-color)" size="1em"></converse-icon> ${i18n_block}</button>`;
}
/**
 * @param {import('../user-details').default} el
 */ function tplBlockButton(el) {
    const i18n_block = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Add to blocklist');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.blockContact(ev)}" class="btn btn-danger"><converse-icon class="fas fa-list-ul" color="var(--background-color)" size="1em"></converse-icon> ${i18n_block}</button>`;
}
/**
 * @param {import('../user-details').default} el
 */ function tplAddButton(el) {
    const i18n_add_contact = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Add as contact');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.addContact(ev)}" class="btn btn-success add-contact"><converse-icon class="fas fa-user-plus" color="var(--background-color)" size="1em"></converse-icon> ${i18n_add_contact}</button>`;
}
/**
 * @param {import('../user-details').default} el
 */ function tplRemoveButton(el) {
    const i18n_remove_contact = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Remove as contact');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.removeContact(ev)}" class="btn btn-danger remove-contact"><converse-icon class="fas fa-trash-alt" color="var(--background-color)" size="1em"></converse-icon> ${i18n_remove_contact}</button>`;
}
/**
 * @param {import('../user-details').default} el
 */ function tplAcceptButton(el) {
    const i18n_accept = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Accept');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.acceptContactRequest(ev)}" class="btn btn-success accept-contact-request"><converse-icon class="fas fa-user-plus" color="var(--background-color)" size="1em"></converse-icon> ${i18n_accept}</button>`;
}
/**
 * @param {import('../user-details').default} el
 */ function tplDeclineButton(el) {
    const i18n_decline = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Decline');
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" @click="${(ev)=>el.declineContactRequest(ev)}" class="btn btn-danger decline-contact-request"><converse-icon class="fas fa-user-plus" color="var(--background-color)" size="1em"></converse-icon> ${i18n_decline}</button>`;
}
/**
 * @param {import('../user-details').default} el
 */ function tplUserDetailsModal(el) {
    var _el_model, _converse_pluggable_plugins_converseomemo, _contact_vcard, _converse_pluggable_plugins_converseomemo1;
    const vcard = (_el_model = el.model) === null || _el_model === void 0 ? void 0 : _el_model.vcard;
    const vcard_json = vcard ? vcard.toJSON() : {};
    const o = _object_spread({}, el.model.toJSON(), vcard_json);
    const contact = el.getContact();
    const is_roster_contact = contact && !contact.isUnsaved();
    const allow_contact_removal = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('allow_contact_removal');
    const domain = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.session.get('domain');
    const blocking_supported = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.disco.supports(Strophe.NS.BLOCKING, domain).then(/** @param {boolean} supported */ (supported)=>_async_to_generator(function*() {
            const blocklist = yield _converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.blocklist.get();
            if (supported) {
                if (blocklist.get(el.model.get('jid'))) {
                    tplUnblockButton(el);
                } else {
                    tplBlockButton(el);
                }
            }
        })());
    const i18n_address = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('XMPP Address');
    const i18n_email = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Email');
    const i18n_full_name = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Full Name');
    const i18n_nickname = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Nickname');
    const i18n_role = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Role');
    const i18n_url = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('URL');
    const i18n_groups = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Groups');
    const i18n_groups_help = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Use commas to separate multiple values');
    const i18n_omemo = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('OMEMO');
    const i18n_profile = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Profile');
    const ii18n_edit = (0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Edit');
    const navigation_tabs = [
        (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'profile' ? 'active' : ''}" id="profile-tab" href="#profile-tabpanel" aria-controls="profile-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="profile" data-toggle="tab">${i18n_profile}</a></li>`
    ];
    if (is_roster_contact) {
        navigation_tabs.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'edit' ? 'active' : ''}" id="edit-tab" href="#edit-tabpanel" aria-controls="edit-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="edit" data-toggle="tab">${ii18n_edit}</a></li>`);
    }
    if ((_converse_pluggable_plugins_converseomemo = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.pluggable.plugins['converse-omemo']) === null || _converse_pluggable_plugins_converseomemo === void 0 ? void 0 : _converse_pluggable_plugins_converseomemo.enabled(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse)) {
        navigation_tabs.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<li role="presentation" class="nav-item"><a class="nav-link ${el.tab === 'omemo' ? 'active' : ''}" id="omemo-tab" href="#omemo-tabpanel" aria-controls="omemo-tabpanel" role="tab" @click="${(ev)=>el.switchTab(ev)}" data-name="omemo" data-toggle="tab">${i18n_omemo}</a></li>`);
    }
    const name = (contact === null || contact === void 0 ? void 0 : contact.get('nickname')) || (contact === null || contact === void 0 ? void 0 : (_contact_vcard = contact.vcard) === null || _contact_vcard === void 0 ? void 0 : _contact_vcard.get('fullname'));
    const groups = (contact === null || contact === void 0 ? void 0 : contact.get('groups')) || [];
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<ul class="nav nav-pills justify-content-center">${navigation_tabs}</ul><div class="tab-content"><div class="tab-pane ${el.tab === 'profile' ? 'active' : ''}" id="profile-tabpanel" role="tabpanel" aria-labelledby="profile-tab"><div class="mb-4 centered"><converse-avatar .model="${el.model}" name="${el.model.getDisplayName()}" height="140" width="140"></converse-avatar></div>${o.fullname ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${i18n_full_name}:</label></div><div class="col-sm-8">${o.fullname}</div></div>` : ''}<div class="row mb-2"><div class="col-sm-4"><label>${i18n_address}:</label></div><div class="col-sm-8"><a href="xmpp:${o.jid}">${o.jid}</a></div></div>${contact ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Presence')}:</label></div><div class="col-sm-8">${getPrettySubcription(contact)}</div></div>` : ''} ${o.nickname ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${i18n_nickname}:</label></div><div class="col-sm-8">${o.nickname}</div></div>` : ''} ${o.url ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${i18n_url}:</label></div><div class="col-sm-8"><a target="_blank" rel="noopener" href="${o.url}">${o.url}</a></div></div>` : ''} ${o.email ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${i18n_email}:</label></div><div class="col-sm-8"><a href="mailto:${o.email}">${o.email}</a></div></div>` : ''} ${o.role ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${i18n_role}:</label></div><div class="col-sm-8">${o.role}</div></div>` : ''} ${groups.length ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${i18n_groups}:</label></div><div class="col-sm-8">${groups.map(/** @param {string} group */ (group)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="badge badge-roster-group me-1">${group}</span>`)}</div></div>` : ''} ${(contact === null || contact === void 0 ? void 0 : contact.get('requesting')) || !is_roster_contact || !contact ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<hr>` : ''} ${(contact === null || contact === void 0 ? void 0 : contact.get('requesting')) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="row mb-2"><div class="col-sm-4"><label>${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Contact Request')}:</label></div><div class="col-sm-8">${tplAcceptButton(el)} ${tplDeclineButton(el)}</div></div>` : ''} ${!is_roster_contact ? tplAddButton(el) : ''} ${!contact ? (0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(blocking_supported.then(()=>tplBlockButton(el)), '') : ''}</div>${is_roster_contact ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="tab-pane ${el.tab === 'edit' ? 'active' : ''}" id="edit-tabpanel" role="tabpanel" aria-labelledby="edit-tab">${el.tab === 'edit' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<form class="converse-form" @submit="${(ev)=>el.updateContact(ev)}"><div class="mb-3"><label class="form-label clearfix" for="name">${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Name')}:</label> <input type="text" name="name" value="${name}" class="form-control"></div><div class="mb-3"><label class="form-label clearfix" for="name">${i18n_groups}:</label><div class="mb-1"><small class="form-text text-muted">${i18n_groups_help}</small></div><converse-autocomplete .list="${(0,plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_3__.getGroupsAutoCompleteList)()}" name="groups" value="${groups}"></converse-autocomplete></div><button type="submit" class="btn btn-primary">${(0,i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Update')}</button></form><hr>${allow_contact_removal && is_roster_contact ? tplRemoveButton(el) : ''} ${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(blocking_supported.then(()=>tplBlockButton(el)), '')}` : ''}</div>` : ''} ${((_converse_pluggable_plugins_converseomemo1 = _converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse.pluggable.plugins['converse-omemo']) === null || _converse_pluggable_plugins_converseomemo1 === void 0 ? void 0 : _converse_pluggable_plugins_converseomemo1.enabled(_converse_headless__WEBPACK_IMPORTED_MODULE_2__._converse)) ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="tab-pane ${el.tab === 'omemo' ? 'active' : ''}" id="omemo-tabpanel" role="tabpanel" aria-labelledby="omemo-tab">${el.tab === 'omemo' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-omemo-fingerprints jid="${o.jid}"></converse-omemo-fingerprints>` : ''}</div>` : ''}</div>`;
}


/***/ }),

/***/ "./src/shared/modals/user-details.js":
/*!*******************************************!*\
  !*** ./src/shared/modals/user-details.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ UserDetailsModal)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! plugins/rosterview/utils.js */ "./src/plugins/rosterview/utils.js");
/* harmony import */ var plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! plugins/modal/modal.js */ "./src/plugins/modal/modal.js");
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var _templates_user_details_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/user-details.js */ "./src/shared/modals/templates/user-details.js");
/* harmony import */ var _styles_user_details_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./styles/user-details.scss */ "./src/shared/modals/styles/user-details.scss");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}






class UserDetailsModal extends plugins_modal_modal_js__WEBPACK_IMPORTED_MODULE_2__["default"] {
    initialize() {
        super.initialize();
        this.addListeners();
        /**
         * Triggered once the UserDetailsModal has been initialized
         * @event _converse#userDetailsModalInitialized
         * @type {import('@converse/headless').ChatBox}
         * @example _converse.api.listen.on('userDetailsModalInitialized', (chatbox) => { ... });
         */ _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.trigger('userDetailsModalInitialized', this.model);
    }
    addListeners() {
        this.listenTo(this.model, 'change', ()=>this.requestUpdate());
        if (this.model instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.ChatBox) {
            this.model.rosterContactAdded.then(()=>this.registerContactEventHandlers(this.model.contact));
            this.registerContactEventHandlers(this.model.contact);
        } else {
            this.registerContactEventHandlers(this.model);
        }
    }
    getContact() {
        if (this.model instanceof _converse_headless__WEBPACK_IMPORTED_MODULE_0__._converse.exports.ChatBox) {
            return this.model.contact;
        } else {
            return this.model;
        }
    }
    /**
     * @param {Map<string, any>} changed
     */ shouldUpdate(changed) {
        if (changed.has('model') && this.model) {
            this.stopListening();
            this.addListeners();
            this.tab = 'profile';
            this.requestUpdate();
        }
        return true;
    }
    renderModal() {
        return (0,_templates_user_details_js__WEBPACK_IMPORTED_MODULE_4__.tplUserDetailsModal)(this);
    }
    getModalTitle() {
        return this.model.getDisplayName();
    }
    /**
     * @param {import('@converse/headless/types/plugins/roster/contact').default} contact
     */ registerContactEventHandlers(contact) {
        if (!contact) return; // happens during tests
        this.listenTo(contact, 'change', ()=>this.requestUpdate());
        this.listenTo(contact, 'destroy', ()=>this.close());
        this.listenTo(contact.vcard, 'change', ()=>this.requestUpdate());
        if (contact.vcard) {
            // Refresh the vcard
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.vcard.update(contact.vcard, true);
        }
    }
    /**
     * @param {MouseEvent} ev
     */ addContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            this.modal.hide();
            _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-add-contact-modal', {
                contact: this.model
            }, ev);
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ updateContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault, /** @type {string} */ _data_get;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            const form = /** @type {HTMLFormElement} */ ev.target;
            const data = new FormData(form);
            const name = /** @type {string} */ (data.get('name') || '').trim();
            const groups = ((_data_get = data.get('groups')) === null || _data_get === void 0 ? void 0 : _data_get.split(',').map((g)=>g.trim())) || [];
            this.getContact().update({
                nickname: name,
                groups
            });
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ removeContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            setTimeout(()=>(0,plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_1__.removeContact)(this.getContact()), 1);
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ blockContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            setTimeout(()=>(0,plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_1__.blockContact)(this.getContact()), 1);
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ unblockContact(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            setTimeout(()=>(0,plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_1__.unblockContact)(this.getContact()), 1);
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ acceptContactRequest(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            setTimeout(()=>{
                _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.modal.show('converse-accept-contact-request-modal', {
                    contact: this.getContact()
                }, ev);
            });
            this.modal.hide();
        }).call(this);
    }
    /**
     * @param {MouseEvent} ev
     */ declineContactRequest(ev) {
        return _async_to_generator(function*() {
            var _ev_preventDefault;
            ev === null || ev === void 0 ? void 0 : (_ev_preventDefault = ev.preventDefault) === null || _ev_preventDefault === void 0 ? void 0 : _ev_preventDefault.call(ev);
            setTimeout(()=>(0,plugins_rosterview_utils_js__WEBPACK_IMPORTED_MODULE_1__.declineContactRequest)(this.getContact()));
            this.modal.hide();
        }).call(this);
    }
    constructor(options){
        super(options);
        this.tab = 'profile';
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define('converse-user-details-modal', UserDetailsModal);


/***/ }),

/***/ "./src/shared/qrcode/component.js":
/*!****************************************!*\
  !*** ./src/shared/qrcode/component.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/components/element.js */ "./src/shared/components/element.js");
/* harmony import */ var _generator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generator.js */ "./src/shared/qrcode/generator.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants.js */ "./src/shared/qrcode/constants.js");
/* harmony import */ var _qrcode_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./qrcode.scss */ "./src/shared/qrcode/qrcode.scss");
function _check_private_redeclaration(obj, privateCollection) {
    if (privateCollection.has(obj)) {
        throw new TypeError("Cannot initialize the same private elements twice on an object");
    }
}
function _class_apply_descriptor_get(receiver, descriptor) {
    if (descriptor.get) {
        return descriptor.get.call(receiver);
    }
    return descriptor.value;
}
function _class_apply_descriptor_set(receiver, descriptor, value) {
    if (descriptor.set) {
        descriptor.set.call(receiver, value);
    } else {
        if (!descriptor.writable) {
            throw new TypeError("attempted to set read only private field");
        }
        descriptor.value = value;
    }
}
function _class_extract_field_descriptor(receiver, privateMap, action) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to " + action + " private field on non-instance");
    }
    return privateMap.get(receiver);
}
function _class_private_field_get(receiver, privateMap) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
    return _class_apply_descriptor_get(receiver, descriptor);
}
function _class_private_field_init(obj, privateMap, value) {
    _check_private_redeclaration(obj, privateMap);
    privateMap.set(obj, value);
}
function _class_private_field_set(receiver, privateMap, value) {
    var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
    _class_apply_descriptor_set(receiver, descriptor, value);
    return value;
}






var /** @type {QRCodeModel} */ _qr_code = /*#__PURE__*/ new WeakMap();
class QRCodeComponent extends shared_components_element_js__WEBPACK_IMPORTED_MODULE_2__.CustomElement {
    static get properties() {
        return {
            text: {
                type: String
            },
            width: {
                type: String
            },
            height: {
                type: String
            }
        };
    }
    render() {
        const nCount = _class_private_field_get(this, _qr_code).getModuleCount();
        const rects = [];
        for(let row = 0; row < nCount; row++){
            for(let col = 0; col < nCount; col++){
                if (_class_private_field_get(this, _qr_code).isDark(row, col)) {
                    rects.push((0,lit__WEBPACK_IMPORTED_MODULE_0__.svg)`<use x="${row}" y="${col}" href="#template"></use>`);
                }
            }
        }
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.svg)`<svg viewBox="0 0 ${nCount} ${nCount}" width="${this.width}" height="${this.height}" fill="${this.colorLight}"><rect fill="${this.colorLight}" width="100%" height="100%"></rect><rect fill="${this.colorDark}" width="1" height="1" id="template"></rect>${rects}</svg>`;
    }
    /**
     * @param {import("lit").PropertyValues} changedProperties
     */ shouldUpdate(changedProperties) {
        if (!_class_private_field_get(this, _qr_code) || changedProperties.has('text') || changedProperties.has('correctLevel')) {
            this.title = this.text;
            _class_private_field_set(this, _qr_code, new _generator_js__WEBPACK_IMPORTED_MODULE_3__.QRCodeModel(this.text, this.correctLevel));
            _class_private_field_get(this, _qr_code).make();
            return super.shouldUpdate(changedProperties) || true;
        }
        return super.shouldUpdate(changedProperties);
    }
    constructor(){
        super(), _class_private_field_init(this, _qr_code, {
            writable: true,
            value: void 0
        });
        _class_private_field_set(this, _qr_code, null);
        this.text = null;
        this.width = '200px';
        this.height = '200px';
        this.colorDark = "#000000";
        this.colorLight = "#ffffff";
        this.correctLevel = _constants_js__WEBPACK_IMPORTED_MODULE_4__.QRErrorCorrectLevelMap.H;
    }
}
_converse_headless__WEBPACK_IMPORTED_MODULE_1__.api.elements.define("converse-qr-code", QRCodeComponent);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QRCodeComponent);


/***/ }),

/***/ "./src/shared/qrcode/constants.js":
/*!****************************************!*\
  !*** ./src/shared/qrcode/constants.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PATTERN_POSITION_TABLE: () => (/* binding */ PATTERN_POSITION_TABLE),
/* harmony export */   QRCodeLimitLength: () => (/* binding */ QRCodeLimitLength),
/* harmony export */   QRErrorCorrectLevelMap: () => (/* binding */ QRErrorCorrectLevelMap),
/* harmony export */   QRMaskPattern: () => (/* binding */ QRMaskPattern),
/* harmony export */   QRMode: () => (/* binding */ QRMode),
/* harmony export */   RS_BLOCK_TABLE: () => (/* binding */ RS_BLOCK_TABLE)
/* harmony export */ });
const QRErrorCorrectLevelMap = {
    L: 1,
    M: 0,
    Q: 3,
    H: 2
};
const QRMode = {
    MODE_NUMBER: 1 << 0,
    MODE_ALPHA_NUM: 1 << 1,
    MODE_8BIT_BYTE: 1 << 2,
    MODE_KANJI: 1 << 3
};
const QRMaskPattern = {
    PATTERN000: 0,
    PATTERN001: 1,
    PATTERN010: 2,
    PATTERN011: 3,
    PATTERN100: 4,
    PATTERN101: 5,
    PATTERN110: 6,
    PATTERN111: 7
};
const QRCodeLimitLength = [
    [
        17,
        14,
        11,
        7
    ],
    [
        32,
        26,
        20,
        14
    ],
    [
        53,
        42,
        32,
        24
    ],
    [
        78,
        62,
        46,
        34
    ],
    [
        106,
        84,
        60,
        44
    ],
    [
        134,
        106,
        74,
        58
    ],
    [
        154,
        122,
        86,
        64
    ],
    [
        192,
        152,
        108,
        84
    ],
    [
        230,
        180,
        130,
        98
    ],
    [
        271,
        213,
        151,
        119
    ],
    [
        321,
        251,
        177,
        137
    ],
    [
        367,
        287,
        203,
        155
    ],
    [
        425,
        331,
        241,
        177
    ],
    [
        458,
        362,
        258,
        194
    ],
    [
        520,
        412,
        292,
        220
    ],
    [
        586,
        450,
        322,
        250
    ],
    [
        644,
        504,
        364,
        280
    ],
    [
        718,
        560,
        394,
        310
    ],
    [
        792,
        624,
        442,
        338
    ],
    [
        858,
        666,
        482,
        382
    ],
    [
        929,
        711,
        509,
        403
    ],
    [
        1003,
        779,
        565,
        439
    ],
    [
        1091,
        857,
        611,
        461
    ],
    [
        1171,
        911,
        661,
        511
    ],
    [
        1273,
        997,
        715,
        535
    ],
    [
        1367,
        1059,
        751,
        593
    ],
    [
        1465,
        1125,
        805,
        625
    ],
    [
        1528,
        1190,
        868,
        658
    ],
    [
        1628,
        1264,
        908,
        698
    ],
    [
        1732,
        1370,
        982,
        742
    ],
    [
        1840,
        1452,
        1030,
        790
    ],
    [
        1952,
        1538,
        1112,
        842
    ],
    [
        2068,
        1628,
        1168,
        898
    ],
    [
        2188,
        1722,
        1228,
        958
    ],
    [
        2303,
        1809,
        1283,
        983
    ],
    [
        2431,
        1911,
        1351,
        1051
    ],
    [
        2563,
        1989,
        1423,
        1093
    ],
    [
        2699,
        2099,
        1499,
        1139
    ],
    [
        2809,
        2213,
        1579,
        1219
    ],
    [
        2953,
        2331,
        1663,
        1273
    ]
];
const PATTERN_POSITION_TABLE = [
    [],
    [
        6,
        18
    ],
    [
        6,
        22
    ],
    [
        6,
        26
    ],
    [
        6,
        30
    ],
    [
        6,
        34
    ],
    [
        6,
        22,
        38
    ],
    [
        6,
        24,
        42
    ],
    [
        6,
        26,
        46
    ],
    [
        6,
        28,
        50
    ],
    [
        6,
        30,
        54
    ],
    [
        6,
        32,
        58
    ],
    [
        6,
        34,
        62
    ],
    [
        6,
        26,
        46,
        66
    ],
    [
        6,
        26,
        48,
        70
    ],
    [
        6,
        26,
        50,
        74
    ],
    [
        6,
        30,
        54,
        78
    ],
    [
        6,
        30,
        56,
        82
    ],
    [
        6,
        30,
        58,
        86
    ],
    [
        6,
        34,
        62,
        90
    ],
    [
        6,
        28,
        50,
        72,
        94
    ],
    [
        6,
        26,
        50,
        74,
        98
    ],
    [
        6,
        30,
        54,
        78,
        102
    ],
    [
        6,
        28,
        54,
        80,
        106
    ],
    [
        6,
        32,
        58,
        84,
        110
    ],
    [
        6,
        30,
        58,
        86,
        114
    ],
    [
        6,
        34,
        62,
        90,
        118
    ],
    [
        6,
        26,
        50,
        74,
        98,
        122
    ],
    [
        6,
        30,
        54,
        78,
        102,
        126
    ],
    [
        6,
        26,
        52,
        78,
        104,
        130
    ],
    [
        6,
        30,
        56,
        82,
        108,
        134
    ],
    [
        6,
        34,
        60,
        86,
        112,
        138
    ],
    [
        6,
        30,
        58,
        86,
        114,
        142
    ],
    [
        6,
        34,
        62,
        90,
        118,
        146
    ],
    [
        6,
        30,
        54,
        78,
        102,
        126,
        150
    ],
    [
        6,
        24,
        50,
        76,
        102,
        128,
        154
    ],
    [
        6,
        28,
        54,
        80,
        106,
        132,
        158
    ],
    [
        6,
        32,
        58,
        84,
        110,
        136,
        162
    ],
    [
        6,
        26,
        54,
        82,
        110,
        138,
        166
    ],
    [
        6,
        30,
        58,
        86,
        114,
        142,
        170
    ]
];
const RS_BLOCK_TABLE = [
    [
        1,
        26,
        19
    ],
    [
        1,
        26,
        16
    ],
    [
        1,
        26,
        13
    ],
    [
        1,
        26,
        9
    ],
    [
        1,
        44,
        34
    ],
    [
        1,
        44,
        28
    ],
    [
        1,
        44,
        22
    ],
    [
        1,
        44,
        16
    ],
    [
        1,
        70,
        55
    ],
    [
        1,
        70,
        44
    ],
    [
        2,
        35,
        17
    ],
    [
        2,
        35,
        13
    ],
    [
        1,
        100,
        80
    ],
    [
        2,
        50,
        32
    ],
    [
        2,
        50,
        24
    ],
    [
        4,
        25,
        9
    ],
    [
        1,
        134,
        108
    ],
    [
        2,
        67,
        43
    ],
    [
        2,
        33,
        15,
        2,
        34,
        16
    ],
    [
        2,
        33,
        11,
        2,
        34,
        12
    ],
    [
        2,
        86,
        68
    ],
    [
        4,
        43,
        27
    ],
    [
        4,
        43,
        19
    ],
    [
        4,
        43,
        15
    ],
    [
        2,
        98,
        78
    ],
    [
        4,
        49,
        31
    ],
    [
        2,
        32,
        14,
        4,
        33,
        15
    ],
    [
        4,
        39,
        13,
        1,
        40,
        14
    ],
    [
        2,
        121,
        97
    ],
    [
        2,
        60,
        38,
        2,
        61,
        39
    ],
    [
        4,
        40,
        18,
        2,
        41,
        19
    ],
    [
        4,
        40,
        14,
        2,
        41,
        15
    ],
    [
        2,
        146,
        116
    ],
    [
        3,
        58,
        36,
        2,
        59,
        37
    ],
    [
        4,
        36,
        16,
        4,
        37,
        17
    ],
    [
        4,
        36,
        12,
        4,
        37,
        13
    ],
    [
        2,
        86,
        68,
        2,
        87,
        69
    ],
    [
        4,
        69,
        43,
        1,
        70,
        44
    ],
    [
        6,
        43,
        19,
        2,
        44,
        20
    ],
    [
        6,
        43,
        15,
        2,
        44,
        16
    ],
    [
        4,
        101,
        81
    ],
    [
        1,
        80,
        50,
        4,
        81,
        51
    ],
    [
        4,
        50,
        22,
        4,
        51,
        23
    ],
    [
        3,
        36,
        12,
        8,
        37,
        13
    ],
    [
        2,
        116,
        92,
        2,
        117,
        93
    ],
    [
        6,
        58,
        36,
        2,
        59,
        37
    ],
    [
        4,
        46,
        20,
        6,
        47,
        21
    ],
    [
        7,
        42,
        14,
        4,
        43,
        15
    ],
    [
        4,
        133,
        107
    ],
    [
        8,
        59,
        37,
        1,
        60,
        38
    ],
    [
        8,
        44,
        20,
        4,
        45,
        21
    ],
    [
        12,
        33,
        11,
        4,
        34,
        12
    ],
    [
        3,
        145,
        115,
        1,
        146,
        116
    ],
    [
        4,
        64,
        40,
        5,
        65,
        41
    ],
    [
        11,
        36,
        16,
        5,
        37,
        17
    ],
    [
        11,
        36,
        12,
        5,
        37,
        13
    ],
    [
        5,
        109,
        87,
        1,
        110,
        88
    ],
    [
        5,
        65,
        41,
        5,
        66,
        42
    ],
    [
        5,
        54,
        24,
        7,
        55,
        25
    ],
    [
        11,
        36,
        12
    ],
    [
        5,
        122,
        98,
        1,
        123,
        99
    ],
    [
        7,
        73,
        45,
        3,
        74,
        46
    ],
    [
        15,
        43,
        19,
        2,
        44,
        20
    ],
    [
        3,
        45,
        15,
        13,
        46,
        16
    ],
    [
        1,
        135,
        107,
        5,
        136,
        108
    ],
    [
        10,
        74,
        46,
        1,
        75,
        47
    ],
    [
        1,
        50,
        22,
        15,
        51,
        23
    ],
    [
        2,
        42,
        14,
        17,
        43,
        15
    ],
    [
        5,
        150,
        120,
        1,
        151,
        121
    ],
    [
        9,
        69,
        43,
        4,
        70,
        44
    ],
    [
        17,
        50,
        22,
        1,
        51,
        23
    ],
    [
        2,
        42,
        14,
        19,
        43,
        15
    ],
    [
        3,
        141,
        113,
        4,
        142,
        114
    ],
    [
        3,
        70,
        44,
        11,
        71,
        45
    ],
    [
        17,
        47,
        21,
        4,
        48,
        22
    ],
    [
        9,
        39,
        13,
        16,
        40,
        14
    ],
    [
        3,
        135,
        107,
        5,
        136,
        108
    ],
    [
        3,
        67,
        41,
        13,
        68,
        42
    ],
    [
        15,
        54,
        24,
        5,
        55,
        25
    ],
    [
        15,
        43,
        15,
        10,
        44,
        16
    ],
    [
        4,
        144,
        116,
        4,
        145,
        117
    ],
    [
        17,
        68,
        42
    ],
    [
        17,
        50,
        22,
        6,
        51,
        23
    ],
    [
        19,
        46,
        16,
        6,
        47,
        17
    ],
    [
        2,
        139,
        111,
        7,
        140,
        112
    ],
    [
        17,
        74,
        46
    ],
    [
        7,
        54,
        24,
        16,
        55,
        25
    ],
    [
        34,
        37,
        13
    ],
    [
        4,
        151,
        121,
        5,
        152,
        122
    ],
    [
        4,
        75,
        47,
        14,
        76,
        48
    ],
    [
        11,
        54,
        24,
        14,
        55,
        25
    ],
    [
        16,
        45,
        15,
        14,
        46,
        16
    ],
    [
        6,
        147,
        117,
        4,
        148,
        118
    ],
    [
        6,
        73,
        45,
        14,
        74,
        46
    ],
    [
        11,
        54,
        24,
        16,
        55,
        25
    ],
    [
        30,
        46,
        16,
        2,
        47,
        17
    ],
    [
        8,
        132,
        106,
        4,
        133,
        107
    ],
    [
        8,
        75,
        47,
        13,
        76,
        48
    ],
    [
        7,
        54,
        24,
        22,
        55,
        25
    ],
    [
        22,
        45,
        15,
        13,
        46,
        16
    ],
    [
        10,
        142,
        114,
        2,
        143,
        115
    ],
    [
        19,
        74,
        46,
        4,
        75,
        47
    ],
    [
        28,
        50,
        22,
        6,
        51,
        23
    ],
    [
        33,
        46,
        16,
        4,
        47,
        17
    ],
    [
        8,
        152,
        122,
        4,
        153,
        123
    ],
    [
        22,
        73,
        45,
        3,
        74,
        46
    ],
    [
        8,
        53,
        23,
        26,
        54,
        24
    ],
    [
        12,
        45,
        15,
        28,
        46,
        16
    ],
    [
        3,
        147,
        117,
        10,
        148,
        118
    ],
    [
        3,
        73,
        45,
        23,
        74,
        46
    ],
    [
        4,
        54,
        24,
        31,
        55,
        25
    ],
    [
        11,
        45,
        15,
        31,
        46,
        16
    ],
    [
        7,
        146,
        116,
        7,
        147,
        117
    ],
    [
        21,
        73,
        45,
        7,
        74,
        46
    ],
    [
        1,
        53,
        23,
        37,
        54,
        24
    ],
    [
        19,
        45,
        15,
        26,
        46,
        16
    ],
    [
        5,
        145,
        115,
        10,
        146,
        116
    ],
    [
        19,
        75,
        47,
        10,
        76,
        48
    ],
    [
        15,
        54,
        24,
        25,
        55,
        25
    ],
    [
        23,
        45,
        15,
        25,
        46,
        16
    ],
    [
        13,
        145,
        115,
        3,
        146,
        116
    ],
    [
        2,
        74,
        46,
        29,
        75,
        47
    ],
    [
        42,
        54,
        24,
        1,
        55,
        25
    ],
    [
        23,
        45,
        15,
        28,
        46,
        16
    ],
    [
        17,
        145,
        115
    ],
    [
        10,
        74,
        46,
        23,
        75,
        47
    ],
    [
        10,
        54,
        24,
        35,
        55,
        25
    ],
    [
        19,
        45,
        15,
        35,
        46,
        16
    ],
    [
        17,
        145,
        115,
        1,
        146,
        116
    ],
    [
        14,
        74,
        46,
        21,
        75,
        47
    ],
    [
        29,
        54,
        24,
        19,
        55,
        25
    ],
    [
        11,
        45,
        15,
        46,
        46,
        16
    ],
    [
        13,
        145,
        115,
        6,
        146,
        116
    ],
    [
        14,
        74,
        46,
        23,
        75,
        47
    ],
    [
        44,
        54,
        24,
        7,
        55,
        25
    ],
    [
        59,
        46,
        16,
        1,
        47,
        17
    ],
    [
        12,
        151,
        121,
        7,
        152,
        122
    ],
    [
        12,
        75,
        47,
        26,
        76,
        48
    ],
    [
        39,
        54,
        24,
        14,
        55,
        25
    ],
    [
        22,
        45,
        15,
        41,
        46,
        16
    ],
    [
        6,
        151,
        121,
        14,
        152,
        122
    ],
    [
        6,
        75,
        47,
        34,
        76,
        48
    ],
    [
        46,
        54,
        24,
        10,
        55,
        25
    ],
    [
        2,
        45,
        15,
        64,
        46,
        16
    ],
    [
        17,
        152,
        122,
        4,
        153,
        123
    ],
    [
        29,
        74,
        46,
        14,
        75,
        47
    ],
    [
        49,
        54,
        24,
        10,
        55,
        25
    ],
    [
        24,
        45,
        15,
        46,
        46,
        16
    ],
    [
        4,
        152,
        122,
        18,
        153,
        123
    ],
    [
        13,
        74,
        46,
        32,
        75,
        47
    ],
    [
        48,
        54,
        24,
        14,
        55,
        25
    ],
    [
        42,
        45,
        15,
        32,
        46,
        16
    ],
    [
        20,
        147,
        117,
        4,
        148,
        118
    ],
    [
        40,
        75,
        47,
        7,
        76,
        48
    ],
    [
        43,
        54,
        24,
        22,
        55,
        25
    ],
    [
        10,
        45,
        15,
        67,
        46,
        16
    ],
    [
        19,
        148,
        118,
        6,
        149,
        119
    ],
    [
        18,
        75,
        47,
        31,
        76,
        48
    ],
    [
        34,
        54,
        24,
        34,
        55,
        25
    ],
    [
        20,
        45,
        15,
        61,
        46,
        16
    ]
];


/***/ }),

/***/ "./src/shared/qrcode/generator.js":
/*!****************************************!*\
  !*** ./src/shared/qrcode/generator.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   QRCodeModel: () => (/* binding */ QRCodeModel)
/* harmony export */ });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./src/shared/qrcode/constants.js");
/* harmony import */ var _polynomial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./polynomial */ "./src/shared/qrcode/polynomial.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./src/shared/qrcode/utils.js");
/**
 * @copyright Kazuhiko Arase
 * @copyright davidshimjs
 * @license MIT
 * The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED
 */ 


class QRCodeModel {
    static get PAD0() {
        return 0xec;
    }
    static get PAD1() {
        return 0x11;
    }
    /**
     * @param {number} row
     * @param {number} col
     */ isDark(row, col) {
        if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
            throw new Error(row + "," + col);
        }
        return this.modules[row][col];
    }
    getModuleCount() {
        return this.moduleCount;
    }
    make() {
        this.makeImpl(false, this.getBestMaskPattern());
    }
    /**
     * @param {boolean} test
     * @param {Number} maskPattern
     */ makeImpl(test, maskPattern) {
        this.moduleCount = this.typeNumber * 4 + 17;
        this.modules = new Array(this.moduleCount);
        for(let row = 0; row < this.moduleCount; row++){
            this.modules[row] = new Array(this.moduleCount);
            for(let col = 0; col < this.moduleCount; col++){
                this.modules[row][col] = null;
            }
        }
        this.setupPositionProbePattern(0, 0);
        this.setupPositionProbePattern(this.moduleCount - 7, 0);
        this.setupPositionProbePattern(0, this.moduleCount - 7);
        this.setupPositionAdjustPattern();
        this.setupTimingPattern();
        this.setupTypeInfo(test, maskPattern);
        if (this.typeNumber >= 7) {
            this.setupTypeNumber(test);
        }
        if (this.dataCache == null) {
            this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
        }
        this.mapData(this.dataCache, maskPattern);
    }
    /**
     * @param {number} row
     * @param {number} col
     */ setupPositionProbePattern(row, col) {
        for(let r = -1; r <= 7; r++){
            if (row + r <= -1 || this.moduleCount <= row + r) continue;
            for(let c = -1; c <= 7; c++){
                if (col + c <= -1 || this.moduleCount <= col + c) continue;
                if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
                    this.modules[row + r][col + c] = true;
                } else {
                    this.modules[row + r][col + c] = false;
                }
            }
        }
    }
    /**
     * @returns {Number}
     */ getBestMaskPattern() {
        let minLostPoint = 0;
        let pattern = 0;
        for(let i = 0; i < 8; i++){
            this.makeImpl(true, i);
            let lostPoint = _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getLostPoint(this);
            if (i == 0 || minLostPoint > lostPoint) {
                minLostPoint = lostPoint;
                pattern = i;
            }
        }
        return pattern;
    }
    setupTimingPattern() {
        for(let r = 8; r < this.moduleCount - 8; r++){
            if (this.modules[r][6] != null) {
                continue;
            }
            this.modules[r][6] = r % 2 == 0;
        }
        for(let c = 8; c < this.moduleCount - 8; c++){
            if (this.modules[6][c] != null) {
                continue;
            }
            this.modules[6][c] = c % 2 == 0;
        }
    }
    setupPositionAdjustPattern() {
        let pos = _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getPatternPosition(this.typeNumber);
        for(let i = 0; i < pos.length; i++){
            for(let j = 0; j < pos.length; j++){
                let row = pos[i];
                let col = pos[j];
                if (this.modules[row][col] != null) {
                    continue;
                }
                for(let r = -2; r <= 2; r++){
                    for(let c = -2; c <= 2; c++){
                        if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
                            this.modules[row + r][col + c] = true;
                        } else {
                            this.modules[row + r][col + c] = false;
                        }
                    }
                }
            }
        }
    }
    /**
     * @param {boolean} test
     */ setupTypeNumber(test) {
        let bits = _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getBCHTypeNumber(this.typeNumber);
        for(let i = 0; i < 18; i++){
            let mod = !test && (bits >> i & 1) == 1;
            this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
        }
        for(let i = 0; i < 18; i++){
            let mod = !test && (bits >> i & 1) == 1;
            this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
        }
    }
    /**
     * @param {boolean} test
     * @param {Number} maskPattern
     */ setupTypeInfo(test, maskPattern) {
        const data = this.errorCorrectLevel << 3 | maskPattern;
        const bits = _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getBCHTypeInfo(data);
        for(let i = 0; i < 15; i++){
            let mod = !test && (bits >> i & 1) == 1;
            if (i < 6) {
                this.modules[i][8] = mod;
            } else if (i < 8) {
                this.modules[i + 1][8] = mod;
            } else {
                this.modules[this.moduleCount - 15 + i][8] = mod;
            }
        }
        for(let i = 0; i < 15; i++){
            let mod = !test && (bits >> i & 1) == 1;
            if (i < 8) {
                this.modules[8][this.moduleCount - i - 1] = mod;
            } else if (i < 9) {
                this.modules[8][15 - i - 1 + 1] = mod;
            } else {
                this.modules[8][15 - i - 1] = mod;
            }
        }
        this.modules[this.moduleCount - 8][8] = !test;
    }
    mapData(data, maskPattern) {
        let inc = -1;
        let row = this.moduleCount - 1;
        let bitIndex = 7;
        let byteIndex = 0;
        for(let col = this.moduleCount - 1; col > 0; col -= 2){
            if (col == 6) col--;
            while(true){
                for(let c = 0; c < 2; c++){
                    if (this.modules[row][col - c] == null) {
                        let dark = false;
                        if (byteIndex < data.length) {
                            dark = (data[byteIndex] >>> bitIndex & 1) == 1;
                        }
                        let mask = _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getMask(maskPattern, row, col - c);
                        if (mask) {
                            dark = !dark;
                        }
                        this.modules[row][col - c] = dark;
                        bitIndex--;
                        if (bitIndex == -1) {
                            byteIndex++;
                            bitIndex = 7;
                        }
                    }
                }
                row += inc;
                if (row < 0 || this.moduleCount <= row) {
                    row -= inc;
                    inc = -inc;
                    break;
                }
            }
        }
    }
    static createData(typeNumber, errorCorrectLevel, dataList) {
        let rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
        const buffer = new QRBitBuffer();
        for(let i = 0; i < dataList.length; i++){
            let data = dataList[i];
            buffer.put(data.mode, 4);
            buffer.put(data.getLength(), _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getLengthInBits(data.mode, typeNumber));
            data.write(buffer);
        }
        let totalDataCount = 0;
        for(let i = 0; i < rsBlocks.length; i++){
            totalDataCount += rsBlocks[i].dataCount;
        }
        if (buffer.getLengthInBits() > totalDataCount * 8) {
            throw new Error("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
        }
        if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
            buffer.put(0, 4);
        }
        while(buffer.getLengthInBits() % 8 != 0){
            buffer.putBit(false);
        }
        while(true){
            if (buffer.getLengthInBits() >= totalDataCount * 8) {
                break;
            }
            buffer.put(QRCodeModel.PAD0, 8);
            if (buffer.getLengthInBits() >= totalDataCount * 8) {
                break;
            }
            buffer.put(QRCodeModel.PAD1, 8);
        }
        return QRCodeModel.createBytes(buffer, rsBlocks);
    }
    static createBytes(buffer, rsBlocks) {
        let offset = 0;
        let maxDcCount = 0;
        let maxEcCount = 0;
        let dcdata = new Array(rsBlocks.length);
        let ecdata = new Array(rsBlocks.length);
        for(let r = 0; r < rsBlocks.length; r++){
            let dcCount = rsBlocks[r].dataCount;
            let ecCount = rsBlocks[r].totalCount - dcCount;
            maxDcCount = Math.max(maxDcCount, dcCount);
            maxEcCount = Math.max(maxEcCount, ecCount);
            dcdata[r] = new Array(dcCount);
            for(let i = 0; i < dcdata[r].length; i++){
                dcdata[r][i] = 0xff & buffer.buffer[i + offset];
            }
            offset += dcCount;
            let rsPoly = _utils__WEBPACK_IMPORTED_MODULE_2__.QRUtil.getErrorCorrectPolynomial(ecCount);
            let rawPoly = new _polynomial__WEBPACK_IMPORTED_MODULE_1__["default"](dcdata[r], rsPoly.getLength() - 1);
            let modPoly = rawPoly.mod(rsPoly);
            ecdata[r] = new Array(rsPoly.getLength() - 1);
            for(let i = 0; i < ecdata[r].length; i++){
                let modIndex = i + modPoly.getLength() - ecdata[r].length;
                ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
            }
        }
        let totalCodeCount = 0;
        for(let i = 0; i < rsBlocks.length; i++){
            totalCodeCount += rsBlocks[i].totalCount;
        }
        let data = new Array(totalCodeCount);
        let index = 0;
        for(let i = 0; i < maxDcCount; i++){
            for(let r = 0; r < rsBlocks.length; r++){
                if (i < dcdata[r].length) {
                    data[index++] = dcdata[r][i];
                }
            }
        }
        for(let i = 0; i < maxEcCount; i++){
            for(let r = 0; r < rsBlocks.length; r++){
                if (i < ecdata[r].length) {
                    data[index++] = ecdata[r][i];
                }
            }
        }
        return data;
    }
    /**
     * @param {String} text
     * @param {import('./types').ErrorCorrectLevel} errorCorrectLevel
     */ constructor(text, errorCorrectLevel){
        this.text = text;
        this.errorCorrectLevel = errorCorrectLevel;
        this.typeNumber = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.getTypeNumber)(this.text, this.errorCorrectLevel);
        this.modules = null;
        this.moduleCount = 0;
        this.dataCache = null;
        this.dataList = [
            new QR8bitByte(this.text)
        ];
    }
}
class QR8bitByte {
    getLength() {
        return this.parsedData.length;
    }
    /**
     * @param {QRBitBuffer} buffer
     */ write(buffer) {
        for(let i = 0, l = this.parsedData.length; i < l; i++){
            buffer.put(this.parsedData[i], 8);
        }
    }
    /**
     * @param {string} data
     */ constructor(data){
        this.mode = _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_8BIT_BYTE;
        this.data = data;
        this.parsedData = [];
        // Added to support UTF-8 Characters
        for(let i = 0, l = this.data.length; i < l; i++){
            let byteArray = [];
            let code = this.data.charCodeAt(i);
            if (code > 0x10000) {
                byteArray[0] = 0xf0 | (code & 0x1c0000) >>> 18;
                byteArray[1] = 0x80 | (code & 0x3f000) >>> 12;
                byteArray[2] = 0x80 | (code & 0xfc0) >>> 6;
                byteArray[3] = 0x80 | code & 0x3f;
            } else if (code > 0x800) {
                byteArray[0] = 0xe0 | (code & 0xf000) >>> 12;
                byteArray[1] = 0x80 | (code & 0xfc0) >>> 6;
                byteArray[2] = 0x80 | code & 0x3f;
            } else if (code > 0x80) {
                byteArray[0] = 0xc0 | (code & 0x7c0) >>> 6;
                byteArray[1] = 0x80 | code & 0x3f;
            } else {
                byteArray[0] = code;
            }
            this.parsedData.push(byteArray);
        }
        this.parsedData = Array.prototype.concat.apply([], this.parsedData);
        if (this.parsedData.length != this.data.length) {
            this.parsedData.unshift(191);
            this.parsedData.unshift(187);
            this.parsedData.unshift(239);
        }
    }
}
class QRRSBlock {
    static getRSBlocks(typeNumber, errorCorrectLevel) {
        let rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
        if (rsBlock == undefined) {
            throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
        }
        let length = rsBlock.length / 3;
        let list = [];
        for(let i = 0; i < length; i++){
            let count = rsBlock[i * 3 + 0];
            let totalCount = rsBlock[i * 3 + 1];
            let dataCount = rsBlock[i * 3 + 2];
            for(let j = 0; j < count; j++){
                list.push(new QRRSBlock(totalCount, dataCount));
            }
        }
        return list;
    }
    static getRsBlockTable(typeNumber, errorCorrectLevel) {
        switch(errorCorrectLevel){
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.L:
                return _constants__WEBPACK_IMPORTED_MODULE_0__.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.M:
                return _constants__WEBPACK_IMPORTED_MODULE_0__.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.Q:
                return _constants__WEBPACK_IMPORTED_MODULE_0__.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.H:
                return _constants__WEBPACK_IMPORTED_MODULE_0__.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
            default:
                return undefined;
        }
    }
    constructor(totalCount, dataCount){
        this.totalCount = totalCount;
        this.dataCount = dataCount;
    }
}
class QRBitBuffer {
    /**
     * @param {Number} index
     */ get(index) {
        const bufIndex = Math.floor(index / 8);
        return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
    }
    /**
     * @param {Number} num
     * @param {Number} length
     */ put(num, length) {
        for(let i = 0; i < length; i++){
            this.putBit((num >>> length - i - 1 & 1) == 1);
        }
    }
    getLengthInBits() {
        return this.length;
    }
    /**
     * @param {Boolean} bit
     */ putBit(bit) {
        let bufIndex = Math.floor(this.length / 8);
        if (this.buffer.length <= bufIndex) {
            this.buffer.push(0);
        }
        if (bit) {
            this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
        }
        this.length++;
    }
    constructor(){
        this.buffer = [];
        this.length = 0;
    }
}


/***/ }),

/***/ "./src/shared/qrcode/polynomial.js":
/*!*****************************************!*\
  !*** ./src/shared/qrcode/polynomial.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   QRMath: () => (/* binding */ QRMath),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
class QRPolynomial {
    get(index) {
        return this.num[index];
    }
    getLength() {
        return this.num.length;
    }
    multiply(e) {
        let num = new Array(this.getLength() + e.getLength() - 1);
        for(let i = 0; i < this.getLength(); i++){
            for(let j = 0; j < e.getLength(); j++){
                num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
            }
        }
        return new QRPolynomial(num, 0);
    }
    mod(e) {
        if (this.getLength() - e.getLength() < 0) {
            return this;
        }
        let ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));
        let num = new Array(this.getLength());
        for(let i = 0; i < this.getLength(); i++){
            num[i] = this.get(i);
        }
        for(let i = 0; i < e.getLength(); i++){
            num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
        }
        return new QRPolynomial(num, 0).mod(e);
    }
    constructor(num, shift){
        if (num.length == undefined) {
            throw new Error(num.length + "/" + shift);
        }
        let offset = 0;
        while(offset < num.length && num[offset] == 0){
            offset++;
        }
        this.num = new Array(num.length - offset + shift);
        for(let i = 0; i < num.length - offset; i++){
            this.num[i] = num[i + offset];
        }
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QRPolynomial);
const QRMath = {
    glog: function(n) {
        if (n < 1) {
            throw new Error("glog(" + n + ")");
        }
        return QRMath.LOG_TABLE[n];
    },
    gexp: function(n) {
        while(n < 0){
            n += 255;
        }
        while(n >= 256){
            n -= 255;
        }
        return QRMath.EXP_TABLE[n];
    },
    EXP_TABLE: new Array(256),
    LOG_TABLE: new Array(256)
};
for(let i = 0; i < 8; i++){
    QRMath.EXP_TABLE[i] = 1 << i;
}
for(let i = 8; i < 256; i++){
    QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
}
for(let i = 0; i < 255; i++){
    QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
}


/***/ }),

/***/ "./src/shared/qrcode/qrcode.scss":
/*!***************************************!*\
  !*** ./src/shared/qrcode/qrcode.scss ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_qrcode_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./qrcode.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/qrcode/qrcode.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_qrcode_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_qrcode_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_qrcode_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_qrcode_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/qrcode/utils.js":
/*!************************************!*\
  !*** ./src/shared/qrcode/utils.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   QRUtil: () => (/* binding */ QRUtil),
/* harmony export */   getTypeNumber: () => (/* binding */ getTypeNumber)
/* harmony export */ });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./src/shared/qrcode/constants.js");
/* harmony import */ var _polynomial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./polynomial */ "./src/shared/qrcode/polynomial.js");


/**
 * Get the type by string length
 * @param {String} text
 * @param {Number} nCorrectLevel
 * @return {Number} type
 */ function getTypeNumber(text, nCorrectLevel) {
    let nType = 1;
    let length = getUTF8Length(text);
    for(let i = 0, len = _constants__WEBPACK_IMPORTED_MODULE_0__.QRCodeLimitLength.length; i <= len; i++){
        let nLimit = 0;
        switch(nCorrectLevel){
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.L:
                nLimit = _constants__WEBPACK_IMPORTED_MODULE_0__.QRCodeLimitLength[i][0];
                break;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.M:
                nLimit = _constants__WEBPACK_IMPORTED_MODULE_0__.QRCodeLimitLength[i][1];
                break;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.Q:
                nLimit = _constants__WEBPACK_IMPORTED_MODULE_0__.QRCodeLimitLength[i][2];
                break;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRErrorCorrectLevelMap.H:
                nLimit = _constants__WEBPACK_IMPORTED_MODULE_0__.QRCodeLimitLength[i][3];
                break;
        }
        if (length <= nLimit) {
            break;
        } else {
            nType++;
        }
    }
    if (nType > _constants__WEBPACK_IMPORTED_MODULE_0__.QRCodeLimitLength.length) {
        throw new Error("Too long data");
    }
    return nType;
}
function getUTF8Length(sText) {
    let replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, "a");
    return replacedText.length + (replacedText.length != sText ? 3 : 0);
}
const QRUtil = {
    G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
    G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
    G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
    getBCHTypeInfo (data) {
        let d = data << 10;
        while(QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0){
            d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
        }
        return (data << 10 | d) ^ QRUtil.G15_MASK;
    },
    getBCHTypeNumber (data) {
        let d = data << 12;
        while(QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0){
            d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
        }
        return data << 12 | d;
    },
    getBCHDigit (data) {
        let digit = 0;
        while(data != 0){
            digit++;
            data >>>= 1;
        }
        return digit;
    },
    getPatternPosition (typeNumber) {
        return _constants__WEBPACK_IMPORTED_MODULE_0__.PATTERN_POSITION_TABLE[typeNumber - 1];
    },
    getMask (maskPattern, i, j) {
        switch(maskPattern){
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN000:
                return (i + j) % 2 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN001:
                return i % 2 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN010:
                return j % 3 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN011:
                return (i + j) % 3 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN100:
                return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN101:
                return i * j % 2 + i * j % 3 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN110:
                return (i * j % 2 + i * j % 3) % 2 == 0;
            case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMaskPattern.PATTERN111:
                return (i * j % 3 + (i + j) % 2) % 2 == 0;
            default:
                throw new Error("bad maskPattern:" + maskPattern);
        }
    },
    getErrorCorrectPolynomial (errorCorrectLength) {
        let a = new _polynomial__WEBPACK_IMPORTED_MODULE_1__["default"]([
            1
        ], 0);
        for(let i = 0; i < errorCorrectLength; i++){
            a = a.multiply(new _polynomial__WEBPACK_IMPORTED_MODULE_1__["default"]([
                1,
                _polynomial__WEBPACK_IMPORTED_MODULE_1__.QRMath.gexp(i)
            ], 0));
        }
        return a;
    },
    getLengthInBits (mode, type) {
        if (1 <= type && type < 10) {
            switch(mode){
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_NUMBER:
                    return 10;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_ALPHA_NUM:
                    return 9;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_8BIT_BYTE:
                    return 8;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_KANJI:
                    return 8;
                default:
                    throw new Error("mode:" + mode);
            }
        } else if (type < 27) {
            switch(mode){
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_NUMBER:
                    return 12;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_ALPHA_NUM:
                    return 11;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_8BIT_BYTE:
                    return 16;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_KANJI:
                    return 10;
                default:
                    throw new Error("mode:" + mode);
            }
        } else if (type < 41) {
            switch(mode){
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_NUMBER:
                    return 14;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_ALPHA_NUM:
                    return 13;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_8BIT_BYTE:
                    return 16;
                case _constants__WEBPACK_IMPORTED_MODULE_0__.QRMode.MODE_KANJI:
                    return 12;
                default:
                    throw new Error("mode:" + mode);
            }
        } else {
            throw new Error("type:" + type);
        }
    },
    getLostPoint (qrCode) {
        let moduleCount = qrCode.getModuleCount();
        let lostPoint = 0;
        for(let row = 0; row < moduleCount; row++){
            for(let col = 0; col < moduleCount; col++){
                let sameCount = 0;
                let dark = qrCode.isDark(row, col);
                for(let r = -1; r <= 1; r++){
                    if (row + r < 0 || moduleCount <= row + r) {
                        continue;
                    }
                    for(let c = -1; c <= 1; c++){
                        if (col + c < 0 || moduleCount <= col + c) {
                            continue;
                        }
                        if (r == 0 && c == 0) {
                            continue;
                        }
                        if (dark == qrCode.isDark(row + r, col + c)) {
                            sameCount++;
                        }
                    }
                }
                if (sameCount > 5) {
                    lostPoint += 3 + sameCount - 5;
                }
            }
        }
        for(let row = 0; row < moduleCount - 1; row++){
            for(let col = 0; col < moduleCount - 1; col++){
                let count = 0;
                if (qrCode.isDark(row, col)) count++;
                if (qrCode.isDark(row + 1, col)) count++;
                if (qrCode.isDark(row, col + 1)) count++;
                if (qrCode.isDark(row + 1, col + 1)) count++;
                if (count == 0 || count == 4) {
                    lostPoint += 3;
                }
            }
        }
        for(let row = 0; row < moduleCount; row++){
            for(let col = 0; col < moduleCount - 6; col++){
                if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
                    lostPoint += 40;
                }
            }
        }
        for(let col = 0; col < moduleCount; col++){
            for(let row = 0; row < moduleCount - 6; row++){
                if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
                    lostPoint += 40;
                }
            }
        }
        let darkCount = 0;
        for(let col = 0; col < moduleCount; col++){
            for(let row = 0; row < moduleCount; row++){
                if (qrCode.isDark(row, col)) {
                    darkCount++;
                }
            }
        }
        let ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
        lostPoint += ratio * 10;
        return lostPoint;
    }
};


/***/ }),

/***/ "./src/shared/registry.js":
/*!********************************!*\
  !*** ./src/shared/registry.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");

const registry = {};
/**
 * The "elements" namespace groups methods relevant to registering custom
 * HTML elements.
 * @namespace api.elements
 * @memberOf api
 */ const elements = {
    registry,
    /**
     * Defines a new custom HTML element.
     *
     * By using this API instead of `customElements.define` from the DOM,
     * we can allow custom elements to be overwritten.
     *
     * Once `converse.initialize()` is called, `api.elements.register()`
     * will get called and all custom elements will be registered to the DOM,
     * from which point onward they cannot be overwritten.
     *
     * @method api.elements.define
     * @param { string } name
     * @param { object } constructor
     */ define (name, constructor) {
        this.registry[name] = constructor;
    },
    /**
     * Registers all previously defined custom HTML elements
     * @method api.elements.register
     */ register () {
        Object.keys(registry).forEach((name)=>{
            if (!customElements.get(name)) {
                customElements.define(name, registry[name]);
            }
        });
    }
};
Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api, {
    elements
});


/***/ }),

/***/ "./src/shared/styles/index.scss":
/*!**************************************!*\
  !*** ./src/shared/styles/index.scss ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./index.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/styles/index.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_index_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/styles/status.scss":
/*!***************************************!*\
  !*** ./src/shared/styles/status.scss ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_status_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./status.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/styles/status.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_status_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_status_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_status_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_status_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/texture/components/image.js":
/*!************************************************!*\
  !*** ./src/shared/texture/components/image.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Image)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var shared_components_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/components/element */ "./src/shared/components/element.js");
/* harmony import */ var shared_texture_templates_gif_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! shared/texture/templates/gif.js */ "./src/shared/texture/templates/gif.js");
/* harmony import */ var utils_url_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! utils/url.js */ "./src/utils/url.js");
/* harmony import */ var _templates_image_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../templates/image.js */ "./src/shared/texture/templates/image.js");





const { isGIFURL } = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u;
class Image extends shared_components_element__WEBPACK_IMPORTED_MODULE_1__.CustomElement {
    static get properties() {
        return {
            src: {
                type: String
            },
            onImgLoad: {
                type: Function
            },
            // If specified, image is wrapped in a hyperlink that points to this URL.
            href: {
                type: String
            }
        };
    }
    render() {
        if (isGIFURL(this.src) && (0,utils_url_js__WEBPACK_IMPORTED_MODULE_3__.shouldRenderMediaFromURL)(this.src, "image")) {
            return (0,shared_texture_templates_gif_js__WEBPACK_IMPORTED_MODULE_2__["default"])((0,utils_url_js__WEBPACK_IMPORTED_MODULE_3__.filterQueryParamsFromURL)(this.src), true);
        } else {
            return (0,_templates_image_js__WEBPACK_IMPORTED_MODULE_4__["default"])({
                "src": (0,utils_url_js__WEBPACK_IMPORTED_MODULE_3__.filterQueryParamsFromURL)(this.src),
                "href": this.href,
                "onClick": this.onImgClick,
                "onLoad": this.onImgLoad
            });
        }
    }
    constructor(){
        super();
        this.src = null;
        this.href = null;
        this.onImgClick = null;
        this.onImgLoad = null;
    }
}

_converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.elements.define("converse-image", Image);


/***/ }),

/***/ "./src/shared/texture/components/texture.js":
/*!**************************************************!*\
  !*** ./src/shared/texture/components/texture.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Texture)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _directives_texture_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../directives/texture.js */ "./src/shared/texture/directives/texture.js");
/* harmony import */ var _styles_texture_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../styles/texture.scss */ "./src/shared/texture/styles/texture.scss");



class Texture extends lit__WEBPACK_IMPORTED_MODULE_0__.LitElement {
    static get properties() {
        return {
            embed_audio: {
                type: Boolean
            },
            embed_videos: {
                type: Boolean
            },
            mentions: {
                type: Array
            },
            nick: {
                type: String
            },
            offset: {
                type: Number
            },
            onImgClick: {
                type: Function
            },
            onImgLoad: {
                type: Function
            },
            render_styling: {
                type: Boolean
            },
            show_images: {
                type: Boolean
            },
            // If media URLs are rendered as media, then this option determines
            // whether the original URL is also still shown or not.
            // Only relevant in conjunction with `show_images`, `embed_audio` and `embed_videos`.
            hide_media_urls: {
                type: Boolean
            },
            show_me_message: {
                type: Boolean
            },
            text: {
                type: String
            }
        };
    }
    createRenderRoot() {
        // Render without the shadow DOM
        return this;
    }
    render() {
        const options = {
            embed_audio: this.embed_audio,
            embed_videos: this.embed_videos,
            hide_media_urls: this.hide_media_urls,
            mentions: this.mentions,
            nick: this.nick,
            onImgClick: this.onImgClick,
            onImgLoad: this.onImgLoad,
            render_styling: this.render_styling,
            show_images: this.show_images,
            show_me_message: this.show_me_message
        };
        return (0,_directives_texture_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.text, this.offset, options);
    }
    constructor(){
        super();
        this.nick = null;
        this.onImgClick = null;
        this.onImgLoad = null;
        this.text = null;
        this.embed_audio = false;
        this.embed_videos = false;
        this.hide_media_urls = false;
        this.mentions = [];
        this.offset = 0;
        this.render_styling = false;
        this.show_image_urls = true;
        this.show_images = false;
        this.show_me_message = false;
    }
}
/**
 * The Texture custom element allows you to parse transform text into rich DOM elements.
 * @example <converse-texture text="*_hello_ world!*"></converse-texture>
 */ 
customElements.define("converse-texture", Texture);


/***/ }),

/***/ "./src/shared/texture/constants.js":
/*!*****************************************!*\
  !*** ./src/shared/texture/constants.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bracketing_directives: () => (/* binding */ bracketing_directives),
/* harmony export */   dont_escape: () => (/* binding */ dont_escape),
/* harmony export */   styling_directives: () => (/* binding */ styling_directives),
/* harmony export */   styling_map: () => (/* binding */ styling_map)
/* harmony export */ });
const bracketing_directives = [
    "*",
    "_",
    "~",
    "`"
];
const styling_directives = [
    ...bracketing_directives,
    "```",
    ">"
];
const styling_map = {
    "*": {
        "name": "strong",
        "type": "span"
    },
    "_": {
        "name": "emphasis",
        "type": "span"
    },
    "~": {
        "name": "strike",
        "type": "span"
    },
    "`": {
        "name": "preformatted",
        "type": "span"
    },
    "```": {
        "name": "preformatted_block",
        "type": "block"
    },
    ">": {
        "name": "quote",
        "type": "block"
    }
};
const dont_escape = [
    "_",
    ">",
    "`",
    "~"
];


/***/ }),

/***/ "./src/shared/texture/directives/image.js":
/*!************************************************!*\
  !*** ./src/shared/texture/directives/image.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   renderImage: () => (/* binding */ renderImage)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_async_directive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/async-directive.js */ "./node_modules/lit/async-directive.js");
/* harmony import */ var lit_directive_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directive.js */ "./node_modules/lit/directive.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var utils_html_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! utils/html.js */ "./src/utils/html.js");





const { isURLWithImageExtension } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.u;
class ImageDirective extends lit_async_directive_js__WEBPACK_IMPORTED_MODULE_1__.AsyncDirective {
    /**
     * @param {string} src - The source URL of the image.
     * @param {string} [href] - The optional hyperlink for the image.
     * @param {Function} [onLoad] - Callback function to be called once the image has loaded.
     * @param {Function} [onClick] - Callback function to be called once the image has been clicked.
     * @returns {import('lit').TemplateResult}
     */ render(src, href, onLoad, onClick) {
        return href ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a href="${href}" class="chat-image__link" target="_blank" rel="noopener">${this.renderImage(src, href, onLoad, onClick)}</a>` : this.renderImage(src, href, onLoad, onClick);
    }
    /**
     * @param {string} src - The source URL of the image.
     * @param {string} [href] - The optional hyperlink for the image.
     * @param {Function} [onLoad] - Callback function to be called once the image has loaded.
     * @param {Function} [onClick] - Callback function to be called once the image has been clicked.
     * @returns {import('lit').TemplateResult}
     */ renderImage(src, href, onLoad, onClick) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<img class="chat-image img-thumbnail" loading="lazy" src="${src}" @click="${onClick}" @error="${()=>this.onError(src, href, onLoad, onClick)}" @load="${onLoad}">`;
    }
    /**
     * Handles errors that occur during image loading.
     * @param {string} src - The source URL of the image that failed to load.
     * @param {string} [href] - The optional hyperlink for the image.
     * @param {Function} [onLoad] - Callback function to be called once the image has loaded.
     * @param {Function} [onClick] - Callback function to be called once the image has been clicked.
     */ onError(src, href, onLoad, onClick) {
        if (isURLWithImageExtension(src)) {
            href && this.setValue((0,utils_html_js__WEBPACK_IMPORTED_MODULE_4__.getHyperlinkTemplate)(href));
        } else {
            try {
                const url = new URL(src);
                const filename = url.pathname.split("/").pop();
                if (filename) {
                    const new_filename = `${filename}.png`;
                    url.pathname = url.pathname.replace(filename, new_filename);
                    this.setValue(renderImage(url.toString(), href, onLoad, onClick));
                }
            } catch (error) {
                console.error("Invalid URL:", src);
            }
        }
    }
}
/**
 * lit directive which attempts to render an <img> element from a URL.
 * It will fall back to rendering an <a> element if it can't.
 *
 * @param { String } src - The value that will be assigned to the `src` attribute of the `<img>` element.
 * @param { String } href - The value that will be assigned to the `href` attribute of the `<img>` element.
 * @param { Function } onLoad - A callback function to be called once the image has loaded.
 * @param { Function } onClick - A callback function to be called once the image has been clicked.
 */ const renderImage = (0,lit_directive_js__WEBPACK_IMPORTED_MODULE_2__.directive)(ImageDirective);


/***/ }),

/***/ "./src/shared/texture/directives/texture.js":
/*!**************************************************!*\
  !*** ./src/shared/texture/directives/texture.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var lit_directive_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directive.js */ "./node_modules/lit/directive.js");
/* harmony import */ var _texture_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../texture.js */ "./src/shared/texture/texture.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}




class TextureRenderer {
    transform() {
        return _async_to_generator(function*() {
            const text = new _texture_js__WEBPACK_IMPORTED_MODULE_3__.Texture(this.text, this.offset, this.options);
            try {
                yield text.addTemplates();
            } catch (e) {
                console.error(e);
            }
            return text.payload;
        }).call(this);
    }
    render() {
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(this.transform(), (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${this.text}`)}`;
    }
    /**
     * @param {string} text
     * @param {number} offset
     */ constructor(text, offset, options = {}){
        this.offset = offset;
        this.options = options;
        this.text = text;
    }
}
class TextureDirective extends lit_directive_js__WEBPACK_IMPORTED_MODULE_2__.Directive {
    /**
     * @param {string} text
     * @param {number} offset
     * @param {object} options
     * @param {Function} [callback]
     */ render(text, offset, options, callback) {
        const renderer = new TextureRenderer(text, offset, options);
        const result = renderer.render();
        callback === null || callback === void 0 ? void 0 : callback();
        return result;
    }
}
const renderTexture = (0,lit_directive_js__WEBPACK_IMPORTED_MODULE_2__.directive)(TextureDirective);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (renderTexture);


/***/ }),

/***/ "./src/shared/texture/styles/audio.scss":
/*!**********************************************!*\
  !*** ./src/shared/texture/styles/audio.scss ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_audio_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./audio.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/texture/styles/audio.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_audio_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_audio_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_audio_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_audio_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/texture/styles/texture.scss":
/*!************************************************!*\
  !*** ./src/shared/texture/styles/texture.scss ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_texture_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./texture.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/shared/texture/styles/texture.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_texture_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_texture_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_texture_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_texture_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/shared/texture/templates/audio.js":
/*!***********************************************!*\
  !*** ./src/shared/texture/templates/audio.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _styles_audio_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../styles/audio.scss */ "./src/shared/texture/styles/audio.scss");



/**
 * @param {string} url
 * @param {boolean} [hide_url]
 * @param {string} [title]
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((url, hide_url, title)=>{
    const { hostname } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getURL(url);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<figure class="audio-element">${title || !hide_url ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<figcaption>${title ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${title}<br>` : ""} ${hide_url ? "" : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a target="_blank" rel="noopener" title="${url}" href="${url}">${hostname}</a>`}</figcaption>` : ""}<audio controls src="${url}"></audio></figure>`;
});


/***/ }),

/***/ "./src/shared/texture/templates/gif.js":
/*!*********************************************!*\
  !*** ./src/shared/texture/templates/gif.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var shared_gif_component_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! shared/gif/component.js */ "./src/shared/gif/component.js");


/**
 * @param {string} url
 * @param {boolean} hide_url
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((url, hide_url)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<converse-gif autoplay noloop fallback="empty" src="${url}"></converse-gif>${hide_url ? '' : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a target="_blank" rel="noopener" href="${url}">${url}</a>`}`);


/***/ }),

/***/ "./src/shared/texture/templates/image.js":
/*!***********************************************!*\
  !*** ./src/shared/texture/templates/image.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _directives_image_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../directives/image.js */ "./src/shared/texture/directives/image.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,_directives_image_js__WEBPACK_IMPORTED_MODULE_1__.renderImage)(o.src || o.url, o.href, o.onLoad, o.onClick)}`);


/***/ }),

/***/ "./src/shared/texture/templates/spotify.js":
/*!*************************************************!*\
  !*** ./src/shared/texture/templates/spotify.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


/**
 * @param {string} song_id - The ID of the song to embed.
 * @param {string} url - The URL to link to (if not hidden).
 * @param {boolean} hide_url - Flag to determine if the URL should be hidden.
 * @returns {import('lit').TemplateResult}
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((song_id, url, hide_url)=>{
    const { hostname } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getURL(url);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<figure><iframe style="border-radius:12px" src="https://open.spotify.com/embed/track/${song_id}" width="100%" height="352" frameborder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>${hide_url ? "" : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a target="_blank" rel="noopener" title="${url}" href="${url}">${hostname}</a>`}</figure>`;
});


/***/ }),

/***/ "./src/shared/texture/templates/video.js":
/*!***********************************************!*\
  !*** ./src/shared/texture/templates/video.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


/**
 * @param {string} url
 * @param {boolean} [hide_url]
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((url, hide_url)=>{
    const { hostname } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getURL(url);
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<figure><video controls preload="metadata" src="${url}"></video>${hide_url || !hostname ? "" : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<a target="_blank" rel="noopener" title="${url}" href="${url}">${hostname}</a>`}</figure>`;
});


/***/ }),

/***/ "./src/shared/texture/texture.js":
/*!***************************************!*\
  !*** ./src/shared/texture/texture.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Texture: () => (/* binding */ Texture),
/* harmony export */   getDirectiveTemplate: () => (/* binding */ getDirectiveTemplate)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var lit_directive_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lit/directive.js */ "./node_modules/lit/directive.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _templates_audio_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./templates/audio.js */ "./src/shared/texture/templates/audio.js");
/* harmony import */ var _templates_gif_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./templates/gif.js */ "./src/shared/texture/templates/gif.js");
/* harmony import */ var _templates_image_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./templates/image.js */ "./src/shared/texture/templates/image.js");
/* harmony import */ var _templates_video_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./templates/video.js */ "./src/shared/texture/templates/video.js");
/* harmony import */ var _templates_spotify_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./templates/spotify.js */ "./src/shared/texture/templates/spotify.js");
/* harmony import */ var _chat_utils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../chat/utils.js */ "./src/shared/chat/utils.js");
/* harmony import */ var _utils_html_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/html.js */ "./src/utils/html.js");
/* harmony import */ var utils_url_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! utils/url.js */ "./src/utils/url.js");
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils.js */ "./src/shared/texture/utils.js");
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./constants.js */ "./src/shared/texture/constants.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}














const { addMediaURLsOffset, convertASCII2Emoji, getCodePointReferences, getMediaURLsMetadata, getShortnameReferences } = _converse_headless__WEBPACK_IMPORTED_MODULE_3__.u;
/**
 * @class Texture
 * A String subclass that is used to render rich text (i.e. text that contains
 * hyperlinks, images, mentions, styling etc.).
 *
 * The "rich" parts of the text is represented by lit TemplateResult
 * objects which are added via the {@link Texture.addTemplateResult}
 * method and saved as metadata.
 *
 * By default Converse adds TemplateResults to support emojis, hyperlinks,
 * images, map URIs and mentions.
 *
 * 3rd party plugins can listen for the `beforeMessageBodyTransformed`
 * and/or `afterMessageBodyTransformed` events and then call
 * `addTemplateResult` on the Texture instance in order to add their own
 * rich features.
 */ class Texture extends String {
    /**
     * @param {string} url - The URL to be checked
     * @param {'audio'|'image'|'video'} type - The type of media
     */ shouldRenderMedia(url, type) {
        let override;
        if (type === "image") {
            override = this.show_images;
        } else if (type === "audio") {
            override = this.embed_audio;
        } else if (type === "video") {
            override = this.embed_videos;
        }
        if (typeof override === "boolean") {
            return override;
        }
        return (0,utils_url_js__WEBPACK_IMPORTED_MODULE_11__.shouldRenderMediaFromURL)(url, type);
    }
    /**
     * Look for `http` URIs and return templates that render them as URL links
     * @param {MediaURLMetadata} url_obj
     * @returns {Promise<string|import('lit').TemplateResult>}
     */ addHyperlinkTemplate(url_obj) {
        return _async_to_generator(function*() {
            const { url } = url_obj;
            const filtered_url = (0,utils_url_js__WEBPACK_IMPORTED_MODULE_11__.filterQueryParamsFromURL)(url);
            let template;
            if (url_obj.is_gif && this.shouldRenderMedia(url, "image")) {
                template = (0,_templates_gif_js__WEBPACK_IMPORTED_MODULE_5__["default"])(filtered_url, this.hide_media_urls);
            } else if (url_obj.is_image && this.shouldRenderMedia(url, "image")) {
                template = (0,_templates_image_js__WEBPACK_IMPORTED_MODULE_6__["default"])({
                    src: filtered_url,
                    // XXX: bit of an abuse of `hide_media_urls`, might want a dedicated option here
                    href: this.hide_media_urls ? null : filtered_url,
                    onClick: this.onImgClick,
                    onLoad: this.onImgLoad
                });
            } else if (url_obj.is_video && this.shouldRenderMedia(url, "video")) {
                template = (0,_templates_video_js__WEBPACK_IMPORTED_MODULE_7__["default"])(filtered_url, this.hide_media_urls);
            } else if (url_obj.is_audio && this.shouldRenderMedia(url, "audio")) {
                template = (0,_templates_audio_js__WEBPACK_IMPORTED_MODULE_4__["default"])(filtered_url, this.hide_media_urls);
            } else if (_converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get("embed_3rd_party_media_players") && (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.isSpotifyTrack)(url)) {
                const song_id = url.split("/track/")[1];
                template = (0,_templates_spotify_js__WEBPACK_IMPORTED_MODULE_8__["default"])(song_id, url, this.hide_media_urls);
            }
            return template || (0,_utils_html_js__WEBPACK_IMPORTED_MODULE_10__.getHyperlinkTemplate)(filtered_url);
        }).call(this);
    }
    /**
     * Look for `http` URIs and return templates that render them as URL links
     * @param {string} text
     * @param {number} local_offset - The index of the passed in text relative to
     *  the start of this Texture instance (which is not necessarily the same as the
     *  offset from the start of the original message stanza's body text).
     */ addHyperlinks(text, local_offset) {
        return _async_to_generator(function*() {
            const full_offset = local_offset + this.offset;
            const urls_meta = this.media_urls || (yield getMediaURLsMetadata(text, local_offset)).media_urls || [];
            const media_urls = addMediaURLsOffset(urls_meta, text, full_offset);
            yield Promise.all(media_urls.filter((o)=>!o.is_encrypted).map((o)=>_async_to_generator(function*() {
                    const template = yield this.addHyperlinkTemplate(o);
                    this.addTemplateResult(o.start + local_offset, o.end + local_offset, template);
                }).call(this)));
        }).call(this);
    }
    /**
     * Look for `geo` URIs and return templates that render them as URL links
     * @param {String} text
     * @param {number} offset - The index of the passed in text relative to
     *  the start of the message body text.
     */ addMapURLs(text, offset) {
        const regex = /geo:([\-0-9.]+),([\-0-9.]+)(?:,([\-0-9.]+))?(?:\?(.*))?/g;
        const matches = text.matchAll(regex);
        for (const m of matches){
            this.addTemplateResult(m.index + offset, m.index + m[0].length + offset, (0,_utils_html_js__WEBPACK_IMPORTED_MODULE_10__.getHyperlinkTemplate)(m[0].replace(regex, _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.settings.get("geouri_replacement"))));
        }
    }
    /**
     * Look for emojis (shortnames or unicode) and add templates for rendering them.
     * @param {String} text
     * @param {number} offset - The index of the passed in text relative to
     *  the start of the message body text.
     */ addEmojis(text, offset) {
        const references = [
            ...getShortnameReferences(text.toString()),
            ...getCodePointReferences(text.toString())
        ];
        references.forEach((e)=>{
            this.addTemplateResult(e.begin + offset, e.end + offset, (0,_chat_utils_js__WEBPACK_IMPORTED_MODULE_9__.getEmojiMarkup)(e, {
                add_title_wrapper: true
            }));
        });
    }
    /**
     * Look for mentions included as XEP-0372 references and add templates for
     * rendering them.
     * @param {String} text
     * @param {number} local_offset - The index of the passed in text relative to
     *  the start of this Texture instance (which is not necessarily the same as the
     *  offset from the start of the original message stanza's body text).
     */ addMentions(text, local_offset) {
        var _this_mentions;
        const full_offset = local_offset + this.offset;
        (_this_mentions = this.mentions) === null || _this_mentions === void 0 ? void 0 : _this_mentions.forEach((ref)=>{
            const begin = Number(ref.begin) - full_offset;
            if (begin < 0 || begin >= full_offset + text.length) {
                return;
            }
            const end = Number(ref.end) - full_offset;
            const mention = text.slice(begin, end);
            if (mention === this.nick) {
                this.addTemplateResult(begin + local_offset, end + local_offset, (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.tplMentionWithNick)(_object_spread_props(_object_spread({}, ref), {
                    mention
                })));
            } else {
                this.addTemplateResult(begin + local_offset, end + local_offset, (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.tplMention)(_object_spread_props(_object_spread({}, ref), {
                    mention
                })));
            }
        });
    }
    /**
     * Look for XEP-0393 styling directives and add templates for rendering them.
     */ addStyling() {
        if (!(0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.containsDirectives)(this)) {
            return;
        }
        const references = [];
        const mention_ranges = this.mentions.map((m)=>Array.from({
                "length": Number(m.end)
            }, (_, i)=>Number(m.begin) + i));
        let i = 0;
        while(i < this.length){
            if (mention_ranges.filter((r)=>r.includes(i)).length) {
                // eslint-disable-line no-loop-func
                // Don't treat potential directives if they fall within a
                // declared XEP-0372 reference
                i++;
                continue;
            }
            const { d, length } = (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.getDirectiveAndLength)(this, i);
            if (d && length) {
                const is_quote = (0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.isQuoteDirective)(d);
                const end = i + length;
                const slice_end = is_quote ? end : end - d.length;
                let slice_begin = d === "```" ? i + d.length + 1 : i + d.length;
                if (is_quote && this[slice_begin] === " ") {
                    // Trim leading space inside codeblock
                    slice_begin += 1;
                }
                const offset = slice_begin;
                const text = this.slice(slice_begin, slice_end);
                references.push({
                    begin: i,
                    template: getDirectiveTemplate(d, text, offset, this.options),
                    end
                });
                i = end;
            }
            i++;
        }
        references.forEach((ref)=>this.addTemplateResult(ref.begin, ref.end, ref.template));
    }
    trimMeMessage() {
        if (this.offset === 0) {
            // Subtract `/me ` from 3rd person messages
            if (this.isMeCommand()) {
                this.payload[0] = this.payload[0].substring(4);
            }
        }
    }
    /**
     * Look for plaintext (i.e. non-templated) sections of this Texture
     * instance and add references via the passed in function.
     * @param {Function} func
     */ addAnnotations(func) {
        return _async_to_generator(function*() {
            const payload = this.marshall();
            let idx = 0; // The text index of the element in the payload
            for (const text of payload){
                if (!text) {
                    continue;
                } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.isString)(text)) {
                    yield func.call(this, text, idx);
                    idx += text.length;
                } else {
                    idx = text.end;
                }
            }
        }).call(this);
    }
    /**
     * Parse the text and add template references for rendering the "rich" parts.
     **/ addTemplates() {
        return _async_to_generator(function*() {
            /**
         * Synchronous event which provides a hook for transforming a chat message's body text
         * before the default transformations have been applied.
         * @event _converse#beforeMessageBodyTransformed
         * @param {Texture} text - A {@link Texture } instance. You
         *  can call {@link Texture#addTemplateResult } on it in order to
         *  add TemplateResult objects meant to render rich parts of the message.
         * @example _converse.api.listen.on('beforeMessageBodyTransformed', (view, text) => { ... });
         */ yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.trigger("beforeMessageBodyTransformed", this, {
                synchronous: true
            });
            this.render_styling && this.addStyling();
            yield this.addAnnotations(this.addMentions);
            yield this.addAnnotations(this.addHyperlinks);
            yield this.addAnnotations(this.addMapURLs);
            yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.emojis.initialize();
            yield this.addAnnotations(this.addEmojis);
            /**
         * Synchronous event which provides a hook for transforming a chat message's body text
         * after the default transformations have been applied.
         * @event _converse#afterMessageBodyTransformed
         * @param { Texture } text - A {@link Texture } instance. You
         *  can call {@link Texture#addTemplateResult} on it in order to
         *  add TemplateResult objects meant to render rich parts of the message.
         * @example _converse.api.listen.on('afterMessageBodyTransformed', (view, text) => { ... });
         */ yield _converse_headless__WEBPACK_IMPORTED_MODULE_3__.api.trigger("afterMessageBodyTransformed", this, {
                synchronous: true
            });
            this.payload = this.marshall();
            this.options.show_me_message && this.trimMeMessage();
            this.payload = this.payload.map((item)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.isString)(item) ? item : item.template);
        }).call(this);
    }
    /**
     * The "rich" markup parts of a chat message are represented by lit
     * TemplateResult objects.
     *
     * This method can be used to add new template results to this message's
     * text.
     *
     * @method Texture.addTemplateResult
     * @param {Number} begin - The starting index of the plain message text
     * which is being replaced with markup.
     * @param {Number} end - The ending index of the plain message text
     * which is being replaced with markup.
     * @param {Object} template - The lit TemplateResult instance
     */ addTemplateResult(begin, end, template) {
        this.references.push({
            begin,
            end,
            template
        });
    }
    isMeCommand() {
        const text = this.toString();
        if (!text) {
            return false;
        }
        return text.startsWith("/me ");
    }
    /**
     * Take the annotations and return an array of text and TemplateResult
     * instances to be rendered to the DOM.
     * @method Texture#marshall
     */ marshall() {
        let list = [
            this.toString()
        ];
        this.references.sort((a, b)=>b.begin - a.begin).forEach((ref)=>{
            const text = list.shift();
            list = [
                text.slice(0, ref.begin),
                ref,
                text.slice(ref.end),
                ...list
            ];
        });
        return list.reduce((acc, i)=>(0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.isString)(i) ? [
                ...acc,
                convertASCII2Emoji((0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.collapseLineBreaks)(i))
            ] : [
                ...acc,
                i
            ], []);
    }
    /**
     * @typedef {import('@converse/headless/types/utils/types').MediaURLMetadata} MediaURLMetadata
     */ /**
     * Create a new {@link Texture} instance.
     * @param {string} text - The text to be annotated
     * @param {number} offset - The offset of this particular piece of text
     *  from the start of the original message text. This is necessary because
     *  Texture instances can be nested when templates call directives
     *  which create new Texture instances (as happens with XEP-393 styling directives).
     * @param {Object} [options]
     * @param {string} [options.nick] - The current user's nickname (only relevant if the message is in a XEP-0045 MUC)
     * @param {boolean} [options.render_styling] - Whether XEP-0393 message styling should be applied to the message
     * @param {boolean} [options.embed_audio] - Whether audio URLs should be rendered as <audio> elements.
     *  If set to `true`, then audio files will always be rendered with an
     *  audio player. If set to `false`, they won't, and if not defined, then the `embed_audio` setting
     *  is used to determine whether they should be rendered as playable audio or as hyperlinks.
     * @param {boolean} [options.embed_videos] - Whether video URLs should be rendered as <video> elements.
     *  If set to `true`, then videos will always be rendered with a video
     *  player. If set to `false`, they won't, and if not defined, then the `embed_videos` setting
     *  is used to determine whether they should be rendered as videos or as hyperlinks.
     * @param {Array} [options.mentions] - An array of mention references
     * @param {MediaURLMetadata[]} [options.media_urls] - An array of {@link MediaURLMetadata} objects,
     *  used to render media such as images, videos and audio. It might not be
     *  possible to have the media metadata available, so if this value is
     *  `undefined` then the passed-in `text` will be parsed for URLs. If you
     *  don't want this parsing to happen, pass in an empty array for this
     *  option.
     * @param {boolean} [options.show_images] - Whether image URLs should be rendered as <img> elements.
     * @param {boolean} [options.show_me_message] - Whether /me messages should be rendered differently
     * @param {Function} [options.onImgClick] - Callback for when an inline rendered image has been clicked
     * @param {Function} [options.onImgLoad] - Callback for when an inline rendered image has been loaded
     * @param {boolean} [options.hide_media_urls] - Callback for when an inline rendered image has been loaded
     */ constructor(text, offset = 0, options = {}){
        super(text);
        this.embed_audio = options === null || options === void 0 ? void 0 : options.embed_audio;
        this.embed_videos = options === null || options === void 0 ? void 0 : options.embed_videos;
        this.mentions = (options === null || options === void 0 ? void 0 : options.mentions) || [];
        this.media_urls = options === null || options === void 0 ? void 0 : options.media_urls;
        this.nick = options === null || options === void 0 ? void 0 : options.nick;
        this.offset = offset;
        this.onImgClick = options === null || options === void 0 ? void 0 : options.onImgClick;
        this.onImgLoad = options === null || options === void 0 ? void 0 : options.onImgLoad;
        this.options = options;
        this.payload = [];
        this.references = [];
        this.render_styling = options === null || options === void 0 ? void 0 : options.render_styling;
        this.show_images = options === null || options === void 0 ? void 0 : options.show_images;
        this.hide_media_urls = options === null || options === void 0 ? void 0 : options.hide_media_urls;
    }
}
// Kept here to avoid circular dependencies
class StylingDirective extends lit_directive_js__WEBPACK_IMPORTED_MODULE_2__.Directive {
    /**
     * @param {Texture} t
     */ static transform(t) {
        return _async_to_generator(function*() {
            try {
                yield t.addTemplates();
            } catch (e) {
                console.error(e);
            }
            return t.payload;
        })();
    }
    /**
     * @param {string} txt
     * @param {number} offset
     * @param {object} options
     */ render(txt, offset, options) {
        const t = new Texture(txt, offset, Object.assign(options, {
            "show_images": false,
            "embed_videos": false,
            "embed_audio": false
        }));
        return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(StylingDirective.transform(t), (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${t}`)}`;
    }
}
const renderStyling = (0,lit_directive_js__WEBPACK_IMPORTED_MODULE_2__.directive)(StylingDirective);
// prettier-ignore
/* eslint-disable max-len */ const styling_templates = {
    // m is the chatbox model
    // i is the offset of this directive relative to the start of the original message
    emphasis: (txt, i, options)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="styling-directive">_</span><i>${renderStyling(txt, i, options)}</i><span class="styling-directive">_</span>`,
    preformatted: (txt)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="styling-directive">\`</span><code>${txt}</code><span class="styling-directive">\`</span>`,
    preformatted_block: (txt)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="styling-directive">\`\`\`</div><pre><code class="block">${txt}</code></pre><div class="styling-directive">\`\`\`</div>`,
    quote: (txt, i, options)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<blockquote>${renderStyling(txt, i, options)}</blockquote>`,
    strike: (txt, i, options)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="styling-directive">~</span><del>${renderStyling(txt, i, options)}</del><span class="styling-directive">~</span>`,
    strong: (txt, i, options)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="styling-directive">*</span><b>${renderStyling(txt, i, options)}</b><span class="styling-directive">*</span>`
};
/**
 * @param {string} d
 * @param {string} text
 * @param {number} offset
 * @param {object} options
 */ function getDirectiveTemplate(d, text, offset, options) {
    const template = styling_templates[_constants_js__WEBPACK_IMPORTED_MODULE_13__.styling_map[d].name];
    if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_12__.isQuoteDirective)(d)) {
        const newtext = text// Don't show the directive itself
        // This big [] corresponds to \s without newlines, to avoid issues when the > is the last character of the line
        .replace(/\n\u200B*>[ \f\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]?/g, (m)=>`\n${"\u200B".repeat(m.length - 1)}`).replace(/\n$/, ""); // Trim line-break at the end
        return template(newtext, offset, options);
    } else {
        return template(text, offset, options);
    }
}


/***/ }),

/***/ "./src/shared/texture/utils.js":
/*!*************************************!*\
  !*** ./src/shared/texture/utils.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   collapseLineBreaks: () => (/* binding */ collapseLineBreaks),
/* harmony export */   containsDirectives: () => (/* binding */ containsDirectives),
/* harmony export */   getDirectiveAndLength: () => (/* binding */ getDirectiveAndLength),
/* harmony export */   getHeaders: () => (/* binding */ getHeaders),
/* harmony export */   isQuoteDirective: () => (/* binding */ isQuoteDirective),
/* harmony export */   isSpotifyTrack: () => (/* binding */ isSpotifyTrack),
/* harmony export */   isString: () => (/* binding */ isString),
/* harmony export */   tplMention: () => (/* binding */ tplMention),
/* harmony export */   tplMentionWithNick: () => (/* binding */ tplMentionWithNick)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./src/shared/texture/constants.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}



/**
 * @param {any} s
 * @returns {boolean} - Returns true if the input is a string, otherwise false.
 */ function isString(s) {
    return typeof s === "string";
}
/**
 * @param {string} url
 * @returns {boolean}
 */ function isSpotifyTrack(url) {
    try {
        const { hostname, pathname } = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getURL(url);
        return hostname === "open.spotify.com" && pathname.startsWith("/track/");
    } catch (e) {
        console.debug(`Could not create URL object from ${url}`);
        return false;
    }
}
/**
 * @param {string} url
 * @returns {Promise<Headers>}
 */ function getHeaders(url) {
    return _async_to_generator(function*() {
        try {
            const response = yield fetch(url, {
                method: "HEAD"
            });
            return response.headers;
        } catch (e) {
            console.debug(`Error calling HEAD on url ${url}: ${e}`);
            return null;
        }
    })();
}
/**
 * We don't render more than two line-breaks, replace extra line-breaks with
 * the zero-width whitespace character
 * This takes into account other characters that may have been removed by
 * being replaced with a zero-width space, such as '> ' in the case of
 * multi-line quotes.
 * @param {string} text
 */ function collapseLineBreaks(text) {
    return text.replace(/\n(\u200B*\n)+/g, (m)=>{
        if (m.length > 2) {
            return `\n${"\u200B".repeat(m.length - 2)}\n`;
        } else if (m.length === 2) {
            return '\n\u200B';
        } else if (m.length === 1) {
            return '\u200B';
        }
    });
}
const tplMentionWithNick = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="mention mention--self badge badge-info" data-uri="${o.uri}">${o.mention}</span>`;
function tplMention(o) {
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="mention" data-uri="${o.uri}">${o.mention}</span>`;
}
/**
 * Checks whether a given character "d" at index "i" of "text" is a valid opening or closing directive.
 * @param {String} d - The potential directive
 * @param {import('./texture').Texture} text - The text in which  the directive appears
 * @param {Number} i - The directive index
 * @param {Boolean} opening - Check for a valid opening or closing directive
 * @returns {boolean}
 */ function isValidDirective(d, text, i, opening) {
    // Ignore directives that are parts of words
    // More info on the Regexes used here: https://javascript.info/regexp-unicode#unicode-properties-p
    if (opening) {
        const regex = RegExp(_constants__WEBPACK_IMPORTED_MODULE_2__.dont_escape.includes(d) ? `^(\\p{L}|\\p{N})${d}` : `^(\\p{L}|\\p{N})\\${d}`, "u");
        if (i > 1 && regex.test(text.slice(i - 1))) {
            return false;
        }
        const is_quote = isQuoteDirective(d);
        if (is_quote && i > 0 && text[i - 1] !== "\n") {
            // Quote directives must be on newlines
            return false;
        } else if (_constants__WEBPACK_IMPORTED_MODULE_2__.bracketing_directives.includes(d) && text[i + 1] === d) {
            // Don't consider empty bracketing directives as valid (e.g. **, `` etc.)
            return false;
        }
    } else {
        const regex = RegExp(_constants__WEBPACK_IMPORTED_MODULE_2__.dont_escape.includes(d) ? `^${d}(\\p{L}|\\p{N})` : `^\\${d}(\\p{L}|\\p{N})`, "u");
        if (i < text.length - 1 && regex.test(text.slice(i))) {
            return false;
        }
        if (_constants__WEBPACK_IMPORTED_MODULE_2__.bracketing_directives.includes(d) && text[i - 1] === d) {
            // Don't consider empty directives as valid (e.g. **, `` etc.)
            return false;
        }
    }
    return true;
}
/**
 * Given a specific index "i" of "text", return the directive it matches or null otherwise.
 * @param {import('./texture').Texture} text - The text in which  the directive appears
 * @param {Number} i - The directive index
 * @param {Boolean} opening - Whether we're looking for an opening or closing directive
 * @returns {string|null}
 */ function getDirective(text, i, opening = true) {
    let d;
    if (/(^```[\s,\u200B]*\n)|(^```[\s,\u200B]*$)/.test(text.slice(i)) && (i === 0 || text[i - 1] === ">" || /\n\u200B{0,2}$/.test(text.slice(0, i)))) {
        d = text.slice(i, i + 3);
    } else if (_constants__WEBPACK_IMPORTED_MODULE_2__.styling_directives.includes(text.slice(i, i + 1))) {
        d = text.slice(i, i + 1);
        if (!isValidDirective(d, text, i, opening)) return null;
    } else {
        return null;
    }
    return d;
}
/**
 * @param {import('./texture').Texture} text
 * @param {number} i
 */ function getDirectiveAndLength(text, i) {
    const d = getDirective(text, i);
    const length = d ? getDirectiveLength(d, text, i) : 0;
    return length > 0 ? {
        d,
        length
    } : {};
}
/**
 * Given a directive "d", which occurs in "text" at index "i", check that it
 * has a valid closing directive and return the length from start to end of the
 * directive.
 * @param {String} d -The directive
 * @param {Number} i - The directive index
 * @param {import('./texture').Texture} text -The text in which the directive appears
 */ function getDirectiveLength(d, text, i) {
    if (!d) return 0;
    const begin = i;
    i += d.length;
    if (isQuoteDirective(d)) {
        i += text.slice(i).split(/\n\u200B*[^>\u200B]/).shift().length;
        return i - begin;
    } else if (_constants__WEBPACK_IMPORTED_MODULE_2__.styling_map[d].type === "span") {
        const line = text.slice(i).split("\n").shift();
        let j = 0;
        let idx = line.indexOf(d);
        while(idx !== -1){
            if (getDirective(text, i + idx, false) === d) {
                return idx + 2 * d.length;
            }
            idx = line.indexOf(d, j++);
        }
        return 0;
    } else {
        // block directives
        const substring = text.slice(i + 1);
        let j = 0;
        let idx = substring.indexOf(d);
        while(idx !== -1){
            if (getDirective(text, i + 1 + idx, false) === d) {
                return idx + 1 + 2 * d.length;
            }
            idx = substring.indexOf(d, j++);
        }
        return 0;
    }
}
/**
 * @param {string} d
 */ function isQuoteDirective(d) {
    return [
        ">",
        "&gt;"
    ].includes(d);
}
/**
 * @param {import('./texture').Texture} text
 * @returns {boolean}
 */ function containsDirectives(text) {
    for(let i = 0; i < _constants__WEBPACK_IMPORTED_MODULE_2__.styling_directives.length; i++){
        if (text.includes(_constants__WEBPACK_IMPORTED_MODULE_2__.styling_directives[i])) {
            return true;
        }
    }
    return false;
}


/***/ }),

/***/ "./src/templates/file.js":
/*!*******************************!*\
  !*** ./src/templates/file.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18n */ "./src/i18n/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((url, name)=>{
    const i18n_download = (0,i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Download file "%1$s"', name);
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<a target="_blank" rel="noopener" href="${url}">${i18n_download}</a>`;
});


/***/ }),

/***/ "./src/templates/form_captcha.js":
/*!***************************************!*\
  !*** ./src/templates/form_captcha.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<fieldset class="mb-3">${o.label ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<label class="form-label">${o.label}</label>` : ''} <img src="data:${o.type};base64,${o.data}"> <input name="${o.name}" type="text" ?required="${o.required}"></fieldset>`);


/***/ }),

/***/ "./src/templates/form_checkbox.js":
/*!****************************************!*\
  !*** ./src/templates/form_checkbox.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<fieldset class="mb-3 form-check"><input id="${o.id}" name="${o.name}" type="checkbox" class="form-check-input" ?readonly="${o.readonly}" ?checked="${o.checked}" ?required="${o.required}"> <label class="form-check-label" for="${o.id}">${o.label} ${o.desc ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<small class="form-text text-muted">${o.desc}</small>` : ''}</label></fieldset>`);


/***/ }),

/***/ "./src/templates/form_date.js":
/*!************************************!*\
  !*** ./src/templates/form_date.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label for="${o.id}" class="form-label">${o.label} ${o.desc ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<small class="form-text text-muted">${o.desc}</small>` : ''}</label> <input class="form-control" id="${o.id}" name="${o.name}" type="datetime-local" value="${o.value || ''}" ?readonly="${o.readonly}" ?required="${o.required}"></div>`);


/***/ }),

/***/ "./src/templates/form_fixed.js":
/*!*************************************!*\
  !*** ./src/templates/form_fixed.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<p>${o.text}</p>`);


/***/ }),

/***/ "./src/templates/form_input.js":
/*!*************************************!*\
  !*** ./src/templates/form_input.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3">${o.type !== 'hidden' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<label for="${o.id}" class="form-label">${o.label} ${o.desc ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<small class="form-text text-muted">${o.desc}</small>` : ''}</label>` : ''} ${o.type === 'password' && o.fixed_username ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<input class="hidden-username" aria-hidden="true" type="text" autocomplete="username" value="${o.fixed_username}">` : ''} <input autocomplete="${o.autocomplete || ''}" class="form-control" id="${o.id}" name="${o.name}" placeholder="${o.placeholder || ''}" type="${o.type}" value="${o.value || ''}" ?readonly="${o.readonly}" ?required="${o.required}"></div>`);


/***/ }),

/***/ "./src/templates/form_select.js":
/*!**************************************!*\
  !*** ./src/templates/form_select.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

const tplOption = (o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<option value="${o.value}" ?selected="${o.selected}">${o.label}</option>`;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    var _o_options;
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label for="${o.id}" class="form-label">${o.label}</label> <select class="form-control" id="${o.id}" name="${o.name}" ?multiple="${o.multiple}">${(_o_options = o.options) === null || _o_options === void 0 ? void 0 : _o_options.map((o)=>tplOption(o))}</select></div>`;
});


/***/ }),

/***/ "./src/templates/form_textarea.js":
/*!****************************************!*\
  !*** ./src/templates/form_textarea.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>{
    const id = _converse_headless__WEBPACK_IMPORTED_MODULE_1__.u.getUniqueId();
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label class="form-label label-ta" for="${o.id}">${o.label} ${o.desc ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<small class="form-text text-muted">${o.desc}</small>` : ''}</label> <textarea name="${o.name}" id="${id}" ?readonly="${o.readonly}" ?required="${o.required}" class="form-control">${o.value}</textarea></div>`;
});


/***/ }),

/***/ "./src/templates/form_url.js":
/*!***********************************!*\
  !*** ./src/templates/form_url.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3"><label for="${o.id}" class="form-label">${o.label} ${o.desc ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<small id="o.id" class="form-text text-muted">${o.desc}</small>` : ''}</label><div><a class="form-url" target="_blank" rel="noopener" id="${o.id}" href="${o.value}">${o.value}</a></div></div>`);


/***/ }),

/***/ "./src/templates/form_username.js":
/*!****************************************!*\
  !*** ./src/templates/form_username.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o)=>(0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="mb-3">${o.type !== 'hidden' ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<label for="${o.id}" class="form-label">${o.label} ${o.desc ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<small class="form-text text-muted">${o.desc}</small>` : ''}</label>` : ''}<div class="input-group"><input name="${o.name}" class="form-control" id="${o.id}" type="${o.type}" value="${o.value || ''}" ?readonly="${o.readonly}" ?required="${o.required}"> ${o.domain ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="input-group-append"><div class="input-group-text" title="${o.domain}">${o.domain}</div></div>` : ''}</div></div>`);


/***/ }),

/***/ "./src/templates/hyperlink.js":
/*!************************************!*\
  !*** ./src/templates/hyperlink.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");


/**
 * @param {MouseEvent} ev
 */ function onClickXMPPURI(ev) {
    ev.preventDefault();
    _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.rooms.open(/** @type {HTMLAnchorElement} */ ev.target.href);
}
/**
 * @param {URL} url - The url object containing the link information.
 * @param {string} url_text - The text to display for the link.
 * @returns {import("lit").TemplateResult} The HTML template for the link.
 */ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((url, url_text)=>{
    if (url.protocol === "xmpp:" && url.searchParams.get("join") != null) {
        return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<a target="_blank" rel="noopener" @click="${onClickXMPPURI}" href="${url.href}">${url_text}</a>`;
    }
    return (0,lit__WEBPACK_IMPORTED_MODULE_1__.html)`<a target="_blank" rel="noopener" href="${url.href}">${url_text}</a>`;
});


/***/ }),

/***/ "./src/templates/spinner.js":
/*!**********************************!*\
  !*** ./src/templates/spinner.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var _styles_spinner_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./styles/spinner.scss */ "./src/templates/styles/spinner.scss");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((o = {})=>{
    return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="d-flex justify-content-center ${o.class}"><div class="spinner-grow" role="status"><span class="visually-hidden">Loading...</span></div></div>`;
});


/***/ }),

/***/ "./src/templates/styles/spinner.scss":
/*!*******************************************!*\
  !*** ./src/templates/styles/spinner.scss ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_spinner_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!../../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./spinner.scss */ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./src/templates/styles/spinner.scss");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_spinner_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_spinner_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_spinner_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_2_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_2_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_5_use_1_node_modules_postcss_loader_dist_cjs_js_ruleSet_1_rules_5_use_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_5_use_3_spinner_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./src/utils/color.js":
/*!****************************!*\
  !*** ./src/utils/color.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAuthorStyle: () => (/* binding */ getAuthorStyle)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lit/directives/until.js */ "./node_modules/lit/directives/until.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/**
 * @typedef {import('lit').TemplateResult} TemplateResult
 * @typedef {import('shared/chat/message').default} Message
 */ 


/**
 * @param {string} color
 * @param {string} append_style
 */ function getCSS(color, append_style = '') {
    return `color: ${color}!important;${append_style}`;
}
/**
 * @returns {string|TemplateResult}
 */ function getAuthorStyle(occupant) {
    if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('colorize_username')) {
        const color = occupant === null || occupant === void 0 ? void 0 : occupant.get('color');
        if (color) {
            return getCSS(color);
        } else {
            return occupant ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${(0,lit_directives_until_js__WEBPACK_IMPORTED_MODULE_1__.until)(occupant === null || occupant === void 0 ? void 0 : occupant.getColor().then(getCSS), '')}` : '';
        }
    }
}


/***/ }),

/***/ "./src/utils/file.js":
/*!***************************!*\
  !*** ./src/utils/file.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MIMETYPES_MAP: () => (/* binding */ MIMETYPES_MAP),
/* harmony export */   compressImage: () => (/* binding */ compressImage),
/* harmony export */   isImageWithAlphaChannel: () => (/* binding */ isImageWithAlphaChannel)
/* harmony export */ });
/* harmony import */ var client_compress__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! client-compress */ "./node_modules/client-compress/dist/index.js");
/* harmony import */ var client_compress__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(client_compress__WEBPACK_IMPORTED_MODULE_0__);
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
        var info = gen[key](arg);
        var value = info.value;
    } catch (error) {
        reject(error);
        return;
    }
    if (info.done) {
        resolve(value);
    } else {
        Promise.resolve(value).then(_next, _throw);
    }
}
function _async_to_generator(fn) {
    return function() {
        var self = this, args = arguments;
        return new Promise(function(resolve, reject) {
            var gen = fn.apply(self, args);
            function _next(value) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
            }
            function _throw(err) {
                asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
            }
            _next(undefined);
        });
    };
}

const MIMETYPES_MAP = {
    'aac': 'audio/aac',
    'abw': 'application/x-abiword',
    'arc': 'application/x-freearc',
    'avi': 'video/x-msvideo',
    'azw': 'application/vnd.amazon.ebook',
    'bin': 'application/octet-stream',
    'bmp': 'image/bmp',
    'bz': 'application/x-bzip',
    'bz2': 'application/x-bzip2',
    'cda': 'application/x-cdf',
    'csh': 'application/x-csh',
    'css': 'text/css',
    'csv': 'text/csv',
    'doc': 'application/msword',
    'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
    'eot': 'application/vnd.ms-fontobject',
    'epub': 'application/epub+zip',
    'gif': 'image/gif',
    'gz': 'application/gzip',
    'htm': 'text/html',
    'html': 'text/html',
    'ico': 'image/vnd.microsoft.icon',
    'ics': 'text/calendar',
    'jar': 'application/java-archive',
    'jpeg': 'image/jpeg',
    'jpg': 'image/jpeg',
    'js': 'text/javascript',
    'json': 'application/json',
    'jsonld': 'application/ld+json',
    'm4a': 'audio/mp4',
    'mid': 'audio/midi',
    'midi': 'audio/midi',
    'mjs': 'text/javascript',
    'mp3': 'audio/mpeg',
    'mp4': 'video/mp4',
    'mpeg': 'video/mpeg',
    'mpkg': 'application/vnd.apple.installer+xml',
    'odp': 'application/vnd.oasis.opendocument.presentation',
    'ods': 'application/vnd.oasis.opendocument.spreadsheet',
    'odt': 'application/vnd.oasis.opendocument.text',
    'oga': 'audio/ogg',
    'ogv': 'video/ogg',
    'ogx': 'application/ogg',
    'opus': 'audio/opus',
    'otf': 'font/otf',
    'png': 'image/png',
    'pdf': 'application/pdf',
    'php': 'application/x-httpd-php',
    'ppt': 'application/vnd.ms-powerpoint',
    'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
    'rar': 'application/vnd.rar',
    'rtf': 'application/rtf',
    'sh': 'application/x-sh',
    'svg': 'image/svg+xml',
    'swf': 'application/x-shockwave-flash',
    'tar': 'application/x-tar',
    'tif': 'image/tiff',
    'tiff': 'image/tiff',
    'ts': 'video/mp2t',
    'ttf': 'font/ttf',
    'txt': 'text/plain',
    'vsd': 'application/vnd.visio',
    'wav': 'audio/wav',
    'weba': 'audio/webm',
    'webm': 'video/webm',
    'webp': 'image/webp',
    'woff': 'font/woff',
    'woff2': 'font/woff2',
    'xhtml': 'application/xhtml+xml',
    'xls': 'application/vnd.ms-excel',
    'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
    'xml': 'text/xml',
    'xul': 'application/vnd.mozilla.xul+xml',
    'zip': 'application/zip',
    '3gp': 'video/3gpp',
    '3g2': 'video/3gpp2',
    '7z': 'application/x-7z-compressed'
};
/**
 * Returns true if the passed in image file is a PNG image with transparency.
 * @param {File} image_file
 * @returns {Promise<boolean>}
 */ function isImageWithAlphaChannel(image_file) {
    return _async_to_generator(function*() {
        if (image_file.type === MIMETYPES_MAP['png']) {
            const buff_reader = new FileReader();
            return yield new Promise((resolve)=>{
                buff_reader.onloadend = (e)=>{
                    const view = new DataView(/** @type {ArrayBuffer} */ e.target.result);
                    // Check for alpha channel in PNG
                    if (view.getUint32(0) === 0x89504e47 && view.getUint32(4) === 0x0d0a1a0a) {
                        // https://www.w3.org/TR/png/#11IHDR
                        // The chunk exists at offset 8 +8 bytes (size, name) +8 (depth) & +9 (type)
                        const type = view.getUint8(8 + 8 + 9);
                        const greyscale_with_alpha = 4;
                        const color_with_alpha = 6;
                        resolve(type === greyscale_with_alpha || type === color_with_alpha);
                    }
                    resolve(false);
                };
                buff_reader.readAsArrayBuffer(image_file);
            });
        }
        return false;
    })();
}
/**
 * @param {File} file
 * @param {import('./types').CompressionOptions} options
 * @returns {Promise<Blob>}
 */ function compressImage(_0) {
    return _async_to_generator(function*(file, options = {
        targetSize: 0.1,
        quality: 0.75,
        maxWidth: 256,
        maxHeight: 256,
        maxUncompressedSize: 100
    }) {
        if (options.maxUncompressedSize && file.size > options.maxUncompressedSize * 1024) {
            delete options.maxUncompressedSize;
            const compress = new (client_compress__WEBPACK_IMPORTED_MODULE_0___default())(options);
            const conversions = yield compress.compress([
                file
            ]);
            const { photo } = conversions[0];
            return photo.data;
        }
        return file;
    }).apply(this, arguments);
}


/***/ }),

/***/ "./src/utils/html.js":
/*!***************************!*\
  !*** ./src/utils/html.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   addClass: () => (/* binding */ addClass),
/* harmony export */   ancestor: () => (/* binding */ ancestor),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   getFileName: () => (/* binding */ getFileName),
/* harmony export */   getHyperlinkTemplate: () => (/* binding */ getHyperlinkTemplate),
/* harmony export */   getNameAndValue: () => (/* binding */ getNameAndValue),
/* harmony export */   getOuterWidth: () => (/* binding */ getOuterWidth),
/* harmony export */   getRootElement: () => (/* binding */ getRootElement),
/* harmony export */   hasClass: () => (/* binding */ hasClass),
/* harmony export */   removeClass: () => (/* binding */ removeClass),
/* harmony export */   removeElement: () => (/* binding */ removeElement),
/* harmony export */   slideIn: () => (/* binding */ slideIn),
/* harmony export */   slideOut: () => (/* binding */ slideOut),
/* harmony export */   xFormField2TemplateResult: () => (/* binding */ xFormField2TemplateResult)
/* harmony export */ });
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lit */ "./node_modules/lit/index.js");
/* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.browser.esm.js");
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var templates_form_date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/form_date.js */ "./src/templates/form_date.js");
/* harmony import */ var _templates_form_captcha_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../templates/form_captcha.js */ "./src/templates/form_captcha.js");
/* harmony import */ var _templates_form_checkbox_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../templates/form_checkbox.js */ "./src/templates/form_checkbox.js");
/* harmony import */ var _templates_form_fixed_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../templates/form_fixed.js */ "./src/templates/form_fixed.js");
/* harmony import */ var _templates_form_input_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../templates/form_input.js */ "./src/templates/form_input.js");
/* harmony import */ var _templates_form_select_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../templates/form_select.js */ "./src/templates/form_select.js");
/* harmony import */ var _templates_form_textarea_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../templates/form_textarea.js */ "./src/templates/form_textarea.js");
/* harmony import */ var _templates_form_url_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../templates/form_url.js */ "./src/templates/form_url.js");
/* harmony import */ var _templates_form_username_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../templates/form_username.js */ "./src/templates/form_username.js");
/* harmony import */ var templates_hyperlink_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! templates/hyperlink.js */ "./src/templates/hyperlink.js");
/**
 * @copyright 2022, the Converse.js contributors
 * @license Mozilla Public License (MPLv2)
 * @description This is the DOM/HTML utilities module.
 * @typedef {import('lit').TemplateResult} TemplateResult
 */ function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}













const { sizzle, Strophe, dayjs } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.converse.env;
const { isValidURL } = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u;
const APPROVED_URL_PROTOCOLS = [
    'http:',
    'https:',
    'xmpp:',
    'mailto:'
];
const EMPTY_TEXT_REGEX = /\s*\n\s*/;
/**
 * @param {Element|Builder|Stanza} el
 */ function stripEmptyTextNodes(el) {
    if (el instanceof strophe_js__WEBPACK_IMPORTED_MODULE_1__.Builder || el instanceof strophe_js__WEBPACK_IMPORTED_MODULE_1__.Stanza) {
        el = el.tree();
    }
    let n;
    const text_nodes = [];
    const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, (node)=>{
        if (node.parentElement.nodeName.toLowerCase() === 'body') {
            return NodeFilter.FILTER_REJECT;
        }
        return NodeFilter.FILTER_ACCEPT;
    });
    while(n = walker.nextNode())text_nodes.push(n);
    text_nodes.forEach((n)=>EMPTY_TEXT_REGEX.test(/** @type {Text} */ n.data) && n.parentElement.removeChild(n));
    return el;
}
/**
 * @param {string} name
 * @param {{ new_password: string }} options
 */ function getAutoCompleteProperty(name, options) {
    return ({
        'muc#roomconfig_lang': 'language',
        'muc#roomconfig_roomsecret': (options === null || options === void 0 ? void 0 : options.new_password) ? 'new-password' : 'current-password'
    })[name];
}
/**
 * Given two XML or HTML elements, determine if they're equal
 * @param {Element} actual
 * @param {Element} expected
 * @returns {Boolean}
 */ function isEqualNode(actual, expected) {
    if (!_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.isElement(actual)) throw new Error('Element being compared must be an Element!');
    actual = stripEmptyTextNodes(actual);
    expected = stripEmptyTextNodes(expected);
    let isEqual = actual.isEqualNode(expected);
    if (!isEqual) {
        // XXX: This is a hack.
        // When creating two XML elements, one via DOMParser, and one via
        // createElementNS (or createElement), then "isEqualNode" doesn't match.
        //
        // For example, in the following code `isEqual` is false:
        // ------------------------------------------------------
        // const a = document.createElementNS('foo', 'div');
        // a.setAttribute('xmlns', 'foo');
        //
        // const b = (new DOMParser()).parseFromString('<div xmlns="foo"></div>', 'text/xml').firstElementChild;
        // const isEqual = a.isEqualNode(div); //  false
        //
        // The workaround here is to serialize both elements to string and then use
        // DOMParser again for both (via xmlHtmlNode).
        //
        // This is not efficient, but currently this is only being used in tests.
        //
        const { xmlHtmlNode } = Strophe;
        const actual_string = Strophe.serialize(actual);
        const expected_string = Strophe.serialize(expected);
        isEqual = actual_string === expected_string || xmlHtmlNode(actual_string).isEqualNode(xmlHtmlNode(expected_string));
    }
    return isEqual;
}
/**
 * Given an HTMLElement representing a form field, return it's name and value.
 * @param {HTMLInputElement|HTMLSelectElement} field
 * @returns {{[key:string]:string|number|string[]}|null}
 */ function getNameAndValue(field) {
    const name = field.getAttribute('name');
    if (!name) {
        return null; // See #1924
    }
    let value;
    if (field.getAttribute('type') === 'checkbox') {
        value = /** @type {HTMLInputElement} */ field.checked && 1 || 0;
    } else if (field.tagName == "TEXTAREA") {
        value = field.value.split('\n').filter((s)=>s.trim());
    } else if (field.tagName == "SELECT") {
        value = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getSelectValues(/** @type {HTMLSelectElement} */ field);
    } else {
        value = field.value;
    }
    return {
        name,
        value
    };
}
/**
 * @param {HTMLElement} el
 */ function slideOutWrapup(el) {
    /* Wrapup function for slideOut. */ el.removeAttribute('data-slider-marker');
    el.classList.remove('collapsed');
    el.style.overflow = '';
    el.style.height = '';
}
/**
 * @param {string} url
 */ function getFileName(url) {
    try {
        const uri = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getURL(url);
        return decodeURI(uri.pathname.split('/').pop());
    } catch (error) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.debug(error);
        return url;
    }
}
/**
 * Return the height of the passed in DOM element,
 * based on the heights of its children.
 * @method u#calculateElementHeight
 * @param {HTMLElement} el
 * @returns {number}
 */ function calculateElementHeight(el) {
    return Array.from(el.children).reduce((result, child)=>{
        if (child instanceof HTMLElement) {
            return result + child.offsetHeight;
        }
        return result;
    }, 0);
}
/**
 * @param {HTMLElement} el
 * @param {string} selector
 */ function getNextElement(el, selector = '*') {
    let next_el = el.nextElementSibling;
    while(next_el !== null && !sizzle.matchesSelector(next_el, selector)){
        next_el = next_el.nextElementSibling;
    }
    return next_el;
}
/**
 * Has an element a class?
 * @param {string} className
 * @param {Element} el
 */ function hasClass(className, el) {
    return el instanceof Element && el.classList.contains(className);
}
/**
 * Add a class to an element.
 * @param {string} className
 * @param {Element} el
 */ function addClass(className, el) {
    if (el instanceof Element) el.classList.add(className);
    return el;
}
/**
 * Remove a class from an element.
 * @param {string} className
 * @param {Element} el
 */ function removeClass(className, el) {
    if (el instanceof Element) el.classList.remove(className);
    return el;
}
/**
 * Remove an element from its parent
 * @param {Element} el
 */ function removeElement(el) {
    if (el instanceof Element && el.parentNode) el.parentNode.removeChild(el);
    return el;
}
/**
 * @param {TemplateResult} tr
 */ function getElementFromTemplateResult(tr) {
    const div = document.createElement('div');
    (0,lit__WEBPACK_IMPORTED_MODULE_0__.render)(tr, div);
    return div.firstElementChild;
}
/**
 * @param {Element} el
 */ function showElement(el) {
    removeClass('collapsed', el);
    removeClass('hidden', el);
}
/**
 * @param {Element} el
 */ function hideElement(el) {
    if (el instanceof Element) el.classList.add('hidden');
    return el;
}
/**
 * @param {HTMLElement} el
 * @param {String} selector
 */ function ancestor(el, selector) {
    let parent = el;
    while(parent !== null && !sizzle.matchesSelector(parent, selector)){
        parent = parent.parentElement;
    }
    return parent;
}
/**
 * Return the element's siblings until one matches the selector.
 * @param {HTMLElement} el
 * @param {String} selector
 */ function nextUntil(el, selector) {
    const matches = [];
    let sibling_el = el.nextElementSibling;
    while(sibling_el !== null && !sibling_el.matches(selector)){
        matches.push(sibling_el);
        sibling_el = sibling_el.nextElementSibling;
    }
    return matches;
}
/**
 * Helper method that replace HTML-escaped symbols with equivalent characters
 * (e.g. transform occurrences of '&amp;' to '&')
 * @param {String} string - a String containing the HTML-escaped symbols.
 */ function unescapeHTML(string) {
    var div = document.createElement('div');
    div.innerHTML = string;
    return div.innerText;
}
/**
 * @param {string} string
 */ function escapeHTML(string) {
    return string.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}
/**
 * @param {string} protocol
 */ function isProtocolApproved(protocol, safeProtocolsList = APPROVED_URL_PROTOCOLS) {
    return !!safeProtocolsList.includes(protocol);
}
/**
 * @param {string} url
 * @returns {TemplateResult|string}
 */ function getHyperlinkTemplate(url) {
    const http_url = RegExp('^w{3}.', 'ig').test(url) ? `http://${url}` : url;
    try {
        const uri = _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getURL(http_url);
        if (isProtocolApproved(uri.protocol)) {
            return (0,templates_hyperlink_js__WEBPACK_IMPORTED_MODULE_12__["default"])(uri, url);
        }
        return url;
    } catch (error) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.debug(error);
    }
}
/**
 * Shows/expands an element by sliding it out of itself
 * @param {HTMLElement} el - The HTML string
 * @param {Number} duration - The duration amount in milliseconds
 */ function slideOut(el, duration = 200) {
    return new Promise((resolve, reject)=>{
        if (!el) {
            const err = 'An element needs to be passed in to slideOut';
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.warn(err);
            reject(new Error(err));
            return;
        }
        const marker = el.getAttribute('data-slider-marker');
        if (marker && !Number.isNaN(Number(marker))) {
            el.removeAttribute('data-slider-marker');
            cancelAnimationFrame(Number(marker));
        }
        const end_height = calculateElementHeight(el);
        if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('disable_effects')) {
            // Effects are disabled (for tests)
            el.style.height = end_height + 'px';
            slideOutWrapup(el);
            resolve();
            return;
        }
        if (!hasClass('collapsed', el) && !hasClass('hidden', el)) {
            resolve();
            return;
        }
        const steps = duration / 17; // We assume 17ms per animation which is ~60FPS
        let height = 0;
        function draw() {
            height += end_height / steps;
            if (height < end_height) {
                el.style.height = height + 'px';
                el.setAttribute('data-slider-marker', requestAnimationFrame(draw).toString());
            } else {
                // We recalculate the height to work around an apparent
                // browser bug where browsers don't know the correct
                // offsetHeight beforehand.
                el.removeAttribute('data-slider-marker');
                el.style.height = calculateElementHeight(el) + 'px';
                el.style.overflow = '';
                el.style.height = '';
                resolve();
            }
        }
        el.style.height = '0';
        el.style.overflow = 'hidden';
        el.classList.remove('hidden');
        el.classList.remove('collapsed');
        el.setAttribute('data-slider-marker', requestAnimationFrame(draw).toString());
    });
}
/**
 * Hides/contracts an element by sliding it into itself
 * @param {HTMLElement} el - The HTML string
 * @param {Number} duration - The duration amount in milliseconds
 */ function slideIn(el, duration = 200) {
    return new Promise((resolve, reject)=>{
        if (!el) {
            const err = 'An element needs to be passed in to slideIn';
            _converse_headless__WEBPACK_IMPORTED_MODULE_2__.log.warn(err);
            return reject(new Error(err));
        } else if (hasClass('collapsed', el)) {
            return resolve(el);
        } else if (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.api.settings.get('disable_effects')) {
            // Effects are disabled (for tests)
            el.classList.add('collapsed');
            el.style.height = '';
            return resolve(el);
        }
        const marker = el.getAttribute('data-slider-marker');
        if (marker && !Number.isNaN(Number(marker))) {
            el.removeAttribute('data-slider-marker');
            cancelAnimationFrame(Number(marker));
        }
        const original_height = el.offsetHeight, steps = duration / 17; // We assume 17ms per animation which is ~60FPS
        let height = original_height;
        el.style.overflow = 'hidden';
        function draw() {
            height -= original_height / steps;
            if (height > 0) {
                el.style.height = height + 'px';
                el.setAttribute('data-slider-marker', requestAnimationFrame(draw).toString());
            } else {
                el.removeAttribute('data-slider-marker');
                el.classList.add('collapsed');
                el.style.height = '';
                resolve(el);
            }
        }
        el.setAttribute('data-slider-marker', requestAnimationFrame(draw).toString());
    });
}
/**
 * @param {HTMLElement} el
 */ function isInDOM(el) {
    return document.querySelector('body').contains(el);
}
/**
 * @param {HTMLElement} el
 */ function isVisible(el) {
    if (el === null) {
        return false;
    }
    if (hasClass('hidden', el)) {
        return false;
    }
    // XXX: Taken from jQuery's "visible" implementation
    return el.offsetWidth > 0 || el.offsetHeight > 0 || el.getClientRects().length > 0;
}
/**
 * Takes an XML field in XMPP XForm (XEP-004: Data Forms) format returns a
 * [TemplateResult](https://lit.polymer-project.org/api/classes/_lit_html_.templateresult.html).
 * @param {import('@converse/headless/shared/types').XFormField} xfield - the field to convert
 * @param {Object} options
 * @returns {TemplateResult}
 */ function xFormField2TemplateResult(xfield, options = {}) {
    const default_vals = {
        id: _converse_headless__WEBPACK_IMPORTED_MODULE_2__.u.getUniqueId(),
        name: xfield.var
    };
    if (xfield['type'] === 'list-single' || xfield['type'] === 'list-multi') {
        return (0,_templates_form_select_js__WEBPACK_IMPORTED_MODULE_8__["default"])(_object_spread_props(_object_spread({}, default_vals, xfield), {
            multiple: xfield.type === 'list-multi'
        }));
    } else if (xfield['type'] === 'fixed') {
        return (0,_templates_form_fixed_js__WEBPACK_IMPORTED_MODULE_6__["default"])(xfield);
    } else if (xfield['type'] === 'jid-multi') {
        return (0,_templates_form_textarea_js__WEBPACK_IMPORTED_MODULE_9__["default"])(_object_spread({}, default_vals, xfield));
    } else if (xfield['type'] === 'boolean') {
        return (0,_templates_form_checkbox_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_object_spread({}, default_vals, xfield));
    } else if (xfield.var === 'username') {
        return (0,_templates_form_username_js__WEBPACK_IMPORTED_MODULE_11__["default"])(_object_spread(_object_spread_props(_object_spread({}, default_vals), {
            domain: options.domain ? ' @' + options.domain : ''
        }), xfield));
    } else if (xfield.var === 'password') {
        return (0,_templates_form_input_js__WEBPACK_IMPORTED_MODULE_7__["default"])(_object_spread_props(_object_spread({}, default_vals, xfield), {
            autocomplete: getAutoCompleteProperty(xfield.var, options),
            fixed_username: options === null || options === void 0 ? void 0 : options.fixed_username,
            type: 'password'
        }));
    } else if (xfield.var === 'ocr') {
        return (0,_templates_form_captcha_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_object_spread_props(_object_spread({}, default_vals, xfield), {
            data: xfield.uri.data,
            type: xfield.uri.type
        }));
    } else if (xfield.type !== 'hidden' && (xfield.var === 'url' || xfield.var === 'uri' || isValidURL(xfield.value))) {
        return (0,_templates_form_url_js__WEBPACK_IMPORTED_MODULE_10__["default"])(xfield);
    } else if (xfield.type === 'datetime' || xfield.type === 'date') {
        const date = xfield.value ? dayjs(xfield.value) : null;
        const value = (date === null || date === void 0 ? void 0 : date.isValid()) ? xfield.type === 'datetime' ? date.format('YYYY-MM-DDTHH:mm:ss') : date.format('YYYY-MM-DD') : null;
        return (0,templates_form_date_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_object_spread_props(_object_spread({}, default_vals, xfield), {
            value
        }));
    } else {
        return (0,_templates_form_input_js__WEBPACK_IMPORTED_MODULE_7__["default"])(_object_spread_props(_object_spread({}, default_vals, xfield), {
            autocomplete: getAutoCompleteProperty(xfield.var, options),
            placeholder: null
        }));
    }
}
/**
 * @param {HTMLElement} el
 * @param {boolean} include_margin
 */ function getOuterWidth(el, include_margin = false) {
    let width = el.offsetWidth;
    if (!include_margin) {
        return width;
    }
    const style = window.getComputedStyle(el);
    width += parseInt(style.marginLeft ? style.marginLeft : '0', 10) + parseInt(style.marginRight ? style.marginRight : '0', 10);
    return width;
}
let root;
function getRootElement() {
    if (!root) {
        root = document.querySelector('converse-root') || document.createElement("converse-root");
    }
    return root;
}
Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u, {
    addClass,
    ancestor,
    calculateElementHeight,
    escapeHTML,
    getElementFromTemplateResult,
    getNextElement,
    getOuterWidth,
    getRootElement,
    hasClass,
    hideElement,
    isEqualNode,
    isInDOM,
    isVisible,
    nextUntil,
    removeClass,
    removeElement,
    showElement,
    slideIn,
    slideOut,
    unescapeHTML,
    xFormField2TemplateResult
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_converse_headless__WEBPACK_IMPORTED_MODULE_2__.u);


/***/ }),

/***/ "./src/utils/index.js":
/*!****************************!*\
  !*** ./src/utils/index.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "./src/utils/color.js");
/* harmony import */ var _file_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./file.js */ "./src/utils/file.js");
/* harmony import */ var _html_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./html.js */ "./src/utils/html.js");
/* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./url.js */ "./src/utils/url.js");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}





/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Object.assign(_converse_headless__WEBPACK_IMPORTED_MODULE_0__.u, _object_spread({}, _color_js__WEBPACK_IMPORTED_MODULE_1__, _file_js__WEBPACK_IMPORTED_MODULE_2__, _html_js__WEBPACK_IMPORTED_MODULE_3__, _url_js__WEBPACK_IMPORTED_MODULE_4__)));


/***/ }),

/***/ "./src/utils/url.js":
/*!**************************!*\
  !*** ./src/utils/url.js ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   filterQueryParamsFromURL: () => (/* binding */ filterQueryParamsFromURL),
/* harmony export */   isDomainAllowed: () => (/* binding */ isDomainAllowed),
/* harmony export */   isDomainWhitelisted: () => (/* binding */ isDomainWhitelisted),
/* harmony export */   isMediaURLDomainAllowed: () => (/* binding */ isMediaURLDomainAllowed),
/* harmony export */   shouldRenderMediaFromURL: () => (/* binding */ shouldRenderMediaFromURL)
/* harmony export */ });
/* harmony import */ var _converse_headless__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless */ "./src/headless/index.js");

/**
 * @param {string[]} whitelist
 * @param {string|URL} url
 */ function isDomainWhitelisted(whitelist, url) {
    const uri = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getURL(url);
    const parts = uri.hostname.split('.');
    const domain = parts.slice(-2).join('.'); // Get the last two parts for domain and TLD
    const subdomain = parts.slice(0, -2).join('.'); // Get everything before the last two parts
    const fulldomain = `${subdomain ? `${subdomain}.` : ""}${domain}`;
    return whitelist.includes(domain) || whitelist.includes(fulldomain);
}
/**
 * @param {string|URL} url
 * @param {string} setting
 */ function isDomainAllowed(url, setting) {
    const allowed_domains = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get(setting);
    if (!Array.isArray(allowed_domains)) {
        return true;
    }
    try {
        return isDomainWhitelisted(allowed_domains, url);
    } catch (error) {
        _converse_headless__WEBPACK_IMPORTED_MODULE_0__.log.debug(error);
        return false;
    }
}
/**
 * Accepts a {@link MediaURLData} object and then checks whether its domain is
 * allowed for rendering in the chat.
 * @param {import('@converse/headless/types/utils/types').MediaURLMetadata} o
 * @returns {boolean}
 */ function isMediaURLDomainAllowed(o) {
    return o.is_audio && isDomainAllowed(o.url, "allowed_audio_domains") || o.is_video && isDomainAllowed(o.url, "allowed_video_domains") || o.is_image && isDomainAllowed(o.url, "allowed_image_domains");
}
/**
 * Given a url, check whether the protocol being used is allowed for rendering
 * the media in the chat (as opposed to just rendering a URL hyperlink).
 * @param {string} url
 * @returns {boolean}
 */ function isAllowedProtocolForMedia(url) {
    const { protocol } = window.location;
    if ([
        "chrome-extension:",
        "file:"
    ].includes(protocol)) {
        return true;
    }
    const uri = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getURL(url);
    return protocol === "http:" || protocol === "https:" && [
        "https:",
        "aesgcm:"
    ].includes(uri.protocol.toLowerCase());
}
/**
 * @param {string} url_text
 * @param {"audio"|"image"|"video"} type
 */ function shouldRenderMediaFromURL(url_text, type) {
    if (!isAllowedProtocolForMedia(url_text)) {
        return false;
    }
    const may_render = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("render_media");
    const is_domain_allowed = isDomainAllowed(url_text, `allowed_${type}_domains`);
    if (Array.isArray(may_render)) {
        return is_domain_allowed && isDomainWhitelisted(may_render, url_text);
    } else {
        return is_domain_allowed && may_render;
    }
}
/**
 * Takes the `filter_url_query_params` array from the settings and
 * removes any query strings from the URL that matches those values.
 * @param {string} url
 * @return {string}
 */ function filterQueryParamsFromURL(url) {
    const setting = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.api.settings.get("filter_url_query_params");
    if (!setting) return url;
    const to_remove = Array.isArray(setting) ? setting : [
        setting
    ];
    const url_obj = _converse_headless__WEBPACK_IMPORTED_MODULE_0__.u.getURL(url);
    to_remove.forEach(/** @param {string} p */ (p)=>url_obj.searchParams.delete(p));
    return url_obj.toString();
}


/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/create fake namespace object */
/******/ 	(() => {
/******/ 		var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ 		var leafPrototypes;
/******/ 		// create a fake namespace object
/******/ 		// mode & 1: value is a module id, require it
/******/ 		// mode & 2: merge all properties of value into the ns
/******/ 		// mode & 4: return value when already ns object
/******/ 		// mode & 16: return value when it's Promise-like
/******/ 		// mode & 8|1: behave like require
/******/ 		__webpack_require__.t = function(value, mode) {
/******/ 			if(mode & 1) value = this(value);
/******/ 			if(mode & 8) return value;
/******/ 			if(typeof value === 'object' && value) {
/******/ 				if((mode & 4) && value.__esModule) return value;
/******/ 				if((mode & 16) && typeof value.then === 'function') return value;
/******/ 			}
/******/ 			var ns = Object.create(null);
/******/ 			__webpack_require__.r(ns);
/******/ 			var def = {};
/******/ 			leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ 			for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ 				Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ 			}
/******/ 			def['default'] = () => (value);
/******/ 			__webpack_require__.d(ns, def);
/******/ 			return ns;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/ensure chunk */
/******/ 	(() => {
/******/ 		__webpack_require__.f = {};
/******/ 		// This file contains only the entry chunk.
/******/ 		// The chunk loading function for additional chunks
/******/ 		__webpack_require__.e = (chunkId) => {
/******/ 			return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ 				__webpack_require__.f[key](chunkId, promises);
/******/ 				return promises;
/******/ 			}, []));
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/get javascript chunk filename */
/******/ 	(() => {
/******/ 		// This function allow to reference async chunks
/******/ 		__webpack_require__.u = (chunkId) => {
/******/ 			// return url for filenames based on template
/******/ 			return "" + chunkId + ".js";
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/get mini-css chunk filename */
/******/ 	(() => {
/******/ 		// This function allow to reference async chunks
/******/ 		__webpack_require__.miniCssF = (chunkId) => {
/******/ 			// return url for filenames based on template
/******/ 			return undefined;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/get mini-css chunk filename */
/******/ 	(() => {
/******/ 		// This function allow to reference async chunks
/******/ 		__webpack_require__.miniCssF = (chunkId) => {
/******/ 			// return url for filenames based on template
/******/ 			return undefined;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/load script */
/******/ 	(() => {
/******/ 		var inProgress = {};
/******/ 		var dataWebpackPrefix = "converse.js:";
/******/ 		// loadScript function to load a script via script tag
/******/ 		__webpack_require__.l = (url, done, key, chunkId) => {
/******/ 			if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ 			var script, needAttach;
/******/ 			if(key !== undefined) {
/******/ 				var scripts = document.getElementsByTagName("script");
/******/ 				for(var i = 0; i < scripts.length; i++) {
/******/ 					var s = scripts[i];
/******/ 					if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ 				}
/******/ 			}
/******/ 			if(!script) {
/******/ 				needAttach = true;
/******/ 				script = document.createElement('script');
/******/ 		
/******/ 				script.charset = 'utf-8';
/******/ 				script.timeout = 120;
/******/ 				if (__webpack_require__.nc) {
/******/ 					script.setAttribute("nonce", __webpack_require__.nc);
/******/ 				}
/******/ 				script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/ 		
/******/ 				script.src = url;
/******/ 			}
/******/ 			inProgress[url] = [done];
/******/ 			var onScriptComplete = (prev, event) => {
/******/ 				// avoid mem leaks in IE.
/******/ 				script.onerror = script.onload = null;
/******/ 				clearTimeout(timeout);
/******/ 				var doneFns = inProgress[url];
/******/ 				delete inProgress[url];
/******/ 				script.parentNode && script.parentNode.removeChild(script);
/******/ 				doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ 				if(prev) return prev(event);
/******/ 			}
/******/ 			var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ 			script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ 			script.onload = onScriptComplete.bind(null, script.onload);
/******/ 			needAttach && document.head.appendChild(script);
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/node module decorator */
/******/ 	(() => {
/******/ 		__webpack_require__.nmd = (module) => {
/******/ 			module.paths = [];
/******/ 			if (!module.children) module.children = [];
/******/ 			return module;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/publicPath */
/******/ 	(() => {
/******/ 		__webpack_require__.p = "/dist/";
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	(() => {
/******/ 		// no baseURI
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			"converse": 0
/******/ 		};
/******/ 		
/******/ 		__webpack_require__.f.j = (chunkId, promises) => {
/******/ 				// JSONP chunk loading for javascript
/******/ 				var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ 				if(installedChunkData !== 0) { // 0 means "already installed".
/******/ 		
/******/ 					// a Promise means "currently loading".
/******/ 					if(installedChunkData) {
/******/ 						promises.push(installedChunkData[2]);
/******/ 					} else {
/******/ 						if(true) { // all chunks have JS
/******/ 							// setup Promise in chunk cache
/******/ 							var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ 							promises.push(installedChunkData[2] = promise);
/******/ 		
/******/ 							// start chunk loading
/******/ 							var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ 							// create error before stack unwound to get useful stacktrace later
/******/ 							var error = new Error();
/******/ 							var loadingEnded = (event) => {
/******/ 								if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ 									installedChunkData = installedChunks[chunkId];
/******/ 									if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ 									if(installedChunkData) {
/******/ 										var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ 										var realSrc = event && event.target && event.target.src;
/******/ 										error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ 										error.name = 'ChunkLoadError';
/******/ 										error.type = errorType;
/******/ 										error.request = realSrc;
/******/ 										installedChunkData[1](error);
/******/ 									}
/******/ 								}
/******/ 							};
/******/ 							__webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
/******/ 						}
/******/ 					}
/******/ 				}
/******/ 		};
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		// no on chunks loaded
/******/ 		
/******/ 		// install a JSONP callback for chunk loading
/******/ 		var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ 			var [chunkIds, moreModules, runtime] = data;
/******/ 			// add "moreModules" to the modules object,
/******/ 			// then flag all "chunkIds" as loaded and fire callback
/******/ 			var moduleId, chunkId, i = 0;
/******/ 			if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ 				for(moduleId in moreModules) {
/******/ 					if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 						__webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ 					}
/******/ 				}
/******/ 				if(runtime) var result = runtime(__webpack_require__);
/******/ 			}
/******/ 			if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ 			for(;i < chunkIds.length; i++) {
/******/ 				chunkId = chunkIds[i];
/******/ 				if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ 					installedChunks[chunkId][0]();
/******/ 				}
/******/ 				installedChunks[chunkId] = 0;
/******/ 			}
/******/ 		
/******/ 		}
/******/ 		
/******/ 		var chunkLoadingGlobal = self["webpackChunkconverse_js"] = self["webpackChunkconverse_js"] || [];
/******/ 		chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ 		chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	(() => {
/******/ 		__webpack_require__.nc = undefined;
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
/*!**********************!*\
  !*** ./src/entry.js ***!
  \**********************/
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
// Converse.js
// https://conversejs.org
//
// Copyright (c) 2020, the Converse.js contributors
// Licensed under the Mozilla Public License (MPLv2)
//
// Webpack entry file
//
// The purpose of this file is to provide an initial temporary public API
// (window.converse) for **before** the rest of converse.js is loaded so
// that we can set the __webpack_public_path__ global variable.
//
// Once the rest converse.js has been loaded, window.converse will be replaced
// with the full-fledged public API.
/**
 * @typedef {Object.<string, object>} Plugins
 */ const plugins = {};
const converse = {
    plugins: {
        /**
         * Adds a Converse plugin
         * @param {string} name The name of the plugin.
         * @param {object} plugin The plugin object to be added.
         * @throws {TypeError} If a plugin with the same name has already been registered.
         */ add (name, plugin) {
            if (plugins[name] !== undefined) {
                throw new TypeError(`Error: plugin with name "${name}" has already been ` + 'registered!');
            }
            plugins[name] = plugin;
        }
    },
    /**
     * Initializes Converse with the provided settings.
     * @param {object} settings
     */ initialize (settings = {}) {
        return converse.load(settings).initialize(settings);
    },
    /**
     * Public API method which explicitly loads Converse and allows you the
     * possibility to pass in configuration settings which need to be defined
     * before loading. Currently this is only the
     * [assets_path](https://conversejs.org/docs/html/configuration.html#assets_path)
     * setting.
     *
     * If not called explicitly, this method will be called implicitly once
     * {@link converse.initialize} is called.
     *
     * In most cases, you probably don't need to explicitly call this method,
     * however, until converse.js has been loaded you won't have access to the
     * utility methods and globals exposed via {@link converse.env}. So if you
     * need to access `converse.env` outside of any plugins and before
     * `converse.initialize` has been called, then you need to call
     * `converse.load` first.
     *
     * @param {object} settings A map of configuration-settings that are needed at load time.
     * @example converse.load({assets_path: '/path/to/assets/'});
     */ load (settings = {}) {
        if (settings.assets_path) {
            // eslint-disable-next-line @typescript-eslint/ban-ts-comment
            // @ts-ignore
            __webpack_require__.p = settings.assets_path; // eslint-disable-line no-undef
        }
        __webpack_require__(/*! ./index.js */ "./src/index.js");
        Object.keys(plugins).forEach((name)=>converse.plugins.add(name, plugins[name]));
        return converse;
    }
};
window['converse'] = converse;
/**
 * Once Converse.js has loaded, it'll dispatch a custom event with the name `converse-loaded`.
 * You can listen for this event in order to be informed as soon as converse.js has been
 * loaded and parsed, which would mean it's safe to call `converse.initialize`.
 * @event converse-loaded
 * @example window.addEventListener('converse-loaded', () => converse.initialize());
 */ const ev = new CustomEvent('converse-loaded', {
    'detail': {
        converse
    }
});
window.dispatchEvent(ev);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (converse);

})();

/******/ })()
;
//# sourceMappingURL=converse.js.map