react-input-emoji 5.5.1 → 5.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13,15 +13,12 @@ var t__default = /*#__PURE__*/_interopDefaultLegacy(t);
13
13
  function styleInject(css, ref) {
14
14
  if (ref === void 0) ref = {};
15
15
  var insertAt = ref.insertAt;
16
-
17
16
  if (!css || typeof document === 'undefined') {
18
17
  return;
19
18
  }
20
-
21
19
  var head = document.head || document.getElementsByTagName('head')[0];
22
20
  var style = document.createElement('style');
23
21
  style.type = 'text/css';
24
-
25
22
  if (insertAt === 'top') {
26
23
  if (head.firstChild) {
27
24
  head.insertBefore(style, head.firstChild);
@@ -31,7 +28,6 @@ function styleInject(css, ref) {
31
28
  } else {
32
29
  head.appendChild(style);
33
30
  }
34
-
35
31
  if (style.styleSheet) {
36
32
  style.styleSheet.cssText = css;
37
33
  } else {
@@ -42,377 +38,355 @@ function styleInject(css, ref) {
42
38
  var css_248z = ".react-input-emoji--container {\n color: #4b4b4b;\n text-rendering: optimizeLegibility;\n background-color: #fff;\n border: 1px solid #fff;\n border-radius: 21px;\n margin: 5px 10px;\n box-sizing: border-box;\n flex: 1 1 auto;\n font-size: 15px;\n font-family: sans-serif;\n font-weight: 400;\n line-height: 20px;\n min-height: 20px;\n min-width: 0;\n outline: none;\n width: inherit;\n will-change: width;\n vertical-align: baseline;\n border: 1px solid #eaeaea;\n margin-right: 0;\n}\n\n.react-input-emoji--wrapper {\n display: flex;\n overflow: hidden;\n flex: 1;\n position: relative;\n padding-right: 0;\n vertical-align: baseline;\n outline: none;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n.react-input-emoji--input {\n font-weight: 400;\n max-height: 100px;\n min-height: 20px;\n outline: none;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n white-space: pre-wrap;\n word-wrap: break-word;\n z-index: 1;\n width: 100%;\n user-select: text;\n padding: 9px 12px 11px;\n text-align: left;\n}\n\n.react-input-emoji--input img {\n vertical-align: middle;\n width: 18px !important;\n height: 18px !important;\n display: inline !important;\n margin-left: 1px;\n margin-right: 1px;\n}\n\n.react-input-emoji--overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 9;\n}\n\n.react-input-emoji--placeholder {\n color: #a0a0a0;\n pointer-events: none;\n position: absolute;\n user-select: none;\n z-index: 2;\n left: 16px;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n width: calc(100% - 22px);\n}\n\n.react-input-emoji--button {\n position: relative;\n display: block;\n text-align: center;\n padding: 0 10px;\n overflow: hidden;\n transition: color 0.1s ease-out;\n margin: 0;\n box-shadow: none;\n background: none;\n border: none;\n outline: none;\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.react-input-emoji--button svg {\n fill: #858585;\n}\n\n.react-input-emoji--button__show svg {\n fill: #128b7e;\n}\n\n.react-emoji {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n}\n\n.react-emoji-picker--container {\n position: absolute;\n top: 0;\n width: 100%;\n}\n\n.react-emoji-picker--wrapper {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 435px;\n width: 352px;\n overflow: hidden;\n z-index: 10;\n}\n\n.react-emoji-picker {\n position: absolute;\n top: 0;\n left: 0;\n animation: slidein 0.1s ease-in-out;\n}\n\n.react-emoji-picker__show {\n top: 0;\n}\n\n.react-input-emoji--mention--container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 10;\n}\n\n.react-input-emoji--mention--list {\n background-color: #fafafa;\n border: 1px solid #eaeaea;\n border-radius: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n gap: 5px;\n flex-direction: column;\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n}\n\n.react-input-emoji--mention--item {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 5px 10px;\n background-color: transparent;\n width: 100%;\n margin: 0;\n border: 0;\n}\n\n.react-input-emoji--mention--item__selected {\n background-color: #eeeeee;\n}\n\n.react-input-emoji--mention--item--img {\n width: 34px;\n height: 34px;\n border-radius: 50%;\n}\n\n.react-input-emoji--mention--item--name {\n font-size: 16px;\n color: #333;\n}\n\n.react-input-emoji--mention--item--name__selected {\n color: green;\n}\n\n.react-input-emoji--mention--text {\n color: #039be5;\n}\n\n.react-input-emoji--mention--loading {\n background-color: #fafafa;\n border: 1px solid #eaeaea;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 10px 0;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n}\n\n.react-input-emoji--mention--loading--spinner,\n.react-input-emoji--mention--loading--spinner::after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\n}\n\n.react-input-emoji--mention--loading--spinner {\n margin: 1px auto;\n font-size: 2px;\n position: relative;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(0, 0, 0, 0.1);\n border-right: 1.1em solid rgba(0, 0, 0, 0.1);\n border-bottom: 1.1em solid rgba(0, 0, 0, 0.1);\n border-left: 1.1em solid rgba(0, 0, 0, 0.4);\n transform: translateZ(0);\n animation: load8 1.1s infinite linear;\n}\n\n@keyframes load8 {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes slidein {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n";
43
39
  styleInject(css_248z);
44
40
 
45
- function ownKeys(object, enumerableOnly) {
46
- var keys = Object.keys(object);
47
-
41
+ function _iterableToArrayLimit(r, l) {
42
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
43
+ if (null != t) {
44
+ var e,
45
+ n,
46
+ i,
47
+ u,
48
+ a = [],
49
+ f = !0,
50
+ o = !1;
51
+ try {
52
+ if (i = (t = t.call(r)).next, 0 === l) {
53
+ if (Object(t) !== t) return;
54
+ f = !1;
55
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
56
+ } catch (r) {
57
+ o = !0, n = r;
58
+ } finally {
59
+ try {
60
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
61
+ } finally {
62
+ if (o) throw n;
63
+ }
64
+ }
65
+ return a;
66
+ }
67
+ }
68
+ function ownKeys(e, r) {
69
+ var t = Object.keys(e);
48
70
  if (Object.getOwnPropertySymbols) {
49
- var symbols = Object.getOwnPropertySymbols(object);
50
- enumerableOnly && (symbols = symbols.filter(function (sym) {
51
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
52
- })), keys.push.apply(keys, symbols);
71
+ var o = Object.getOwnPropertySymbols(e);
72
+ r && (o = o.filter(function (r) {
73
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
74
+ })), t.push.apply(t, o);
53
75
  }
54
-
55
- return keys;
76
+ return t;
56
77
  }
57
-
58
- function _objectSpread2(target) {
59
- for (var i = 1; i < arguments.length; i++) {
60
- var source = null != arguments[i] ? arguments[i] : {};
61
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
62
- _defineProperty(target, key, source[key]);
63
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
64
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
78
+ function _objectSpread2(e) {
79
+ for (var r = 1; r < arguments.length; r++) {
80
+ var t = null != arguments[r] ? arguments[r] : {};
81
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
82
+ _defineProperty(e, r, t[r]);
83
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
84
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
65
85
  });
66
86
  }
67
-
68
- return target;
87
+ return e;
69
88
  }
70
-
71
89
  function _regeneratorRuntime() {
72
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
73
-
74
90
  _regeneratorRuntime = function () {
75
- return exports;
91
+ return e;
76
92
  };
77
-
78
- var exports = {},
79
- Op = Object.prototype,
80
- hasOwn = Op.hasOwnProperty,
81
- $Symbol = "function" == typeof Symbol ? Symbol : {},
82
- iteratorSymbol = $Symbol.iterator || "@@iterator",
83
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
84
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
85
-
86
- function define(obj, key, value) {
87
- return Object.defineProperty(obj, key, {
88
- value: value,
93
+ var t,
94
+ e = {},
95
+ r = Object.prototype,
96
+ n = r.hasOwnProperty,
97
+ o = Object.defineProperty || function (t, e, r) {
98
+ t[e] = r.value;
99
+ },
100
+ i = "function" == typeof Symbol ? Symbol : {},
101
+ a = i.iterator || "@@iterator",
102
+ c = i.asyncIterator || "@@asyncIterator",
103
+ u = i.toStringTag || "@@toStringTag";
104
+ function define(t, e, r) {
105
+ return Object.defineProperty(t, e, {
106
+ value: r,
89
107
  enumerable: !0,
90
108
  configurable: !0,
91
109
  writable: !0
92
- }), obj[key];
110
+ }), t[e];
93
111
  }
94
-
95
112
  try {
96
113
  define({}, "");
97
- } catch (err) {
98
- define = function (obj, key, value) {
99
- return obj[key] = value;
114
+ } catch (t) {
115
+ define = function (t, e, r) {
116
+ return t[e] = r;
100
117
  };
101
118
  }
102
-
103
- function wrap(innerFn, outerFn, self, tryLocsList) {
104
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
105
- generator = Object.create(protoGenerator.prototype),
106
- context = new Context(tryLocsList || []);
107
- return generator._invoke = function (innerFn, self, context) {
108
- var state = "suspendedStart";
109
- return function (method, arg) {
110
- if ("executing" === state) throw new Error("Generator is already running");
111
-
112
- if ("completed" === state) {
113
- if ("throw" === method) throw arg;
114
- return doneResult();
115
- }
116
-
117
- for (context.method = method, context.arg = arg;;) {
118
- var delegate = context.delegate;
119
-
120
- if (delegate) {
121
- var delegateResult = maybeInvokeDelegate(delegate, context);
122
-
123
- if (delegateResult) {
124
- if (delegateResult === ContinueSentinel) continue;
125
- return delegateResult;
126
- }
127
- }
128
-
129
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
130
- if ("suspendedStart" === state) throw state = "completed", context.arg;
131
- context.dispatchException(context.arg);
132
- } else "return" === context.method && context.abrupt("return", context.arg);
133
- state = "executing";
134
- var record = tryCatch(innerFn, self, context);
135
-
136
- if ("normal" === record.type) {
137
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
138
- return {
139
- value: record.arg,
140
- done: context.done
141
- };
142
- }
143
-
144
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
145
- }
146
- };
147
- }(innerFn, self, context), generator;
119
+ function wrap(t, e, r, n) {
120
+ var i = e && e.prototype instanceof Generator ? e : Generator,
121
+ a = Object.create(i.prototype),
122
+ c = new Context(n || []);
123
+ return o(a, "_invoke", {
124
+ value: makeInvokeMethod(t, r, c)
125
+ }), a;
148
126
  }
149
-
150
- function tryCatch(fn, obj, arg) {
127
+ function tryCatch(t, e, r) {
151
128
  try {
152
129
  return {
153
130
  type: "normal",
154
- arg: fn.call(obj, arg)
131
+ arg: t.call(e, r)
155
132
  };
156
- } catch (err) {
133
+ } catch (t) {
157
134
  return {
158
135
  type: "throw",
159
- arg: err
136
+ arg: t
160
137
  };
161
138
  }
162
139
  }
163
-
164
- exports.wrap = wrap;
165
- var ContinueSentinel = {};
166
-
140
+ e.wrap = wrap;
141
+ var h = "suspendedStart",
142
+ l = "suspendedYield",
143
+ f = "executing",
144
+ s = "completed",
145
+ y = {};
167
146
  function Generator() {}
168
-
169
147
  function GeneratorFunction() {}
170
-
171
148
  function GeneratorFunctionPrototype() {}
172
-
173
- var IteratorPrototype = {};
174
- define(IteratorPrototype, iteratorSymbol, function () {
149
+ var p = {};
150
+ define(p, a, function () {
175
151
  return this;
176
152
  });
177
- var getProto = Object.getPrototypeOf,
178
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
179
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
180
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
181
-
182
- function defineIteratorMethods(prototype) {
183
- ["next", "throw", "return"].forEach(function (method) {
184
- define(prototype, method, function (arg) {
185
- return this._invoke(method, arg);
153
+ var d = Object.getPrototypeOf,
154
+ v = d && d(d(values([])));
155
+ v && v !== r && n.call(v, a) && (p = v);
156
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
157
+ function defineIteratorMethods(t) {
158
+ ["next", "throw", "return"].forEach(function (e) {
159
+ define(t, e, function (t) {
160
+ return this._invoke(e, t);
186
161
  });
187
162
  });
188
163
  }
189
-
190
- function AsyncIterator(generator, PromiseImpl) {
191
- function invoke(method, arg, resolve, reject) {
192
- var record = tryCatch(generator[method], generator, arg);
193
-
194
- if ("throw" !== record.type) {
195
- var result = record.arg,
196
- value = result.value;
197
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
198
- invoke("next", value, resolve, reject);
199
- }, function (err) {
200
- invoke("throw", err, resolve, reject);
201
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
202
- result.value = unwrapped, resolve(result);
203
- }, function (error) {
204
- return invoke("throw", error, resolve, reject);
164
+ function AsyncIterator(t, e) {
165
+ function invoke(r, o, i, a) {
166
+ var c = tryCatch(t[r], t, o);
167
+ if ("throw" !== c.type) {
168
+ var u = c.arg,
169
+ h = u.value;
170
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
171
+ invoke("next", t, i, a);
172
+ }, function (t) {
173
+ invoke("throw", t, i, a);
174
+ }) : e.resolve(h).then(function (t) {
175
+ u.value = t, i(u);
176
+ }, function (t) {
177
+ return invoke("throw", t, i, a);
205
178
  });
206
179
  }
207
-
208
- reject(record.arg);
180
+ a(c.arg);
209
181
  }
210
-
211
- var previousPromise;
212
-
213
- this._invoke = function (method, arg) {
214
- function callInvokeWithMethodAndArg() {
215
- return new PromiseImpl(function (resolve, reject) {
216
- invoke(method, arg, resolve, reject);
217
- });
182
+ var r;
183
+ o(this, "_invoke", {
184
+ value: function (t, n) {
185
+ function callInvokeWithMethodAndArg() {
186
+ return new e(function (e, r) {
187
+ invoke(t, n, e, r);
188
+ });
189
+ }
190
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
218
191
  }
219
-
220
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
221
- };
192
+ });
222
193
  }
223
-
224
- function maybeInvokeDelegate(delegate, context) {
225
- var method = delegate.iterator[context.method];
226
-
227
- if (undefined === method) {
228
- if (context.delegate = null, "throw" === context.method) {
229
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
230
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
194
+ function makeInvokeMethod(e, r, n) {
195
+ var o = h;
196
+ return function (i, a) {
197
+ if (o === f) throw new Error("Generator is already running");
198
+ if (o === s) {
199
+ if ("throw" === i) throw a;
200
+ return {
201
+ value: t,
202
+ done: !0
203
+ };
231
204
  }
232
-
233
- return ContinueSentinel;
234
- }
235
-
236
- var record = tryCatch(method, delegate.iterator, context.arg);
237
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
238
- var info = record.arg;
239
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
205
+ for (n.method = i, n.arg = a;;) {
206
+ var c = n.delegate;
207
+ if (c) {
208
+ var u = maybeInvokeDelegate(c, n);
209
+ if (u) {
210
+ if (u === y) continue;
211
+ return u;
212
+ }
213
+ }
214
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
215
+ if (o === h) throw o = s, n.arg;
216
+ n.dispatchException(n.arg);
217
+ } else "return" === n.method && n.abrupt("return", n.arg);
218
+ o = f;
219
+ var p = tryCatch(e, r, n);
220
+ if ("normal" === p.type) {
221
+ if (o = n.done ? s : l, p.arg === y) continue;
222
+ return {
223
+ value: p.arg,
224
+ done: n.done
225
+ };
226
+ }
227
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
228
+ }
229
+ };
240
230
  }
241
-
242
- function pushTryEntry(locs) {
243
- var entry = {
244
- tryLoc: locs[0]
231
+ function maybeInvokeDelegate(e, r) {
232
+ var n = r.method,
233
+ o = e.iterator[n];
234
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
235
+ var i = tryCatch(o, e.iterator, r.arg);
236
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
237
+ var a = i.arg;
238
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
239
+ }
240
+ function pushTryEntry(t) {
241
+ var e = {
242
+ tryLoc: t[0]
245
243
  };
246
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
244
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
247
245
  }
248
-
249
- function resetTryEntry(entry) {
250
- var record = entry.completion || {};
251
- record.type = "normal", delete record.arg, entry.completion = record;
246
+ function resetTryEntry(t) {
247
+ var e = t.completion || {};
248
+ e.type = "normal", delete e.arg, t.completion = e;
252
249
  }
253
-
254
- function Context(tryLocsList) {
250
+ function Context(t) {
255
251
  this.tryEntries = [{
256
252
  tryLoc: "root"
257
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
253
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
258
254
  }
259
-
260
- function values(iterable) {
261
- if (iterable) {
262
- var iteratorMethod = iterable[iteratorSymbol];
263
- if (iteratorMethod) return iteratorMethod.call(iterable);
264
- if ("function" == typeof iterable.next) return iterable;
265
-
266
- if (!isNaN(iterable.length)) {
267
- var i = -1,
268
- next = function next() {
269
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
270
-
271
- return next.value = undefined, next.done = !0, next;
272
- };
273
-
274
- return next.next = next;
255
+ function values(e) {
256
+ if (e || "" === e) {
257
+ var r = e[a];
258
+ if (r) return r.call(e);
259
+ if ("function" == typeof e.next) return e;
260
+ if (!isNaN(e.length)) {
261
+ var o = -1,
262
+ i = function next() {
263
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
264
+ return next.value = t, next.done = !0, next;
265
+ };
266
+ return i.next = i;
275
267
  }
276
268
  }
277
-
278
- return {
279
- next: doneResult
280
- };
281
- }
282
-
283
- function doneResult() {
284
- return {
285
- value: undefined,
286
- done: !0
287
- };
269
+ throw new TypeError(typeof e + " is not iterable");
288
270
  }
289
-
290
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
291
- var ctor = "function" == typeof genFun && genFun.constructor;
292
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
293
- }, exports.mark = function (genFun) {
294
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
295
- }, exports.awrap = function (arg) {
271
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
272
+ value: GeneratorFunctionPrototype,
273
+ configurable: !0
274
+ }), o(GeneratorFunctionPrototype, "constructor", {
275
+ value: GeneratorFunction,
276
+ configurable: !0
277
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
278
+ var e = "function" == typeof t && t.constructor;
279
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
280
+ }, e.mark = function (t) {
281
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
282
+ }, e.awrap = function (t) {
296
283
  return {
297
- __await: arg
284
+ __await: t
298
285
  };
299
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
286
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
300
287
  return this;
301
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
302
- void 0 === PromiseImpl && (PromiseImpl = Promise);
303
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
304
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
305
- return result.done ? result.value : iter.next();
288
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
289
+ void 0 === i && (i = Promise);
290
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
291
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
292
+ return t.done ? t.value : a.next();
306
293
  });
307
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
294
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
308
295
  return this;
309
- }), define(Gp, "toString", function () {
296
+ }), define(g, "toString", function () {
310
297
  return "[object Generator]";
311
- }), exports.keys = function (object) {
312
- var keys = [];
313
-
314
- for (var key in object) keys.push(key);
315
-
316
- return keys.reverse(), function next() {
317
- for (; keys.length;) {
318
- var key = keys.pop();
319
- if (key in object) return next.value = key, next.done = !1, next;
298
+ }), e.keys = function (t) {
299
+ var e = Object(t),
300
+ r = [];
301
+ for (var n in e) r.push(n);
302
+ return r.reverse(), function next() {
303
+ for (; r.length;) {
304
+ var t = r.pop();
305
+ if (t in e) return next.value = t, next.done = !1, next;
320
306
  }
321
-
322
307
  return next.done = !0, next;
323
308
  };
324
- }, exports.values = values, Context.prototype = {
309
+ }, e.values = values, Context.prototype = {
325
310
  constructor: Context,
326
- reset: function (skipTempReset) {
327
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
311
+ reset: function (e) {
312
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
328
313
  },
329
314
  stop: function () {
330
315
  this.done = !0;
331
- var rootRecord = this.tryEntries[0].completion;
332
- if ("throw" === rootRecord.type) throw rootRecord.arg;
316
+ var t = this.tryEntries[0].completion;
317
+ if ("throw" === t.type) throw t.arg;
333
318
  return this.rval;
334
319
  },
335
- dispatchException: function (exception) {
336
- if (this.done) throw exception;
337
- var context = this;
338
-
339
- function handle(loc, caught) {
340
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
320
+ dispatchException: function (e) {
321
+ if (this.done) throw e;
322
+ var r = this;
323
+ function handle(n, o) {
324
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
341
325
  }
342
-
343
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
344
- var entry = this.tryEntries[i],
345
- record = entry.completion;
346
- if ("root" === entry.tryLoc) return handle("end");
347
-
348
- if (entry.tryLoc <= this.prev) {
349
- var hasCatch = hasOwn.call(entry, "catchLoc"),
350
- hasFinally = hasOwn.call(entry, "finallyLoc");
351
-
352
- if (hasCatch && hasFinally) {
353
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
354
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
355
- } else if (hasCatch) {
356
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
326
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
327
+ var i = this.tryEntries[o],
328
+ a = i.completion;
329
+ if ("root" === i.tryLoc) return handle("end");
330
+ if (i.tryLoc <= this.prev) {
331
+ var c = n.call(i, "catchLoc"),
332
+ u = n.call(i, "finallyLoc");
333
+ if (c && u) {
334
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
335
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
336
+ } else if (c) {
337
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
357
338
  } else {
358
- if (!hasFinally) throw new Error("try statement without catch or finally");
359
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
339
+ if (!u) throw new Error("try statement without catch or finally");
340
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
360
341
  }
361
342
  }
362
343
  }
363
344
  },
364
- abrupt: function (type, arg) {
365
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
366
- var entry = this.tryEntries[i];
367
-
368
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
369
- var finallyEntry = entry;
345
+ abrupt: function (t, e) {
346
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
347
+ var o = this.tryEntries[r];
348
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
349
+ var i = o;
370
350
  break;
371
351
  }
372
352
  }
373
-
374
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
375
- var record = finallyEntry ? finallyEntry.completion : {};
376
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
353
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
354
+ var a = i ? i.completion : {};
355
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
377
356
  },
378
- complete: function (record, afterLoc) {
379
- if ("throw" === record.type) throw record.arg;
380
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
357
+ complete: function (t, e) {
358
+ if ("throw" === t.type) throw t.arg;
359
+ 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), y;
381
360
  },
382
- finish: function (finallyLoc) {
383
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
384
- var entry = this.tryEntries[i];
385
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
361
+ finish: function (t) {
362
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
363
+ var r = this.tryEntries[e];
364
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
386
365
  }
387
366
  },
388
- catch: function (tryLoc) {
389
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
390
- var entry = this.tryEntries[i];
391
-
392
- if (entry.tryLoc === tryLoc) {
393
- var record = entry.completion;
394
-
395
- if ("throw" === record.type) {
396
- var thrown = record.arg;
397
- resetTryEntry(entry);
367
+ catch: function (t) {
368
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
369
+ var r = this.tryEntries[e];
370
+ if (r.tryLoc === t) {
371
+ var n = r.completion;
372
+ if ("throw" === n.type) {
373
+ var o = n.arg;
374
+ resetTryEntry(r);
398
375
  }
399
-
400
- return thrown;
376
+ return o;
401
377
  }
402
378
  }
403
-
404
379
  throw new Error("illegal catch attempt");
405
380
  },
406
- delegateYield: function (iterable, resultName, nextLoc) {
381
+ delegateYield: function (e, r, n) {
407
382
  return this.delegate = {
408
- iterator: values(iterable),
409
- resultName: resultName,
410
- nextLoc: nextLoc
411
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
383
+ iterator: values(e),
384
+ resultName: r,
385
+ nextLoc: n
386
+ }, "next" === this.method && (this.arg = t), y;
412
387
  }
413
- }, exports;
388
+ }, e;
414
389
  }
415
-
416
390
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
417
391
  try {
418
392
  var info = gen[key](arg);
@@ -421,35 +395,30 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
421
395
  reject(error);
422
396
  return;
423
397
  }
424
-
425
398
  if (info.done) {
426
399
  resolve(value);
427
400
  } else {
428
401
  Promise.resolve(value).then(_next, _throw);
429
402
  }
430
403
  }
431
-
432
404
  function _asyncToGenerator(fn) {
433
405
  return function () {
434
406
  var self = this,
435
- args = arguments;
407
+ args = arguments;
436
408
  return new Promise(function (resolve, reject) {
437
409
  var gen = fn.apply(self, args);
438
-
439
410
  function _next(value) {
440
411
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
441
412
  }
442
-
443
413
  function _throw(err) {
444
414
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
445
415
  }
446
-
447
416
  _next(undefined);
448
417
  });
449
418
  };
450
419
  }
451
-
452
420
  function _defineProperty(obj, key, value) {
421
+ key = _toPropertyKey(key);
453
422
  if (key in obj) {
454
423
  Object.defineProperty(obj, key, {
455
424
  value: value,
@@ -460,35 +429,26 @@ function _defineProperty(obj, key, value) {
460
429
  } else {
461
430
  obj[key] = value;
462
431
  }
463
-
464
432
  return obj;
465
433
  }
466
-
467
434
  function _objectWithoutPropertiesLoose(source, excluded) {
468
435
  if (source == null) return {};
469
436
  var target = {};
470
437
  var sourceKeys = Object.keys(source);
471
438
  var key, i;
472
-
473
439
  for (i = 0; i < sourceKeys.length; i++) {
474
440
  key = sourceKeys[i];
475
441
  if (excluded.indexOf(key) >= 0) continue;
476
442
  target[key] = source[key];
477
443
  }
478
-
479
444
  return target;
480
445
  }
481
-
482
446
  function _objectWithoutProperties(source, excluded) {
483
447
  if (source == null) return {};
484
-
485
448
  var target = _objectWithoutPropertiesLoose(source, excluded);
486
-
487
449
  var key, i;
488
-
489
450
  if (Object.getOwnPropertySymbols) {
490
451
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
491
-
492
452
  for (i = 0; i < sourceSymbolKeys.length; i++) {
493
453
  key = sourceSymbolKeys[i];
494
454
  if (excluded.indexOf(key) >= 0) continue;
@@ -496,60 +456,23 @@ function _objectWithoutProperties(source, excluded) {
496
456
  target[key] = source[key];
497
457
  }
498
458
  }
499
-
500
459
  return target;
501
460
  }
502
-
503
461
  function _slicedToArray(arr, i) {
504
462
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
505
463
  }
506
-
507
464
  function _toConsumableArray(arr) {
508
465
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
509
466
  }
510
-
511
467
  function _arrayWithoutHoles(arr) {
512
468
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
513
469
  }
514
-
515
470
  function _arrayWithHoles(arr) {
516
471
  if (Array.isArray(arr)) return arr;
517
472
  }
518
-
519
473
  function _iterableToArray(iter) {
520
474
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
521
475
  }
522
-
523
- function _iterableToArrayLimit(arr, i) {
524
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
525
-
526
- if (_i == null) return;
527
- var _arr = [];
528
- var _n = true;
529
- var _d = false;
530
-
531
- var _s, _e;
532
-
533
- try {
534
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
535
- _arr.push(_s.value);
536
-
537
- if (i && _arr.length === i) break;
538
- }
539
- } catch (err) {
540
- _d = true;
541
- _e = err;
542
- } finally {
543
- try {
544
- if (!_n && _i["return"] != null) _i["return"]();
545
- } finally {
546
- if (_d) throw _e;
547
- }
548
- }
549
-
550
- return _arr;
551
- }
552
-
553
476
  function _unsupportedIterableToArray(o, minLen) {
554
477
  if (!o) return;
555
478
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -558,35 +481,44 @@ function _unsupportedIterableToArray(o, minLen) {
558
481
  if (n === "Map" || n === "Set") return Array.from(o);
559
482
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
560
483
  }
561
-
562
484
  function _arrayLikeToArray(arr, len) {
563
485
  if (len == null || len > arr.length) len = arr.length;
564
-
565
486
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
566
-
567
487
  return arr2;
568
488
  }
569
-
570
489
  function _nonIterableSpread() {
571
490
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
572
491
  }
573
-
574
492
  function _nonIterableRest() {
575
493
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
576
494
  }
495
+ function _toPrimitive(input, hint) {
496
+ if (typeof input !== "object" || input === null) return input;
497
+ var prim = input[Symbol.toPrimitive];
498
+ if (prim !== undefined) {
499
+ var res = prim.call(input, hint || "default");
500
+ if (typeof res !== "object") return res;
501
+ throw new TypeError("@@toPrimitive must return a primitive value.");
502
+ }
503
+ return (hint === "string" ? String : Number)(input);
504
+ }
505
+ function _toPropertyKey(arg) {
506
+ var key = _toPrimitive(arg, "string");
507
+ return typeof key === "symbol" ? key : String(key);
508
+ }
577
509
 
578
510
  /* eslint-disable valid-jsdoc */
579
511
  // @ts-check
512
+
580
513
  var TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
514
+
581
515
  /**
582
516
  * Replace all text with emoji with an image html tag
583
517
  * @param {string} text
584
518
  * @return {string}
585
519
  */
586
-
587
520
  function replaceAllTextEmojis(text) {
588
521
  var allEmojis = getAllEmojisFromText(text);
589
-
590
522
  if (allEmojis) {
591
523
  allEmojis = _toConsumableArray(new Set(allEmojis)); // remove duplicates
592
524
 
@@ -594,9 +526,9 @@ function replaceAllTextEmojis(text) {
594
526
  text = replaceAll(text, emoji, getInputEmojiHTML(emoji));
595
527
  });
596
528
  }
597
-
598
529
  return text;
599
530
  }
531
+
600
532
  /**
601
533
  * Replace all occurrencies in a string
602
534
  * @param {string} str
@@ -604,77 +536,67 @@ function replaceAllTextEmojis(text) {
604
536
  * @param {string} replace
605
537
  * @return {string}
606
538
  */
607
-
608
539
  function replaceAll(str, find, replace) {
609
540
  return str.replace(new RegExp(find, "g"), replace);
610
541
  }
542
+
611
543
  /**
612
544
  * Get all emojis from the text
613
545
  * @param {string} text
614
546
  * @return {string[]}
615
547
  */
616
-
617
-
618
548
  function getAllEmojisFromText(text) {
619
549
  return text.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g);
620
- } // eslint-disable-next-line valid-jsdoc
550
+ }
621
551
 
552
+ // eslint-disable-next-line valid-jsdoc
622
553
  /**
623
554
  *
624
555
  * @param { import("../types/types").EmojiMartItem } emoji
625
556
  * @return {string}
626
557
  */
627
-
628
-
629
558
  function getImageEmoji(emoji) {
630
559
  var _emojiPickerEl$shadow;
631
-
632
560
  /** @type {HTMLElement | null} */
633
561
  var emojiPickerEl = document.querySelector('em-emoji-picker');
634
-
635
562
  if (!emojiPickerEl) {
636
563
  return getInputEmojiNativeHTML(emoji["native"]);
637
564
  }
638
- /** @type {HTMLSpanElement | null=} */
639
-
640
-
641
- var emojiSpanEl = emojiPickerEl === null || emojiPickerEl === void 0 ? void 0 : (_emojiPickerEl$shadow = emojiPickerEl.shadowRoot) === null || _emojiPickerEl$shadow === void 0 ? void 0 : _emojiPickerEl$shadow.querySelector("[title=\"".concat(emoji.name, "\"] > span > span"));
642
565
 
566
+ /** @type {HTMLSpanElement | null=} */
567
+ var emojiSpanEl = emojiPickerEl === null || emojiPickerEl === void 0 || (_emojiPickerEl$shadow = emojiPickerEl.shadowRoot) === null || _emojiPickerEl$shadow === void 0 ? void 0 : _emojiPickerEl$shadow.querySelector("[title=\"".concat(emoji.name, "\"] > span > span"));
643
568
  if (!emojiSpanEl) {
644
569
  return getInputEmojiNativeHTML(emoji["native"]);
645
570
  }
646
-
647
571
  var style = replaceAll(emojiSpanEl.style.cssText, '"', "'");
648
572
  return getInputEmojiHTML(style, emoji["native"]);
649
- } // eslint-disable-next-line valid-jsdoc
573
+ }
650
574
 
575
+ // eslint-disable-next-line valid-jsdoc
651
576
  /**
652
577
  *
653
578
  * @param {string} style
654
579
  * @param {string} emoji
655
580
  * @returns
656
581
  */
657
-
658
582
  function getInputEmojiHTML(style, emoji) {
659
583
  return "<img style=\"".concat(style, "; display: inline-block\" data-emoji=\"").concat(emoji, "\" src=\"").concat(TRANSPARENT_GIF, "\" />");
660
584
  }
585
+
661
586
  /**
662
587
  *
663
588
  * @param {string} emoji
664
589
  * @returns
665
590
  */
666
-
667
-
668
591
  function getInputEmojiNativeHTML(emoji) {
669
592
  return "<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">".concat(emoji, "</span>");
670
593
  }
594
+
671
595
  /**
672
596
  *
673
597
  * @param {string} html
674
598
  * @return {string}
675
599
  */
676
-
677
-
678
600
  function replaceAllTextEmojiToString(html) {
679
601
  var container = document.createElement("div");
680
602
  container.innerHTML = html;
@@ -686,37 +608,35 @@ function replaceAllTextEmojiToString(html) {
686
608
  }
687
609
 
688
610
  // @ts-check
611
+
689
612
  /**
690
613
  *
691
614
  * @param {string} html
692
615
  */
693
-
694
616
  function handlePasteHtmlAtCaret(html) {
695
617
  var sel;
696
618
  var range;
697
-
698
619
  if (window.getSelection) {
699
620
  // IE9 and non-IE
700
621
  sel = window.getSelection();
701
622
  if (sel === null) return;
702
-
703
623
  if (sel.getRangeAt && sel.rangeCount) {
704
624
  range = sel.getRangeAt(0);
705
- range.deleteContents(); // Range.createContextualFragment() would be useful here but is
706
- // non-standard and not supported in all browsers (IE9, for one)
625
+ range.deleteContents();
707
626
 
627
+ // Range.createContextualFragment() would be useful here but is
628
+ // non-standard and not supported in all browsers (IE9, for one)
708
629
  var el = document.createElement("div");
709
630
  el.innerHTML = html;
710
631
  var frag = document.createDocumentFragment();
711
632
  var node;
712
633
  var lastNode;
713
-
714
634
  while (node = el.firstChild) {
715
635
  lastNode = frag.appendChild(node);
716
636
  }
637
+ range.insertNode(frag);
717
638
 
718
- range.insertNode(frag); // Preserve the selection
719
-
639
+ // Preserve the selection
720
640
  if (lastNode) {
721
641
  range = range.cloneRange();
722
642
  range.setStartAfter(lastNode);
@@ -727,34 +647,32 @@ function handlePasteHtmlAtCaret(html) {
727
647
  }
728
648
  }
729
649
  }
650
+
730
651
  /**
731
652
  *
732
653
  * @param {{text: string, html: string}} props
733
654
  * @return {number}
734
655
  */
735
-
736
656
  function totalCharacters(_ref2) {
737
657
  var text = _ref2.text,
738
- html = _ref2.html;
658
+ html = _ref2.html;
739
659
  var textCount = text.length;
740
660
  var emojisCount = (html.match(/<img/g) || []).length;
741
661
  return textCount + emojisCount;
742
- } // eslint-disable-next-line valid-jsdoc
662
+ }
663
+
743
664
  /**
744
665
  * Set caret to the end of text value
745
666
  * @param {React.MutableRefObject<HTMLDivElement| null>} input
746
667
  */
747
-
748
668
  function moveCaretToEnd(input) {
749
669
  var range;
750
670
  var selection;
751
-
752
671
  if (document.createRange && input.current) {
753
672
  range = document.createRange();
754
673
  range.selectNodeContents(input.current);
755
674
  range.collapse(false);
756
675
  selection = window.getSelection();
757
-
758
676
  if (selection) {
759
677
  selection.removeAllRanges();
760
678
  selection.addRange(range);
@@ -766,39 +684,34 @@ function moveCaretToEnd(input) {
766
684
  * @param {HTMLDivElement} inputDiv
767
685
  * @return {string}
768
686
  */
769
-
770
687
  function removeHtmlExceptBr(inputDiv) {
771
688
  var temp = inputDiv.innerHTML.replace(/<br\s*\/?>/gi, '[BR]'); // temporarily replace <br> with placeholder
772
-
773
689
  var stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags
774
-
775
690
  var _final = stripped.replace(/\[BR\]/gi, '</br>'); // replace placeholders with <br>
776
-
777
-
778
691
  return _final;
779
692
  }
780
693
 
781
694
  // @ts-check
695
+
782
696
  /**
783
697
  * @typedef {import('../types/types').SanitizeFn} SanitizeFn
784
698
  */
785
- // eslint-disable-next-line valid-jsdoc
786
699
 
700
+ // eslint-disable-next-line valid-jsdoc
787
701
  /**
788
702
  * @param {boolean} shouldReturn
789
703
  */
790
-
791
704
  function useSanitize(shouldReturn) {
792
705
  /** @type {React.MutableRefObject<SanitizeFn[]>} */
793
706
  var sanitizeFnsRef = React.useRef([]);
794
707
  var sanitizedTextRef = React.useRef("");
795
- /** @type {(fn: SanitizeFn) => void} */
796
708
 
709
+ /** @type {(fn: SanitizeFn) => void} */
797
710
  var addSanitizeFn = React.useCallback(function (fn) {
798
711
  sanitizeFnsRef.current.push(fn);
799
712
  }, []);
800
- /** @type {(html: string) => string} */
801
713
 
714
+ /** @type {(html: string) => string} */
802
715
  var sanitize = React.useCallback(function (html) {
803
716
  var result = sanitizeFnsRef.current.reduce(function (acc, fn) {
804
717
  return fn(acc);
@@ -813,30 +726,30 @@ function useSanitize(shouldReturn) {
813
726
  sanitizedTextRef: sanitizedTextRef
814
727
  };
815
728
  }
729
+
816
730
  /**
817
731
  *
818
732
  * @param {string} html
819
733
  * @param {boolean} shouldReturn
820
734
  * @return {string}
821
735
  */
822
-
823
736
  function replaceAllHtmlToString(html, shouldReturn) {
824
737
  var container = document.createElement("div");
825
738
  container.innerHTML = html;
826
739
  var text;
827
-
828
740
  if (shouldReturn) {
829
741
  text = removeHtmlExceptBr(container);
830
742
  } else {
831
743
  text = container.innerText || "";
832
- } // remove all ↵ for safari
833
-
744
+ }
834
745
 
746
+ // remove all ↵ for safari
835
747
  text = text.replace(/\n/gi, "");
836
748
  return text;
837
749
  }
838
750
 
839
751
  // @ts-check
752
+
840
753
  /**
841
754
  * @typedef {Object} Props
842
755
  * @property {React.Ref<any>} ref
@@ -849,27 +762,22 @@ function replaceAllHtmlToString(html, shouldReturn) {
849
762
  *
850
763
  * @param {Props} props
851
764
  */
852
-
853
765
  function useExpose(_ref) {
854
766
  var ref = _ref.ref,
855
- textInputRef = _ref.textInputRef,
856
- setValue = _ref.setValue,
857
- emitChange = _ref.emitChange;
858
-
767
+ textInputRef = _ref.textInputRef,
768
+ setValue = _ref.setValue,
769
+ emitChange = _ref.emitChange;
859
770
  var _useSanitize = useSanitize(),
860
- sanitize = _useSanitize.sanitize,
861
- sanitizedTextRef = _useSanitize.sanitizedTextRef;
862
-
771
+ sanitize = _useSanitize.sanitize,
772
+ sanitizedTextRef = _useSanitize.sanitizedTextRef;
863
773
  React.useImperativeHandle(ref, function () {
864
774
  return {
865
775
  get value() {
866
776
  return sanitizedTextRef.current;
867
777
  },
868
-
869
778
  set value(value) {
870
779
  setValue(value);
871
780
  },
872
-
873
781
  focus: function focus() {
874
782
  if (textInputRef.current === null) return;
875
783
  textInputRef.current.focus();
@@ -878,7 +786,6 @@ function useExpose(_ref) {
878
786
  if (textInputRef.current !== null) {
879
787
  sanitize(textInputRef.current.html);
880
788
  }
881
-
882
789
  emitChange();
883
790
  }
884
791
  };
@@ -887,13 +794,13 @@ function useExpose(_ref) {
887
794
 
888
795
  // @ts-check
889
796
 
797
+ // eslint-disable-next-line valid-jsdoc
890
798
  /**
891
799
  * useEmit
892
800
  * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef
893
801
  * @param {(size: {width: number, height: number}) => void} onResize
894
802
  * @param {(text: string) => void} onChange
895
803
  */
896
-
897
804
  function useEmit(textInputRef, onResize, onChange) {
898
805
  /** @type {React.MutableRefObject<{width: number; height: number} | null>} */
899
806
  var currentSizeRef = React.useRef(null);
@@ -902,11 +809,9 @@ function useEmit(textInputRef, onResize, onChange) {
902
809
  if (textInputRef.current !== null) {
903
810
  var currentSize = currentSizeRef.current;
904
811
  var nextSize = textInputRef.current.size;
905
-
906
812
  if ((!currentSize || currentSize.width !== nextSize.width || currentSize.height !== nextSize.height) && typeof onResize === "function") {
907
813
  onResize(nextSize);
908
814
  }
909
-
910
815
  currentSizeRef.current = nextSize;
911
816
  }
912
817
  }, [onResize, textInputRef]);
@@ -914,7 +819,6 @@ function useEmit(textInputRef, onResize, onChange) {
914
819
  if (typeof onChangeFn.current === "function") {
915
820
  onChangeFn.current(sanitizedText);
916
821
  }
917
-
918
822
  if (typeof onResize === "function") {
919
823
  checkAndEmitResize();
920
824
  }
@@ -928,6 +832,7 @@ function useEmit(textInputRef, onResize, onChange) {
928
832
  }
929
833
 
930
834
  var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
835
+
931
836
  /**
932
837
  * @typedef {Object} Props
933
838
  * @property {(event: React.KeyboardEvent) => void} onKeyDown
@@ -957,47 +862,39 @@ var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
957
862
  * focus: () => void;
958
863
  * }} Ref
959
864
  */
960
- // eslint-disable-next-line valid-jsdoc
961
865
 
866
+ // eslint-disable-next-line valid-jsdoc
962
867
  /** @type {React.ForwardRefRenderFunction<Ref, Props>} */
963
-
964
868
  var TextInput = function TextInput(_ref, ref) {
965
869
  var placeholder = _ref.placeholder,
966
- style = _ref.style,
967
- tabIndex = _ref.tabIndex,
968
- className = _ref.className,
969
- onChange = _ref.onChange,
970
- props = _objectWithoutProperties(_ref, _excluded);
971
-
870
+ style = _ref.style,
871
+ tabIndex = _ref.tabIndex,
872
+ className = _ref.className,
873
+ onChange = _ref.onChange,
874
+ props = _objectWithoutProperties(_ref, _excluded);
972
875
  React.useImperativeHandle(ref, function () {
973
876
  return {
974
877
  appendContent: function appendContent(html) {
975
878
  if (textInputRef.current) {
976
879
  textInputRef.current.focus();
977
880
  }
978
-
979
881
  handlePasteHtmlAtCaret(html);
980
-
981
882
  if (textInputRef.current) {
982
883
  textInputRef.current.focus();
983
884
  }
984
-
985
885
  if (textInputRef.current && placeholderRef.current && textInputRef.current.innerHTML.trim() === "") {
986
886
  placeholderRef.current.style.visibility = "visible";
987
887
  } else if (placeholderRef.current) {
988
888
  placeholderRef.current.style.visibility = "hidden";
989
889
  }
990
-
991
890
  if (textInputRef.current && typeof onChange === 'function') {
992
891
  onChange(textInputRef.current.innerHTML);
993
892
  }
994
893
  },
995
-
996
894
  set html(value) {
997
895
  if (textInputRef.current) {
998
896
  textInputRef.current.innerHTML = value;
999
897
  }
1000
-
1001
898
  if (placeholderRef.current) {
1002
899
  if (value.trim() === "") {
1003
900
  placeholderRef.current.style.visibility = "visible";
@@ -1005,22 +902,18 @@ var TextInput = function TextInput(_ref, ref) {
1005
902
  placeholderRef.current.style.visibility = "hidden";
1006
903
  }
1007
904
  }
1008
-
1009
905
  if (typeof onChange === 'function' && textInputRef.current) {
1010
906
  onChange(textInputRef.current.innerHTML);
1011
907
  }
1012
908
  },
1013
-
1014
909
  get html() {
1015
910
  if (!textInputRef.current) return '';
1016
911
  return textInputRef.current.innerHTML;
1017
912
  },
1018
-
1019
913
  get text() {
1020
914
  if (!textInputRef.current) return '';
1021
915
  return textInputRef.current.innerText;
1022
916
  },
1023
-
1024
917
  get size() {
1025
918
  if (!textInputRef.current) {
1026
919
  return {
@@ -1028,41 +921,36 @@ var TextInput = function TextInput(_ref, ref) {
1028
921
  height: 0
1029
922
  };
1030
923
  }
1031
-
1032
924
  return {
1033
925
  width: textInputRef.current.offsetWidth,
1034
926
  height: textInputRef.current.offsetHeight
1035
927
  };
1036
928
  },
1037
-
1038
929
  focus: function focus() {
1039
930
  if (!textInputRef.current) return;
1040
931
  textInputRef.current.focus();
1041
932
  }
1042
933
  };
1043
934
  });
1044
- /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1045
935
 
936
+ /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1046
937
  var placeholderRef = React.useRef(null);
1047
938
  /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1048
-
1049
939
  var textInputRef = React.useRef(null);
940
+
1050
941
  /**
1051
942
  *
1052
943
  * @param {React.KeyboardEvent} event
1053
944
  */
1054
-
1055
945
  function handleKeyDown(event) {
1056
946
  if (event.key === "Enter" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {
1057
947
  event.preventDefault();
1058
-
1059
948
  if (textInputRef.current) {
1060
949
  textInputRef.current.innerHTML = "".concat(textInputRef.current.innerHTML, "</br></br>");
1061
950
  moveCaretToEnd(textInputRef);
1062
951
  return;
1063
952
  }
1064
953
  }
1065
-
1066
954
  if (event.key === "Enter") {
1067
955
  props.onEnter(event);
1068
956
  } else if (event.key === "ArrowUp") {
@@ -1074,40 +962,33 @@ var TextInput = function TextInput(_ref, ref) {
1074
962
  placeholderRef.current.style.visibility = "hidden";
1075
963
  }
1076
964
  }
1077
-
1078
965
  props.onKeyDown(event);
1079
966
  }
1080
- /** */
1081
-
1082
967
 
968
+ /** */
1083
969
  function handleClick() {
1084
970
  props.onFocus();
1085
971
  }
972
+
1086
973
  /**
1087
974
  *
1088
975
  * @param {React.KeyboardEvent} event
1089
976
  */
1090
-
1091
-
1092
977
  function handleKeyUp(event) {
1093
978
  props.onKeyUp(event);
1094
979
  var input = textInputRef.current;
1095
-
1096
980
  if (placeholderRef.current) {
1097
981
  var _input$innerText;
1098
-
1099
- if ((input === null || input === void 0 ? void 0 : (_input$innerText = input.innerText) === null || _input$innerText === void 0 ? void 0 : _input$innerText.trim()) === "") {
982
+ if ((input === null || input === void 0 || (_input$innerText = input.innerText) === null || _input$innerText === void 0 ? void 0 : _input$innerText.trim()) === "") {
1100
983
  placeholderRef.current.style.visibility = "visible";
1101
984
  } else {
1102
985
  placeholderRef.current.style.visibility = "hidden";
1103
986
  }
1104
987
  }
1105
-
1106
988
  if (typeof onChange === 'function' && textInputRef.current) {
1107
989
  onChange(textInputRef.current.innerHTML);
1108
990
  }
1109
991
  }
1110
-
1111
992
  return /*#__PURE__*/React__default["default"].createElement("div", {
1112
993
  className: "react-input-emoji--container",
1113
994
  style: style
@@ -1130,7 +1011,6 @@ var TextInput = function TextInput(_ref, ref) {
1130
1011
  "data-testid": "react-input-emoji--input"
1131
1012
  })));
1132
1013
  };
1133
-
1134
1014
  var TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
1135
1015
 
1136
1016
  /**
@@ -1138,6 +1018,7 @@ var TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
1138
1018
  * @property {boolean} showPicker
1139
1019
  * @property {(event: React.MouseEvent) => void} toggleShowPicker
1140
1020
  * @property {HTMLDivElement=} buttonElement
1021
+ * @property {React.MutableRefObject=} buttonRef
1141
1022
  */
1142
1023
 
1143
1024
  /**
@@ -1145,28 +1026,28 @@ var TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
1145
1026
  * @param {Props} props
1146
1027
  * @return {JSX.Element}
1147
1028
  */
1148
-
1149
1029
  function EmojiPickerButton(_ref) {
1150
1030
  var showPicker = _ref.showPicker,
1151
- toggleShowPicker = _ref.toggleShowPicker,
1152
- buttonElement = _ref.buttonElement;
1153
- var buttonRef = React.useRef(null);
1154
-
1031
+ toggleShowPicker = _ref.toggleShowPicker,
1032
+ buttonElement = _ref.buttonElement,
1033
+ buttonRef = _ref.buttonRef;
1034
+ var localButtonRef = React.useRef(null);
1155
1035
  var _useState = React.useState(false),
1156
- _useState2 = _slicedToArray(_useState, 2),
1157
- showCustomButtonContent = _useState2[0],
1158
- setShowCustomButtonContent = _useState2[1];
1159
-
1036
+ _useState2 = _slicedToArray(_useState, 2),
1037
+ showCustomButtonContent = _useState2[0],
1038
+ setShowCustomButtonContent = _useState2[1];
1160
1039
  React.useEffect(function () {
1161
- var _buttonElement$childN, _buttonElement$childN2;
1162
-
1163
- if (((_buttonElement$childN = buttonElement === null || buttonElement === void 0 ? void 0 : (_buttonElement$childN2 = buttonElement.childNodes) === null || _buttonElement$childN2 === void 0 ? void 0 : _buttonElement$childN2.length) !== null && _buttonElement$childN !== void 0 ? _buttonElement$childN : 0) > 2) {
1164
- buttonRef.current.appendChild(buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes[0]);
1040
+ var _buttonRef$current$ch, _buttonRef$current, _buttonElement$childN, _buttonElement$childN2;
1041
+ if (((_buttonRef$current$ch = buttonRef === null || buttonRef === void 0 || (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || (_buttonRef$current = _buttonRef$current.childNodes) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.length) !== null && _buttonRef$current$ch !== void 0 ? _buttonRef$current$ch : 0) > 2) {
1042
+ localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);
1043
+ setShowCustomButtonContent(true);
1044
+ } else if (((_buttonElement$childN = buttonElement === null || buttonElement === void 0 || (_buttonElement$childN2 = buttonElement.childNodes) === null || _buttonElement$childN2 === void 0 ? void 0 : _buttonElement$childN2.length) !== null && _buttonElement$childN !== void 0 ? _buttonElement$childN : 0) > 2) {
1045
+ localButtonRef.current.appendChild(buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes[0]);
1165
1046
  setShowCustomButtonContent(true);
1166
1047
  }
1167
1048
  }, [buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes]);
1168
1049
  return /*#__PURE__*/React__default["default"].createElement("button", {
1169
- ref: buttonRef,
1050
+ ref: localButtonRef,
1170
1051
  type: "button",
1171
1052
  className: "react-input-emoji--button".concat(showPicker ? " react-input-emoji--button__show" : ""),
1172
1053
  onClick: toggleShowPicker
@@ -1186,7 +1067,6 @@ function EmojiPickerButton(_ref) {
1186
1067
  function $parcel$interopDefault(a) {
1187
1068
  return a && a.__esModule ? a.default : a;
1188
1069
  }
1189
-
1190
1070
  function $c770c458706daa72$export$2e2bcd8739ae039(obj, key, value) {
1191
1071
  if (key in obj) Object.defineProperty(obj, key, {
1192
1072
  value: value,
@@ -1196,40 +1076,32 @@ function $c770c458706daa72$export$2e2bcd8739ae039(obj, key, value) {
1196
1076
  });else obj[key] = value;
1197
1077
  return obj;
1198
1078
  }
1199
-
1200
1079
  var $fb96b826c0c5f37a$var$n,
1201
- $fb96b826c0c5f37a$export$41c562ebe57d11e2,
1202
- $fb96b826c0c5f37a$var$u,
1203
- $fb96b826c0c5f37a$var$t,
1204
- $fb96b826c0c5f37a$var$r,
1205
- $fb96b826c0c5f37a$var$o,
1206
- $fb96b826c0c5f37a$var$e = {},
1207
- $fb96b826c0c5f37a$var$c = [],
1208
- $fb96b826c0c5f37a$var$s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
1209
-
1080
+ $fb96b826c0c5f37a$export$41c562ebe57d11e2,
1081
+ $fb96b826c0c5f37a$var$u,
1082
+ $fb96b826c0c5f37a$var$t,
1083
+ $fb96b826c0c5f37a$var$r,
1084
+ $fb96b826c0c5f37a$var$o,
1085
+ $fb96b826c0c5f37a$var$e = {},
1086
+ $fb96b826c0c5f37a$var$c = [],
1087
+ $fb96b826c0c5f37a$var$s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
1210
1088
  function $fb96b826c0c5f37a$var$a(n1, l1) {
1211
1089
  for (var u1 in l1) n1[u1] = l1[u1];
1212
-
1213
1090
  return n1;
1214
1091
  }
1215
-
1216
1092
  function $fb96b826c0c5f37a$var$h(n2) {
1217
1093
  var l2 = n2.parentNode;
1218
1094
  l2 && l2.removeChild(n2);
1219
1095
  }
1220
-
1221
1096
  function $fb96b826c0c5f37a$export$c8a8987d4410bf2d(l3, u2, i1) {
1222
1097
  var t1,
1223
- r1,
1224
- o1,
1225
- f1 = {};
1226
-
1098
+ r1,
1099
+ o1,
1100
+ f1 = {};
1227
1101
  for (o1 in u2) "key" == o1 ? t1 = u2[o1] : "ref" == o1 ? r1 = u2[o1] : f1[o1] = u2[o1];
1228
-
1229
1102
  if (arguments.length > 2 && (f1.children = arguments.length > 3 ? $fb96b826c0c5f37a$var$n.call(arguments, 2) : i1), "function" == typeof l3 && null != l3.defaultProps) for (o1 in l3.defaultProps) void 0 === f1[o1] && (f1[o1] = l3.defaultProps[o1]);
1230
1103
  return $fb96b826c0c5f37a$var$y(l3, f1, t1, r1, null);
1231
1104
  }
1232
-
1233
1105
  function $fb96b826c0c5f37a$var$y(n3, i2, t2, r2, o2) {
1234
1106
  var f2 = {
1235
1107
  type: n3,
@@ -1248,46 +1120,35 @@ function $fb96b826c0c5f37a$var$y(n3, i2, t2, r2, o2) {
1248
1120
  };
1249
1121
  return null == o2 && null != $fb96b826c0c5f37a$export$41c562ebe57d11e2.vnode && $fb96b826c0c5f37a$export$41c562ebe57d11e2.vnode(f2), f2;
1250
1122
  }
1251
-
1252
1123
  function $fb96b826c0c5f37a$export$7d1e3a5e95ceca43() {
1253
1124
  return {
1254
1125
  current: null
1255
1126
  };
1256
1127
  }
1257
-
1258
1128
  function $fb96b826c0c5f37a$export$ffb0004e005737fa(n4) {
1259
1129
  return n4.children;
1260
1130
  }
1261
-
1262
1131
  function $fb96b826c0c5f37a$export$16fa2f45be04daa8(n5, l4) {
1263
1132
  this.props = n5, this.context = l4;
1264
1133
  }
1265
-
1266
1134
  function $fb96b826c0c5f37a$var$k(n6, l5) {
1267
1135
  if (null == l5) return n6.__ ? $fb96b826c0c5f37a$var$k(n6.__, n6.__.__k.indexOf(n6) + 1) : null;
1268
-
1269
1136
  for (var u3; l5 < n6.__k.length; l5++) if (null != (u3 = n6.__k[l5]) && null != u3.__e) return u3.__e;
1270
-
1271
1137
  return "function" == typeof n6.type ? $fb96b826c0c5f37a$var$k(n6) : null;
1272
1138
  }
1273
-
1274
1139
  function $fb96b826c0c5f37a$var$b(n7) {
1275
1140
  var l6, u4;
1276
-
1277
1141
  if (null != (n7 = n7.__) && null != n7.__c) {
1278
1142
  for (n7.__e = n7.__c.base = null, l6 = 0; l6 < n7.__k.length; l6++) if (null != (u4 = n7.__k[l6]) && null != u4.__e) {
1279
1143
  n7.__e = n7.__c.base = u4.__e;
1280
1144
  break;
1281
1145
  }
1282
-
1283
1146
  return $fb96b826c0c5f37a$var$b(n7);
1284
1147
  }
1285
1148
  }
1286
-
1287
1149
  function $fb96b826c0c5f37a$var$m(n8) {
1288
1150
  (!n8.__d && (n8.__d = !0) && $fb96b826c0c5f37a$var$t.push(n8) && !$fb96b826c0c5f37a$var$g.__r++ || $fb96b826c0c5f37a$var$o !== $fb96b826c0c5f37a$export$41c562ebe57d11e2.debounceRendering) && (($fb96b826c0c5f37a$var$o = $fb96b826c0c5f37a$export$41c562ebe57d11e2.debounceRendering) || $fb96b826c0c5f37a$var$r)($fb96b826c0c5f37a$var$g);
1289
1151
  }
1290
-
1291
1152
  function $fb96b826c0c5f37a$var$g() {
1292
1153
  for (var n9; $fb96b826c0c5f37a$var$g.__r = $fb96b826c0c5f37a$var$t.length;) n9 = $fb96b826c0c5f37a$var$t.sort(function (n10, l7) {
1293
1154
  return n10.__v.__b - l7.__v.__b;
@@ -1296,18 +1157,16 @@ function $fb96b826c0c5f37a$var$g() {
1296
1157
  n11.__d && (r3 = (t3 = (l8 = n11).__v).__e, (o3 = l8.__P) && (u5 = [], (i3 = $fb96b826c0c5f37a$var$a({}, t3)).__v = t3.__v + 1, $fb96b826c0c5f37a$var$j(o3, t3, i3, l8.__n, void 0 !== o3.ownerSVGElement, null != t3.__h ? [r3] : null, u5, null == r3 ? $fb96b826c0c5f37a$var$k(t3) : r3, t3.__h), $fb96b826c0c5f37a$var$z(u5, t3), t3.__e != r3 && $fb96b826c0c5f37a$var$b(t3)));
1297
1158
  });
1298
1159
  }
1299
-
1300
1160
  function $fb96b826c0c5f37a$var$w(n12, l9, u6, i4, t4, r4, o4, f3, s1, a1) {
1301
1161
  var h1,
1302
- v1,
1303
- p1,
1304
- _1,
1305
- b1,
1306
- m1,
1307
- g1,
1308
- w1 = i4 && i4.__k || $fb96b826c0c5f37a$var$c,
1309
- A1 = w1.length;
1310
-
1162
+ v1,
1163
+ p1,
1164
+ _1,
1165
+ b1,
1166
+ m1,
1167
+ g1,
1168
+ w1 = i4 && i4.__k || $fb96b826c0c5f37a$var$c,
1169
+ A1 = w1.length;
1311
1170
  for (u6.__k = [], h1 = 0; h1 < l9.length; h1++) if (null != (_1 = u6.__k[h1] = null == (_1 = l9[h1]) || "boolean" == typeof _1 ? null : "string" == typeof _1 || "number" == typeof _1 || "bigint" == typeof _1 ? $fb96b826c0c5f37a$var$y(null, _1, null, null, _1) : Array.isArray(_1) ? $fb96b826c0c5f37a$var$y($fb96b826c0c5f37a$export$ffb0004e005737fa, {
1312
1171
  children: _1
1313
1172
  }, null, null, null) : _1.__b > 0 ? $fb96b826c0c5f37a$var$y(_1.type, _1.props, _1.key, null, _1.__v) : _1)) {
@@ -1316,54 +1175,40 @@ function $fb96b826c0c5f37a$var$w(n12, l9, u6, i4, t4, r4, o4, f3, s1, a1) {
1316
1175
  w1[v1] = void 0;
1317
1176
  break;
1318
1177
  }
1319
-
1320
1178
  p1 = null;
1321
1179
  }
1322
1180
  $fb96b826c0c5f37a$var$j(n12, _1, p1 = p1 || $fb96b826c0c5f37a$var$e, t4, r4, o4, f3, s1, a1), b1 = _1.__e, (v1 = _1.ref) && p1.ref != v1 && (g1 || (g1 = []), p1.ref && g1.push(p1.ref, null, _1), g1.push(v1, _1.__c || b1, _1)), null != b1 ? (null == m1 && (m1 = b1), "function" == typeof _1.type && _1.__k === p1.__k ? _1.__d = s1 = $fb96b826c0c5f37a$var$x(_1, s1, n12) : s1 = $fb96b826c0c5f37a$var$P(n12, _1, p1, w1, b1, s1), "function" == typeof u6.type && (u6.__d = s1)) : s1 && p1.__e == s1 && s1.parentNode != n12 && (s1 = $fb96b826c0c5f37a$var$k(p1));
1323
1181
  }
1324
-
1325
1182
  for (u6.__e = m1, h1 = A1; h1--;) null != w1[h1] && ("function" == typeof u6.type && null != w1[h1].__e && w1[h1].__e == u6.__d && (u6.__d = $fb96b826c0c5f37a$var$k(i4, h1 + 1)), $fb96b826c0c5f37a$var$N(w1[h1], w1[h1]));
1326
-
1327
1183
  if (g1) for (h1 = 0; h1 < g1.length; h1++) $fb96b826c0c5f37a$var$M(g1[h1], g1[++h1], g1[++h1]);
1328
1184
  }
1329
-
1330
1185
  function $fb96b826c0c5f37a$var$x(n13, l10, u7) {
1331
1186
  for (var i5, t5 = n13.__k, r5 = 0; t5 && r5 < t5.length; r5++) (i5 = t5[r5]) && (i5.__ = n13, l10 = "function" == typeof i5.type ? $fb96b826c0c5f37a$var$x(i5, l10, u7) : $fb96b826c0c5f37a$var$P(u7, i5, i5, t5, i5.__e, l10));
1332
-
1333
1187
  return l10;
1334
1188
  }
1335
-
1336
1189
  function $fb96b826c0c5f37a$export$47e4c5b300681277(n14, l11) {
1337
1190
  return l11 = l11 || [], null == n14 || "boolean" == typeof n14 || (Array.isArray(n14) ? n14.some(function (n15) {
1338
1191
  $fb96b826c0c5f37a$export$47e4c5b300681277(n15, l11);
1339
1192
  }) : l11.push(n14)), l11;
1340
1193
  }
1341
-
1342
1194
  function $fb96b826c0c5f37a$var$P(n16, l12, u8, i6, t6, r6) {
1343
1195
  var o5, f4, e1;
1344
1196
  if (void 0 !== l12.__d) o5 = l12.__d, l12.__d = void 0;else if (null == u8 || t6 != r6 || null == t6.parentNode) n: if (null == r6 || r6.parentNode !== n16) n16.appendChild(t6), o5 = null;else {
1345
1197
  for (f4 = r6, e1 = 0; (f4 = f4.nextSibling) && e1 < i6.length; e1 += 2) if (f4 == t6) break n;
1346
-
1347
1198
  n16.insertBefore(t6, r6), o5 = r6;
1348
1199
  }
1349
1200
  return void 0 !== o5 ? o5 : t6.nextSibling;
1350
1201
  }
1351
-
1352
1202
  function $fb96b826c0c5f37a$var$C(n17, l13, u9, i7, t7) {
1353
1203
  var r7;
1354
-
1355
1204
  for (r7 in u9) "children" === r7 || "key" === r7 || r7 in l13 || $fb96b826c0c5f37a$var$H(n17, r7, null, u9[r7], i7);
1356
-
1357
1205
  for (r7 in l13) t7 && "function" != typeof l13[r7] || "children" === r7 || "key" === r7 || "value" === r7 || "checked" === r7 || u9[r7] === l13[r7] || $fb96b826c0c5f37a$var$H(n17, r7, l13[r7], u9[r7], i7);
1358
1206
  }
1359
-
1360
1207
  function $fb96b826c0c5f37a$var$$(n18, l14, u10) {
1361
1208
  "-" === l14[0] ? n18.setProperty(l14, u10) : n18[l14] = null == u10 ? "" : "number" != typeof u10 || $fb96b826c0c5f37a$var$s.test(l14) ? u10 : u10 + "px";
1362
1209
  }
1363
-
1364
1210
  function $fb96b826c0c5f37a$var$H(n19, l15, u11, i8, t8) {
1365
1211
  var r8;
1366
-
1367
1212
  n: if ("style" === l15) {
1368
1213
  if ("string" == typeof u11) n19.style.cssText = u11;else {
1369
1214
  if ("string" == typeof i8 && (n19.style.cssText = i8 = ""), i8) for (l15 in i8) u11 && l15 in u11 || $fb96b826c0c5f37a$var$$(n19.style, l15, "");
@@ -1377,31 +1222,27 @@ function $fb96b826c0c5f37a$var$H(n19, l15, u11, i8, t8) {
1377
1222
  "function" == typeof u11 || (null != u11 && (!1 !== u11 || "a" === l15[0] && "r" === l15[1]) ? n19.setAttribute(l15, u11) : n19.removeAttribute(l15));
1378
1223
  }
1379
1224
  }
1380
-
1381
1225
  function $fb96b826c0c5f37a$var$I(n20) {
1382
1226
  this.l[n20.type + !1]($fb96b826c0c5f37a$export$41c562ebe57d11e2.event ? $fb96b826c0c5f37a$export$41c562ebe57d11e2.event(n20) : n20);
1383
1227
  }
1384
-
1385
1228
  function $fb96b826c0c5f37a$var$T(n21) {
1386
1229
  this.l[n21.type + !0]($fb96b826c0c5f37a$export$41c562ebe57d11e2.event ? $fb96b826c0c5f37a$export$41c562ebe57d11e2.event(n21) : n21);
1387
1230
  }
1388
-
1389
1231
  function $fb96b826c0c5f37a$var$j(n22, u12, i9, t9, r9, o6, f5, e2, c1) {
1390
1232
  var s2,
1391
- h2,
1392
- v2,
1393
- y1,
1394
- p2,
1395
- k1,
1396
- b2,
1397
- m2,
1398
- g2,
1399
- x1,
1400
- A2,
1401
- P1 = u12.type;
1233
+ h2,
1234
+ v2,
1235
+ y1,
1236
+ p2,
1237
+ k1,
1238
+ b2,
1239
+ m2,
1240
+ g2,
1241
+ x1,
1242
+ A2,
1243
+ P1 = u12.type;
1402
1244
  if (void 0 !== u12.constructor) return null;
1403
1245
  null != i9.__h && (c1 = i9.__h, e2 = u12.__e = i9.__e, u12.__h = null, o6 = [e2]), (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.__b) && s2(u12);
1404
-
1405
1246
  try {
1406
1247
  n: if ("function" == typeof P1) {
1407
1248
  if (m2 = u12.props, g2 = (s2 = P1.contextType) && t9[s2.__c], x1 = s2 ? g2 ? g2.props.value : s2.__ : t9, i9.__c ? b2 = (h2 = u12.__c = i9.__c).__ = h2.__E : ("prototype" in P1 && P1.prototype.render ? u12.__c = h2 = new P1(m2, x1) : (u12.__c = h2 = new $fb96b826c0c5f37a$export$16fa2f45be04daa8(m2, x1), h2.constructor = P1, h2.render = $fb96b826c0c5f37a$var$O), g2 && g2.sub(h2), h2.props = m2, h2.state || (h2.state = {}), h2.context = x1, h2.__n = t9, v2 = h2.__d = !0, h2.__h = []), null == h2.__s && (h2.__s = h2.state), null != P1.getDerivedStateFromProps && (h2.__s == h2.state && (h2.__s = $fb96b826c0c5f37a$var$a({}, h2.__s)), $fb96b826c0c5f37a$var$a(h2.__s, P1.getDerivedStateFromProps(m2, h2.__s))), y1 = h2.props, p2 = h2.state, v2) null == P1.getDerivedStateFromProps && null != h2.componentWillMount && h2.componentWillMount(), null != h2.componentDidMount && h2.__h.push(h2.componentDidMount);else {
@@ -1411,20 +1252,17 @@ function $fb96b826c0c5f37a$var$j(n22, u12, i9, t9, r9, o6, f5, e2, c1) {
1411
1252
  }), h2.__h.length && f5.push(h2);
1412
1253
  break n;
1413
1254
  }
1414
-
1415
1255
  null != h2.componentWillUpdate && h2.componentWillUpdate(m2, h2.__s, x1), null != h2.componentDidUpdate && h2.__h.push(function () {
1416
1256
  h2.componentDidUpdate(y1, p2, k1);
1417
1257
  });
1418
1258
  }
1419
1259
  h2.context = x1, h2.props = m2, h2.state = h2.__s, (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.__r) && s2(u12), h2.__d = !1, h2.__v = u12, h2.__P = n22, s2 = h2.render(h2.props, h2.state, h2.context), h2.state = h2.__s, null != h2.getChildContext && (t9 = $fb96b826c0c5f37a$var$a($fb96b826c0c5f37a$var$a({}, t9), h2.getChildContext())), v2 || null == h2.getSnapshotBeforeUpdate || (k1 = h2.getSnapshotBeforeUpdate(y1, p2)), A2 = null != s2 && s2.type === $fb96b826c0c5f37a$export$ffb0004e005737fa && null == s2.key ? s2.props.children : s2, $fb96b826c0c5f37a$var$w(n22, Array.isArray(A2) ? A2 : [A2], u12, i9, t9, r9, o6, f5, e2, c1), h2.base = u12.__e, u12.__h = null, h2.__h.length && f5.push(h2), b2 && (h2.__E = h2.__ = null), h2.__e = !1;
1420
1260
  } else null == o6 && u12.__v === i9.__v ? (u12.__k = i9.__k, u12.__e = i9.__e) : u12.__e = $fb96b826c0c5f37a$var$L(i9.__e, u12, i9, t9, r9, o6, f5, c1);
1421
-
1422
1261
  (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.diffed) && s2(u12);
1423
1262
  } catch (n24) {
1424
1263
  u12.__v = null, (c1 || null != o6) && (u12.__e = e2, u12.__h = !!c1, o6[o6.indexOf(e2)] = null), $fb96b826c0c5f37a$export$41c562ebe57d11e2.__e(n24, u12, i9);
1425
1264
  }
1426
1265
  }
1427
-
1428
1266
  function $fb96b826c0c5f37a$var$z(n25, u13) {
1429
1267
  $fb96b826c0c5f37a$export$41c562ebe57d11e2.__c && $fb96b826c0c5f37a$export$41c562ebe57d11e2.__c(u13, n25), n25.some(function (u14) {
1430
1268
  try {
@@ -1436,40 +1274,34 @@ function $fb96b826c0c5f37a$var$z(n25, u13) {
1436
1274
  }
1437
1275
  });
1438
1276
  }
1439
-
1440
1277
  function $fb96b826c0c5f37a$var$L(l16, u15, i10, t10, r10, o7, f6, c2) {
1441
1278
  var s3,
1442
- a2,
1443
- v3,
1444
- y2 = i10.props,
1445
- p3 = u15.props,
1446
- d1 = u15.type,
1447
- _2 = 0;
1448
-
1279
+ a2,
1280
+ v3,
1281
+ y2 = i10.props,
1282
+ p3 = u15.props,
1283
+ d1 = u15.type,
1284
+ _2 = 0;
1449
1285
  if ("svg" === d1 && (r10 = !0), null != o7) {
1450
1286
  for (; _2 < o7.length; _2++) if ((s3 = o7[_2]) && "setAttribute" in s3 == !!d1 && (d1 ? s3.localName === d1 : 3 === s3.nodeType)) {
1451
1287
  l16 = s3, o7[_2] = null;
1452
1288
  break;
1453
1289
  }
1454
1290
  }
1455
-
1456
1291
  if (null == l16) {
1457
1292
  if (null === d1) return document.createTextNode(p3);
1458
1293
  l16 = r10 ? document.createElementNS("http://www.w3.org/2000/svg", d1) : document.createElement(d1, p3.is && p3), o7 = null, c2 = !1;
1459
1294
  }
1460
-
1461
1295
  if (null === d1) y2 === p3 || c2 && l16.data === p3 || (l16.data = p3);else {
1462
1296
  if (o7 = o7 && $fb96b826c0c5f37a$var$n.call(l16.childNodes), a2 = (y2 = i10.props || $fb96b826c0c5f37a$var$e).dangerouslySetInnerHTML, v3 = p3.dangerouslySetInnerHTML, !c2) {
1463
1297
  if (null != o7) for (y2 = {}, _2 = 0; _2 < l16.attributes.length; _2++) y2[l16.attributes[_2].name] = l16.attributes[_2].value;
1464
1298
  (v3 || a2) && (v3 && (a2 && v3.__html == a2.__html || v3.__html === l16.innerHTML) || (l16.innerHTML = v3 && v3.__html || ""));
1465
1299
  }
1466
-
1467
1300
  if ($fb96b826c0c5f37a$var$C(l16, p3, y2, r10, c2), v3) u15.__k = [];else if (_2 = u15.props.children, $fb96b826c0c5f37a$var$w(l16, Array.isArray(_2) ? _2 : [_2], u15, i10, t10, r10 && "foreignObject" !== d1, o7, f6, o7 ? o7[0] : i10.__k && $fb96b826c0c5f37a$var$k(i10, 0), c2), null != o7) for (_2 = o7.length; _2--;) null != o7[_2] && $fb96b826c0c5f37a$var$h(o7[_2]);
1468
1301
  c2 || ("value" in p3 && void 0 !== (_2 = p3.value) && (_2 !== y2.value || _2 !== l16.value || "progress" === d1 && !_2) && $fb96b826c0c5f37a$var$H(l16, "value", _2, y2.value, !1), "checked" in p3 && void 0 !== (_2 = p3.checked) && _2 !== l16.checked && $fb96b826c0c5f37a$var$H(l16, "checked", _2, y2.checked, !1));
1469
1302
  }
1470
1303
  return l16;
1471
1304
  }
1472
-
1473
1305
  function $fb96b826c0c5f37a$var$M(n28, u16, i11) {
1474
1306
  try {
1475
1307
  "function" == typeof n28 ? n28(u16) : n28.current = u16;
@@ -1477,10 +1309,8 @@ function $fb96b826c0c5f37a$var$M(n28, u16, i11) {
1477
1309
  $fb96b826c0c5f37a$export$41c562ebe57d11e2.__e(n29, i11);
1478
1310
  }
1479
1311
  }
1480
-
1481
1312
  function $fb96b826c0c5f37a$var$N(n30, u17, i12) {
1482
1313
  var t11, r11;
1483
-
1484
1314
  if ($fb96b826c0c5f37a$export$41c562ebe57d11e2.unmount && $fb96b826c0c5f37a$export$41c562ebe57d11e2.unmount(n30), (t11 = n30.ref) && (t11.current && t11.current !== n30.__e || $fb96b826c0c5f37a$var$M(t11, null, u17)), null != (t11 = n30.__c)) {
1485
1315
  if (t11.componentWillUnmount) try {
1486
1316
  t11.componentWillUnmount();
@@ -1489,20 +1319,16 @@ function $fb96b826c0c5f37a$var$N(n30, u17, i12) {
1489
1319
  }
1490
1320
  t11.base = t11.__P = null;
1491
1321
  }
1492
-
1493
1322
  if (t11 = n30.__k) for (r11 = 0; r11 < t11.length; r11++) t11[r11] && $fb96b826c0c5f37a$var$N(t11[r11], u17, "function" != typeof n30.type);
1494
1323
  i12 || null == n30.__e || $fb96b826c0c5f37a$var$h(n30.__e), n30.__e = n30.__d = void 0;
1495
1324
  }
1496
-
1497
1325
  function $fb96b826c0c5f37a$var$O(n32, l, u18) {
1498
1326
  return this.constructor(n32, u18);
1499
1327
  }
1500
-
1501
1328
  function $fb96b826c0c5f37a$export$b3890eb0ae9dca99(u19, i13, t12) {
1502
1329
  var r12, o8, f7;
1503
1330
  $fb96b826c0c5f37a$export$41c562ebe57d11e2.__ && $fb96b826c0c5f37a$export$41c562ebe57d11e2.__(u19, i13), o8 = (r12 = "function" == typeof t12) ? null : t12 && t12.__k || i13.__k, f7 = [], $fb96b826c0c5f37a$var$j(i13, u19 = (!r12 && t12 || i13).__k = $fb96b826c0c5f37a$export$c8a8987d4410bf2d($fb96b826c0c5f37a$export$ffb0004e005737fa, null, [u19]), o8 || $fb96b826c0c5f37a$var$e, $fb96b826c0c5f37a$var$e, void 0 !== i13.ownerSVGElement, !r12 && t12 ? [t12] : o8 ? null : i13.firstChild ? $fb96b826c0c5f37a$var$n.call(i13.childNodes) : null, f7, !r12 && t12 ? t12 : o8 ? o8.__e : i13.firstChild, r12), $fb96b826c0c5f37a$var$z(f7, u19);
1504
1331
  }
1505
-
1506
1332
  $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$export$41c562ebe57d11e2 = {
1507
1333
  __e: function (n39, l22) {
1508
1334
  for (var u23, i16, t14; l22 = l22.__;) if ((u23 = l22.__c) && !u23.__) try {
@@ -1510,7 +1336,6 @@ $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$expor
1510
1336
  } catch (l23) {
1511
1337
  n39 = l23;
1512
1338
  }
1513
-
1514
1339
  throw n39;
1515
1340
  }
1516
1341
  }, $fb96b826c0c5f37a$var$u = 0, $fb96b826c0c5f37a$export$16fa2f45be04daa8.prototype.setState = function (n41, l24) {
@@ -1520,14 +1345,11 @@ $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$expor
1520
1345
  this.__v && (this.__e = !0, n42 && this.__h.push(n42), $fb96b826c0c5f37a$var$m(this));
1521
1346
  }, $fb96b826c0c5f37a$export$16fa2f45be04daa8.prototype.render = $fb96b826c0c5f37a$export$ffb0004e005737fa, $fb96b826c0c5f37a$var$t = [], $fb96b826c0c5f37a$var$r = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, $fb96b826c0c5f37a$var$g.__r = 0;
1522
1347
  var $bd9dd35321b03dd4$var$o = 0;
1523
-
1524
1348
  function $bd9dd35321b03dd4$export$34b9dba7ce09269b(_1, e1, n, t, f) {
1525
1349
  var l,
1526
- s,
1527
- u = {};
1528
-
1350
+ s,
1351
+ u = {};
1529
1352
  for (s in e1) "ref" == s ? l = e1[s] : u[s] = e1[s];
1530
-
1531
1353
  var a = {
1532
1354
  type: _1,
1533
1355
  props: u,
@@ -1548,20 +1370,17 @@ function $bd9dd35321b03dd4$export$34b9dba7ce09269b(_1, e1, n, t, f) {
1548
1370
  if ("function" == typeof _1 && (l = _1.defaultProps)) for (s in l) void 0 === u[s] && (u[s] = l[s]);
1549
1371
  return ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode && ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode(a), a;
1550
1372
  }
1551
-
1552
1373
  function $f72b75cf796873c7$var$set(key, value) {
1553
1374
  try {
1554
1375
  window.localStorage[`emoji-mart.${key}`] = JSON.stringify(value);
1555
1376
  } catch (error) {}
1556
1377
  }
1557
-
1558
1378
  function $f72b75cf796873c7$var$get(key) {
1559
1379
  try {
1560
1380
  const value = window.localStorage[`emoji-mart.${key}`];
1561
1381
  if (value) return JSON.parse(value);
1562
1382
  } catch (error) {}
1563
1383
  }
1564
-
1565
1384
  var $f72b75cf796873c7$export$2e2bcd8739ae039 = {
1566
1385
  set: $f72b75cf796873c7$var$set,
1567
1386
  get: $f72b75cf796873c7$var$get
@@ -1601,7 +1420,6 @@ const $c84d045dcc34faf5$var$VERSIONS = [{
1601
1420
  v: 1,
1602
1421
  emoji: "\uD83D\uDE43"
1603
1422
  }];
1604
-
1605
1423
  function $c84d045dcc34faf5$var$latestVersion() {
1606
1424
  for (const {
1607
1425
  v: v,
@@ -1610,76 +1428,68 @@ function $c84d045dcc34faf5$var$latestVersion() {
1610
1428
  if ($c84d045dcc34faf5$var$isSupported(emoji)) return v;
1611
1429
  }
1612
1430
  }
1613
-
1614
1431
  function $c84d045dcc34faf5$var$noCountryFlags() {
1615
1432
  if ($c84d045dcc34faf5$var$isSupported("\uD83C\uDDE8\uD83C\uDDE6")) return false;
1616
1433
  return true;
1617
1434
  }
1618
-
1619
1435
  function $c84d045dcc34faf5$var$isSupported(emoji) {
1620
1436
  if ($c84d045dcc34faf5$var$CACHE.has(emoji)) return $c84d045dcc34faf5$var$CACHE.get(emoji);
1621
1437
  const supported = $c84d045dcc34faf5$var$isEmojiSupported(emoji);
1622
1438
  $c84d045dcc34faf5$var$CACHE.set(emoji, supported);
1623
1439
  return supported;
1624
- } // https://github.com/koala-interactive/is-emoji-supported
1625
-
1626
-
1440
+ }
1441
+ // https://github.com/koala-interactive/is-emoji-supported
1627
1442
  const $c84d045dcc34faf5$var$isEmojiSupported = (() => {
1628
1443
  let ctx = null;
1629
-
1630
1444
  try {
1631
1445
  if (!navigator.userAgent.includes("jsdom")) ctx = document.createElement("canvas").getContext("2d", {
1632
1446
  willReadFrequently: true
1633
1447
  });
1634
- } catch {} // Not in browser env
1635
-
1636
-
1448
+ } catch {}
1449
+ // Not in browser env
1637
1450
  if (!ctx) return () => false;
1638
1451
  const CANVAS_HEIGHT = 25;
1639
1452
  const CANVAS_WIDTH = 20;
1640
- const textSize = Math.floor(CANVAS_HEIGHT / 2); // Initialize convas context
1641
-
1453
+ const textSize = Math.floor(CANVAS_HEIGHT / 2);
1454
+ // Initialize convas context
1642
1455
  ctx.font = textSize + "px Arial, Sans-Serif";
1643
1456
  ctx.textBaseline = "top";
1644
1457
  ctx.canvas.width = CANVAS_WIDTH * 2;
1645
1458
  ctx.canvas.height = CANVAS_HEIGHT;
1646
1459
  return unicode => {
1647
- ctx.clearRect(0, 0, CANVAS_WIDTH * 2, CANVAS_HEIGHT); // Draw in red on the left
1648
-
1460
+ ctx.clearRect(0, 0, CANVAS_WIDTH * 2, CANVAS_HEIGHT);
1461
+ // Draw in red on the left
1649
1462
  ctx.fillStyle = "#FF0000";
1650
- ctx.fillText(unicode, 0, 22); // Draw in blue on right
1651
-
1463
+ ctx.fillText(unicode, 0, 22);
1464
+ // Draw in blue on right
1652
1465
  ctx.fillStyle = "#0000FF";
1653
1466
  ctx.fillText(unicode, CANVAS_WIDTH, 22);
1654
1467
  const a = ctx.getImageData(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT).data;
1655
1468
  const count = a.length;
1656
- let i = 0; // Search the first visible pixel
1657
-
1658
- for (; i < count && !a[i + 3]; i += 4); // No visible pixel
1659
-
1660
-
1661
- if (i >= count) return false; // Emoji has immutable color, so we check the color of the emoji in two different colors
1469
+ let i = 0;
1470
+ // Search the first visible pixel
1471
+ for (; i < count && !a[i + 3]; i += 4);
1472
+ // No visible pixel
1473
+ if (i >= count) return false;
1474
+ // Emoji has immutable color, so we check the color of the emoji in two different colors
1662
1475
  // the result show be the same.
1663
-
1664
1476
  const x = CANVAS_WIDTH + i / 4 % CANVAS_WIDTH;
1665
1477
  const y = Math.floor(i / 4 / CANVAS_WIDTH);
1666
1478
  const b = ctx.getImageData(x, y, 1, 1).data;
1667
- if (a[i] !== b[0] || a[i + 2] !== b[2]) return false; // Some emojis are a contraction of different ones, so if it's not
1479
+ if (a[i] !== b[0] || a[i + 2] !== b[2]) return false;
1480
+ // Some emojis are a contraction of different ones, so if it's not
1668
1481
  // supported, it will show multiple characters
1669
-
1670
- if (ctx.measureText(unicode).width >= CANVAS_WIDTH) return false; // Supported
1671
-
1482
+ if (ctx.measureText(unicode).width >= CANVAS_WIDTH) return false;
1483
+ // Supported
1672
1484
  return true;
1673
1485
  };
1674
1486
  })();
1675
-
1676
1487
  var $c84d045dcc34faf5$export$2e2bcd8739ae039 = {
1677
1488
  latestVersion: $c84d045dcc34faf5$var$latestVersion,
1678
1489
  noCountryFlags: $c84d045dcc34faf5$var$noCountryFlags
1679
1490
  };
1680
1491
  const $b22cfd0a55410b4f$var$DEFAULTS = ["+1", "grinning", "kissing_heart", "heart_eyes", "laughing", "stuck_out_tongue_winking_eye", "sweat_smile", "joy", "scream", "disappointed", "unamused", "weary", "sob", "sunglasses", "heart"];
1681
1492
  let $b22cfd0a55410b4f$var$Index = null;
1682
-
1683
1493
  function $b22cfd0a55410b4f$var$add(emoji) {
1684
1494
  $b22cfd0a55410b4f$var$Index || ($b22cfd0a55410b4f$var$Index = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("frequently") || {});
1685
1495
  const emojiId = emoji.id || emoji;
@@ -1689,7 +1499,6 @@ function $b22cfd0a55410b4f$var$add(emoji) {
1689
1499
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("last", emojiId);
1690
1500
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("frequently", $b22cfd0a55410b4f$var$Index);
1691
1501
  }
1692
-
1693
1502
  function $b22cfd0a55410b4f$var$get({
1694
1503
  maxFrequentRows: maxFrequentRows,
1695
1504
  perLine: perLine
@@ -1697,51 +1506,39 @@ function $b22cfd0a55410b4f$var$get({
1697
1506
  if (!maxFrequentRows) return [];
1698
1507
  $b22cfd0a55410b4f$var$Index || ($b22cfd0a55410b4f$var$Index = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("frequently"));
1699
1508
  let emojiIds = [];
1700
-
1701
1509
  if (!$b22cfd0a55410b4f$var$Index) {
1702
1510
  $b22cfd0a55410b4f$var$Index = {};
1703
-
1704
1511
  for (let i in $b22cfd0a55410b4f$var$DEFAULTS.slice(0, perLine)) {
1705
1512
  const emojiId = $b22cfd0a55410b4f$var$DEFAULTS[i];
1706
1513
  $b22cfd0a55410b4f$var$Index[emojiId] = perLine - i;
1707
1514
  emojiIds.push(emojiId);
1708
1515
  }
1709
-
1710
1516
  return emojiIds;
1711
1517
  }
1712
-
1713
1518
  const max = maxFrequentRows * perLine;
1714
1519
  const last = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("last");
1715
-
1716
1520
  for (let emojiId in $b22cfd0a55410b4f$var$Index) emojiIds.push(emojiId);
1717
-
1718
1521
  emojiIds.sort((a, b) => {
1719
1522
  const aScore = $b22cfd0a55410b4f$var$Index[b];
1720
1523
  const bScore = $b22cfd0a55410b4f$var$Index[a];
1721
1524
  if (aScore == bScore) return a.localeCompare(b);
1722
1525
  return aScore - bScore;
1723
1526
  });
1724
-
1725
1527
  if (emojiIds.length > max) {
1726
1528
  const removedIds = emojiIds.slice(max);
1727
1529
  emojiIds = emojiIds.slice(0, max);
1728
-
1729
1530
  for (let removedId of removedIds) {
1730
1531
  if (removedId == last) continue;
1731
1532
  delete $b22cfd0a55410b4f$var$Index[removedId];
1732
1533
  }
1733
-
1734
1534
  if (last && emojiIds.indexOf(last) == -1) {
1735
1535
  delete $b22cfd0a55410b4f$var$Index[emojiIds[emojiIds.length - 1]];
1736
1536
  emojiIds.splice(-1, 1, last);
1737
1537
  }
1738
-
1739
1538
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("frequently", $b22cfd0a55410b4f$var$Index);
1740
1539
  }
1741
-
1742
1540
  return emojiIds;
1743
1541
  }
1744
-
1745
1542
  var $b22cfd0a55410b4f$export$2e2bcd8739ae039 = {
1746
1543
  add: $b22cfd0a55410b4f$var$add,
1747
1544
  get: $b22cfd0a55410b4f$var$get,
@@ -1847,7 +1644,6 @@ var $b247ea80b67298d5$export$2e2bcd8739ae039 = {
1847
1644
  let $7adb23b0109cc36a$export$dbe3113d60765c1a = null;
1848
1645
  let $7adb23b0109cc36a$export$2d0294657ab35f1b = null;
1849
1646
  const $7adb23b0109cc36a$var$fetchCache = {};
1850
-
1851
1647
  async function $7adb23b0109cc36a$var$fetchJSON(src) {
1852
1648
  if ($7adb23b0109cc36a$var$fetchCache[src]) return $7adb23b0109cc36a$var$fetchCache[src];
1853
1649
  const response = await fetch(src);
@@ -1855,11 +1651,9 @@ async function $7adb23b0109cc36a$var$fetchJSON(src) {
1855
1651
  $7adb23b0109cc36a$var$fetchCache[src] = json;
1856
1652
  return json;
1857
1653
  }
1858
-
1859
1654
  let $7adb23b0109cc36a$var$promise = null;
1860
1655
  let $7adb23b0109cc36a$var$initCallback = null;
1861
1656
  let $7adb23b0109cc36a$var$initialized = false;
1862
-
1863
1657
  function $7adb23b0109cc36a$export$2cd8252107eb640b(options, {
1864
1658
  caller: caller
1865
1659
  } = {}) {
@@ -1869,7 +1663,6 @@ function $7adb23b0109cc36a$export$2cd8252107eb640b(options, {
1869
1663
  if (options) $7adb23b0109cc36a$var$_init(options);else if (caller && !$7adb23b0109cc36a$var$initialized) console.warn(`\`${caller}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`);
1870
1664
  return $7adb23b0109cc36a$var$promise;
1871
1665
  }
1872
-
1873
1666
  async function $7adb23b0109cc36a$var$_init(props) {
1874
1667
  $7adb23b0109cc36a$var$initialized = true;
1875
1668
  let {
@@ -1880,7 +1673,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
1880
1673
  emojiVersion || (emojiVersion = ($b247ea80b67298d5$export$2e2bcd8739ae039).emojiVersion.value);
1881
1674
  set || (set = ($b247ea80b67298d5$export$2e2bcd8739ae039).set.value);
1882
1675
  locale || (locale = ($b247ea80b67298d5$export$2e2bcd8739ae039).locale.value);
1883
-
1884
1676
  if (!$7adb23b0109cc36a$export$2d0294657ab35f1b) {
1885
1677
  $7adb23b0109cc36a$export$2d0294657ab35f1b = (typeof props.data === "function" ? await props.data() : props.data) || (await $7adb23b0109cc36a$var$fetchJSON(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${emojiVersion}/${set}.json`));
1886
1678
  $7adb23b0109cc36a$export$2d0294657ab35f1b.emoticons = {};
@@ -1889,7 +1681,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
1889
1681
  id: "frequent",
1890
1682
  emojis: []
1891
1683
  });
1892
-
1893
1684
  for (const alias in $7adb23b0109cc36a$export$2d0294657ab35f1b.aliases) {
1894
1685
  const emojiId = $7adb23b0109cc36a$export$2d0294657ab35f1b.aliases[alias];
1895
1686
  const emoji = $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emojiId];
@@ -1897,14 +1688,12 @@ async function $7adb23b0109cc36a$var$_init(props) {
1897
1688
  emoji.aliases || (emoji.aliases = []);
1898
1689
  emoji.aliases.push(alias);
1899
1690
  }
1900
-
1901
1691
  $7adb23b0109cc36a$export$2d0294657ab35f1b.originalCategories = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories;
1902
1692
  } else $7adb23b0109cc36a$export$2d0294657ab35f1b.categories = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.filter(c => {
1903
1693
  const isCustom = !!c.name;
1904
1694
  if (!isCustom) return true;
1905
1695
  return false;
1906
1696
  });
1907
-
1908
1697
  $7adb23b0109cc36a$export$dbe3113d60765c1a = (typeof props.i18n === "function" ? await props.i18n() : props.i18n) || (locale == "en" ? (/*@__PURE__*/$parcel$interopDefault($8d50d93417ef682a$exports)) : await $7adb23b0109cc36a$var$fetchJSON(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${locale}.json`));
1909
1698
  if (props.custom) for (let i in props.custom) {
1910
1699
  i = parseInt(i);
@@ -1915,7 +1704,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
1915
1704
  category.name || (category.name = $7adb23b0109cc36a$export$dbe3113d60765c1a.categories.custom);
1916
1705
  if (prevCategory && !category.icon) category.target = prevCategory.target || prevCategory;
1917
1706
  $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.push(category);
1918
-
1919
1707
  for (const emoji of category.emojis) $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emoji.id] = emoji;
1920
1708
  }
1921
1709
  if (props.categories) $7adb23b0109cc36a$export$2d0294657ab35f1b.categories = $7adb23b0109cc36a$export$2d0294657ab35f1b.originalCategories.filter(c => {
@@ -1927,18 +1715,14 @@ async function $7adb23b0109cc36a$var$_init(props) {
1927
1715
  });
1928
1716
  let latestVersionSupport = null;
1929
1717
  let noCountryFlags = null;
1930
-
1931
1718
  if (set == "native") {
1932
1719
  latestVersionSupport = ($c84d045dcc34faf5$export$2e2bcd8739ae039).latestVersion();
1933
1720
  noCountryFlags = props.noCountryFlags || ($c84d045dcc34faf5$export$2e2bcd8739ae039).noCountryFlags();
1934
1721
  }
1935
-
1936
1722
  let categoryIndex = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.length;
1937
1723
  let resetSearchIndex = false;
1938
-
1939
1724
  while (categoryIndex--) {
1940
1725
  const category = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories[categoryIndex];
1941
-
1942
1726
  if (category.id == "frequent") {
1943
1727
  let {
1944
1728
  maxFrequentRows: maxFrequentRows,
@@ -1951,48 +1735,38 @@ async function $7adb23b0109cc36a$var$_init(props) {
1951
1735
  perLine: perLine
1952
1736
  });
1953
1737
  }
1954
-
1955
1738
  if (!category.emojis || !category.emojis.length) {
1956
1739
  $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.splice(categoryIndex, 1);
1957
1740
  continue;
1958
1741
  }
1959
-
1960
1742
  const {
1961
1743
  categoryIcons: categoryIcons
1962
1744
  } = props;
1963
-
1964
1745
  if (categoryIcons) {
1965
1746
  const icon = categoryIcons[category.id];
1966
1747
  if (icon && !category.icon) category.icon = icon;
1967
1748
  }
1968
-
1969
1749
  let emojiIndex = category.emojis.length;
1970
-
1971
1750
  while (emojiIndex--) {
1972
1751
  const emojiId = category.emojis[emojiIndex];
1973
1752
  const emoji = emojiId.id ? emojiId : $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emojiId];
1974
-
1975
1753
  const ignore = () => {
1976
1754
  category.emojis.splice(emojiIndex, 1);
1977
1755
  };
1978
-
1979
1756
  if (!emoji || props.exceptEmojis && props.exceptEmojis.includes(emoji.id)) {
1980
1757
  ignore();
1981
1758
  continue;
1982
1759
  }
1983
-
1984
1760
  if (latestVersionSupport && emoji.version > latestVersionSupport) {
1985
1761
  ignore();
1986
1762
  continue;
1987
1763
  }
1988
-
1989
1764
  if (noCountryFlags && category.id == "flags") {
1990
1765
  if (!($e6eae5155b87f591$export$bcb25aa587e9cb13).includes(emoji.id)) {
1991
1766
  ignore();
1992
1767
  continue;
1993
1768
  }
1994
1769
  }
1995
-
1996
1770
  if (!emoji.search) {
1997
1771
  resetSearchIndex = true;
1998
1772
  emoji.search = "," + [[emoji.id, false], [emoji.name, true], [emoji.keywords, false], [emoji.emoticons, false]].map(([strings, split]) => {
@@ -2006,65 +1780,51 @@ async function $7adb23b0109cc36a$var$_init(props) {
2006
1780
  $7adb23b0109cc36a$export$2d0294657ab35f1b.emoticons[emoticon] = emoji.id;
2007
1781
  }
2008
1782
  let skinIndex = 0;
2009
-
2010
1783
  for (const skin of emoji.skins) {
2011
1784
  if (!skin) continue;
2012
1785
  skinIndex++;
2013
1786
  const {
2014
1787
  native: native
2015
1788
  } = skin;
2016
-
2017
1789
  if (native) {
2018
1790
  $7adb23b0109cc36a$export$2d0294657ab35f1b.natives[native] = emoji.id;
2019
1791
  emoji.search += `,${native}`;
2020
1792
  }
2021
-
2022
1793
  const skinShortcodes = skinIndex == 1 ? "" : `:skin-tone-${skinIndex}:`;
2023
1794
  skin.shortcodes = `:${emoji.id}:${skinShortcodes}`;
2024
1795
  }
2025
1796
  }
2026
1797
  }
2027
1798
  }
2028
-
2029
1799
  if (resetSearchIndex) ($c4d155af13ad4d4b$export$2e2bcd8739ae039).reset();
2030
1800
  $7adb23b0109cc36a$var$initCallback();
2031
1801
  }
2032
-
2033
1802
  function $7adb23b0109cc36a$export$75fe5f91d452f94b(props, defaultProps, element) {
2034
1803
  props || (props = {});
2035
1804
  const _props = {};
2036
-
2037
1805
  for (let k in defaultProps) _props[k] = $7adb23b0109cc36a$export$88c9ddb45cea7241(k, props, defaultProps, element);
2038
-
2039
1806
  return _props;
2040
1807
  }
2041
-
2042
1808
  function $7adb23b0109cc36a$export$88c9ddb45cea7241(propName, props, defaultProps, element) {
2043
1809
  const defaults = defaultProps[propName];
2044
1810
  let value = element && element.getAttribute(propName) || (props[propName] != null && props[propName] != undefined ? props[propName] : null);
2045
1811
  if (!defaults) return value;
2046
-
2047
1812
  if (value != null && defaults.value && typeof defaults.value != typeof value) {
2048
1813
  if (typeof defaults.value == "boolean") value = value == "false" ? false : true;else value = defaults.value.constructor(value);
2049
1814
  }
2050
-
2051
1815
  if (defaults.transform && value) value = defaults.transform(value);
2052
1816
  if (value == null || defaults.choices && defaults.choices.indexOf(value) == -1) value = defaults.value;
2053
1817
  return value;
2054
1818
  }
2055
-
2056
1819
  const $c4d155af13ad4d4b$var$SHORTCODES_REGEX = /^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;
2057
1820
  let $c4d155af13ad4d4b$var$Pool = null;
2058
-
2059
1821
  function $c4d155af13ad4d4b$var$get(emojiId) {
2060
1822
  if (emojiId.id) return emojiId;
2061
1823
  return ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[emojiId] || ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[($7adb23b0109cc36a$export$2d0294657ab35f1b).aliases[emojiId]] || ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[($7adb23b0109cc36a$export$2d0294657ab35f1b).natives[emojiId]];
2062
1824
  }
2063
-
2064
1825
  function $c4d155af13ad4d4b$var$reset() {
2065
1826
  $c4d155af13ad4d4b$var$Pool = null;
2066
1827
  }
2067
-
2068
1828
  async function $c4d155af13ad4d4b$var$search(value, {
2069
1829
  maxResults: maxResults,
2070
1830
  caller: caller
@@ -2080,12 +1840,10 @@ async function $c4d155af13ad4d4b$var$search(value, {
2080
1840
  if (!values.length) return;
2081
1841
  let pool = $c4d155af13ad4d4b$var$Pool || ($c4d155af13ad4d4b$var$Pool = Object.values(($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis));
2082
1842
  let results, scores;
2083
-
2084
1843
  for (const value1 of values) {
2085
1844
  if (!pool.length) break;
2086
1845
  results = [];
2087
1846
  scores = {};
2088
-
2089
1847
  for (const emoji of pool) {
2090
1848
  if (!emoji.search) continue;
2091
1849
  const score = emoji.search.indexOf(`,${value1}`);
@@ -2094,10 +1852,8 @@ async function $c4d155af13ad4d4b$var$search(value, {
2094
1852
  scores[emoji.id] || (scores[emoji.id] = 0);
2095
1853
  scores[emoji.id] += emoji.id == value1 ? 0 : score + 1;
2096
1854
  }
2097
-
2098
1855
  pool = results;
2099
1856
  }
2100
-
2101
1857
  if (results.length < 2) return results;
2102
1858
  results.sort((a, b) => {
2103
1859
  const aScore = scores[a.id];
@@ -2108,7 +1864,6 @@ async function $c4d155af13ad4d4b$var$search(value, {
2108
1864
  if (results.length > maxResults) results = results.slice(0, maxResults);
2109
1865
  return results;
2110
1866
  }
2111
-
2112
1867
  var $c4d155af13ad4d4b$export$2e2bcd8739ae039 = {
2113
1868
  search: $c4d155af13ad4d4b$var$search,
2114
1869
  get: $c4d155af13ad4d4b$var$get,
@@ -2116,15 +1871,12 @@ var $c4d155af13ad4d4b$export$2e2bcd8739ae039 = {
2116
1871
  SHORTCODES_REGEX: $c4d155af13ad4d4b$var$SHORTCODES_REGEX
2117
1872
  };
2118
1873
  const $e6eae5155b87f591$export$bcb25aa587e9cb13 = ["checkered_flag", "crossed_flags", "pirate_flag", "rainbow-flag", "transgender_flag", "triangular_flag_on_post", "waving_black_flag", "waving_white_flag"];
2119
-
2120
1874
  function $693b183b0a78708f$export$9cb4719e2e525b7a(a, b) {
2121
1875
  return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((val, index) => val == b[index]);
2122
1876
  }
2123
-
2124
1877
  async function $693b183b0a78708f$export$e772c8ff12451969(frames = 1) {
2125
1878
  for (let _ in [...Array(frames).keys()]) await new Promise(requestAnimationFrame);
2126
1879
  }
2127
-
2128
1880
  function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
2129
1881
  skinIndex = 0
2130
1882
  } = {}) {
@@ -2132,7 +1884,6 @@ function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
2132
1884
  skinIndex = 0;
2133
1885
  return emoji.skins[skinIndex];
2134
1886
  })();
2135
-
2136
1887
  const emojiData = {
2137
1888
  id: emoji.id,
2138
1889
  name: emoji.name,
@@ -2147,7 +1898,6 @@ function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
2147
1898
  if (emoji.emoticons && emoji.emoticons.length) emojiData.emoticons = emoji.emoticons;
2148
1899
  return emojiData;
2149
1900
  }
2150
-
2151
1901
  const $fcccfb36ed0cde68$var$categories = {
2152
1902
  activity: {
2153
1903
  outline: /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("svg", {
@@ -2331,23 +2081,19 @@ var $fcccfb36ed0cde68$export$2e2bcd8739ae039 = {
2331
2081
  categories: $fcccfb36ed0cde68$var$categories,
2332
2082
  search: $fcccfb36ed0cde68$var$search
2333
2083
  };
2334
-
2335
2084
  function $254755d3f438722f$export$2e2bcd8739ae039(props) {
2336
2085
  let {
2337
2086
  id: id,
2338
2087
  skin: skin,
2339
2088
  emoji: emoji
2340
2089
  } = props;
2341
-
2342
2090
  if (props.shortcodes) {
2343
2091
  const matches = props.shortcodes.match(($c4d155af13ad4d4b$export$2e2bcd8739ae039).SHORTCODES_REGEX);
2344
-
2345
2092
  if (matches) {
2346
2093
  id = matches[1];
2347
2094
  if (matches[2]) skin = matches[2];
2348
2095
  }
2349
2096
  }
2350
-
2351
2097
  emoji || (emoji = ($c4d155af13ad4d4b$export$2e2bcd8739ae039).get(id || props.native));
2352
2098
  if (!emoji) return props.fallback;
2353
2099
  const emojiSkin = emoji.skins[skin - 1] || emoji.skins[0];
@@ -2382,18 +2128,14 @@ function $254755d3f438722f$export$2e2bcd8739ae039(props) {
2382
2128
  })
2383
2129
  });
2384
2130
  }
2385
-
2386
2131
  const $6f57cc9cd54c5aaa$var$WindowHTMLElement = typeof window !== "undefined" && window.HTMLElement ? window.HTMLElement : Object;
2387
-
2388
2132
  class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$WindowHTMLElement {
2389
2133
  static get observedAttributes() {
2390
2134
  return Object.keys(this.Props);
2391
2135
  }
2392
-
2393
2136
  update(props = {}) {
2394
2137
  for (let k in props) this.attributeChangedCallback(k, null, props[k]);
2395
2138
  }
2396
-
2397
2139
  attributeChangedCallback(attr, _, newValue) {
2398
2140
  if (!this.component) return;
2399
2141
  const value = ($7adb23b0109cc36a$export$88c9ddb45cea7241)(attr, {
@@ -2406,16 +2148,13 @@ class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$Win
2406
2148
  this.component.forceUpdate();
2407
2149
  }
2408
2150
  }
2409
-
2410
2151
  disconnectedCallback() {
2411
2152
  this.disconnected = true;
2412
2153
  if (this.component && this.component.unregister) this.component.unregister();
2413
2154
  }
2414
-
2415
2155
  constructor(props = {}) {
2416
2156
  super();
2417
2157
  this.props = props;
2418
-
2419
2158
  if (props.parent || props.ref) {
2420
2159
  let ref = null;
2421
2160
  const parent = props.parent || (ref = props.ref && props.ref.current);
@@ -2423,23 +2162,19 @@ class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$Win
2423
2162
  if (parent) parent.appendChild(this);
2424
2163
  }
2425
2164
  }
2426
-
2427
2165
  }
2428
-
2429
2166
  class $26f27c338a96b1a6$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export$2e2bcd8739ae039) {
2430
2167
  setShadow() {
2431
2168
  this.attachShadow({
2432
2169
  mode: "open"
2433
2170
  });
2434
2171
  }
2435
-
2436
2172
  injectStyles(styles) {
2437
2173
  if (!styles) return;
2438
2174
  const style = document.createElement("style");
2439
2175
  style.textContent = styles;
2440
2176
  this.shadowRoot.insertBefore(style, this.shadowRoot.firstChild);
2441
2177
  }
2442
-
2443
2178
  constructor(props, {
2444
2179
  styles: styles
2445
2180
  } = {}) {
@@ -2447,9 +2182,7 @@ class $26f27c338a96b1a6$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export
2447
2182
  this.setShadow();
2448
2183
  this.injectStyles(styles);
2449
2184
  }
2450
-
2451
2185
  }
2452
-
2453
2186
  var $3d90f6e46fb2dd47$export$2e2bcd8739ae039 = {
2454
2187
  fallback: "",
2455
2188
  id: "",
@@ -2467,41 +2200,34 @@ var $3d90f6e46fb2dd47$export$2e2bcd8739ae039 = {
2467
2200
  set: ($b247ea80b67298d5$export$2e2bcd8739ae039).set,
2468
2201
  skin: ($b247ea80b67298d5$export$2e2bcd8739ae039).skin
2469
2202
  };
2470
-
2471
2203
  class $331b4160623139bf$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export$2e2bcd8739ae039) {
2472
2204
  async connectedCallback() {
2473
2205
  const props = ($7adb23b0109cc36a$export$75fe5f91d452f94b)(this.props, ($3d90f6e46fb2dd47$export$2e2bcd8739ae039), this);
2474
2206
  props.element = this;
2475
-
2476
2207
  props.ref = component => {
2477
2208
  this.component = component;
2478
2209
  };
2479
-
2480
2210
  await ($7adb23b0109cc36a$export$2cd8252107eb640b)();
2481
2211
  if (this.disconnected) return;
2482
- ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($254755d3f438722f$export$2e2bcd8739ae039), { ...props
2212
+ ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($254755d3f438722f$export$2e2bcd8739ae039), {
2213
+ ...props
2483
2214
  }), this);
2484
2215
  }
2485
-
2486
2216
  constructor(props) {
2487
2217
  super(props);
2488
2218
  }
2489
-
2490
2219
  }
2491
-
2492
2220
  ($c770c458706daa72$export$2e2bcd8739ae039)($331b4160623139bf$export$2e2bcd8739ae039, "Props", ($3d90f6e46fb2dd47$export$2e2bcd8739ae039));
2493
2221
  if (typeof customElements !== "undefined" && !customElements.get("em-emoji")) customElements.define("em-emoji", $331b4160623139bf$export$2e2bcd8739ae039);
2494
2222
  var $1a9a8ef576b7773d$var$r,
2495
- $1a9a8ef576b7773d$var$i = [],
2496
- $1a9a8ef576b7773d$var$c = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b,
2497
- $1a9a8ef576b7773d$var$f = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r,
2498
- $1a9a8ef576b7773d$var$e = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).diffed,
2499
- $1a9a8ef576b7773d$var$a = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c,
2500
- $1a9a8ef576b7773d$var$v = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
2501
-
2223
+ $1a9a8ef576b7773d$var$i = [],
2224
+ $1a9a8ef576b7773d$var$c = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b,
2225
+ $1a9a8ef576b7773d$var$f = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r,
2226
+ $1a9a8ef576b7773d$var$e = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).diffed,
2227
+ $1a9a8ef576b7773d$var$a = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c,
2228
+ $1a9a8ef576b7773d$var$v = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
2502
2229
  function $1a9a8ef576b7773d$var$x() {
2503
2230
  var t6;
2504
-
2505
2231
  for ($1a9a8ef576b7773d$var$i.sort(function (n11, t7) {
2506
2232
  return n11.__v.__b - t7.__v.__b;
2507
2233
  }); t6 = $1a9a8ef576b7773d$var$i.pop();) if (t6.__P) try {
@@ -2510,7 +2236,6 @@ function $1a9a8ef576b7773d$var$x() {
2510
2236
  t6.__H.__h = [], ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e(u4, t6.__v);
2511
2237
  }
2512
2238
  }
2513
-
2514
2239
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b = function (n12) {
2515
2240
  $1a9a8ef576b7773d$var$c && $1a9a8ef576b7773d$var$c(n12);
2516
2241
  }, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r = function (n13) {
@@ -2522,11 +2247,10 @@ function $1a9a8ef576b7773d$var$x() {
2522
2247
  var o6 = t8.__c;
2523
2248
  o6 && o6.__H && o6.__H.__h.length && (1 !== $1a9a8ef576b7773d$var$i.push(o6) && $1a9a8ef576b7773d$var$r === ($fb96b826c0c5f37a$export$41c562ebe57d11e2).requestAnimationFrame || (($1a9a8ef576b7773d$var$r = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).requestAnimationFrame) || function (n14) {
2524
2249
  var t9,
2525
- u5 = function () {
2526
- clearTimeout(r9), $1a9a8ef576b7773d$var$b && cancelAnimationFrame(t9), setTimeout(n14);
2527
- },
2528
- r9 = setTimeout(u5, 100);
2529
-
2250
+ u5 = function () {
2251
+ clearTimeout(r9), $1a9a8ef576b7773d$var$b && cancelAnimationFrame(t9), setTimeout(n14);
2252
+ },
2253
+ r9 = setTimeout(u5, 100);
2530
2254
  $1a9a8ef576b7773d$var$b && (t9 = requestAnimationFrame(u5));
2531
2255
  })($1a9a8ef576b7773d$var$x));
2532
2256
  }, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c = function (t10, u6) {
@@ -2544,7 +2268,7 @@ function $1a9a8ef576b7773d$var$x() {
2544
2268
  }, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount = function (t12) {
2545
2269
  $1a9a8ef576b7773d$var$v && $1a9a8ef576b7773d$var$v(t12);
2546
2270
  var u7,
2547
- r11 = t12.__c;
2271
+ r11 = t12.__c;
2548
2272
  r11 && r11.__H && (r11.__H.__.forEach(function (n17) {
2549
2273
  try {
2550
2274
  $1a9a8ef576b7773d$var$g(n17);
@@ -2554,105 +2278,80 @@ function $1a9a8ef576b7773d$var$x() {
2554
2278
  }), u7 && ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e(u7, r11.__v));
2555
2279
  };
2556
2280
  var $1a9a8ef576b7773d$var$b = "function" == typeof requestAnimationFrame;
2557
-
2558
2281
  function $1a9a8ef576b7773d$var$g(n19) {
2559
2282
  var r12 = n19.__c;
2560
2283
  "function" == typeof r12 && (n19.__c = void 0, r12());
2561
2284
  }
2562
-
2563
2285
  function $1a9a8ef576b7773d$var$j(n20) {
2564
2286
  n20.__c = n20.__();
2565
2287
  }
2566
-
2567
2288
  function $dc040a17866866fa$var$S(n1, t1) {
2568
2289
  for (var e1 in t1) n1[e1] = t1[e1];
2569
-
2570
2290
  return n1;
2571
2291
  }
2572
-
2573
2292
  function $dc040a17866866fa$var$C(n2, t2) {
2574
2293
  for (var e2 in n2) if ("__source" !== e2 && !(e2 in t2)) return !0;
2575
-
2576
2294
  for (var r1 in t2) if ("__source" !== r1 && n2[r1] !== t2[r1]) return !0;
2577
-
2578
2295
  return !1;
2579
2296
  }
2580
-
2581
2297
  function $dc040a17866866fa$export$221d75b3f55bb0bd(n3) {
2582
2298
  this.props = n3;
2583
2299
  }
2584
-
2585
2300
  ($dc040a17866866fa$export$221d75b3f55bb0bd.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).isPureReactComponent = !0, $dc040a17866866fa$export$221d75b3f55bb0bd.prototype.shouldComponentUpdate = function (n6, t5) {
2586
2301
  return $dc040a17866866fa$var$C(this.props, n6) || $dc040a17866866fa$var$C(this.state, t5);
2587
2302
  };
2588
2303
  var $dc040a17866866fa$var$w = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b;
2589
-
2590
2304
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b = function (n7) {
2591
2305
  n7.type && n7.type.__f && n7.ref && (n7.props.ref = n7.ref, n7.ref = null), $dc040a17866866fa$var$w && $dc040a17866866fa$var$w(n7);
2592
2306
  };
2593
-
2594
2307
  var $dc040a17866866fa$var$A = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e;
2595
-
2596
2308
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e = function (n12, t10, e6) {
2597
2309
  if (n12.then) {
2598
2310
  for (var r5, u1 = t10; u1 = u1.__;) if ((r5 = u1.__c) && r5.__c) return null == t10.__e && (t10.__e = e6.__e, t10.__k = e6.__k), r5.__c(n12, t10);
2599
2311
  }
2600
-
2601
2312
  $dc040a17866866fa$var$A(n12, t10, e6);
2602
2313
  };
2603
-
2604
2314
  var $dc040a17866866fa$var$O = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
2605
-
2606
2315
  function $dc040a17866866fa$export$74bf444e3cd11ea5() {
2607
2316
  this.__u = 0, this.t = null, this.__b = null;
2608
2317
  }
2609
-
2610
2318
  function $dc040a17866866fa$var$U(n13) {
2611
2319
  var t11 = n13.__.__c;
2612
2320
  return t11 && t11.__e && t11.__e(n13);
2613
2321
  }
2614
-
2615
2322
  function $dc040a17866866fa$export$998bcd577473dd93() {
2616
2323
  this.u = null, this.o = null;
2617
2324
  }
2618
-
2619
2325
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount = function (n17) {
2620
2326
  var t13 = n17.__c;
2621
2327
  t13 && t13.__R && t13.__R(), t13 && !0 === n17.__h && (n17.type = null), $dc040a17866866fa$var$O && $dc040a17866866fa$var$O(n17);
2622
2328
  }, ($dc040a17866866fa$export$74bf444e3cd11ea5.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).__c = function (n18, t14) {
2623
2329
  var e8 = t14.__c,
2624
- r7 = this;
2330
+ r7 = this;
2625
2331
  null == r7.t && (r7.t = []), r7.t.push(e8);
2626
-
2627
2332
  var u4 = $dc040a17866866fa$var$U(r7.__v),
2628
- o1 = !1,
2629
- i1 = function () {
2630
- o1 || (o1 = !0, e8.__R = null, u4 ? u4(l1) : l1());
2631
- };
2632
-
2333
+ o1 = !1,
2334
+ i1 = function () {
2335
+ o1 || (o1 = !0, e8.__R = null, u4 ? u4(l1) : l1());
2336
+ };
2633
2337
  e8.__R = i1;
2634
-
2635
2338
  var l1 = function () {
2636
- if (! --r7.__u) {
2637
- if (r7.state.__e) {
2638
- var n19 = r7.state.__e;
2639
-
2640
- r7.__v.__k[0] = function n22(t17, e9, r8) {
2641
- return t17 && (t17.__v = null, t17.__k = t17.__k && t17.__k.map(function (t18) {
2642
- return n22(t18, e9, r8);
2643
- }), t17.__c && t17.__c.__P === e9 && (t17.__e && r8.insertBefore(t17.__e, t17.__d), t17.__c.__e = !0, t17.__c.__P = r8)), t17;
2644
- }(n19, n19.__c.__P, n19.__c.__O);
2339
+ if (! --r7.__u) {
2340
+ if (r7.state.__e) {
2341
+ var n19 = r7.state.__e;
2342
+ r7.__v.__k[0] = function n22(t17, e9, r8) {
2343
+ return t17 && (t17.__v = null, t17.__k = t17.__k && t17.__k.map(function (t18) {
2344
+ return n22(t18, e9, r8);
2345
+ }), t17.__c && t17.__c.__P === e9 && (t17.__e && r8.insertBefore(t17.__e, t17.__d), t17.__c.__e = !0, t17.__c.__P = r8)), t17;
2346
+ }(n19, n19.__c.__P, n19.__c.__O);
2347
+ }
2348
+ var t15;
2349
+ for (r7.setState({
2350
+ __e: r7.__b = null
2351
+ }); t15 = r7.t.pop();) t15.forceUpdate();
2645
2352
  }
2646
-
2647
- var t15;
2648
-
2649
- for (r7.setState({
2650
- __e: r7.__b = null
2651
- }); t15 = r7.t.pop();) t15.forceUpdate();
2652
- }
2653
- },
2654
- c1 = !0 === t14.__h;
2655
-
2353
+ },
2354
+ c1 = !0 === t14.__h;
2656
2355
  r7.__u++ || c1 || r7.setState({
2657
2356
  __e: r7.__b = r7.__v.__k[0]
2658
2357
  }), n18.then(i1, i1);
@@ -2662,8 +2361,7 @@ function $dc040a17866866fa$export$998bcd577473dd93() {
2662
2361
  if (this.__b) {
2663
2362
  if (this.__v.__k) {
2664
2363
  var e10 = document.createElement("div"),
2665
- r9 = this.__v.__k[0].__c;
2666
-
2364
+ r9 = this.__v.__k[0].__c;
2667
2365
  this.__v.__k[0] = function n24(t20, e13, r12) {
2668
2366
  return t20 && (t20.__c && t20.__c.__H && (t20.__c.__H.__.forEach(function (n25) {
2669
2367
  "function" == typeof n25.__c && n25.__c();
@@ -2672,41 +2370,33 @@ function $dc040a17866866fa$export$998bcd577473dd93() {
2672
2370
  })), t20;
2673
2371
  }(this.__b, e10, r9.__O = r9.__P);
2674
2372
  }
2675
-
2676
2373
  this.__b = null;
2677
2374
  }
2678
-
2679
2375
  var u5 = t19.__e && ($fb96b826c0c5f37a$export$c8a8987d4410bf2d)(($fb96b826c0c5f37a$export$ffb0004e005737fa), null, n23.fallback);
2680
2376
  return u5 && (u5.__h = null), [($fb96b826c0c5f37a$export$c8a8987d4410bf2d)(($fb96b826c0c5f37a$export$ffb0004e005737fa), null, t19.__e ? null : n23.children), u5];
2681
2377
  };
2682
-
2683
2378
  var $dc040a17866866fa$var$T = function (n26, t22, e14) {
2684
2379
  if (++e14[1] === e14[0] && n26.o.delete(t22), n26.props.revealOrder && ("t" !== n26.props.revealOrder[0] || !n26.o.size)) for (e14 = n26.u; e14;) {
2685
2380
  for (; e14.length > 3;) e14.pop()();
2686
-
2687
2381
  if (e14[1] < e14[0]) break;
2688
2382
  n26.u = e14 = e14[2];
2689
2383
  }
2690
2384
  };
2691
-
2692
2385
  ($dc040a17866866fa$export$998bcd577473dd93.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).__e = function (n33) {
2693
2386
  var t25 = this,
2694
- e16 = $dc040a17866866fa$var$U(t25.__v),
2695
- r13 = t25.o.get(n33);
2387
+ e16 = $dc040a17866866fa$var$U(t25.__v),
2388
+ r13 = t25.o.get(n33);
2696
2389
  return r13[0]++, function (u6) {
2697
2390
  var o2 = function () {
2698
2391
  t25.props.revealOrder ? (r13.push(u6), $dc040a17866866fa$var$T(t25, n33, r13)) : u6();
2699
2392
  };
2700
-
2701
2393
  e16 ? e16(o2) : o2();
2702
2394
  };
2703
2395
  }, $dc040a17866866fa$export$998bcd577473dd93.prototype.render = function (n34) {
2704
2396
  this.u = null, this.o = new Map();
2705
2397
  var t26 = ($fb96b826c0c5f37a$export$47e4c5b300681277)(n34.children);
2706
2398
  n34.revealOrder && "b" === n34.revealOrder[0] && t26.reverse();
2707
-
2708
2399
  for (var e17 = t26.length; e17--;) this.o.set(t26[e17], this.u = [1, 0, this.u]);
2709
-
2710
2400
  return n34.children;
2711
2401
  }, $dc040a17866866fa$export$998bcd577473dd93.prototype.componentDidUpdate = $dc040a17866866fa$export$998bcd577473dd93.prototype.componentDidMount = function () {
2712
2402
  var n35 = this;
@@ -2714,14 +2404,12 @@ var $dc040a17866866fa$var$T = function (n26, t22, e14) {
2714
2404
  $dc040a17866866fa$var$T(n35, e18, t27);
2715
2405
  });
2716
2406
  };
2717
-
2718
2407
  var $dc040a17866866fa$var$j = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103,
2719
- $dc040a17866866fa$var$P = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,
2720
- $dc040a17866866fa$var$V = "undefined" != typeof document,
2721
- $dc040a17866866fa$var$z = function (n36) {
2722
- return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n36);
2723
- };
2724
-
2408
+ $dc040a17866866fa$var$P = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,
2409
+ $dc040a17866866fa$var$V = "undefined" != typeof document,
2410
+ $dc040a17866866fa$var$z = function (n36) {
2411
+ return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n36);
2412
+ };
2725
2413
  ($fb96b826c0c5f37a$export$16fa2f45be04daa8).prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function (n39) {
2726
2414
  Object.defineProperty(($fb96b826c0c5f37a$export$16fa2f45be04daa8).prototype, n39, {
2727
2415
  configurable: !0,
@@ -2738,54 +2426,42 @@ var $dc040a17866866fa$var$j = "undefined" != typeof Symbol && Symbol.for && Symb
2738
2426
  });
2739
2427
  });
2740
2428
  var $dc040a17866866fa$var$H = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).event;
2741
-
2742
2429
  function $dc040a17866866fa$var$Z() {}
2743
-
2744
2430
  function $dc040a17866866fa$var$Y() {
2745
2431
  return this.cancelBubble;
2746
2432
  }
2747
-
2748
2433
  function $dc040a17866866fa$var$q() {
2749
2434
  return this.defaultPrevented;
2750
2435
  }
2751
-
2752
2436
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).event = function (n40) {
2753
2437
  return $dc040a17866866fa$var$H && (n40 = $dc040a17866866fa$var$H(n40)), n40.persist = $dc040a17866866fa$var$Z, n40.isPropagationStopped = $dc040a17866866fa$var$Y, n40.isDefaultPrevented = $dc040a17866866fa$var$q, n40.nativeEvent = n40;
2754
2438
  };
2755
-
2756
2439
  var $dc040a17866866fa$var$J = {
2757
- configurable: !0,
2758
- get: function () {
2759
- return this.class;
2760
- }
2761
- },
2762
- $dc040a17866866fa$var$K = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode;
2763
-
2440
+ configurable: !0,
2441
+ get: function () {
2442
+ return this.class;
2443
+ }
2444
+ },
2445
+ $dc040a17866866fa$var$K = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode;
2764
2446
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode = function (n41) {
2765
2447
  var t31 = n41.type,
2766
- e21 = n41.props,
2767
- r14 = e21;
2768
-
2448
+ e21 = n41.props,
2449
+ r14 = e21;
2769
2450
  if ("string" == typeof t31) {
2770
2451
  var u7 = -1 === t31.indexOf("-");
2771
-
2772
2452
  for (var o3 in r14 = {}, e21) {
2773
2453
  var i2 = e21[o3];
2774
2454
  $dc040a17866866fa$var$V && "children" === o3 && "noscript" === t31 || "value" === o3 && "defaultValue" in e21 && null == i2 || ("defaultValue" === o3 && "value" in e21 && null == e21.value ? o3 = "value" : "download" === o3 && !0 === i2 ? i2 = "" : /ondoubleclick/i.test(o3) ? o3 = "ondblclick" : /^onchange(textarea|input)/i.test(o3 + t31) && !$dc040a17866866fa$var$z(e21.type) ? o3 = "oninput" : /^onfocus$/i.test(o3) ? o3 = "onfocusin" : /^onblur$/i.test(o3) ? o3 = "onfocusout" : /^on(Ani|Tra|Tou|BeforeInp)/.test(o3) ? o3 = o3.toLowerCase() : u7 && $dc040a17866866fa$var$P.test(o3) ? o3 = o3.replace(/[A-Z0-9]/, "-$&").toLowerCase() : null === i2 && (i2 = void 0), r14[o3] = i2);
2775
2455
  }
2776
-
2777
2456
  "select" == t31 && r14.multiple && Array.isArray(r14.value) && (r14.value = ($fb96b826c0c5f37a$export$47e4c5b300681277)(e21.children).forEach(function (n42) {
2778
2457
  n42.props.selected = -1 != r14.value.indexOf(n42.props.value);
2779
2458
  })), "select" == t31 && null != r14.defaultValue && (r14.value = ($fb96b826c0c5f37a$export$47e4c5b300681277)(e21.children).forEach(function (n43) {
2780
2459
  n43.props.selected = r14.multiple ? -1 != r14.defaultValue.indexOf(n43.props.value) : r14.defaultValue == n43.props.value;
2781
2460
  })), n41.props = r14, e21.class != e21.className && ($dc040a17866866fa$var$J.enumerable = "className" in e21, null != e21.className && (r14.class = e21.className), Object.defineProperty(r14, "className", $dc040a17866866fa$var$J));
2782
2461
  }
2783
-
2784
2462
  n41.$$typeof = $dc040a17866866fa$var$j, $dc040a17866866fa$var$K && $dc040a17866866fa$var$K(n41);
2785
2463
  };
2786
-
2787
2464
  var $dc040a17866866fa$var$Q = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r;
2788
-
2789
2465
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r = function (n44) {
2790
2466
  $dc040a17866866fa$var$Q && $dc040a17866866fa$var$Q(n44), n44.__c;
2791
2467
  };
@@ -2793,13 +2469,11 @@ const $ec8c39fdad15601a$var$THEME_ICONS = {
2793
2469
  light: "outline",
2794
2470
  dark: "solid"
2795
2471
  };
2796
-
2797
2472
  class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export$221d75b3f55bb0bd) {
2798
2473
  renderIcon(category) {
2799
2474
  const {
2800
2475
  icon: icon
2801
2476
  } = category;
2802
-
2803
2477
  if (icon) {
2804
2478
  if (icon.svg) return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("span", {
2805
2479
  class: "flex",
@@ -2811,12 +2485,10 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
2811
2485
  src: icon.src
2812
2486
  });
2813
2487
  }
2814
-
2815
2488
  const categoryIcons = ($fcccfb36ed0cde68$export$2e2bcd8739ae039).categories[category.id] || ($fcccfb36ed0cde68$export$2e2bcd8739ae039).categories.custom;
2816
2489
  const style = this.props.icons == "auto" ? $ec8c39fdad15601a$var$THEME_ICONS[this.props.theme] : this.props.icons;
2817
2490
  return categoryIcons[style] || categoryIcons;
2818
2491
  }
2819
-
2820
2492
  render() {
2821
2493
  let selectedCategoryIndex = null;
2822
2494
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("nav", {
@@ -2856,7 +2528,6 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
2856
2528
  })
2857
2529
  });
2858
2530
  }
2859
-
2860
2531
  constructor() {
2861
2532
  super();
2862
2533
  this.categories = ($7adb23b0109cc36a$export$2d0294657ab35f1b).categories.filter(category => {
@@ -2866,29 +2537,22 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
2866
2537
  categoryId: this.categories[0].id
2867
2538
  };
2868
2539
  }
2869
-
2870
2540
  }
2871
-
2872
2541
  class $e0d4dda61265ff1e$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export$221d75b3f55bb0bd) {
2873
2542
  shouldComponentUpdate(nextProps) {
2874
2543
  for (let k in nextProps) {
2875
2544
  if (k == "children") continue;
2876
2545
  if (nextProps[k] != this.props[k]) return true;
2877
2546
  }
2878
-
2879
2547
  return false;
2880
2548
  }
2881
-
2882
2549
  render() {
2883
2550
  return this.props.children;
2884
2551
  }
2885
-
2886
2552
  }
2887
-
2888
2553
  const $89bd6bb200cc8fef$var$Performance = {
2889
2554
  rowsPerRender: 10
2890
2555
  };
2891
-
2892
2556
  class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export$16fa2f45be04daa8) {
2893
2557
  getInitialState(props = this.props) {
2894
2558
  return {
@@ -2896,7 +2560,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2896
2560
  theme: this.initTheme(props.theme)
2897
2561
  };
2898
2562
  }
2899
-
2900
2563
  componentWillMount() {
2901
2564
  this.dir = ($7adb23b0109cc36a$export$dbe3113d60765c1a).rtl ? "rtl" : "ltr";
2902
2565
  this.refs = {
@@ -2909,17 +2572,14 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2909
2572
  skinToneRadio: ($fb96b826c0c5f37a$export$7d1e3a5e95ceca43)()
2910
2573
  };
2911
2574
  this.initGrid();
2912
-
2913
2575
  if (this.props.stickySearch == false && this.props.searchPosition == "sticky") {
2914
2576
  console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`.");
2915
2577
  this.props.searchPosition = "static";
2916
2578
  }
2917
2579
  }
2918
-
2919
2580
  componentDidMount() {
2920
2581
  this.register();
2921
2582
  this.shadowRoot = this.base.parentNode;
2922
-
2923
2583
  if (this.props.autoFocus) {
2924
2584
  const {
2925
2585
  searchInput: searchInput
@@ -2927,32 +2587,25 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2927
2587
  if (searchInput.current) searchInput.current.focus();
2928
2588
  }
2929
2589
  }
2930
-
2931
2590
  componentWillReceiveProps(nextProps) {
2932
2591
  this.nextState || (this.nextState = {});
2933
-
2934
2592
  for (const k1 in nextProps) this.nextState[k1] = nextProps[k1];
2935
-
2936
2593
  clearTimeout(this.nextStateTimer);
2937
2594
  this.nextStateTimer = setTimeout(() => {
2938
2595
  let requiresGridReset = false;
2939
-
2940
2596
  for (const k in this.nextState) {
2941
2597
  this.props[k] = this.nextState[k];
2942
2598
  if (k === "custom" || k === "categories") requiresGridReset = true;
2943
2599
  }
2944
-
2945
2600
  delete this.nextState;
2946
2601
  const nextState = this.getInitialState();
2947
2602
  if (requiresGridReset) return this.reset(nextState);
2948
2603
  this.setState(nextState);
2949
2604
  });
2950
2605
  }
2951
-
2952
2606
  componentWillUnmount() {
2953
2607
  this.unregister();
2954
2608
  }
2955
-
2956
2609
  async reset(nextState = {}) {
2957
2610
  await ($7adb23b0109cc36a$export$2cd8252107eb640b)(this.props);
2958
2611
  this.initGrid();
@@ -2962,35 +2615,28 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2962
2615
  this.observeRows();
2963
2616
  });
2964
2617
  }
2965
-
2966
2618
  register() {
2967
2619
  document.addEventListener("click", this.handleClickOutside);
2968
2620
  this.observe();
2969
2621
  }
2970
-
2971
2622
  unregister() {
2972
2623
  document.removeEventListener("click", this.handleClickOutside);
2973
2624
  this.unobserve();
2974
2625
  }
2975
-
2976
2626
  observe() {
2977
2627
  this.observeCategories();
2978
2628
  this.observeRows();
2979
2629
  }
2980
-
2981
2630
  unobserve({
2982
2631
  except = []
2983
2632
  } = {}) {
2984
2633
  if (!Array.isArray(except)) except = [except];
2985
-
2986
2634
  for (const observer of this.observers) {
2987
2635
  if (except.includes(observer)) continue;
2988
2636
  observer.disconnect();
2989
2637
  }
2990
-
2991
2638
  this.observers = [].concat(except);
2992
2639
  }
2993
-
2994
2640
  initGrid() {
2995
2641
  const {
2996
2642
  categories: categories
@@ -3001,7 +2647,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3001
2647
  this.navKey = navKey;
3002
2648
  this.grid = [];
3003
2649
  this.grid.setsize = 0;
3004
-
3005
2650
  const addRow = (rows, category) => {
3006
2651
  const row = [];
3007
2652
  row.__categoryId = category.id;
@@ -3014,27 +2659,22 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3014
2659
  rows.push(rowRef);
3015
2660
  return row;
3016
2661
  };
3017
-
3018
2662
  for (let category1 of categories) {
3019
2663
  const rows = [];
3020
2664
  let row = addRow(rows, category1);
3021
-
3022
2665
  for (let emoji of category1.emojis) {
3023
2666
  if (row.length == this.getPerLine()) row = addRow(rows, category1);
3024
2667
  this.grid.setsize += 1;
3025
2668
  row.push(emoji);
3026
2669
  }
3027
-
3028
2670
  this.refs.categories.set(category1.id, {
3029
2671
  root: ($fb96b826c0c5f37a$export$7d1e3a5e95ceca43)(),
3030
2672
  rows: rows
3031
2673
  });
3032
2674
  }
3033
2675
  }
3034
-
3035
2676
  initTheme(theme) {
3036
2677
  if (theme != "auto") return theme;
3037
-
3038
2678
  if (!this.darkMedia) {
3039
2679
  this.darkMedia = matchMedia("(prefers-color-scheme: dark)");
3040
2680
  if (this.darkMedia.media.match(/^not/)) return "light";
@@ -3045,24 +2685,20 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3045
2685
  });
3046
2686
  });
3047
2687
  }
3048
-
3049
2688
  return this.darkMedia.matches ? "dark" : "light";
3050
2689
  }
3051
-
3052
2690
  initDynamicPerLine(props = this.props) {
3053
2691
  if (!props.dynamicWidth) return;
3054
2692
  const {
3055
2693
  element: element,
3056
2694
  emojiButtonSize: emojiButtonSize
3057
2695
  } = props;
3058
-
3059
2696
  const calculatePerLine = () => {
3060
2697
  const {
3061
2698
  width: width
3062
2699
  } = element.getBoundingClientRect();
3063
2700
  return Math.floor(width / emojiButtonSize);
3064
2701
  };
3065
-
3066
2702
  const observer = new ResizeObserver(() => {
3067
2703
  this.unobserve({
3068
2704
  except: observer
@@ -3081,29 +2717,24 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3081
2717
  this.observers.push(observer);
3082
2718
  return calculatePerLine();
3083
2719
  }
3084
-
3085
2720
  getPerLine() {
3086
2721
  return this.state.perLine || this.props.perLine;
3087
2722
  }
3088
-
3089
2723
  getEmojiByPos([p1, p2]) {
3090
2724
  const grid = this.state.searchResults || this.grid;
3091
2725
  const emoji = grid[p1] && grid[p1][p2];
3092
2726
  if (!emoji) return;
3093
2727
  return ($c4d155af13ad4d4b$export$2e2bcd8739ae039).get(emoji);
3094
2728
  }
3095
-
3096
2729
  observeCategories() {
3097
2730
  const navigation = this.refs.navigation.current;
3098
2731
  if (!navigation) return;
3099
2732
  const visibleCategories = new Map();
3100
-
3101
2733
  const setFocusedCategory = categoryId => {
3102
2734
  if (categoryId != navigation.state.categoryId) navigation.setState({
3103
2735
  categoryId: categoryId
3104
2736
  });
3105
2737
  };
3106
-
3107
2738
  const observerOptions = {
3108
2739
  root: this.refs.scroll.current,
3109
2740
  threshold: [0.0, 1.0]
@@ -3113,31 +2744,26 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3113
2744
  const id = entry.target.dataset.id;
3114
2745
  visibleCategories.set(id, entry.intersectionRatio);
3115
2746
  }
3116
-
3117
2747
  const ratios = [...visibleCategories];
3118
-
3119
2748
  for (const [id, ratio] of ratios) if (ratio) {
3120
2749
  setFocusedCategory(id);
3121
2750
  break;
3122
2751
  }
3123
2752
  }, observerOptions);
3124
-
3125
2753
  for (const {
3126
2754
  root: root
3127
2755
  } of this.refs.categories.values()) observer.observe(root.current);
3128
-
3129
2756
  this.observers.push(observer);
3130
2757
  }
3131
-
3132
2758
  observeRows() {
3133
- const visibleRows = { ...this.state.visibleRows
2759
+ const visibleRows = {
2760
+ ...this.state.visibleRows
3134
2761
  };
3135
2762
  const observer = new IntersectionObserver(entries => {
3136
2763
  for (const entry of entries) {
3137
2764
  const index = parseInt(entry.target.dataset.index);
3138
2765
  if (entry.isIntersecting) visibleRows[index] = true;else delete visibleRows[index];
3139
2766
  }
3140
-
3141
2767
  this.setState({
3142
2768
  visibleRows: visibleRows
3143
2769
  });
@@ -3145,26 +2771,21 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3145
2771
  root: this.refs.scroll.current,
3146
2772
  rootMargin: `${this.props.emojiButtonSize * ($89bd6bb200cc8fef$var$Performance.rowsPerRender + 5)}px 0px ${this.props.emojiButtonSize * $89bd6bb200cc8fef$var$Performance.rowsPerRender}px`
3147
2773
  });
3148
-
3149
2774
  for (const {
3150
2775
  rows: rows
3151
2776
  } of this.refs.categories.values()) {
3152
2777
  for (const row of rows) if (row.current) observer.observe(row.current);
3153
2778
  }
3154
-
3155
2779
  this.observers.push(observer);
3156
2780
  }
3157
-
3158
2781
  preventDefault(e) {
3159
2782
  e.preventDefault();
3160
2783
  }
3161
-
3162
2784
  unfocusSearch() {
3163
2785
  const input = this.refs.searchInput.current;
3164
2786
  if (!input) return;
3165
2787
  input.blur();
3166
2788
  }
3167
-
3168
2789
  navigate({
3169
2790
  e: e,
3170
2791
  input: input,
@@ -3176,53 +2797,42 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3176
2797
  const grid = this.state.searchResults || this.grid;
3177
2798
  if (!grid.length) return;
3178
2799
  let [p1, p2] = this.state.pos;
3179
-
3180
2800
  const pos = (() => {
3181
2801
  if (p1 == 0) {
3182
2802
  if (p2 == 0 && !e.repeat && (left || up)) return null;
3183
2803
  }
3184
-
3185
2804
  if (p1 == -1) {
3186
2805
  if (!e.repeat && (right || down) && input.selectionStart == input.value.length) return [0, 0];
3187
2806
  return null;
3188
2807
  }
3189
-
3190
2808
  if (left || right) {
3191
2809
  let row = grid[p1];
3192
2810
  const increment = left ? -1 : 1;
3193
2811
  p2 += increment;
3194
-
3195
2812
  if (!row[p2]) {
3196
2813
  p1 += increment;
3197
2814
  row = grid[p1];
3198
-
3199
2815
  if (!row) {
3200
2816
  p1 = left ? 0 : grid.length - 1;
3201
2817
  p2 = left ? 0 : grid[p1].length - 1;
3202
2818
  return [p1, p2];
3203
2819
  }
3204
-
3205
2820
  p2 = left ? row.length - 1 : 0;
3206
2821
  }
3207
-
3208
2822
  return [p1, p2];
3209
2823
  }
3210
-
3211
2824
  if (up || down) {
3212
2825
  p1 += up ? -1 : 1;
3213
2826
  const row = grid[p1];
3214
-
3215
2827
  if (!row) {
3216
2828
  p1 = up ? 0 : grid.length - 1;
3217
2829
  p2 = up ? 0 : grid[p1].length - 1;
3218
2830
  return [p1, p2];
3219
2831
  }
3220
-
3221
2832
  if (!row[p2]) p2 = row.length - 1;
3222
2833
  return [p1, p2];
3223
2834
  }
3224
2835
  })();
3225
-
3226
2836
  if (pos) e.preventDefault();else {
3227
2837
  if (this.state.pos[0] > -1) this.setState({
3228
2838
  pos: [-1, -1]
@@ -3238,7 +2848,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3238
2848
  });
3239
2849
  });
3240
2850
  }
3241
-
3242
2851
  scrollTo({
3243
2852
  categoryId: categoryId,
3244
2853
  row: row
@@ -3249,13 +2858,11 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3249
2858
  const scrollRect = scroll.getBoundingClientRect();
3250
2859
  let scrollTop = 0;
3251
2860
  if (row >= 0) categoryId = grid[row].__categoryId;
3252
-
3253
2861
  if (categoryId) {
3254
2862
  const ref = this.refs[categoryId] || this.refs.categories.get(categoryId).root;
3255
2863
  const categoryRect = ref.current.getBoundingClientRect();
3256
2864
  scrollTop = categoryRect.top - (scrollRect.top - scroll.scrollTop) + 1;
3257
2865
  }
3258
-
3259
2866
  if (row >= 0) {
3260
2867
  if (!row) scrollTop = 0;else {
3261
2868
  const rowIndex = grid[row].__index;
@@ -3264,11 +2871,9 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3264
2871
  if (rowTop < scroll.scrollTop) scrollTop = rowTop;else if (rowBot > scroll.scrollTop + scrollRect.height) scrollTop = rowBot - scrollRect.height;else return;
3265
2872
  }
3266
2873
  }
3267
-
3268
2874
  this.ignoreMouse();
3269
2875
  scroll.scrollTop = scrollTop;
3270
2876
  }
3271
-
3272
2877
  ignoreMouse() {
3273
2878
  this.mouseIsIgnored = true;
3274
2879
  clearTimeout(this.ignoreMouseTimer);
@@ -3276,7 +2881,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3276
2881
  delete this.mouseIsIgnored;
3277
2882
  }, 100);
3278
2883
  }
3279
-
3280
2884
  handleEmojiOver(pos) {
3281
2885
  if (this.mouseIsIgnored || this.state.showSkins) return;
3282
2886
  this.setState({
@@ -3284,7 +2888,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3284
2888
  keyboard: false
3285
2889
  });
3286
2890
  }
3287
-
3288
2891
  handleEmojiClick({
3289
2892
  e: e,
3290
2893
  emoji: emoji,
@@ -3292,7 +2895,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3292
2895
  }) {
3293
2896
  if (!this.props.onEmojiSelect) return;
3294
2897
  if (!emoji && pos) emoji = this.getEmojiByPos(pos);
3295
-
3296
2898
  if (emoji) {
3297
2899
  const emojiData = ($693b183b0a78708f$export$d10ac59fbe52a745)(emoji, {
3298
2900
  skinIndex: this.state.skin - 1
@@ -3301,7 +2903,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3301
2903
  this.props.onEmojiSelect(emojiData, e);
3302
2904
  }
3303
2905
  }
3304
-
3305
2906
  closeSkins() {
3306
2907
  if (!this.state.showSkins) return;
3307
2908
  this.setState({
@@ -3311,13 +2912,11 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3311
2912
  this.base.removeEventListener("click", this.handleBaseClick);
3312
2913
  this.base.removeEventListener("keydown", this.handleBaseKeydown);
3313
2914
  }
3314
-
3315
2915
  handleSkinMouseOver(tempSkin) {
3316
2916
  this.setState({
3317
2917
  tempSkin: tempSkin
3318
2918
  });
3319
2919
  }
3320
-
3321
2920
  handleSkinClick(skin) {
3322
2921
  this.ignoreMouse();
3323
2922
  this.closeSkins();
@@ -3327,7 +2926,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3327
2926
  });
3328
2927
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("skin", skin);
3329
2928
  }
3330
-
3331
2929
  renderNav() {
3332
2930
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($ec8c39fdad15601a$export$2e2bcd8739ae039), {
3333
2931
  ref: this.refs.navigation,
@@ -3339,7 +2937,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3339
2937
  onClick: this.handleCategoryClick
3340
2938
  }, this.navKey);
3341
2939
  }
3342
-
3343
2940
  renderPreview() {
3344
2941
  const emoji = this.getEmojiByPos(this.state.pos);
3345
2942
  const noSearchResults = this.state.searchResults && !this.state.searchResults.length;
@@ -3384,7 +2981,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3384
2981
  }), !emoji && this.props.skinTonePosition == "preview" && this.renderSkinToneButton()]
3385
2982
  });
3386
2983
  }
3387
-
3388
2984
  renderEmojiButton(emoji, {
3389
2985
  pos: pos,
3390
2986
  posinset: posinset,
@@ -3440,7 +3036,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3440
3036
  })
3441
3037
  }, key);
3442
3038
  }
3443
-
3444
3039
  renderSearch() {
3445
3040
  const renderSkinTone = this.props.previewPosition == "none" || this.props.skinTonePosition == "search";
3446
3041
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("div", {
@@ -3474,7 +3069,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3474
3069
  })]
3475
3070
  });
3476
3071
  }
3477
-
3478
3072
  renderSearchResults() {
3479
3073
  const {
3480
3074
  searchResults: searchResults
@@ -3508,7 +3102,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3508
3102
  })]
3509
3103
  });
3510
3104
  }
3511
-
3512
3105
  renderCategories() {
3513
3106
  const {
3514
3107
  categories: categories
@@ -3575,7 +3168,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3575
3168
  })
3576
3169
  });
3577
3170
  }
3578
-
3579
3171
  renderSkinToneButton() {
3580
3172
  if (this.props.skinTonePosition == "none") return null;
3581
3173
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("div", {
@@ -3603,7 +3195,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3603
3195
  })
3604
3196
  });
3605
3197
  }
3606
-
3607
3198
  renderLiveRegion() {
3608
3199
  const emoji = this.getEmojiByPos(this.state.pos);
3609
3200
  const contents = emoji ? emoji.name : "";
@@ -3613,7 +3204,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3613
3204
  children: contents
3614
3205
  });
3615
3206
  }
3616
-
3617
3207
  renderSkins() {
3618
3208
  const skinToneButton = this.refs.skinToneButton.current;
3619
3209
  const skinToneButtonRect = skinToneButton.getBoundingClientRect();
@@ -3668,7 +3258,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3668
3258
  })
3669
3259
  });
3670
3260
  }
3671
-
3672
3261
  render() {
3673
3262
  const lineWidth = this.props.perLine * this.props.emojiButtonSize;
3674
3263
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("section", {
@@ -3697,14 +3286,12 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3697
3286
  }), this.props.navPosition == "bottom" && this.renderNav(), this.props.previewPosition == "bottom" && this.renderPreview(), this.state.showSkins && this.renderSkins(), this.renderLiveRegion()]
3698
3287
  });
3699
3288
  }
3700
-
3701
3289
  constructor(props) {
3702
3290
  super();
3703
3291
  ($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleClickOutside", e => {
3704
3292
  const {
3705
3293
  element: element
3706
3294
  } = this.props;
3707
-
3708
3295
  if (e.target != element) {
3709
3296
  if (this.state.showSkins) this.closeSkins();
3710
3297
  if (this.props.onClickOutside) this.props.onClickOutside(e);
@@ -3712,7 +3299,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3712
3299
  });
3713
3300
  ($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleBaseClick", e => {
3714
3301
  if (!this.state.showSkins) return;
3715
-
3716
3302
  if (!e.target.closest(".menu")) {
3717
3303
  e.preventDefault();
3718
3304
  e.stopImmediatePropagation();
@@ -3721,7 +3307,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3721
3307
  });
3722
3308
  ($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleBaseKeydown", e => {
3723
3309
  if (!this.state.showSkins) return;
3724
-
3725
3310
  if (e.key == "Escape") {
3726
3311
  e.preventDefault();
3727
3312
  e.stopImmediatePropagation();
@@ -3742,12 +3327,10 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3742
3327
  value: value
3743
3328
  } = input;
3744
3329
  const searchResults = await ($c4d155af13ad4d4b$export$2e2bcd8739ae039).search(value);
3745
-
3746
3330
  const afterRender = () => {
3747
3331
  if (!this.refs.scroll.current) return;
3748
3332
  this.refs.scroll.current.scrollTop = 0;
3749
3333
  };
3750
-
3751
3334
  if (!searchResults) return this.setState({
3752
3335
  searchResults: searchResults,
3753
3336
  pos: [-1, -1]
@@ -3756,7 +3339,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3756
3339
  const grid = [];
3757
3340
  grid.setsize = searchResults.length;
3758
3341
  let row = null;
3759
-
3760
3342
  for (let emoji of searchResults) {
3761
3343
  if (!grid.length || row.length == this.getPerLine()) {
3762
3344
  row = [];
@@ -3764,10 +3346,8 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3764
3346
  row.__index = grid.length;
3765
3347
  grid.push(row);
3766
3348
  }
3767
-
3768
3349
  row.push(emoji);
3769
3350
  }
3770
-
3771
3351
  this.ignoreMouse();
3772
3352
  this.setState({
3773
3353
  searchResults: grid,
@@ -3778,7 +3358,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3778
3358
  // const specialKey = e.altKey || e.ctrlKey || e.metaKey
3779
3359
  const input = e.currentTarget;
3780
3360
  e.stopImmediatePropagation();
3781
-
3782
3361
  switch (e.key) {
3783
3362
  case "ArrowLeft":
3784
3363
  // if (specialKey) return
@@ -3789,7 +3368,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3789
3368
  left: true
3790
3369
  });
3791
3370
  break;
3792
-
3793
3371
  case "ArrowRight":
3794
3372
  // if (specialKey) return
3795
3373
  // e.preventDefault()
@@ -3799,7 +3377,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3799
3377
  right: true
3800
3378
  });
3801
3379
  break;
3802
-
3803
3380
  case "ArrowUp":
3804
3381
  // if (specialKey) return
3805
3382
  // e.preventDefault()
@@ -3809,7 +3386,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3809
3386
  up: true
3810
3387
  });
3811
3388
  break;
3812
-
3813
3389
  case "ArrowDown":
3814
3390
  // if (specialKey) return
3815
3391
  // e.preventDefault()
@@ -3819,7 +3395,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3819
3395
  down: true
3820
3396
  });
3821
3397
  break;
3822
-
3823
3398
  case "Enter":
3824
3399
  e.preventDefault();
3825
3400
  this.handleEmojiClick({
@@ -3827,7 +3402,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3827
3402
  pos: this.state.pos
3828
3403
  });
3829
3404
  break;
3830
-
3831
3405
  case "Escape":
3832
3406
  e.preventDefault();
3833
3407
  if (this.state.searchResults) this.clearSearch();else this.unfocusSearch();
@@ -3879,32 +3453,26 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3879
3453
  ...this.getInitialState(props)
3880
3454
  };
3881
3455
  }
3882
-
3883
3456
  }
3884
-
3885
3457
  class $efa000751917694d$export$2e2bcd8739ae039 extends ($26f27c338a96b1a6$export$2e2bcd8739ae039) {
3886
3458
  async connectedCallback() {
3887
3459
  const props = ($7adb23b0109cc36a$export$75fe5f91d452f94b)(this.props, ($b247ea80b67298d5$export$2e2bcd8739ae039), this);
3888
3460
  props.element = this;
3889
-
3890
3461
  props.ref = component => {
3891
3462
  this.component = component;
3892
3463
  };
3893
-
3894
3464
  await ($7adb23b0109cc36a$export$2cd8252107eb640b)(props);
3895
3465
  if (this.disconnected) return;
3896
- ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($89bd6bb200cc8fef$export$2e2bcd8739ae039), { ...props
3466
+ ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($89bd6bb200cc8fef$export$2e2bcd8739ae039), {
3467
+ ...props
3897
3468
  }), this.shadowRoot);
3898
3469
  }
3899
-
3900
3470
  constructor(props) {
3901
3471
  super(props, {
3902
3472
  styles: (/*@__PURE__*/$parcel$interopDefault($329d53ba9fd7125f$exports))
3903
3473
  });
3904
3474
  }
3905
-
3906
3475
  }
3907
-
3908
3476
  ($c770c458706daa72$export$2e2bcd8739ae039)($efa000751917694d$export$2e2bcd8739ae039, "Props", ($b247ea80b67298d5$export$2e2bcd8739ae039));
3909
3477
  if (typeof customElements !== "undefined" && !customElements.get("em-emoji-picker")) customElements.define("em-emoji-picker", $efa000751917694d$export$2e2bcd8739ae039);
3910
3478
  var $329d53ba9fd7125f$exports = {};
@@ -3915,7 +3483,8 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
3915
3483
  const instance = (React.useRef)(null);
3916
3484
  if (instance.current) instance.current.update(props);
3917
3485
  (React.useEffect)(() => {
3918
- instance.current = new ($efa000751917694d$export$2e2bcd8739ae039)({ ...props,
3486
+ instance.current = new ($efa000751917694d$export$2e2bcd8739ae039)({
3487
+ ...props,
3919
3488
  ref: ref
3920
3489
  });
3921
3490
  return () => {
@@ -3941,23 +3510,20 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
3941
3510
  * @param {Props} props
3942
3511
  * @return {React.FC}
3943
3512
  */
3944
-
3945
3513
  function EmojiPicker(props) {
3946
3514
  var theme = props.theme,
3947
- onSelectEmoji = props.onSelectEmoji,
3948
- disableRecent = props.disableRecent,
3949
- customEmojis = props.customEmojis,
3950
- language = props.language;
3951
- /** @type {string[]} */
3515
+ onSelectEmoji = props.onSelectEmoji,
3516
+ disableRecent = props.disableRecent,
3517
+ customEmojis = props.customEmojis,
3518
+ language = props.language;
3952
3519
 
3520
+ /** @type {string[]} */
3953
3521
  var categories = React.useMemo(function () {
3954
3522
  /** @type {string[]} */
3955
3523
  var categoryies = [];
3956
-
3957
3524
  if (!disableRecent) {
3958
3525
  categoryies.push("frequent");
3959
3526
  }
3960
-
3961
3527
  categoryies = [].concat(_toConsumableArray(categoryies), ["people", "nature", "foods", "activity", "places", "objects", "symbols", "flags"]);
3962
3528
  return categoryies;
3963
3529
  }, [disableRecent]);
@@ -3965,7 +3531,6 @@ function EmojiPicker(props) {
3965
3531
  if (!language) {
3966
3532
  return undefined;
3967
3533
  }
3968
-
3969
3534
  return require("@emoji-mart/data/i18n/".concat(language !== null && language !== void 0 ? language : 'en', ".json"));
3970
3535
  }, [language]);
3971
3536
  return /*#__PURE__*/React__default["default"].createElement($e5534fc185f7111e$export$2e2bcd8739ae039, {
@@ -3979,7 +3544,6 @@ function EmojiPicker(props) {
3979
3544
  i18n: i18n
3980
3545
  });
3981
3546
  }
3982
-
3983
3547
  var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
3984
3548
 
3985
3549
  /**
@@ -3998,15 +3562,14 @@ var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
3998
3562
  * @param {Props} props
3999
3563
  * @return {JSX.Element}
4000
3564
  */
4001
-
4002
3565
  function EmojiPickerContainer(_ref) {
4003
3566
  var showPicker = _ref.showPicker,
4004
- theme = _ref.theme,
4005
- handleSelectEmoji = _ref.handleSelectEmoji,
4006
- disableRecent = _ref.disableRecent,
4007
- customEmojis = _ref.customEmojis,
4008
- position = _ref.position,
4009
- language = _ref.language;
3567
+ theme = _ref.theme,
3568
+ handleSelectEmoji = _ref.handleSelectEmoji,
3569
+ disableRecent = _ref.disableRecent,
3570
+ customEmojis = _ref.customEmojis,
3571
+ position = _ref.position,
3572
+ language = _ref.language;
4010
3573
  return /*#__PURE__*/React__default["default"].createElement("div", {
4011
3574
  className: "react-emoji-picker--container"
4012
3575
  }, showPicker && /*#__PURE__*/React__default["default"].createElement("div", {
@@ -4029,6 +3592,7 @@ function EmojiPickerContainer(_ref) {
4029
3592
  }
4030
3593
 
4031
3594
  var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
3595
+
4032
3596
  /**
4033
3597
  * @typedef {import('../types/types').SanitizeFn} SanitizeFn
4034
3598
  */
@@ -4047,42 +3611,37 @@ var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
4047
3611
  * @property {(fn: PolluteFn) => void} addPolluteFn
4048
3612
  * @property {(html: string) => void} appendContent
4049
3613
  * @property {HTMLDivElement=} buttonElement
3614
+ * @property {React.MutableRefObject=} buttonRef
4050
3615
  * @property {import('../types/types').Languages=} language
4051
3616
  */
4052
- // eslint-disable-next-line valid-jsdoc
4053
3617
 
3618
+ // eslint-disable-next-line valid-jsdoc
4054
3619
  /** @type {React.FC<Props>} */
4055
-
4056
3620
  var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4057
3621
  var theme = props.theme,
4058
- keepOpened = props.keepOpened,
4059
- disableRecent = props.disableRecent,
4060
- customEmojis = props.customEmojis,
4061
- addSanitizeFn = props.addSanitizeFn,
4062
- addPolluteFn = props.addPolluteFn,
4063
- appendContent = props.appendContent,
4064
- buttonElement = props.buttonElement,
4065
- language = props.language;
4066
-
3622
+ keepOpened = props.keepOpened,
3623
+ disableRecent = props.disableRecent,
3624
+ customEmojis = props.customEmojis,
3625
+ addSanitizeFn = props.addSanitizeFn,
3626
+ addPolluteFn = props.addPolluteFn,
3627
+ appendContent = props.appendContent,
3628
+ buttonElement = props.buttonElement,
3629
+ buttonRef = props.buttonRef,
3630
+ language = props.language;
4067
3631
  var _useState = React.useState(false),
4068
- _useState2 = _slicedToArray(_useState, 2),
4069
- showPicker = _useState2[0],
4070
- setShowPicker = _useState2[1];
3632
+ _useState2 = _slicedToArray(_useState, 2),
3633
+ showPicker = _useState2[0],
3634
+ setShowPicker = _useState2[1];
4071
3635
  /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */
4072
-
4073
-
4074
3636
  var _useState3 = React.useState(),
4075
- _useState4 = _slicedToArray(_useState3, 2),
4076
- customButton = _useState4[0],
4077
- setCustomButton = _useState4[1];
3637
+ _useState4 = _slicedToArray(_useState3, 2),
3638
+ customButton = _useState4[0],
3639
+ setCustomButton = _useState4[1];
4078
3640
  /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */
4079
-
4080
-
4081
3641
  var _useState5 = React.useState(),
4082
- _useState6 = _slicedToArray(_useState5, 2),
4083
- emojiPickerPosition = _useState6[0],
4084
- setEmojiPickerPosition = _useState6[1];
4085
-
3642
+ _useState6 = _slicedToArray(_useState5, 2),
3643
+ emojiPickerPosition = _useState6[0],
3644
+ setEmojiPickerPosition = _useState6[1];
4086
3645
  React.useEffect(function () {
4087
3646
  addSanitizeFn(replaceAllTextEmojiToString);
4088
3647
  }, [addSanitizeFn]);
@@ -4098,24 +3657,21 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4098
3657
  /** @type {HTMLElement} */
4099
3658
  // @ts-ignore
4100
3659
  var element = event.target;
4101
-
4102
3660
  if (element.classList.contains("react-input-emoji--button") || element.classList.contains("react-input-emoji--button--icon")) {
4103
3661
  return;
4104
3662
  }
4105
-
4106
3663
  setShowPicker(false);
4107
3664
  }
4108
-
4109
3665
  document.addEventListener("click", checkClickOutside);
4110
3666
  return function () {
4111
3667
  document.removeEventListener("click", checkClickOutside);
4112
3668
  };
4113
3669
  }, []);
3670
+
4114
3671
  /**
4115
3672
  *
4116
3673
  * @param {React.MouseEvent} event
4117
3674
  */
4118
-
4119
3675
  function toggleShowPicker(event) {
4120
3676
  event.stopPropagation();
4121
3677
  event.preventDefault();
@@ -4124,18 +3680,18 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4124
3680
  return !currentShowPicker;
4125
3681
  });
4126
3682
  }
3683
+
4127
3684
  /**
4128
3685
  *
4129
3686
  * @param {React.MouseEvent} event
4130
3687
  * @return {'above' | 'below'}
4131
3688
  */
4132
-
4133
-
4134
3689
  function calcTopPosition(event) {
4135
3690
  var btn = event.currentTarget;
4136
3691
  var btnRect = btn.getBoundingClientRect();
4137
- var popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT; // Decide to display above or below based on available space
3692
+ var popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;
4138
3693
 
3694
+ // Decide to display above or below based on available space
4139
3695
  if (btnRect.top >= popoverHeight) {
4140
3696
  // Display above
4141
3697
  return 'above';
@@ -4143,30 +3699,31 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4143
3699
  // Display below
4144
3700
  return 'below';
4145
3701
  }
4146
- } // eslint-disable-next-line valid-jsdoc
3702
+ }
4147
3703
 
3704
+ // eslint-disable-next-line valid-jsdoc
4148
3705
  /**
4149
3706
  *
4150
3707
  * @param {import("../types/types").EmojiMartItem} emoji
4151
3708
  */
4152
-
4153
-
4154
3709
  function handleSelectEmoji(emoji) {
4155
3710
  appendContent(getImageEmoji(emoji));
4156
-
4157
3711
  if (!keepOpened) {
4158
3712
  setShowPicker(function (currentShowPicker) {
4159
3713
  return !currentShowPicker;
4160
3714
  });
4161
3715
  }
4162
3716
  }
4163
-
4164
3717
  React.useEffect(function () {
4165
- if (buttonElement !== null && buttonElement !== void 0 && buttonElement.style) {
3718
+ var _buttonRef$current;
3719
+ if (buttonRef !== null && buttonRef !== void 0 && (_buttonRef$current = buttonRef.current) !== null && _buttonRef$current !== void 0 && _buttonRef$current.style) {
3720
+ buttonRef.current.style.position = "relative";
3721
+ setCustomButton(buttonRef.current);
3722
+ } else if (buttonElement !== null && buttonElement !== void 0 && buttonElement.style) {
4166
3723
  buttonElement.style.position = "relative";
4167
3724
  setCustomButton(buttonElement);
4168
3725
  }
4169
- }, [buttonElement]);
3726
+ }, [buttonRef, buttonElement]);
4170
3727
  return customButton ? /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(EmojiPickerContainer, {
4171
3728
  showPicker: showPicker,
4172
3729
  theme: theme,
@@ -4178,7 +3735,8 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4178
3735
  }), /*#__PURE__*/React__default["default"].createElement(EmojiPickerButton, {
4179
3736
  showPicker: showPicker,
4180
3737
  toggleShowPicker: toggleShowPicker,
4181
- buttonElement: customButton
3738
+ buttonElement: customButton,
3739
+ buttonRef: buttonRef
4182
3740
  })), customButton) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(EmojiPickerContainer, {
4183
3741
  showPicker: showPicker,
4184
3742
  theme: theme,
@@ -4204,37 +3762,34 @@ function getTextFromAtToCaret() {
4204
3762
  if (!range) return null;
4205
3763
  var text = range.text.substring(range.begin, range.end);
4206
3764
  return text || null;
4207
- } // eslint-disable-next-line valid-jsdoc
3765
+ }
4208
3766
 
3767
+ // eslint-disable-next-line valid-jsdoc
4209
3768
  /** */
4210
-
4211
3769
  function deleteTextFromAtToCaret() {
4212
3770
  var range = getRangeFromAtToCaret();
4213
- if (!range) return; // @ts-ignore
3771
+ if (!range) return;
4214
3772
 
3773
+ // @ts-ignore
4215
3774
  range.element.deleteData(range.begin, range.end - range.begin);
4216
3775
  }
3776
+
4217
3777
  /**
4218
3778
  *
4219
3779
  * @return {{begin: number, end: number, text: string, element: Node} | null}
4220
3780
  */
4221
-
4222
3781
  function getRangeFromAtToCaret() {
4223
3782
  var elementWithFocus = getElementWithFocus();
4224
-
4225
3783
  if (!elementWithFocus) {
4226
3784
  return null;
4227
3785
  }
4228
-
4229
3786
  var element = elementWithFocus.element,
4230
- caretOffset = elementWithFocus.caretOffset;
3787
+ caretOffset = elementWithFocus.caretOffset;
4231
3788
  var text = element.textContent;
4232
3789
  var lastAt = text.lastIndexOf("@");
4233
-
4234
3790
  if (lastAt === -1 || lastAt >= caretOffset || lastAt !== 0 && text[lastAt - 1] !== " ") {
4235
3791
  return null;
4236
3792
  }
4237
-
4238
3793
  return {
4239
3794
  begin: lastAt,
4240
3795
  end: caretOffset,
@@ -4242,49 +3797,46 @@ function getRangeFromAtToCaret() {
4242
3797
  element: element
4243
3798
  };
4244
3799
  }
3800
+
4245
3801
  /**
4246
3802
  *
4247
3803
  * @return {{element: Node, caretOffset: number}}
4248
3804
  */
4249
-
4250
-
4251
3805
  function getElementWithFocus() {
4252
3806
  var element = getSelectionStart();
4253
-
4254
3807
  if (element === null) {
4255
3808
  return null;
4256
3809
  }
4257
-
4258
3810
  var caretOffset = 0;
4259
-
4260
3811
  if (typeof window.getSelection != "undefined") {
4261
3812
  var range = window.getSelection().getRangeAt(0);
4262
3813
  var preCaretRange = range.cloneRange();
4263
3814
  preCaretRange.selectNodeContents(element);
4264
3815
  preCaretRange.setEnd(range.endContainer, range.endOffset);
4265
3816
  caretOffset = preCaretRange.toString().length;
4266
- } else if ( // @ts-ignore
4267
- typeof document.selection != "undefined" && // @ts-ignore
3817
+ } else if (
3818
+ // @ts-ignore
3819
+ typeof document.selection != "undefined" &&
3820
+ // @ts-ignore
4268
3821
  document.selection.type != "Control") {
4269
3822
  // @ts-ignore
4270
- var textRange = document.selection.createRange(); // @ts-ignore
4271
-
3823
+ var textRange = document.selection.createRange();
3824
+ // @ts-ignore
4272
3825
  var preCaretTextRange = document.body.createTextRange();
4273
3826
  preCaretTextRange.moveToElementText(element);
4274
3827
  preCaretTextRange.setEndPoint("EndToEnd", textRange);
4275
3828
  caretOffset = preCaretTextRange.text.length;
4276
3829
  }
4277
-
4278
3830
  return {
4279
3831
  element: element,
4280
3832
  caretOffset: caretOffset
4281
3833
  };
4282
3834
  }
3835
+
4283
3836
  /**
4284
3837
  *
4285
3838
  * @return {Node | null}
4286
3839
  */
4287
-
4288
3840
  function getSelectionStart() {
4289
3841
  var node = document.getSelection().anchorNode;
4290
3842
  return (node === null || node === void 0 ? void 0 : node.nodeType) == 3 ? node : null;
@@ -4293,113 +3845,93 @@ function getSelectionStart() {
4293
3845
  /**
4294
3846
  * @typedef {import('../types/types').MentionUser} MentionUser
4295
3847
  */
4296
- // eslint-disable-next-line valid-jsdoc
4297
3848
 
3849
+ // eslint-disable-next-line valid-jsdoc
4298
3850
  /**
4299
3851
  *
4300
3852
  * @param {(text: string) => Promise<MentionUser[]>=} searchMention
4301
3853
  * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}
4302
3854
  */
4303
-
4304
3855
  function useMention(searchMention) {
3856
+ var _ref2;
4305
3857
  var _useState = React.useState(false),
4306
- _useState2 = _slicedToArray(_useState, 2),
4307
- loading = _useState2[0],
4308
- setLoading = _useState2[1];
4309
- /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */
4310
-
3858
+ _useState2 = _slicedToArray(_useState, 2),
3859
+ loading = _useState2[0],
3860
+ setLoading = _useState2[1];
4311
3861
 
3862
+ /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */
4312
3863
  var _useState3 = React.useState([]),
4313
- _useState4 = _slicedToArray(_useState3, 2),
4314
- mentionUsers = _useState4[0],
4315
- setMentionUsers = _useState4[1];
4316
- /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */
4317
-
3864
+ _useState4 = _slicedToArray(_useState3, 2),
3865
+ mentionUsers = _useState4[0],
3866
+ setMentionUsers = _useState4[1];
4318
3867
 
3868
+ /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */
4319
3869
  var _useState5 = React.useState(null),
4320
- _useState6 = _slicedToArray(_useState5, 2),
4321
- mentionSearchText = _useState6[0],
4322
- setMentionSearchText = _useState6[1];
4323
-
3870
+ _useState6 = _slicedToArray(_useState5, 2),
3871
+ mentionSearchText = _useState6[0],
3872
+ setMentionSearchText = _useState6[1];
4324
3873
  var onSelectUser = React.useCallback(function () {
4325
3874
  deleteTextFromAtToCaret();
4326
3875
  setMentionUsers([]);
4327
3876
  }, []);
4328
- /** */
4329
3877
 
3878
+ /** */
4330
3879
  var checkMentionText = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4331
3880
  var metionText, users;
4332
3881
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4333
- while (1) {
4334
- switch (_context.prev = _context.next) {
4335
- case 0:
4336
- metionText = getTextFromAtToCaret();
4337
- setMentionSearchText(metionText);
4338
-
4339
- if (!(metionText === null)) {
4340
- _context.next = 6;
4341
- break;
4342
- }
4343
-
4344
- setMentionUsers([]);
4345
- _context.next = 12;
3882
+ while (1) switch (_context.prev = _context.next) {
3883
+ case 0:
3884
+ metionText = getTextFromAtToCaret();
3885
+ setMentionSearchText(metionText);
3886
+ if (!(metionText === null)) {
3887
+ _context.next = 6;
4346
3888
  break;
4347
-
4348
- case 6:
4349
- setLoading(true);
4350
- _context.next = 9;
4351
- return searchMention(metionText);
4352
-
4353
- case 9:
4354
- users = _context.sent;
4355
- setLoading(false);
4356
- setMentionUsers(users);
4357
-
4358
- case 12:
4359
- case "end":
4360
- return _context.stop();
4361
- }
3889
+ }
3890
+ setMentionUsers([]);
3891
+ _context.next = 12;
3892
+ break;
3893
+ case 6:
3894
+ setLoading(true);
3895
+ _context.next = 9;
3896
+ return searchMention(metionText);
3897
+ case 9:
3898
+ users = _context.sent;
3899
+ setLoading(false);
3900
+ setMentionUsers(users);
3901
+ case 12:
3902
+ case "end":
3903
+ return _context.stop();
4362
3904
  }
4363
3905
  }, _callee);
4364
3906
  })), [searchMention]);
4365
- /** @type {(event: React.KeyboardEvent) => void} */
4366
3907
 
4367
- var onKeyUp = React.useCallback( /*#__PURE__*/function () {
4368
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
3908
+ /** @type {(event: React.KeyboardEvent) => void} */
3909
+ var onKeyUp = React.useCallback(function (_x) {
3910
+ return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
4369
3911
  var _getElementWithFocus;
4370
-
4371
3912
  var elementWithFocus;
4372
3913
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4373
- while (1) {
4374
- switch (_context2.prev = _context2.next) {
4375
- case 0:
4376
- if (!(typeof searchMention !== "function")) {
4377
- _context2.next = 2;
4378
- break;
4379
- }
4380
-
4381
- return _context2.abrupt("return");
4382
-
4383
- case 2:
4384
- if (event.key === "Backspace" && (_getElementWithFocus = getElementWithFocus()) !== null && _getElementWithFocus !== void 0 && _getElementWithFocus.element.parentElement.hasAttribute("data-mention-id")) {
4385
- elementWithFocus = getElementWithFocus();
4386
- elementWithFocus.element.parentElement.remove();
4387
- } else if (!["ArrowUp", "ArrowDown", "Esc", "Escape"].includes(event.key)) {
4388
- checkMentionText();
4389
- }
4390
-
4391
- case 3:
4392
- case "end":
4393
- return _context2.stop();
4394
- }
3914
+ while (1) switch (_context2.prev = _context2.next) {
3915
+ case 0:
3916
+ if (!(typeof searchMention !== "function")) {
3917
+ _context2.next = 2;
3918
+ break;
3919
+ }
3920
+ return _context2.abrupt("return");
3921
+ case 2:
3922
+ if (event.key === "Backspace" && (_getElementWithFocus = getElementWithFocus()) !== null && _getElementWithFocus !== void 0 && _getElementWithFocus.element.parentElement.hasAttribute("data-mention-id")) {
3923
+ elementWithFocus = getElementWithFocus();
3924
+ elementWithFocus.element.parentElement.remove();
3925
+ } else if (!["ArrowUp", "ArrowDown", "Esc", "Escape"].includes(event.key)) {
3926
+ checkMentionText();
3927
+ }
3928
+ case 3:
3929
+ case "end":
3930
+ return _context2.stop();
4395
3931
  }
4396
3932
  }, _callee2);
4397
- }));
4398
-
4399
- return function (_x) {
4400
- return _ref2.apply(this, arguments);
4401
- };
4402
- }(), [checkMentionText, searchMention]);
3933
+ }))).apply(this, arguments);
3934
+ }, [checkMentionText, searchMention]);
4403
3935
  var onFocus = React.useCallback(function () {
4404
3936
  checkMentionText();
4405
3937
  }, [checkMentionText]);
@@ -4432,21 +3964,18 @@ function useMention(searchMention) {
4432
3964
  /**
4433
3965
  * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref
4434
3966
  */
4435
- // eslint-disable-next-line valid-jsdoc
4436
3967
 
3968
+ // eslint-disable-next-line valid-jsdoc
4437
3969
  /** @type {React.ForwardRefRenderFunction<Ref, Props>} */
4438
-
4439
3970
  var MentionUserList = function MentionUserList(_ref, ref) {
4440
3971
  var users = _ref.users,
4441
- mentionSearchText = _ref.mentionSearchText,
4442
- onSelect = _ref.onSelect,
4443
- addEventListener = _ref.addEventListener;
4444
-
3972
+ mentionSearchText = _ref.mentionSearchText,
3973
+ onSelect = _ref.onSelect,
3974
+ addEventListener = _ref.addEventListener;
4445
3975
  var _useState = React.useState(0),
4446
- _useState2 = _slicedToArray(_useState, 2),
4447
- selectedUser = _useState2[0],
4448
- setSelectedUser = _useState2[1];
4449
-
3976
+ _useState2 = _slicedToArray(_useState, 2),
3977
+ selectedUser = _useState2[0],
3978
+ setSelectedUser = _useState2[1];
4450
3979
  React.useImperativeHandle(ref, function () {
4451
3980
  return {
4452
3981
  prevUser: function prevUser() {
@@ -4454,7 +3983,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4454
3983
  if (currentSelectedUser === 0) {
4455
3984
  return 0;
4456
3985
  }
4457
-
4458
3986
  return currentSelectedUser - 1;
4459
3987
  });
4460
3988
  },
@@ -4463,7 +3991,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4463
3991
  if (currentSelectedUser === users.length - 1) {
4464
3992
  return users.length - 1;
4465
3993
  }
4466
-
4467
3994
  return currentSelectedUser + 1;
4468
3995
  });
4469
3996
  }
@@ -4472,24 +3999,22 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4472
3999
  React.useEffect(function () {
4473
4000
  setSelectedUser(0);
4474
4001
  }, [users]);
4002
+
4475
4003
  /**
4476
4004
  *
4477
4005
  * @param {string} selectedText
4478
4006
  * @param {string} rest
4479
4007
  * @return {string}
4480
4008
  */
4481
-
4482
4009
  function getMentionSelectedNameEl(selectedText, rest) {
4483
4010
  return "<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">".concat(selectedText, "</span>").concat(rest);
4484
4011
  }
4485
- /** @type {(MentionUser & {nameHtml: string})[]} */
4486
-
4487
4012
 
4013
+ /** @type {(MentionUser & {nameHtml: string})[]} */
4488
4014
  var usersFiltered = React.useMemo(function () {
4489
4015
  var searchText = mentionSearchText ? mentionSearchText.substring(1).toLocaleLowerCase() : "";
4490
4016
  return users.map(function (user) {
4491
4017
  var nameHtml = user.name;
4492
-
4493
4018
  if (mentionSearchText && mentionSearchText.length > 1) {
4494
4019
  if (user.name.toLowerCase().startsWith(searchText)) {
4495
4020
  nameHtml = getMentionSelectedNameEl(user.name.substring(0, searchText.length), user.name.substring(searchText.length));
@@ -4499,24 +4024,22 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4499
4024
  if (name.toLocaleLowerCase().startsWith(searchText)) {
4500
4025
  return getMentionSelectedNameEl(name.substring(0, searchText.length), name.substring(searchText.length));
4501
4026
  }
4502
-
4503
4027
  return name;
4504
4028
  }).join(" ");
4505
4029
  }
4506
4030
  }
4507
-
4508
4031
  return _objectSpread2(_objectSpread2({}, user), {}, {
4509
4032
  nameHtml: nameHtml
4510
4033
  });
4511
4034
  });
4512
- }, [mentionSearchText, users]); // eslint-disable-next-line valid-jsdoc
4035
+ }, [mentionSearchText, users]);
4513
4036
 
4037
+ // eslint-disable-next-line valid-jsdoc
4514
4038
  /**
4515
4039
  *
4516
4040
  * @param {MentionUser} user
4517
4041
  * @returns {(event: React.MouseEvent) => void} event
4518
4042
  */
4519
-
4520
4043
  function handleClick(user) {
4521
4044
  return function (event) {
4522
4045
  event.stopPropagation();
@@ -4524,7 +4047,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4524
4047
  onSelect(user);
4525
4048
  };
4526
4049
  }
4527
-
4528
4050
  React.useEffect(function () {
4529
4051
  var unsubscribe = addEventListener("enter", function (event) {
4530
4052
  event.stopPropagation();
@@ -4559,7 +4081,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4559
4081
  })));
4560
4082
  }));
4561
4083
  };
4562
-
4563
4084
  var MentionUserListWithRef = /*#__PURE__*/React.forwardRef(MentionUserList);
4564
4085
  MentionUserListWithRef.propTypes = {
4565
4086
  users: t__default["default"].array.isRequired
@@ -4584,32 +4105,27 @@ MentionUserListWithRef.propTypes = {
4584
4105
  * @property {(html: string) => void} appendContent
4585
4106
  * @property {(fn: SanitizeFn) => void} addSanitizeFn
4586
4107
  */
4587
- // eslint-disable-next-line valid-jsdoc
4588
4108
 
4109
+ // eslint-disable-next-line valid-jsdoc
4589
4110
  /** @type {React.FC<Props>} */
4590
-
4591
4111
  var MentionWrapper = function MentionWrapper(_ref) {
4592
4112
  var searchMention = _ref.searchMention,
4593
- addEventListener = _ref.addEventListener,
4594
- appendContent = _ref.appendContent,
4595
- addSanitizeFn = _ref.addSanitizeFn;
4596
-
4113
+ addEventListener = _ref.addEventListener,
4114
+ appendContent = _ref.appendContent,
4115
+ addSanitizeFn = _ref.addSanitizeFn;
4597
4116
  /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */
4598
4117
  var metionUserListRef = React.useRef(null);
4599
-
4600
4118
  var _useState = React.useState(false),
4601
- _useState2 = _slicedToArray(_useState, 2),
4602
- showUserList = _useState2[0],
4603
- setShowUserList = _useState2[1];
4604
-
4119
+ _useState2 = _slicedToArray(_useState, 2),
4120
+ showUserList = _useState2[0],
4121
+ setShowUserList = _useState2[1];
4605
4122
  var _useMention = useMention(searchMention),
4606
- mentionSearchText = _useMention.mentionSearchText,
4607
- mentionUsers = _useMention.mentionUsers,
4608
- loading = _useMention.loading,
4609
- onKeyUp = _useMention.onKeyUp,
4610
- onFocus = _useMention.onFocus,
4611
- onSelectUser = _useMention.onSelectUser;
4612
-
4123
+ mentionSearchText = _useMention.mentionSearchText,
4124
+ mentionUsers = _useMention.mentionUsers,
4125
+ loading = _useMention.loading,
4126
+ onKeyUp = _useMention.onKeyUp,
4127
+ onFocus = _useMention.onFocus,
4128
+ onSelectUser = _useMention.onSelectUser;
4613
4129
  React.useEffect(function () {
4614
4130
  addSanitizeFn(function (html) {
4615
4131
  var container = document.createElement("div");
@@ -4629,7 +4145,6 @@ var MentionWrapper = function MentionWrapper(_ref) {
4629
4145
  function checkClickOutside() {
4630
4146
  setShowUserList(false);
4631
4147
  }
4632
-
4633
4148
  document.addEventListener("click", checkClickOutside);
4634
4149
  return function () {
4635
4150
  document.removeEventListener("click", checkClickOutside);
@@ -4649,13 +4164,11 @@ var MentionWrapper = function MentionWrapper(_ref) {
4649
4164
  function handleKeyDown(event) {
4650
4165
  switch (event.key) {
4651
4166
  case "Esc": // IE/Edge specific value
4652
-
4653
4167
  case "Escape":
4654
4168
  setShowUserList(false);
4655
4169
  break;
4656
4170
  }
4657
4171
  }
4658
-
4659
4172
  var unsubscribe = addEventListener("keyDown", handleKeyDown);
4660
4173
  return function () {
4661
4174
  unsubscribe();
@@ -4685,16 +4198,15 @@ var MentionWrapper = function MentionWrapper(_ref) {
4685
4198
  };
4686
4199
  }
4687
4200
  }, [addEventListener, showUserList]);
4201
+
4688
4202
  /**
4689
4203
  *
4690
4204
  * @param {MetionUser} user
4691
4205
  */
4692
-
4693
4206
  function handleSelect(user) {
4694
4207
  onSelectUser();
4695
4208
  appendContent("<span class=\"react-input-emoji--mention--text\" data-mention-id=\"".concat(user.id, "\" data-mention-name=\"").concat(user.name, "\">@").concat(user.name, "</span> "));
4696
4209
  }
4697
-
4698
4210
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, loading ? /*#__PURE__*/React__default["default"].createElement("div", {
4699
4211
  className: "react-input-emoji--mention--container"
4700
4212
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -4716,8 +4228,8 @@ var MentionWrapper = function MentionWrapper(_ref) {
4716
4228
  };
4717
4229
 
4718
4230
  // @ts-check
4719
- // eslint-disable-next-line valid-jsdoc
4720
4231
 
4232
+ // eslint-disable-next-line valid-jsdoc
4721
4233
  /**
4722
4234
  * @template T
4723
4235
  * @returns {import('../types/types').ListenerObj<T>}
@@ -4739,22 +4251,20 @@ function createObserver() {
4739
4251
  return listener(event);
4740
4252
  });
4741
4253
  },
4742
-
4743
4254
  get currentListerners() {
4744
4255
  return listeners;
4745
4256
  }
4746
-
4747
4257
  };
4748
4258
  }
4749
4259
 
4750
4260
  // @ts-check
4261
+
4751
4262
  /**
4752
4263
  * @typedef {import('../types/types').TextInputListeners} TextInputListeners
4753
4264
  */
4754
- // eslint-disable-next-line valid-jsdoc
4755
4265
 
4266
+ // eslint-disable-next-line valid-jsdoc
4756
4267
  /** */
4757
-
4758
4268
  function useEventListeners() {
4759
4269
  /** @type {TextInputListeners} */
4760
4270
  var listeners = React.useMemo(function () {
@@ -4768,11 +4278,11 @@ function useEventListeners() {
4768
4278
  blur: createObserver()
4769
4279
  };
4770
4280
  }, []);
4281
+
4771
4282
  /**
4772
4283
  * @template {keyof TextInputListeners} T, K
4773
4284
  * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}
4774
4285
  */
4775
-
4776
4286
  var addEventListener = React.useCallback(function (event, fn) {
4777
4287
  return listeners[event].subscribe(fn);
4778
4288
  }, [listeners]);
@@ -4783,23 +4293,23 @@ function useEventListeners() {
4783
4293
  }
4784
4294
 
4785
4295
  // @ts-check
4296
+
4786
4297
  /**
4787
4298
  * @typedef {import('../types/types').PolluteFn} PolluteFn
4788
4299
  */
4789
- // eslint-disable-next-line valid-jsdoc
4790
4300
 
4301
+ // eslint-disable-next-line valid-jsdoc
4791
4302
  /** */
4792
-
4793
4303
  function usePollute() {
4794
4304
  /** @type {React.MutableRefObject<PolluteFn[]>} */
4795
4305
  var polluteFnsRef = React.useRef([]);
4796
- /** @type {(fn: PolluteFn) => void} */
4797
4306
 
4307
+ /** @type {(fn: PolluteFn) => void} */
4798
4308
  var addPolluteFn = React.useCallback(function (fn) {
4799
4309
  polluteFnsRef.current.push(fn);
4800
4310
  }, []);
4801
- /** @type {(html: string) => string} */
4802
4311
 
4312
+ /** @type {(html: string) => string} */
4803
4313
  var pollute = React.useCallback(function (text) {
4804
4314
  var result = polluteFnsRef.current.reduce(function (acc, fn) {
4805
4315
  return fn(acc);
@@ -4813,6 +4323,7 @@ function usePollute() {
4813
4323
  }
4814
4324
 
4815
4325
  // @ts-check
4326
+
4816
4327
  /**
4817
4328
  * @typedef {import('./types/types').MentionUser} MetionUser
4818
4329
  */
@@ -4849,6 +4360,7 @@ function usePollute() {
4849
4360
  * @property {import('./types/types').Languages=} language
4850
4361
  * @property {(text: string) => Promise<MetionUser[]>=} searchMention
4851
4362
  * @property {HTMLDivElement=} buttonElement
4363
+ * @property {React.MutableRefObject=} buttonRef
4852
4364
  */
4853
4365
 
4854
4366
  /**
@@ -4857,50 +4369,46 @@ function usePollute() {
4857
4369
  * @param {React.Ref<any>} ref
4858
4370
  * @return {JSX.Element}
4859
4371
  */
4860
-
4861
4372
  function InputEmoji(props, ref) {
4862
4373
  var onChange = props.onChange,
4863
- onEnter = props.onEnter,
4864
- shouldReturn = props.shouldReturn,
4865
- onResize = props.onResize,
4866
- onClick = props.onClick,
4867
- onFocus = props.onFocus,
4868
- onBlur = props.onBlur,
4869
- onKeyDown = props.onKeyDown,
4870
- theme = props.theme,
4871
- cleanOnEnter = props.cleanOnEnter,
4872
- placeholder = props.placeholder,
4873
- maxLength = props.maxLength,
4874
- keepOpened = props.keepOpened,
4875
- inputClass = props.inputClass,
4876
- disableRecent = props.disableRecent,
4877
- tabIndex = props.tabIndex,
4878
- value = props.value,
4879
- customEmojis = props.customEmojis,
4880
- language = props.language,
4881
- searchMention = props.searchMention,
4882
- buttonElement = props.buttonElement,
4883
- borderRadius = props.borderRadius,
4884
- borderColor = props.borderColor,
4885
- fontSize = props.fontSize,
4886
- fontFamily = props.fontFamily;
4887
- /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
4374
+ onEnter = props.onEnter,
4375
+ shouldReturn = props.shouldReturn,
4376
+ onResize = props.onResize,
4377
+ onClick = props.onClick,
4378
+ onFocus = props.onFocus,
4379
+ onBlur = props.onBlur,
4380
+ onKeyDown = props.onKeyDown,
4381
+ theme = props.theme,
4382
+ cleanOnEnter = props.cleanOnEnter,
4383
+ placeholder = props.placeholder,
4384
+ maxLength = props.maxLength,
4385
+ keepOpened = props.keepOpened,
4386
+ inputClass = props.inputClass,
4387
+ disableRecent = props.disableRecent,
4388
+ tabIndex = props.tabIndex,
4389
+ value = props.value,
4390
+ customEmojis = props.customEmojis,
4391
+ language = props.language,
4392
+ searchMention = props.searchMention,
4393
+ buttonElement = props.buttonElement,
4394
+ buttonRef = props.buttonRef,
4395
+ borderRadius = props.borderRadius,
4396
+ borderColor = props.borderColor,
4397
+ fontSize = props.fontSize,
4398
+ fontFamily = props.fontFamily;
4888
4399
 
4400
+ /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
4889
4401
  var textInputRef = React.useRef(null);
4890
-
4891
4402
  var _useEventListeners = useEventListeners(),
4892
- addEventListener = _useEventListeners.addEventListener,
4893
- listeners = _useEventListeners.listeners;
4894
-
4403
+ addEventListener = _useEventListeners.addEventListener,
4404
+ listeners = _useEventListeners.listeners;
4895
4405
  var _useSanitize = useSanitize(props.shouldReturn),
4896
- addSanitizeFn = _useSanitize.addSanitizeFn,
4897
- sanitize = _useSanitize.sanitize,
4898
- sanitizedTextRef = _useSanitize.sanitizedTextRef;
4899
-
4406
+ addSanitizeFn = _useSanitize.addSanitizeFn,
4407
+ sanitize = _useSanitize.sanitize,
4408
+ sanitizedTextRef = _useSanitize.sanitizedTextRef;
4900
4409
  var _usePollute = usePollute(),
4901
- addPolluteFn = _usePollute.addPolluteFn,
4902
- pollute = _usePollute.pollute;
4903
-
4410
+ addPolluteFn = _usePollute.addPolluteFn,
4411
+ pollute = _usePollute.pollute;
4904
4412
  var updateHTML = React.useCallback(function () {
4905
4413
  var nextValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
4906
4414
  if (textInputRef.current === null) return;
@@ -4926,7 +4434,9 @@ function InputEmoji(props, ref) {
4926
4434
  if (sanitizedTextRef.current !== value) {
4927
4435
  setValue(value);
4928
4436
  }
4929
- }, [sanitizedTextRef, setValue, value]); // useEffect(() => {
4437
+ }, [sanitizedTextRef, setValue, value]);
4438
+
4439
+ // useEffect(() => {
4930
4440
  // updateHTML();
4931
4441
  // }, [updateHTML]);
4932
4442
 
@@ -4940,34 +4450,26 @@ function InputEmoji(props, ref) {
4940
4450
  if (typeof maxLength !== "undefined" && event.key !== "Backspace" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
4941
4451
  event.preventDefault();
4942
4452
  }
4943
-
4944
4453
  if (event.key === "Enter" && textInputRef.current) {
4945
4454
  event.preventDefault();
4946
4455
  var text = sanitize(textInputRef.current.html);
4947
4456
  emitChange(sanitizedTextRef.current);
4948
-
4949
4457
  if (typeof onEnter === "function" && listeners.enter.currentListerners.length === 0) {
4950
4458
  onEnter(text);
4951
4459
  }
4952
-
4953
4460
  if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {
4954
4461
  updateHTML("");
4955
4462
  }
4956
-
4957
4463
  if (typeof onKeyDown === "function") {
4958
4464
  onKeyDown(event.nativeEvent);
4959
4465
  }
4960
-
4961
4466
  return false;
4962
4467
  }
4963
-
4964
4468
  if (typeof onKeyDown === "function") {
4965
4469
  onKeyDown(event.nativeEvent);
4966
4470
  }
4967
-
4968
4471
  return true;
4969
4472
  }
4970
-
4971
4473
  var unsubscribe = addEventListener("keyDown", handleKeydown);
4972
4474
  return function () {
4973
4475
  unsubscribe();
@@ -4979,12 +4481,10 @@ function InputEmoji(props, ref) {
4979
4481
  if (typeof onClick === "function") {
4980
4482
  onClick();
4981
4483
  }
4982
-
4983
4484
  if (typeof onFocus === "function") {
4984
4485
  onFocus();
4985
4486
  }
4986
4487
  }
4987
-
4988
4488
  var unsubscribe = addEventListener("focus", handleFocus);
4989
4489
  return function () {
4990
4490
  unsubscribe();
@@ -4997,82 +4497,70 @@ function InputEmoji(props, ref) {
4997
4497
  onBlur();
4998
4498
  }
4999
4499
  }
5000
-
5001
4500
  var unsubscribe = addEventListener("blur", handleBlur);
5002
4501
  return function () {
5003
4502
  unsubscribe();
5004
4503
  };
5005
4504
  }, [addEventListener, onBlur]);
4505
+
5006
4506
  /**
5007
4507
  *
5008
4508
  * @param {string} html
5009
4509
  */
5010
-
5011
4510
  function handleTextInputChange(html) {
5012
4511
  sanitize(html);
5013
-
5014
4512
  if (value !== sanitizedTextRef.current) {
5015
4513
  emitChange(sanitizedTextRef.current);
5016
4514
  }
5017
4515
  }
4516
+
5018
4517
  /**
5019
4518
  *
5020
4519
  * @param {string} html
5021
4520
  */
5022
-
5023
-
5024
4521
  function appendContent(html) {
5025
4522
  if (typeof maxLength !== "undefined" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
5026
4523
  return;
5027
4524
  }
5028
-
5029
4525
  if (textInputRef.current !== null) {
5030
4526
  textInputRef.current.appendContent(html);
5031
4527
  }
5032
4528
  }
4529
+
5033
4530
  /**
5034
4531
  * Handle copy of current selected text
5035
4532
  * @param {React.ClipboardEvent} event
5036
4533
  */
5037
-
5038
-
5039
4534
  function handleCopy(event) {
5040
4535
  var selection = window.getSelection();
5041
-
5042
4536
  if (selection !== null) {
5043
4537
  var selectedText = '';
5044
-
5045
4538
  if (selection.anchorNode && selection.anchorNode.nodeType === Node.ELEMENT_NODE) {
5046
4539
  // @ts-ignore
5047
4540
  selectedText = selection.anchorNode.innerHTML;
5048
4541
  } else if (selection.anchorNode && selection.anchorNode.nodeType === Node.TEXT_NODE) {
5049
4542
  var _selection$anchorNode;
5050
-
5051
4543
  selectedText = (_selection$anchorNode = selection.anchorNode.textContent) !== null && _selection$anchorNode !== void 0 ? _selection$anchorNode : '';
5052
4544
  }
5053
-
5054
4545
  var text = replaceAllTextEmojiToString(selectedText);
5055
4546
  event.clipboardData.setData("text", text);
5056
4547
  event.preventDefault();
5057
4548
  }
5058
4549
  }
4550
+
5059
4551
  /**
5060
4552
  * Handle past on input
5061
4553
  * @param {React.ClipboardEvent} event
5062
4554
  */
5063
-
5064
-
5065
4555
  function handlePaste(event) {
5066
4556
  event.preventDefault();
5067
4557
  var content;
5068
-
5069
4558
  if (event.clipboardData) {
5070
4559
  content = event.clipboardData.getData("text/plain");
5071
4560
  content = pollute(content);
5072
4561
  document.execCommand("insertHTML", false, content);
5073
4562
  }
5074
4563
  }
5075
-
5076
4564
  return /*#__PURE__*/React__default["default"].createElement("div", {
5077
4565
  className: "react-emoji"
5078
4566
  }, /*#__PURE__*/React__default["default"].createElement(MentionWrapper, {
@@ -5111,15 +4599,13 @@ function InputEmoji(props, ref) {
5111
4599
  addPolluteFn: addPolluteFn,
5112
4600
  appendContent: appendContent,
5113
4601
  buttonElement: buttonElement,
4602
+ buttonRef: buttonRef,
5114
4603
  language: language
5115
4604
  }));
5116
4605
  }
5117
-
5118
4606
  var InputEmojiWithRef = /*#__PURE__*/React.forwardRef(InputEmoji);
5119
4607
  InputEmojiWithRef.defaultProps = {
5120
- theme:
5121
- /** @type {const} */
5122
- "auto",
4608
+ theme: /** @type {const} */"auto",
5123
4609
  height: 30,
5124
4610
  placeholder: "Type a message",
5125
4611
  borderRadius: 21,