1function Xe(t) { 2 if (typeof t != "string" || !t) 3 throw new Error("expected a non-empty string, got: " + t); 4} 5function tt(t) { 6 if (typeof t != "number") 7 throw new Error("expected a number, got: " + t); 8} 9const fn = 1, hn = 1, de = "emoji", Ae = "keyvalue", ht = "favorites", mn = "tokens", Ut = "tokens", pn = "unicode", Pt = "count", gn = "group", _n = "order", Kt = "group-order", at = "eTag", $e = "url", yt = "skinTone", Oe = "readonly", mt = "readwrite", Gt = "skinUnicodes", bn = "skinUnicodes", yn = "https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json", kn = "en"; 10function vn(t, e) { 11 const n = /* @__PURE__ */ new Set(), o = []; 12 for (const r of t) { 13 const s = e(r); 14 n.has(s) || (n.add(s), o.push(r)); 15 } 16 return o; 17} 18function kt(t) { 19 return vn(t, (e) => e.unicode); 20} 21function wn(t) { 22 function e(n, o, r) { 23 const s = o ? t.createObjectStore(n, { keyPath: o }) : t.createObjectStore(n); 24 if (r) 25 for (const [c, [m, u]] of Object.entries(r)) 26 s.createIndex(c, m, { multiEntry: u }); 27 return s; 28 } 29 e(Ae), e( 30 de, 31 /* keyPath */ 32 pn, 33 { 34 [Ut]: [ 35 mn, 36 /* multiEntry */ 37 !0 38 ], 39 [Kt]: [[gn, _n]], 40 [Gt]: [ 41 bn, 42 /* multiEntry */ 43 !0 44 ] 45 } 46 ), e(ht, void 0, { 47 [Pt]: [""] 48 }); 49} 50const lt = {}, Je = {}, xe = {}; 51function Wt(t, e, n) { 52 n.onerror = () => e(n.error), n.onblocked = () => e(new Error("IDB blocked")), n.onsuccess = () => t(n.result); 53} 54async function En(t) { 55 const e = await new Promise((n, o) => { 56 const r = indexedDB.open(t, fn); 57 lt[t] = r, r.onupgradeneeded = (s) => { 58 s.oldVersion < hn && wn(r.result); 59 }, Wt(n, o, r); 60 }); 61 return e.onclose = () => pt(t), e; 62} 63function jn(t) { 64 return Je[t] || (Je[t] = En(t)), Je[t]; 65} 66function oe(t, e, n, o) { 67 return new Promise((r, s) => { 68 const c = t.transaction(e, n, { durability: "relaxed" }), m = typeof e == "string" ? c.objectStore(e) : e.map((d) => c.objectStore(d)); 69 let u; 70 o(m, c, (d) => { 71 u = d; 72 }), c.oncomplete = () => r(u), c.onerror = () => s(c.error); 73 }); 74} 75function pt(t) { 76 const e = lt[t], n = e && e.result; 77 if (n) { 78 n.close(); 79 const o = xe[t]; 80 if (o) 81 for (const r of o) 82 r(); 83 } 84 delete lt[t], delete Je[t], delete xe[t]; 85} 86function Tn(t) { 87 return new Promise((e, n) => { 88 pt(t); 89 const o = indexedDB.deleteDatabase(t); 90 Wt(e, n, o); 91 }); 92} 93function Sn(t, e) { 94 let n = xe[t]; 95 n || (n = xe[t] = []), n.push(e); 96} 97const Cn = /* @__PURE__ */ new Set([ 98 ":D", 99 "XD", 100 ":'D", 101 "O:)", 102 ":X", 103 ":P", 104 ";P", 105 "XP", 106 ":L", 107 ":Z", 108 ":j", 109 "8D", 110 "XO", 111 "8)", 112 ":B", 113 ":O", 114 ":S", 115 ":'o", 116 "Dx", 117 "X(", 118 "D:", 119 ":C", 120 ">0)", 121 ":3", 122 "</3", 123 "<3", 124 "\\M/", 125 ":E", 126 "8#" 127]); 128function De(t) { 129 return t.split(/[\s_]+/).map((e) => !e.match(/\w/) || Cn.has(e) ? e.toLowerCase() : e.replace(/[)(:,]/g, "").replace(/â/g, "'").toLowerCase()).filter(Boolean); 130} 131const Dn = 2; 132function Vt(t) { 133 return t.filter(Boolean).map((e) => e.toLowerCase()).filter((e) => e.length >= Dn); 134} 135function Ln(t) { 136 return t.map(({ annotation: n, emoticon: o, group: r, order: s, shortcodes: c, skins: m, tags: u, emoji: d, version: f }) => { 137 const g = [...new Set( 138 Vt([ 139 ...(c || []).map(De).flat(), 140 ...u.map(De).flat(), 141 ...De(n), 142 o 143 ]) 144 )].sort(), h = { 145 annotation: n, 146 group: r, 147 order: s, 148 tags: u, 149 tokens: g, 150 unicode: d, 151 version: f 152 }; 153 if (o && (h.emoticon = o), c && (h.shortcodes = c), m) { 154 h.skinTones = [], h.skinUnicodes = [], h.skinVersions = []; 155 for (const { tone: _, emoji: w, version: v } of m) 156 h.skinTones.push(_), h.skinUnicodes.push(w), h.skinVersions.push(v); 157 } 158 return h; 159 }); 160} 161function Ht(t, e, n, o) { 162 t[e](n).onsuccess = (r) => o && o(r.target.result); 163} 164function ue(t, e, n) { 165 Ht(t, "get", e, n); 166} 167function Xt(t, e, n) { 168 Ht(t, "getAll", e, n); 169} 170function gt(t) { 171 t.commit && t.commit(); 172} 173function An(t, e) { 174 let n = t[0]; 175 for (let o = 1; o < t.length; o++) { 176 const r = t[o]; 177 e(n) > e(r) && (n = r); 178 } 179 return n; 180} 181function Yt(t, e) { 182 const n = An(t, (r) => r.length), o = []; 183 for (const r of n) 184 t.some((s) => s.findIndex((c) => e(c) === e(r)) === -1) || o.push(r); 185 return o; 186} 187async function In(t) { 188 return !await _t(t, Ae, $e); 189} 190async function On(t, e, n) { 191 const [o, r] = await Promise.all([at, $e].map((s) => _t(t, Ae, s))); 192 return o === n && r === e; 193} 194async function Rn(t, e) { 195 return oe(t, de, Oe, (o, r, s) => {
196 let c; 197 const m = () => { 198 o.getAll(c && IDBKeyRange.lowerBound(c, !0), 50).onsuccess = (u) => { 199 const d = u.target.result; 200 for (const f of d) 201 if (c = f.unicode, e(f)) 202 return s(f); 203 if (d.length < 50) 204 return s(); 205 m(); 206 }; 207 }; 208 m(); 209 }); 210} 211async function Zt(t, e, n, o) { 212 try { 213 const r = Ln(e); 214 await oe(t, [de, Ae], mt, ([s, c], m) => { 215 let u, d, f = 0; 216 function g() { 217 ++f === 2 && h(); 218 } 219 function h() { 220 if (!(u === o && d === n)) { 221 s.clear(); 222 for (const _ of r) 223 s.put(_); 224 c.put(o, at), c.put(n, $e), gt(m); 225 } 226 } 227 ue(c, at, (_) => { 228 u = _, g(); 229 }), ue(c, $e, (_) => { 230 d = _, g(); 231 }); 232 }); 233 } finally { 234 } 235} 236async function Bn(t, e) { 237 return oe(t, de, Oe, (n, o, r) => { 238 const s = IDBKeyRange.bound([e, 0], [e + 1, 0], !1, !0); 239 Xt(n.index(Kt), s, r); 240 }); 241} 242async function qt(t, e) { 243 const n = Vt(De(e)); 244 return n.length ? oe(t, de, Oe, (o, r, s) => { 245 const c = [], m = () => { 246 c.length === n.length && u(); 247 }, u = () => { 248 const d = Yt(c, (f) => f.unicode); 249 s(d.sort((f, g) => f.order < g.order ? -1 : 1)); 250 }; 251 for (let d = 0; d < n.length; d++) { 252 const f = n[d], g = d === n.length - 1 ? IDBKeyRange.bound(f, f + "ï¿¿", !1, !0) : IDBKeyRange.only(f); 253 Xt(o.index(Ut), g, (h) => { 254 c.push(h), m(); 255 }); 256 } 257 }) : []; 258} 259async function zn(t, e) { 260 const n = await qt(t, e); 261 return n.length ? n.filter((o) => (o.shortcodes || []).map((s) => s.toLowerCase()).includes(e.toLowerCase()))[0] || null : await Rn(t, (r) => (r.shortcodes || []).includes(e.toLowerCase())) || null; 262} 263async function Mn(t, e) { 264 return oe(t, de, Oe, (n, o, r) => ue(n, e, (s) => { 265 if (s) 266 return r(s); 267 ue(n.index(Gt), e, (c) => r(c || null)); 268 })); 269} 270function _t(t, e, n) { 271 return oe(t, e, Oe, (o, r, s) => ue(o, n, s)); 272} 273function Fn(t, e, n, o) { 274 return oe(t, e, mt, (r, s) => { 275 r.put(o, n), gt(s); 276 }); 277} 278function Nn(t, e) { 279 return oe(t, ht, mt, (n, o) => ue(n, e, (r) => { 280 n.put((r || 0) + 1, e), gt(o); 281 })); 282} 283function Un(t, e, n) { 284 return n === 0 ? [] : oe(t, [ht, de], Oe, ([o, r], s, c) => { 285 const m = []; 286 o.index(Pt).openCursor(void 0, "prev").onsuccess = (u) => { 287 const d = u.target.result; 288 if (!d) 289 return c(m); 290 function f(_) { 291 if (m.push(_), m.length === n) 292 return c(m); 293 d.continue(); 294 } 295 const g = d.primaryKey, h = e.byName(g); 296 if (h) 297 return f(h); 298 ue(r, g, (_) => { 299 if (_) 300 return f(_); 301 d.continue(); 302 }); 303 }; 304 }); 305} 306const Ye = ""; 307function Pn(t, e) { 308 const n = /* @__PURE__ */ new Map(); 309 for (const r of t) { 310 const s = e(r); 311 for (const c of s) { 312 let m = n; 313 for (let d = 0; d < c.length; d++) { 314 const f = c.charAt(d); 315 let g = m.get(f); 316 g || (g = /* @__PURE__ */ new Map(), m.set(f, g)), m = g; 317 } 318 let u = m.get(Ye); 319 u || (u = [], m.set(Ye, u)), u.push(r); 320 } 321 } 322 return (r, s) => {
323 let c = n; 324 for (let d = 0; d < r.length; d++) { 325 const f = r.charAt(d), g = c.get(f); 326 if (g) 327 c = g; 328 else 329 return []; 330 } 331 if (s) 332 return c.get(Ye) || []; 333 const m = [], u = [c]; 334 for (; u.length; ) { 335 const f = [...u.shift().entries()].sort((g, h) => g[0] < h[0] ? -1 : 1); 336 for (const [g, h] of f) 337 g === Ye ? m.push(...h) : u.push(h); 338 } 339 return m; 340 }; 341} 342const Kn = [ 343 "name", 344 "url" 345]; 346function Gn(t) { 347 const e = t && Array.isArray(t), n = e && t.length && (!t[0] || Kn.some((o) => !(o in t[0]))); 348 if (!e || n) 349 throw new Error("Custom emojis are in the wrong format"); 350} 351function vt(t) { 352 Gn(t); 353 const e = (h, _) => h.name.toLowerCase() < _.name.toLowerCase() ? -1 : 1, n = t.sort(e), r = Pn(t, (h) => [...new Set((h.shortcodes || []).map((_) => De(_)).flat())]), s = (h) => r(h, !0), c = (h) => r(h, !1), m = (h) => { 354 const _ = De(h), w = _.map((v, k) => (k < _.length - 1 ? s : c)(v)); 355 return Yt(w, (v) => v.name).sort(e); 356 }, u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(); 357 for (const h of t) { 358 d.set(h.name.toLowerCase(), h); 359 for (const _ of h.shortcodes || []) 360 u.set(_.toLowerCase(), h); 361 } 362 return { 363 all: n, 364 search: m, 365 byShortcode: (h) => u.get(h.toLowerCase()), 366 byName: (h) => d.get(h.toLowerCase()) 367 }; 368} 369const Wn = typeof wrappedJSObject < "u"; 370function Fe(t) { 371 if (!t) 372 return t; 373 if (Wn && (t = structuredClone(t)), delete t.tokens, t.skinTone
373s) { 374 const e = t.skinTones.length; 375 t.skins = Array(e); 376 for (let n = 0; n < e; n++) 377 t.skins[n] = { 378 tone: t.skinTones[n], 379 unicode: t.skinUnicodes[n], 380 version: t.skinVersions[n] 381 }; 382 delete t.skinTones, delete t.skinUnicodes, delete t.skinVersions; 383 } 384 return t; 385} 386function Jt(t) { 387 t || console.warn("emoji-picker-element is more efficient if the dataSource server exposes an ETag header."); 388} 389const Vn = [ 390 "annotation", 391 "emoji", 392 "group", 393 "order", 394 "tags", 395 "version" 396]; 397function Hn(t) { 398 if (!t || !Array.isArray(t) || !t[0] || typeof t[0] != "object" || Vn.some((e) => !(e in t[0]))) 399 throw new Error("Emoji data is in the wrong format"); 400} 401function Qt(t, e) { 402 if (Math.floor(t.status / 100) !== 2) 403 throw new Error("Failed to fetch: " + e + ": " + t.status); 404} 405async function Xn(t) { 406 const e = await fetch(t, { method: "HEAD" }); 407 Qt(e, t); 408 const n = e.headers.get("etag"); 409 return Jt(n), n; 410} 411async function ct(t) { 412 const e = await fetch(t); 413 Qt(e, t); 414 const n = e.headers.get("etag"); 415 Jt(n); 416 const o = await e.json(); 417 return Hn(o), [n, o]; 418} 419function Yn(t) { 420 for (var e = "", n = new Uint8Array(t), o = n.byteLength, r = -1; ++r < o; ) 421 e += String.fromCharCode(n[r]); 422 return e; 423} 424function Zn(t) { 425 for (var e = t.length, n = new ArrayBuffer(e), o = new Uint8Array(n), r = -1; ++r < e; ) 426 o[r] = t.charCodeAt(r); 427 return n; 428} 429async function $t(t) { 430 const e = JSON.stringify(t), n = Zn(e), o = await crypto.subtle.digest("SHA-1", n), r = Yn(o); 431 return btoa(r); 432} 433async function qn(t, e) { 434 let n, o = await Xn(e); 435 if (!o) { 436 const r = await ct(e); 437 o = r[0], n = r[1], o || (o = await $t(n)); 438 } 439 await On(t, e, o) || (n || (n = (await ct(e))[1]), await Zt(t, n, e, o)); 440} 441async function Jn(t, e) { 442 let [n, o] = await ct(e); 443 n || (n = await $t(o)), await Zt(t, o, e, n); 444} 445class Qn { 446 constructor({ dataSource: e = yn, locale: n = kn, customEmoji: o = [] } = {}) { 447 this.dataSource = e, this.locale = n, this._dbName = `emoji-picker-element-${this.locale}`, this._db = void 0, this._lazyUpdate = void 0, this._custom = vt(o), this._clear = this._clear.bind(this), this._ready = this._init(); 448 } 449 async _init() { 450 const e = this._db = await jn(this._dbName); 451 Sn(this._dbName, this._clear); 452 const n = this.dataSource; 453 await In(e) ? await Jn(e, n) : this._lazyUpdate = qn(e, n); 454 } 455 async ready() { 456 const e = async () => (this._ready || (this._ready = this._init()), this._ready); 457 await e(), this._db || await e(); 458 } 459 async getEmojiByGroup(e) { 460 return tt(e), await this.ready(), kt(await Bn(this._db, e)).map(Fe); 461 } 462 async getEmojiBySearchQuery(e) { 463 Xe(e), await this.ready(); 464 const n = this._custom.search(e), o = kt(await qt(this._db, e)).map(Fe); 465 return [ 466 ...n, 467 ...o 468 ]; 469 } 470 async getEmojiByShortcode(e) { 471 Xe(e), await this.ready(); 472 const n = this._custom.byShortcode(e); 473 return n || Fe(await zn(this._db, e)); 474 } 475 async getEmojiByUnicodeOrName(e) { 476 Xe(e), await this.ready(); 477 const n = this._custom.byName(e); 478 return n || Fe(await Mn(this._db, e)); 479 } 480 async getPreferredSkinTone() { 481 return await this.ready(), await _t(this._db, Ae, yt) || 0; 482 } 483 async setPreferredSkinTone(e) { 484 return tt(e), await this.ready(), Fn(this._db, Ae, yt, e); 485 } 486 async incrementFavoriteEmojiCount(e) { 487 return Xe(e), await this.ready(), Nn(this._db, e); 488 } 489 async getTopFavoriteEmoji(e) { 490 return tt(e), await this.ready(), (await Un(this._db, this._custom, e)).map(Fe); 491 } 492 set customEmoji(e) { 493 this._custom = vt(e); 494 } 495 get customEmoji() { 496 return this._custom.all; 497 } 498 async _shutdown() { 499 await this.ready(); 500 try { 501 await this._lazyUpdate; 502 } catch { 503 } 504 } 505 // clear references to IDB, e.g. during a close event 506 _clear() { 507 this._db = this._ready = this._lazyUpdate = void 0; 508 } 509 async close() { 510 await this._shutdown(), await pt(this._dbName); 511 } 512 async delete() { 513 await this._shutdown(), await Tn(this._dbName); 514 } 515} 516function Ie() { 517} 518function xt(t) { 519 return t(); 520} 521function wt() { 522 return /* @__PURE__ */ Object.create(null); 523} 524function Re(t) { 525 t.forEach(xt); 526} 527function bt(t) { 528 return typeof t == "function"; 529} 530function $n(t, e) { 531 return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function"; 532} 533let Ze; 534function et(t, e) { 535 return Ze || (Ze = document.createElement("a")), Ze.href = e, t === Ze.href; 536} 537function xn(t) { 538 return Object.keys(t).length === 0; 539} 540function eo(t) { 541 return t && bt(t.destroy) ? t.destroy : Ie; 542} 543const to = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : global; 544function C(t, e) { 545 t.appendChild(e); 546} 547function q(t, e, n) { 548 t.insertBefore(e, n || null); 549} 550function J(t) { 551 t.parentNode && t.parentNode.removeChild(t); 552} 553function S(t) { 554 return document.createElement(t); 555} 556function x(t) { 557 return document.createTextNode(t); 558} 559function Z(t, e, n, o) { 560 return t.addEventListener(e, n, o), () => t.removeEventListener(e, n, o); 561} 562function i(t, e, n) { 563 n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n); 564} 565function ee(t, e) { 566 e = "" + e, t.data !== e && (t.data = e); 567} 568function Et(t, e) { 569 t.value = e ?? ""; 570} 571function re(t, e, n, o) { 572 n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, o ? "important" : ""); 573} 574let Ge; 575function Ke(t) { 576 Ge = t; 577} 578function no() { 579 if (!Ge) 580 throw new Error("Function called outside component initialization"); 581 return Ge; 582} 583function oo(t) { 584 no().$$.on_mount.push(t); 585} 586const Se = [], Ce = []; 587let Le = []; 588const jt = [], io = /* @__PURE__ */ Promise.resolve(); 589let ut = !1; 590function ro() { 591 ut || (ut = !0, io.then(en)); 592} 593function dt(t) { 594 Le.push(t); 595} 596const nt = /* @__PURE__ */ new Set(); 597let Te = 0; 598function en() { 599 if (Te !== 0) 600 return; 601 const t = Ge; 602 do { 603 try { 604 for (; Te < Se.length; ) { 605 const e = Se[Te]; 606 Te++, Ke(e), so(e.$$); 607 } 608 } catch (e) { 609 throw Se.length = 0, Te = 0, e; 610 } 611 for (Ke(null), Se.length = 0, Te = 0; Ce.length; ) 612 Ce.pop()(); 613 for (let e = 0; e < Le.length; e += 1) { 614 const n = Le[e]; 615 nt.has(n) || (nt.add(n), n()); 616 } 617 Le.length = 0; 618 } while (Se.length); 619 for (; jt.length; ) 620 jt.pop()(); 621 ut = !1, nt.clear(), Ke(t); 622} 623function so(t) { 624 if (t.fragment !== null) {
vendor: 2,985 bytes, lines 625-719
625 t.update(), Re(t.before_update); 626 const e = t.dirty; 627 t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(dt); 628 } 629} 630function ao(t) { 631 const e = [], n = []; 632 Le.forEach((o) => t.indexOf(o) === -1 ? e.push(o) : n.push(o)), n.forEach((o) => o()), Le = e; 633} 634const lo = /* @__PURE__ */ new Set(); 635function co(t, e) { 636 t && t.i && (lo.delete(t), t.i(e)); 637} 638function Ne(t, e) { 639 t.d(1), e.delete(t.key); 640} 641function Ue(t, e, n, o, r, s, c, m, u, d, f, g) { 642 let h = t.length, _ = s.length, w = h; 643 const v = {}; 644 for (; w--; ) 645 v[t[w].key] = w; 646 const k = [], L = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), F = []; 647 for (w = _; w--; ) { 648 const y = g(r, s, w), T = n(y); 649 let R = c.get(T); 650 R ? o && F.push(() => R.p(y, e)) : (R = d(T, y), R.c()), L.set(T, k[w] = R), T in v && A.set(T, Math.abs(w - v[T])); 651 } 652 const I = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Set(); 653 function G(y) { 654 co(y, 1), y.m(m, f), c.set(y.key, y), f = y.first, _--; 655 } 656 for (; h && _; ) { 657 const y = k[_ - 1], T = t[h - 1], R = y.key, W = T.key; 658 y === T ? (f = y.first, h--, _--) : L.has(W) ? !c.has(R) || I.has(R) ? G(y) : V.has(W) ? h-- : A.get(R) > A.get(W) ? (V.add(R), G(y)) : (I.add(W), h--) : (u(T, c), h--); 659 } 660 for (; h--; ) { 661 const y = t[h]; 662 L.has(y.key) || u(y, c); 663 } 664 for (; _; ) 665 G(k[_ - 1]); 666 return Re(F), k; 667} 668function uo(t, e, n, o) { 669 const { fragment: r, after_update: s } = t.$$; 670 r && r.m(e, n), o || dt(() => { 671 const c = t.$$.on_mount.map(xt).filter(bt); 672 t.$$.on_destroy ? t.$$.on_destroy.push(...c) : Re(c), t.$$.on_mount = []; 673 }), s.forEach(dt); 674} 675function fo(t, e) { 676 const n = t.$$; 677 n.fragment !== null && (ao(n.after_update), Re(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []); 678} 679function ho(t, e) { 680 t.$$.dirty[0] === -1 && (Se.push(t), ro(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31; 681} 682function mo(t, e, n, o, r, s, c, m = [-1]) { 683 const u = Ge; 684 Ke(t); 685 const d = t.$$ = { 686 fragment: null, 687 ctx: [], 688 // state 689 props: s, 690 update: Ie, 691 not_equal: r, 692 bound: wt(), 693 // lifecycle 694 on_mount: [], 695 on_destroy: [], 696 on_disconnect: [], 697 before_update: [], 698 after_update: [], 699 context: new Map(u ? u.$$.context : []), 700 // everything else 701 callbacks: wt(), 702 dirty: m, 703 skip_bound: !1, 704 root: e.target || u.$$.root 705 }; 706 c && c(d.root); 707 let f = !1; 708 d.ctx = n ? n(t, e.props || {}, (g, h, ..._) => { 709 const w = _.length ? _[0] : h; 710 return d.ctx && r(d.ctx[g], d.ctx[g] = w) && (!d.skip_bound && d.bound[g] && d.bound[g](w), f && ho(t, g)), h; 711 }) : [], d.update(), f = !0, Re(d.before_update), d.fragment = o ? o(d.ctx) : !1, e.target && (d.fragment && d.fragment.c(), uo(t, e.target, void 0, void 0), en()), Ke(u); 712} 713class po { 714 $destroy() { 715 fo(this, 1), this.$destroy = Ie; 716 } 717 $on(e, n) { 718 if (!bt(n)) 719 return Ie;
720 const o = this.$$.callbacks[e] || (this.$$.callbacks[e] = []); 721 return o.push(n), () => { 722 const r = o.indexOf(n); 723 r !== -1 && o.splice(r, 1); 724 }; 725 } 726 $set(e) { 727 this.$$set && !xn(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1); 728 } 729} 730const tn = [ 731 [-1, "â¨", "custom"], 732 [0, "ð", "smileys-emotion"], 733 [1, "ð", "people-body"], 734 [3, "ð±", "animals-nature"], 735 [4, "ð", "food-drink"], 736 [5, "ð ï¸", "travel-places"], 737 [6, "â½", "activities"], 738 [7, "ð", "objects"], 739 [8, "âï¸", "symbols"], 740 [9, "ð", "flags"] 741].map(([t, e, n]) => ({ id: t, emoji: e, name: n })), qe = tn.slice(1), go = tn[0], _o = 2, Tt = 6, nn = typeof requestIdleCallback == "function" ? requestIdleCallback : setTimeout; 742function St(t) { 743 return t.unicode.includes("â"); 744} 745const bo = { 746 "ð«¨": 15, 747 "ð« ": 14, 748 "ð¥²": 13.1, 749 // smiling face with tear, technically from v13 but see note above 750 "ð¥»": 12.1, 751 // sari, technically from v12 but see note above 752 "ð¥°": 11, 753 "ð¤©": 5, 754 "ð±ââï¸": 4, 755 "ð¤£": 3, 756 "ðï¸âð¨ï¸": 2, 757 "ð": 1, 758 "ðï¸": 0.7, 759 "ð": 0.6 760}, yo = 1e3, ko = "ðï¸", vo = 8, wo = [ 761 "ð", 762 "ð", 763 "â¥ï¸", 764 "ðï¸", 765 "ð", 766 "ð", 767 "ð", 768 "âºï¸", 769 "ð", 770 "ð©", 771 "ð", 772 "ð", 773 "ð", 774 "ð" 775], on = '"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif', Eo = (t, e) => t < e ? -1 : t > e ? 1 : 0, Ct = (t, e) => { 776 const n = document.createElement("canvas"); 777 n.width = n.height = 1; 778 const o = n.getContext("2d"); 779 return o.textBaseline = "top", o.font = `100px ${on}`, o.fillStyle = e, o.scale(0.01, 0.01), o.fillText(t, 0, 0), o.getImageData(0, 0, 1, 1).data; 780}, jo = (t, e) => { 781 const n = [...t].join(","), o = [...e].join(","); 782 return n === o && !n.startsWith("0,0,0,"); 783}; 784function To(t) { 785 const e = Ct(t, "#000"), n = Ct(t, "#fff"); 786 return e && n && jo(e, n); 787} 788function So() { 789 const t = Object.entries(bo); 790 try { 791 for (const [e, n] of t) 792 if (To(e)) 793 return n; 794 } catch { 795 } finally { 796 } 797 return t[0][1]; 798} 799let ot; 800const it = () => (ot || (ot = new Promise((t) => nn(() => t(So())))), ot), ft = /* @__PURE__ */ new Map(), Co = "ï¸", Do = "\uD83C", Lo = "â", Ao = 127995, Io = 57339; 801function Oo(t, e) { 802 if (e === 0) 803 return t; 804 const n = t.indexOf(Lo); 805 return n !== -1 ? t.substring(0, n) + String.fromCodePoint(Ao + e - 1) + t.substring(n) : (t.endsWith(Co) && (t = t.substring(0, t.length - 1)), t + Do + String.fromCodePoint(Io + e - 1)); 806} 807function $(t) { 808 t.preventDefault(), t.stopPropagation(); 809} 810function rt(t, e, n) { 811 return e += t ? -1 : 1, e < 0 ? e = n.length - 1 : e >= n.length && (e = 0), e; 812} 813function rn(t, e) { 814 const n = /* @__PURE__ */ new Set(), o = []; 815 for (const r of t) { 816 const s = e(r); 817 n.has(s) || (n.add(s), o.push(r)); 818 } 819 return o; 820} 821function Ro(t, e) { 822 const n = (o) => { 823 const r = {}; 824 for (const s of o) 825 typeof s.tone == "number" && s.version <= e && (r[s.tone] = s.unicode); 826 return r; 827 }; 828 return t.map(({ unicode: o, skins: r, shortcodes: s, url: c, name: m, category: u, annotation: d }) => ({ 829 unicode: o, 830 name: m, 831 shortcodes: s, 832 url: c, 833 category: u, 834 annotation: d, 835 id: o || m, 836 skins: r && n(r) 837 })); 838} 839const Qe = requestAnimationFrame; 840let Bo = typeof ResizeObserver == "function"; 841function zo(t, e) { 842 let n; 843 return Bo ? (n = new ResizeObserver((o) => e(o[0].contentRect.width)), n.observe(t)) : Qe(() => e(t.getBoundingClientRect().width)), { 844 destroy() { 845 n && n.disconnect(); 846 } 847 }; 848} 849function Dt(t) { 850 { 851 const e = document.createRange(); 852 return e.selectNode(t.firstChild), e.getBoundingClientRect().width; 853 } 854} 855let st; 856function Mo(t, e, n) { 857 for (const o of t) { 858 const r = n(o), s = Dt(r); 859 typeof st > "u" && (st = Dt(e)); 860 const c = s / 1.8 < st; 861 ft.set(o.unicode, c); 862 } 863} 864function Fo(t) { 865 return rn(t, (e) => e); 866} 867function No(t) { 868 t && (t.scrollTop = 0); 869} 870const { Map: Pe } = to; 871function Lt(t, e, n) { 872 const o = t.slice(); 873 return o[66] = e[n], o[68] = n, o; 874} 875function At(t, e, n) { 876 const o = t.slice(); 877 return o[69] = e[n], o[68] = n, o; 878} 879function It(t, e, n) { 880 const o = t.slice(); 881 return o[66] = e[n], o[68] = n, o; 882} 883function Ot(t, e, n) { 884 const o = t.slice(); 885 return o[72] = e[n], o; 886} 887function Rt(t, e, n) { 888 const o = t.slice(); 889 return o[75] = e[n], o[68] = n, o; 890} 891function Bt(t, e) { 892 let n, o = ( 893 /*skinTone*/ 894 e[75] + "" 895 ), r, s, c, m, u, d; 896 return { 897 key: t, 898 first: null, 899 c() { 900 n = S("div"), r = x(o), i(n, "id", s = "skintone-" + /*i*/ 901 e[68]), i(n, "class", c = "emoji " + /*i*/ 902 (e[68] === /*activeSkinTone*/ 903 e[20] ? "active" : "")), i(n, "aria-selected", m = /*i*/ 904 e[68] === /*activeSkinTone*/ 905 e[20]), i(n, "role", "option"), i(n, "title", u = /*i18n*/
906 e[0].skinTones[ 907 /*i*/ 908 e[68] 909 ]), i(n, "aria-label", d = /*i18n*/ 910 e[0].skinTones[ 911 /*i*/ 912 e[68] 913 ]), this.first = n; 914 }, 915 m(f, g) { 916 q(f, n, g), C(n, r); 917 }, 918 p(f, g) { 919 e = f, g[0] & /*skinTones*/ 920 512 && o !== (o = /*skinTone*/ 921 e[75] + "") && ee(r, o), g[0] & /*skinTones*/ 922 512 && s !== (s = "skintone-" + /*i*/ 923 e[68]) && i(n, "id", s), g[0] & /*skinTones, activeSkinTone*/ 924 1049088 && c !== (c = "emoji " + /*i*/ 925 (e[68] === /*activeSkinTone*/ 926 e[20] ? "active" : "")) && i(n, "class", c), g[0] & /*skinTones, activeSkinTone*/ 927 1049088 && m !== (m = /*i*/ 928 e[68] === /*activeSkinTone*/ 929 e[20]) && i(n, "aria-selected", m), g[0] & /*i18n, skinTones*/ 930 513 && u !== (u = /*i18n*/ 931 e[0].skinTones[ 932 /*i*/ 933 e[68] 934 ]) && i(n, "title", u), g[0] & /*i18n, skinTones*/ 935 513 && d !== (d = /*i18n*/ 936 e[0].skinTones[ 937 /*i*/ 938 e[68] 939 ]) && i(n, "aria-label", d); 940 }, 941 d(f) { 942 f && J(n); 943 } 944 }; 945} 946function zt(t, e) { 947 let n, o, r = ( 948 /*group*/ 949 e[72].emoji + "" 950 ), s, c, m, u, d, f, g; 951 function h() { 952 return ( 953 /*click_handler*/ 954 e[51]( 955 /*group*/ 956 e[72] 957 ) 958 ); 959 } 960 return { 961 key: t, 962 first: null, 963 c() { 964 n = S("button"), o = S("div"), s = x(r), i(o, "class", "nav-emoji emoji"), i(n, "role", "tab"), i(n, "class", "nav-button"), i(n, "aria-controls", c = "tab-" + /*group*/ 965 e[72].id), i(n, "aria-label", m = /*i18n*/ 966 e[0].categories[ 967 /*group*/ 968 e[72].name 969 ]), i(n, "aria-selected", u = !/*searchMode*/ 970 e[4] && /*currentGroup*/ 971 e[13].id === /*group*/ 972 e[72].id), i(n, "title", d = /*i18n*/ 973 e[0].categories[ 974 /*group*/ 975 e[72].name 976 ]), this.first = n; 977 }, 978 m(_, w) { 979 q(_, n, w), C(n, o), C(o, s), f || (g = Z(n, "click", h), f = !0); 980 }, 981 p(_, w) { 982 e = _, w[0] & /*groups*/ 983 4096 && r !== (r = /*group*/ 984 e[72].emoji + "") && ee(s, r), w[0] & /*groups*/ 985 4096 && c !== (c = "tab-" + /*group*/ 986 e[72].id) && i(n, "aria-controls", c), w[0] & /*i18n, groups*/ 987 4097 && m !== (m = /*i18n*/ 988 e[0].categories[ 989 /*group*/ 990 e[72].name 991 ]) && i(n, "aria-label", m), w[0] & /*searchMode, currentGroup, groups*/ 992 12304 && u !== (u = !/*searchMode*/ 993 e[4] && /*currentGroup*/ 994 e[13].id === /*group*/ 995 e[72].id) && i(n, "aria-selected", u), w[0] & /*i18n, groups*/ 996 4097 && d !== (d = /*i18n*/ 997 e[0].categories[ 998 /*group*/ 999 e[72].name 1000 ]) && i(n, "title", d); 1001 }, 1002 d(_) { 1003 _ && J(n), f = !1, g(); 1004 } 1005 }; 1006} 1007function Uo(t) { 1008 let e, n; 1009 return { 1010 c() { 1011 e = S("img"), i(e, "class", "custom-emoji"), et(e.src, n = /*emoji*/ 1012 t[66].url) || i(e, "src", n), i(e, "alt", ""), i(e, "loading", "lazy"); 1013 }, 1014 m(o, r) { 1015 q(o, e, r); 1016 }, 1017 p(o, r) { 1018 r[0] & /*currentEmojisWithCategories*/ 1019 32768 && !et(e.src, n = /*emoji*/ 1020 o[66].url) && i(e, "src", n); 1021 }, 1022 d(o) { 1023 o && J(e); 1024 } 1025 }; 1026} 1027function Po(t) { 1028 let e = ( 1029 /*unicodeWithSkin*/ 1030 t[27]( 1031 /*emoji*/ 1032 t[66], 1033 /*currentSkinTone*/ 1034 t[8] 1035 ) + "" 1036 ), n; 1037 return { 1038 c() { 1039 n = x(e); 1040 }, 1041 m(o, r) { 1042 q(o, n, r); 1043 }, 1044 p(o, r) { 1045 r[0] & /*currentEmojisWithCategories, currentSkinTone*/ 1046 33024 && e !== (e = /*unicodeWithSkin*/ 1047 o[27]( 1048 /*emoji*/ 1049 o[66], 1050 /*currentSkinTone*/ 1051 o[8] 1052 ) + "") && ee(n, e); 1053 }, 1054 d(o) { 1055 o && J(n); 1056 } 1057 }; 1058} 1059function Mt(t, e) { 1060 let n, o, r, s, c, m, u; 1061 function d(h, _) { 1062 return ( 1063 /*emoji*/ 1064 h[66].unicode ? Po : Uo 1065 ); 1066 } 1067 let f = d(e), g = f(e); 1068 return { 1069 key: t, 1070 first: null, 1071 c() { 1072 n = S("button"), g.c(), i(n, "role", o = /*searchMode*/ 1073 e[4] ? "option" : "menuitem"), i(n, "aria-selected", r = /*searchMode*/ 1074 e[4] ? ( 1075 /*i*/ 1076 e[68] == /*activeSearchItem*/ 1077 e[5] 1078 ) : ""), i(n, "aria-label", s = /*labelWithSkin*/ 1079 e[28]( 1080 /*emoji*/ 1081 e[66], 1082 /*currentSkinTone*/ 1083 e[8] 1084 )), i(n, "title", c = /*titleForEmoji*/ 1085 e[29]( 1086 /*emoji*/ 1087 e[66] 1088 )), i(n, "class", m = "emoji " + /*searchMode*/ 1089 (e[4] && /*i*/ 1090 e[68] === /*activeSearchItem*/ 1091 e[5] ? "active" : "")), i(n, "id", u = "emo-" + /*emoji*/ 1092 e[66].id), this.first = n; 1093 }, 1094 m(h, _) { 1095 q(h, n, _), g.m(n, null); 1096 }, 1097 p(h, _) { 1098 e = h, f === (f = d(e)) && g ? g.p(e, _) : (g.d(1), g = f(e), g && (g.c(), g.m(n, null))), _[0] & /*searchMode*/ 1099 16 && o !== (o = /*searchMode*/ 1100 e[4] ? "option" : "menuitem") && i(n, "role", o), _[0] & /*searchMode, currentEmojisWithCategories, activeSearchItem*/ 1101 32816 && r !== (r = /*searchMode*/ 1102 e[4] ? ( 1103 /*i*/ 1104 e[68] == /*activeSearchItem*/ 1105 e[5] 1106 ) : "") && i(n, "aria-selected", r), _[0] & /*currentEmojisWithCategories, currentSkinTone*/ 1107 33024 && s !== (s = /*labelWithSkin*/ 1108 e[28]( 1109 /*emoji*/ 1110 e[66], 1111 /*currentSkinTone*/ 1112 e[8] 1113 )) && i(n, "aria-label", s), _[0] & /*currentEmojisWithCategories*/ 1114 32768 && c !== (c = /*titleForEmoji*/ 1115 e[29]( 1116 /*emoji*/ 1117 e[66] 1118 )) && i(n, "title", c), _[0] & /*searchMode, currentEmojisWithCategories, activeSearchItem*/ 1119 32816 && m !== (m = "emoji " + /*searchMode*/ 1120 (e[4] && /*i*/ 1121 e[68] === /*activeSearchItem*/ 1122 e[5] ? "active" : "")) && i(n, "class", m), _[0] & /*currentEmojisWithCategories*/ 1123 32768 && u !== (u = "emo-" + /*emoji*/ 1124 e[66].id) && i(n, "id", u); 1125 }, 1126 d(h) { 1127 h && J(n), g.d(); 1128 } 1129 }; 1130} 1131function Ft(t, e) { 1132 let n, o = ( 1133 /*searchMode*/ 1134 (e[4] ? ( 1135 /*i18n*/ 1136 e[0].searchResultsLabel 1137 ) : ( 1138 /*emojiWithCategory*/ 1139 e[69].category ? ( 1140 /*emojiWithCategory*/ 1141 e[69].category 1142 ) : ( 1143 /*currentEmojisWithCategories*/ 1144 e[15].length > 1 ? ( 1145 /*i18n*/ 1146 e[0].categories.custom 1147 ) : ( 1148 /*i18n*/ 1149 e[0].categories[ 1150 /*currentGroup*/ 1151 e[13].name 1152 ] 1153 ) 1154 ) 1155 )) + "" 1156 ), r, s, c, m, u = [], d = new Pe(), f, g, h, _ = ( 1157 /*emojiWithCategory*/ 1158 e[69].emojis 1159 ); 1160 const w = (v) => ( 1161 /*emoji*/ 1162 v[66].id 1163 ); 1164 for (let v = 0; v < _.length; v += 1) { 1165 let k = It(e, _, v), L = w(k); 1166 d.set(L, u[v] = Mt(L, k)); 1167 } 1168 return { 1169 key: t, 1170 first: null, 1171 c() {
1172 n = S("div"), r = x(o), m = S("div"); 1173 for (let v = 0; v < u.length; v += 1) 1174 u[v].c(); 1175 i(n, "id", s = "menu-label-" + /*i*/ 1176 e[68]), i(n, "class", c = "category " + /*currentEmojisWithCategories*/ 1177 (e[15].length === 1 && /*currentEmojisWithCategories*/ 1178 e[15][0].category === "" ? "gone" : "")), i(n, "aria-hidden", "true"), i(m, "class", "emoji-menu"), i(m, "role", f = /*searchMode*/ 1179 e[4] ? "listbox" : "menu"), i(m, "aria-labelledby", g = "menu-label-" + /*i*/ 1180 e[68]), i(m, "id", h = /*searchMode*/ 1181 e[4] ? "search-results" : ""), this.first = n; 1182 }, 1183 m(v, k) { 1184 q(v, n, k), C(n, r), q(v, m, k); 1185 for (let L = 0; L < u.length; L += 1) 1186 u[L] && u[L].m(m, null); 1187 }, 1188 p(v, k) { 1189 e = v, k[0] & /*searchMode, i18n, currentEmojisWithCategories, currentGroup*/ 1190 40977 && o !== (o = /*searchMode*/ 1191 (e[4] ? ( 1192 /*i18n*/ 1193 e[0].searchResultsLabel 1194 ) : ( 1195 /*emojiWithCategory*/ 1196 e[69].category ? ( 1197 /*emojiWithCategory*/ 1198 e[69].category 1199 ) : ( 1200 /*currentEmojisWithCategories*/ 1201 e[15].length > 1 ? ( 1202 /*i18n*/ 1203 e[0].categories.custom 1204 ) : ( 1205 /*i18n*/ 1206 e[0].categories[ 1207 /*currentGroup*/ 1208 e[13].name 1209 ] 1210 ) 1211 ) 1212 )) + "") && ee(r, o), k[0] & /*currentEmojisWithCategories*/ 1213 32768 && s !== (s = "menu-label-" + /*i*/ 1214 e[68]) && i(n, "id", s), k[0] & /*currentEmojisWithCategories*/ 1215 32768 && c !== (c = "category " + /*currentEmojisWithCategories*/ 1216 (e[15].length === 1 && /*currentEmojisWithCategories*/ 1217 e[15][0].category === "" ? "gone" : "")) && i(n, "class", c), k[0] & /*searchMode, currentEmojisWithCategories, activeSearchItem, labelWithSkin, currentSkinTone, titleForEmoji, unicodeWithSkin*/ 1218 939557168 && (_ = /*emojiWithCategory*/ 1219 e[69].emojis, u = Ue(u, k, w, 1, e, _, d, m, Ne, Mt, null, It)), k[0] & /*searchMode*/ 1220 16 && f !== (f = /*searchMode*/ 1221 e[4] ? "listbox" : "menu") && i(m, "role", f), k[0] & /*currentEmojisWithCategories*/ 1222 32768 && g !== (g = "menu-label-" + /*i*/ 1223 e[68]) && i(m, "aria-labelledby", g), k[0] & /*searchMode*/ 1224 16 && h !== (h = /*searchMode*/ 1225 e[4] ? "search-results" : "") && i(m, "id", h); 1226 }, 1227 d(v) { 1228 v && J(n), v && J(m); 1229 for (let k = 0; k < u.length; k += 1) 1230 u[k].d(); 1231 } 1232 }; 1233} 1234function Ko(t) { 1235 let e, n; 1236 return { 1237 c() { 1238 e = S("img"), i(e, "class", "custom-emoji"), et(e.src, n = /*emoji*/ 1239 t[66].url) || i(e, "src", n), i(e, "alt", ""), i(e, "loading", "lazy"); 1240 }, 1241 m(o, r) { 1242 q(o, e, r); 1243 }, 1244 p(o, r) { 1245 r[0] & /*currentFavorites*/ 1246 1024 && !et(e.src, n = /*emoji*/ 1247 o[66].url) && i(e, "src", n); 1248 }, 1249 d(o) { 1250 o && J(e); 1251 } 1252 }; 1253} 1254function Go(t) { 1255 let e = ( 1256 /*unicodeWithSkin*/ 1257 t[27]( 1258 /*emoji*/ 1259 t[66], 1260 /*currentSkinTone*/ 1261 t[8] 1262 ) + "" 1263 ), n; 1264 return { 1265 c() { 1266 n = x(e); 1267 }, 1268 m(o, r) { 1269 q(o, n, r); 1270 }, 1271 p(o, r) { 1272 r[0] & /*currentFavorites, currentSkinTone*/ 1273 1280 && e !== (e = /*unicodeWithSkin*/ 1274 o[27]( 1275 /*emoji*/ 1276 o[66], 1277 /*currentSkinTone*/ 1278 o[8] 1279 ) + "") && ee(n, e); 1280 }, 1281 d(o) { 1282 o && J(n); 1283 } 1284 }; 1285} 1286function Nt(t, e) { 1287 let n, o, r, s; 1288 function c(d, f) { 1289 return ( 1290 /*emoji*/ 1291 d[66].unicode ? Go : Ko 1292 ); 1293 } 1294 let m = c(e), u = m(e); 1295 return { 1296 key: t, 1297 first: null, 1298 c() { 1299 n = S("button"), u.c(), i(n, "role", "menuitem"), i(n, "aria-label", o = /*labelWithSkin*/ 1300 e[28]( 1301 /*emoji*/ 1302 e[66], 1303 /*currentSkinTone*/ 1304 e[8] 1305 )), i(n, "title", r = /*titleForEmoji*/ 1306 e[29]( 1307 /*emoji*/ 1308 e[66] 1309 )), i(n, "class", "emoji"), i(n, "id", s = "fav-" + /*emoji*/ 1310 e[66].id), this.first = n; 1311 }, 1312 m(d, f) { 1313 q(d, n, f), u.m(n, null); 1314 }, 1315 p(d, f) { 1316 e = d, m === (m = c(e)) && u ? u.p(e, f) : (u.d(1), u = m(e), u && (u.c(), u.m(n, null))), f[0] & /*currentFavorites, currentSkinTone*/ 1317 1280 && o !== (o = /*labelWithSkin*/ 1318 e[28]( 1319 /*emoji*/ 1320 e[66], 1321 /*currentSkinTone*/ 1322 e[8] 1323 )) && i(n, "aria-label", o), f[0] & /*currentFavorites*/ 1324 1024 && r !== (r = /*titleForEmoji*/ 1325 e[29]( 1326 /*emoji*/ 1327 e[66] 1328 )) && i(n, "title", r), f[0] & /*currentFavorites*/ 1329 1024 && s !== (s = "fav-" + /*emoji*/ 1330 e[66].id) && i(n, "id", s); 1331 }, 1332 d(d) { 1333 d && J(n), u.d(); 1334 } 1335 }; 1336} 1337function Wo(t) { 1338 let e, n, o, r, s, c, m, u, d, f = ( 1339 /*i18n*/ 1340 t[0].searchLabel + "" 1341 ), g, h, _ = ( 1342 /*i18n*/ 1343 t[0].searchDescription + "" 1344 ), w, v, k, L, A, F, I, V = ( 1345 /*i18n*/ 1346 t[0].skinToneDescription + "" 1347 ), G, y, T = [], R = new Pe(), W, se, H, ie, B, z = [], Be = new Pe(), ae, X, N, U, Q, le, O, te, P = [], fe = new Pe(), he, me, pe, ge, M, K = [], _e = new Pe(), be, ye, ne, ce, ze, Me, ke = ( 1348 /*skinTones*/ 1349 t[9] 1350 ); 1351 const ve = (l) => ( 1352 /*skinTone*/ 1353 l[75] 1354 ); 1355 for (let l = 0; l < ke.length; l += 1) { 1356 let p = Rt(t, ke, l), j = ve(p); 1357 R.set(j, T[l] = Bt(j, p)); 1358 } 1359 let we = ( 1360 /*groups*/ 1361 t[12] 1362 ); 1363 const We = (l) => ( 1364 /*group*/ 1365 l[72].id 1366 ); 1367 for (let l = 0; l < we.length; l += 1) { 1368 let p = Ot(t, we, l), j = We(p); 1369 Be.set(j, z[l] = zt(j, p)); 1370 } 1371 let Ee = ( 1372 /*currentEmojisWithCategories*/ 1373 t[15] 1374 ); 1375 const Ve = (l) => ( 1376 /*emojiWithCategory*/ 1377 l[69].category 1378 ); 1379 for (let l = 0; l < Ee.length; l += 1) { 1380 let p = At(t, Ee, l), j = Ve(p); 1381 fe.set(j, P[l] = Ft(j, p)); 1382 } 1383 let je = ( 1384 /*currentFavorites*/ 1385 t[10] 1386 ); 1387 const He = (l) => ( 1388 /*emoji*/ 1389 l[66].id 1390 ); 1391 for (let l = 0; l < je.length; l += 1) { 1392 let p = Lt(t, je, l), j = He(p); 1393 _e.set(j, K[l] = Nt(j, p)); 1394 } 1395 return { 1396 c() { 1397 e = S("section"), n = S("div"), o = S("div"), r = S("div"), s = S("input"), d = S("label"), g = x(f), h
1397= S("span"), w = x(_), v = S("div"), k = S("button"), L = x( 1398 /*skinToneButtonText*/ 1399 t[21] 1400 ), I = S("span"), G = x(V), y = S("div"); 1401 for (let l = 0; l < T.length; l += 1) 1402 T[l].c(); 1403 B = S("div"); 1404 for (let l = 0; l < z.length; l += 1) 1405 z[l].c(); 1406 X = S("div"), N = S("div"), U = S("div"), Q = x( 1407 /*message*/ 1408 t[18] 1409 ), O = S("div"), te = S("div"); 1410 for (let l = 0; l < P.length; l += 1) 1411 P[l].c(); 1412 M = S("div"); 1413 for (let l = 0; l < K.length; l += 1) 1414 K[l].c(); 1415 ne = S("button"), ne.textContent = "ð", i(n, "class", "pad-top"), i(s, "id", "search"), i(s, "class", "search"), i(s, "type", "search"), i(s, "role", "combobox"), i(s, "enterkeyhint", "search"), i(s, "placeholder", c = /*i18n*/ 1416 t[0].searchLabel), i(s, "autocapitalize", "none"), i(s, "autocomplete", "off"), i(s, "spellcheck", "true"), i(s, "aria-expanded", m = !!/*searchMode*/ 1417 (t[4] && /*currentEmojis*/ 1418 t[1].length)), i(s, "aria-controls", "search-results"), i(s, "aria-describedby", "search-description"), i(s, "aria-autocomplete", "list"), i(s, "aria-activedescendant", u = /*activeSearchItemId*/ 1419 t[26] ? `emo-${/*activeSearchItemId*/ 1420 t[26]}` : ""), i(d, "class", "sr-only"), i(d, "for", "search"), i(h, "id", "search-description"), i(h, "class", "sr-only"), i(r, "class", "search-wrapper"), i(k, "id", "skintone-button"), i(k, "class", A = "emoji " + /*skinTonePickerExpanded*/ 1421 (t[6] ? "hide-focus" : "")), i( 1422 k, 1423 "aria-label", 1424 /*skinToneButtonLabel*/ 1425 t[23] 1426 ), i( 1427 k, 1428 "title", 1429 /*skinToneButtonLabel*/ 1430 t[23] 1431 ), i(k, "aria-describedby", "skintone-description"), i(k, "aria-haspopup", "listbox"), i( 1432 k, 1433 "aria-expanded", 1434 /*skinTonePickerExpanded*/ 1435 t[6] 1436 ), i(k, "aria-controls", "skintone-list"), i(v, "class", F = "skintone-button-wrapper " + /*skinTonePickerExpandedAfterAnimation*/ 1437 (t[19] ? "expanded" : "")), i(I, "id", "skintone-description"), i(I, "class", "sr-only"), i(y, "id", "skintone-list"), i(y, "class", W = "skintone-list hide-focus " + /*skinTonePickerExpanded*/ 1438 (t[6] ? "" : "hidden no-animate")), re(y, "transform", "translateY(" + /*skinTonePickerExpanded*/ 1439 (t[6] ? 0 : "calc(-1 * var(--num-skintones) * var(--total-emoji-size))") + ")"), i(y, "role", "listbox"), i(y, "aria-label", se = /*i18n*/ 1440 t[0].skinTonesLabel), i(y, "aria-activedescendant", H = "skintone-" + /*activeSkinTone*/ 1441 t[20]), i(y, "aria-hidden", ie = !/*skinTonePickerExpanded*/ 1442 t[6]), i(y, "tabindex", "-1"), i(o, "class", "search-row"), i(B, "class", "nav"), i(B, "role", "tablist"), re(B, "grid-template-columns", "repeat(" + /*groups*/ 1443 t[12].length + ", 1fr)"), i(B, "aria-label", ae = /*i18n*/ 1444 t[0].categoriesLabel), i(N, "class", "indicator"), re(N, "transform", "translateX(" + /*isRtl*/ 1445 (t[24] ? -1 : 1) * /*currentGroupIndex*/ 1446 t[11] * 100 + "%)"), i(X, "class", "indicator-wrapper"), i(U, "class", le = "message " + /*message*/ 1447 (t[18] ? "" : "gone")), i(U, "role", "alert"), i(U, "aria-live", "polite"), i(O, "class", he = "tabpanel " + (!/*databaseLoaded*/ 1448 t[14] || /*message*/ 1449 t[18] ? "gone" : "")), i(O, "role", me = /*searchMode*/ 1450 t[4] ? "region" : "tabpanel"), i(O, "aria-label", pe = /*searchMode*/ 1451 t[4] ? ( 1452 /*i18n*/ 1453 t[0].searchResultsLabel 1454 ) : ( 1455 /*i18n*/ 1456 t[0].categories[ 1457 /*currentGroup*/ 1458 t[13].name 1459 ] 1460 )), i(O, "id", ge = /*searchMode*/ 1461 t[4] ? "" : `tab-${/*currentGroup*/ 1462 t[13].id}`), i(O, "tabindex", "0"), i(M, "class", be = "favorites emoji-menu " + /*message*/ 1463 (t[18] ? "gone" : "")), i(M, "role", "menu"), i(M, "aria-label", ye = /*i18n*/ 1464 t[0].favoritesLabel), re( 1465 M, 1466 "padding-inline-end", 1467 /*scrollbarWidth*/ 1468 t[25] + "px" 1469 ), i(ne, "aria-hidden", "true"), i(ne, "tabindex", "-1"), i(ne, "class", "abs-pos hidden emoji"), i(e, "class", "picker"), i(e, "aria-label", ce = /*i18n*/ 1470 t[0].regionLabel), i( 1471 e, 1472 "style", 1473 /*pickerStyle*/ 1474 t[22] 1475 ); 1476 }, 1477 m(l, p) { 1478 q(l, e, p), C(e, n), C(e, o), C(o, r), C(r, s), Et( 1479 s, 1480 /*rawSearchText*/ 1481 t[2] 1482 ), C(r, d), C(d, g), C(r, h), C(h, w), C(o, v), C(v, k), C(k, L), C(o, I), C(I, G), C(o, y); 1483 for (let j = 0; j < T.length; j += 1) 1484 T[j] && T[j].m(y, null); 1485 t[50](y), C(e, B); 1486 for (let j = 0; j < z.length; j += 1) 1487 z[j] && z[j].m(B, null); 1488 C(e, X), C(X, N), C(e, U), C(U, Q), C(e, O), C(O, te); 1489 for (let j = 0; j < P.length; j += 1) 1490 P[j] && P[j].m(te, null); 1491 t[52](O), C(e, M); 1492 for (let j = 0; j < K.length; j += 1) 1493 K[j] && K[j].m(M, null); 1494 C(e, ne), t[53](ne), t[54](e), ze || (Me = [ 1495 Z( 1496 s, 1497 "input", 1498 /*input_input_handler*/ 1499 t[49] 1500 ), 1501 Z( 1502 s, 1503 "keydown", 1504 /*onSearchKeydown*/ 1505 t[31] 1506 ), 1507 Z( 1508 k, 1509 "click", 1510 /*onClickSkinToneButton*/ 1511 t[36] 1512 ), 1513 Z( 1514 y, 1515 "focusout", 1516 /*onSkinToneOptionsFocusOut*/ 1517 t[39] 1518 ), 1519 Z( 1520 y, 1521 "click", 1522 /*onSkinToneOptionsClick*/ 1523 t[35] 1524 ), 1525 Z( 1526 y, 1527 "keydown", 1528 /*onSkinToneOptionsKeydown*/ 1529 t[37] 1530 ), 1531 Z( 1532 y, 1533 "keyup", 1534 /*onSkinToneOptionsKeyup*/ 1535 t[38] 1536 ), 1537 Z( 1538 B, 1539 "keydown", 1540 /*onNavKeydown*/ 1541 t[33] 1542 ), 1543 eo( 1544 /*calculateEmojiGridStyle*/ 1545 t[30].call(null, te) 1546 ), 1547 Z( 1548 O, 1549 "click", 1550 /*onEmojiClick*/ 1551 t[34] 1552 ), 1553 Z( 1554 M, 1555 "click", 1556 /*onEmojiClick*/ 1557 t[34] 1558 ) 1559 ], ze = !0); 1560 }, 1561 p(l, p) { 1562 p[0] & /*i18n*/ 1563 1 && c !== (c = /*i18n*/ 1564 l[0].searchLabel) && i(s, "placeholder", c), p[0] & /*searchMode, currentEmojis*/ 1565 18 && m !== (m = !!/*searchMode*/ 1566 (l[4] && /*currentEmojis*/ 1567 l[1].length)) && i(s, "aria-expanded", m), p[0] & /*activeSearchItemId*/ 1568 67108864 && u !== (u = /*activeSearchItemId*/ 1569 l[26] ? `emo-${/*activeSearchItemId*/ 1570 l[26]}` : "") && i(s, "aria-activedescendant", u), p[0] & /*rawSearchText*/ 1571 4 && s.value !== /*rawSearchText*/ 1572 l[2] && Et( 1573 s, 1574 /*rawSearchText*/ 1575 l[2] 1576 ), p[0] & /*i18n*/ 1577 1 && f !== (f = /*i18n*/ 1578 l[0].searchLabel + "") && ee(g, f), p[0] & /*i18n*/ 1579 1 && _ !== (_ = /*i18n*/ 1580 l[0].searchDescription + "") && ee(w, _), p[0] & /*skinToneButtonText*/ 1581 2097152 && ee( 1582 L, 1583 /*skinToneButtonText*/ 1584 l[21] 1585 ), p[0] & /*skinTonePickerExpanded*/ 1586 64 && A !== (A = "emoji " + /*skinTonePickerExpanded*/ 1587 (l[6] ? "hide-focus" : "")) && i(k, "class", A), p[0] & /*skinToneButtonLabel*/ 1588 8388608 && i( 1589 k, 1590 "aria-label", 1591 /*skinToneButtonLabel*/ 1592 l[23] 1593 ), p[0] & /*skinToneButtonLabel*/ 1594 8388608 && i( 1595 k, 1596 "title", 1597 /*skinToneButtonLabel*/ 1598 l[23] 1599 ), p[0] & /*skinTonePickerExpanded*/ 1600 64 && i( 1601 k, 1602 "aria-expanded", 1603 /*skinTonePickerExpanded*/ 1604 l[6] 1605 ), p[0] & /*skinTonePickerExpandedAfterAnimation*/ 1606 524288 && F !== (F = "skintone-button-wrapper " + /*skinTonePickerExpandedAfterAnimation*/ 1607 (l[19] ? "expanded" : "")) && i(v, "class", F), p[0] & /*i18n*/ 1608 1 && V !== (V = /*i18n*/ 1609 l[0].skinToneDescription + "") && ee(G, V), p[0] & /*skinTones, activeSkinTone, i18n*/ 1610 1049089 && (ke = /*skinTones*/ 1611 l[9], T = Ue(T, p, ve, 1, l, ke, R, y, Ne, Bt, null, Rt)), p[0] & /*skinTonePickerExpanded*/ 1612 64 && W !== (W = "skintone-list hide-focus " + /*skinTonePickerExpanded*/ 1613 (l[6] ? "" : "hidden no-animate")) && i(y, "class", W), p[0] & /*skinTonePickerExpanded*/ 1614 64 && re(y, "transform", "translateY(" + /*skinTonePickerExpanded*/ 1615 (l[6] ? 0 : "calc(-1 * var(--num-skintones) * var(--total-emoji-size))") + ")"), p[0] & /*i18n*/ 1616 1 && se !== (se = /*i18n*/
1617 l[0].skinTonesLabel) && i(y, "aria-label", se), p[0] & /*activeSkinTone*/ 1618 1048576 && H !== (H = "skintone-" + /*activeSkinTone*/ 1619 l[20]) && i(y, "aria-activedescendant", H), p[0] & /*skinTonePickerExpanded*/ 1620 64 && ie !== (ie = !/*skinTonePickerExpanded*/ 1621 l[6]) && i(y, "aria-hidden", ie), p[0] & /*groups, i18n, searchMode, currentGroup*/ 1622 12305 | p[1] & /*onNavClick*/ 1623 2 && (we = /*groups*/ 1624 l[12], z = Ue(z, p, We, 1, l, we, Be, B, Ne, zt, null, Ot)), p[0] & /*groups*/ 1625 4096 && re(B, "grid-template-columns", "repeat(" + /*groups*/ 1626 l[12].length + ", 1fr)"), p[0] & /*i18n*/ 1627 1 && ae !== (ae = /*i18n*/ 1628 l[0].categoriesLabel) && i(B, "aria-label", ae), p[0] & /*isRtl, currentGroupIndex*/ 1629 16779264 && re(N, "transform", "translateX(" + /*isRtl*/ 1630 (l[24] ? -1 : 1) * /*currentGroupIndex*/ 1631 l[11] * 100 + "%)"), p[0] & /*message*/ 1632 262144 && ee( 1633 Q, 1634 /*message*/ 1635 l[18] 1636 ), p[0] & /*message*/ 1637 262144 && le !== (le = "message " + /*message*/ 1638 (l[18] ? "" : "gone")) && i(U, "class", le), p[0] & /*searchMode, currentEmojisWithCategories, activeSearchItem, labelWithSkin, currentSkinTone, titleForEmoji, unicodeWithSkin, i18n, currentGroup*/ 1639 939565361 && (Ee = /*currentEmojisWithCategories*/ 1640 l[15], P = Ue(P, p, Ve, 1, l, Ee, fe, te, Ne, Ft, null, At)), p[0] & /*databaseLoaded, message*/ 1641 278528 && he !== (he = "tabpanel " + (!/*databaseLoaded*/ 1642 l[14] || /*message*/ 1643 l[18] ? "gone" : "")) && i(O, "class", he), p[0] & /*searchMode*/ 1644 16 && me !== (me = /*searchMode*/ 1645 l[4] ? "region" : "tabpanel") && i(O, "role", me), p[0] & /*searchMode, i18n, currentGroup*/ 1646 8209 && pe !== (pe = /*searchMode*/ 1647 l[4] ? ( 1648 /*i18n*/ 1649 l[0].searchResultsLabel 1650 ) : ( 1651 /*i18n*/ 1652 l[0].categories[ 1653 /*currentGroup*/ 1654 l[13].name 1655 ] 1656 )) && i(O, "aria-label", pe), p[0] & /*searchMode, currentGroup*/ 1657 8208 && ge !== (ge = /*searchMode*/ 1658 l[4] ? "" : `tab-${/*currentGroup*/ 1659 l[13].id}`) && i(O, "id", ge), p[0] & /*labelWithSkin, currentFavorites, currentSkinTone, titleForEmoji, unicodeWithSkin*/ 1660 939525376 && (je = /*currentFavorites*/
1661 l[10], K = Ue(K, p, He, 1, l, je, _e, M, Ne, Nt, null, Lt)), p[0] & /*message*/ 1662 262144 && be !== (be = "favorites emoji-menu " + /*message*/ 1663 (l[18] ? "gone" : "")) && i(M, "class", be), p[0] & /*i18n*/ 1664 1 && ye !== (ye = /*i18n*/ 1665 l[0].favoritesLabel) && i(M, "aria-label", ye), p[0] & /*scrollbarWidth*/ 1666 33554432 && re( 1667 M, 1668 "padding-inline-end", 1669 /*scrollbarWidth*/ 1670 l[25] + "px" 1671 ), p[0] & /*i18n*/ 1672 1 && ce !== (ce = /*i18n*/ 1673 l[0].regionLabel) && i(e, "aria-label", ce), p[0] & /*pickerStyle*/ 1674 4194304 && i( 1675 e, 1676 "style", 1677 /*pickerStyle*/ 1678 l[22] 1679 ); 1680 }, 1681 i: Ie, 1682 o: Ie, 1683 d(l) { 1684 l && J(e); 1685 for (let p = 0; p < T.length; p += 1) 1686 T[p].d(); 1687 t[50](null); 1688 for (let p = 0; p < z.length; p += 1) 1689 z[p].d(); 1690 for (let p = 0; p < P.length; p += 1) 1691 P[p].d(); 1692 t[52](null); 1693 for (let p = 0; p < K.length; p += 1) 1694 K[p].d(); 1695 t[53](null), t[54](null), ze = !1, Re(Me); 1696 } 1697 }; 1698} 1699function Vo(t, e, n) { 1700 let { skinToneEmoji: o } = e, { i18n: r } = e, { database: s } = e, { customEmoji: c } = e, { customCategorySorting: m } = e, { emojiVersion: u } = e, d = !0, f = [], g = [], h = "", _ = "", w, v, k, L = !1, A = -1, F, I = !1, V = !1, G, y = 0, T = 0, R, W, se = "", H = [], ie = [], B, z = vo, Be = !1, ae = 0, X = 0, N = qe, U, Q = !1, le; 1701 const O = [], te = (a) => { 1702 w.getRootNode().getElementById(a).focus(); 1703 }, P = (a, b) => { 1704 w.dispatchEvent(new CustomEvent(a, { detail: b, bubbles: !0, composed: !0 })); 1705 }, fe = (a, b) => b && a.skins && a.skins[b] || a.unicode, he = (a, b) => Fo([ 1706 a.name || fe(a, b), 1707 a.annotation, 1708 ...a.shortcodes || O 1709 ].filter(Boolean)).join(", "), me = (a) => a.annotation || (a.shortcodes || O).join(", "); 1710 oo(() => { 1711 u || it().then((a) => { 1712 a || n(18, F = r.emojiUnsupportedMessage); 1713 }); 1714 }); 1715 function pe(a) { 1716 return zo(a, (b) => { 1717 { 1718 const E = getComputedStyle(w), D = parseInt(E.getPropertyValue("--num-columns"), 10), Y = E.getPropertyValue("direction") === "rtl", dn = a.parentElement.getBoundingClientRect().width - b; 1719 n(48, z = D), n(25, ae = dn), n(24, Be = Y); 1720 } 1721 }); 1722 } 1723 function ge(a) { 1724 const b = w.getRootNode(); 1725 Mo(a, v, (D) => b.getElementById(`emo-${D.id}`)), n(1, f = f); 1726 } 1727 function M(a) { 1728 return !a.unicode || !St(a) || ft.get(a.unicode); 1729 } 1730 async function K(a) { 1731 const b = u || await it(); 1732 return a.filter(({ version: E }) => !E || E <= b); 1733 } 1734 async function _e(a) { 1735 return Ro(a, u || await it()); 1736 } 1737 async function be(a) { 1738 const b = a === -1 ? c : await s.getEmojiByGroup(a); 1739 return _e(await K(b)); 1740 } 1741 async function ye(a) { 1742 return _e(await K(await s.getEmojiBySearchQuery(a))); 1743 } 1744 function ne(a) { 1745 if (!L || !f.length) 1746 return; 1747 const b = (E) => { 1748 $(a), n(5, A = rt(E, A, f)); 1749 }; 1750 switch (a.key) { 1751 case "ArrowDown": 1752 return b(!1); 1753 case "ArrowUp": 1754 return b(!0); 1755 case "Enter": 1756 if (A !== -1) 1757 return $(a), Me(f[A].id); 1758 f.length && n(5, A = 0); 1759 } 1760 } 1761 function ce(a) { 1762 n(2, h = ""), n(46, _ = ""), n(5, A = -1), n(11, X = N.findIndex((b) => b.id === a.id)); 1763 } 1764 function ze(a) { 1765 const { target: b, key: E } = a, D = (Y) => { 1766 Y && ($(a), Y.focus()); 1767 }; 1768 switch (E) { 1769 case "ArrowLeft": 1770 return D(b.previousSibling); 1771 case "ArrowRight": 1772 return D(b.nextSibling); 1773 case "Home": 1774 return D(b.parentElement.firstChild); 1775 case "End": 1776 return D(b.parentElement.lastChild); 1777 } 1778 } 1779 async function Me(a) { 1780 const b = await s.getEmojiByUnicodeOrName(a), E = [...f, ...ie].find((Y) => Y.id === a), D = E.unicode && fe(E, y); 1781 await s.incrementFavoriteEmojiCount(a), P("emoji-click", { 1782 emoji: b, 1783 skinTone: y, 1784 ...D && { unicode: D }, 1785 ...E.name && { name: E.name } 1786 }); 1787 } 1788 async function ke(a) { 1789 const { target: b } = a; 1790 if (!b.classList.contains("emoji")) 1791 return; 1792 $(a); 1793 const E = b.id.substring(4); 1794 Me(E); 1795 } 1796 function ve(a) { 1797 n(8, y = a), n(6, I = !1), te("skintone-button"), P("skin-tone-change", { skinTone: a }), s.setPreferredSkinTone(a); 1798 } 1799 function we(a) { 1800 const { target: { id: b } } = a, E = b && b.match(/^skintone-(\d)/); 1801 if (!E) 1802 return; 1803 $(a); 1804 const D = parseInt(E[1], 10); 1805 ve(D); 1806 } 1807 function We(a) { 1808 n(6, I = !I), n(20, T = y), I && ($(a), Qe(() => te("skintone-list"))); 1809 } 1810 function Ee(a) { 1811 if (!I) 1812 return; 1813 const b = async (E) => { 1814 $(a), n(20, T = E); 1815 }; 1816 switch (a.key) { 1817 case "ArrowUp": 1818 return b(rt(!0, T, H)); 1819 case "ArrowDown": 1820 return b(rt(!1, T, H)); 1821 case "Home": 1822 return b(0); 1823 case "End": 1824 return b(H.length - 1); 1825 case "Enter": 1826 return $(a), ve(T); 1827 case "Escape": 1828 return $(a), n(6, I = !1), te("skintone-button"); 1829 } 1830 } 1831 function Ve(a) { 1832 if (I) 1833 switch (a.key) { 1834 case " ": 1835 return $(a), ve(T); 1836 } 1837 } 1838 async function je(a) { 1839 const { relatedTarget: b } = a; 1840 (!b || b.id !== "skintone-list") && n(6, I = !1); 1841 } 1842 function He() { 1843 h = this.value, n(2, h); 1844 } 1845 function l(a) { 1846 Ce[a ? "unshift" : "push"](() => { 1847 G = a, n(7, G); 1848 }); 1849 } 1850 const p = (a) => ce(a); 1851 function j(a) { 1852 Ce[a ? "unshift" : "push"](() => { 1853 k = a, n(3, k); 1854 }); 1855 } 1856 function cn(a) { 1857 Ce[a ? "unshift" : "push"](() => { 1858 v = a, n(17, v); 1859 }); 1860 } 1861 function un(a) { 1862 Ce[a ? "unshift" : "push"](() => { 1863 w = a, n(16, w); 1864 }); 1865 } 1866 return t.$$set = (a) => { 1867 "skinToneEmoji" in a && n(41, o = a.skinToneEmoji), "i18n" in a && n(0, r = a.i18n), "database" in a && n(40, s = a.database), "customEmoji" in a && n(42, c = a.customEmoji), "customCategorySorting" in a && n(43, m = a.customCategorySorting), "emojiVersion" in a && n(44, u = a.emojiVersion); 1868 }, t.$$.update = () => { 1869 if (t.$$.dirty[1] & /*customEmoji, database*/
1870 2560 && c && s && n(40, s.customEmoji = c, s), t.$$.dirty[0] & /*i18n*/ 1871 1 | t.$$.dirty[1] & /*database*/ 1872 512) { 1873 async function a() { 1874 let b = !1; 1875 const E = setTimeout( 1876 () => { 1877 b = !0, n(18, F = r.loadingMessage); 1878 }, 1879 yo 1880 ); 1881 try { 1882 await s.ready(), n(14, Q = !0); 1883 } catch (D) { 1884 console.error(D), n(18, F = r.networkErrorMessage); 1885 } finally { 1886 clearTimeout(E), b && (b = !1, n(18, F = "")); 1887 } 1888 } 1889 s && a(); 1890 } 1891 if (t.$$.dirty[0] & /*groups, currentGroupIndex*/ 1892 6144 | t.$$.dirty[1] & /*customEmoji*/ 1893 2048 && (c && c.length ? n(12, N = [go, ...qe]) : N !== qe && (X && n(11, X--, X), n(12, N = qe))), t.$$.dirty[0] & /*rawSearchText*/ 1894 4 && nn(() => { 1895 n(46, _ = (h || "").trim()), n(5, A = -1); 1896 }), t.$$.dirty[0] & /*groups, currentGroupIndex*/ 1897 6144 && n(13, U = N[X]), t.$$.dirty[0] & /*databaseLoaded, currentGroup*/ 1898 24576 | t.$$.dirty[1] & /*searchText*/ 1899 32768) { 1900 async function a() { 1901 if (!Q) 1902 n(1, f = []), n(4, L = !1); 1903 else if (_.length >= _o) { 1904 const b = _, E = await ye(b); 1905 b === _ && (n(1, f = E), n(4, L = !0)); 1906 } else if (U) { 1907 const b = U.id, E = await be(b); 1908 b === U.id && (n(1, f = E), n(4, L = !1)); 1909 } 1910 } 1911 a(); 1912 } 1913 if (t.$$.dirty[0] & /*groups, searchMode*/ 1914 4112 && n(22, W = ` 1915 --num-groups: ${N.length}; 1916 --indicator-opacity: ${L ? 0 : 1}; 1917 --num-skintones: ${Tt};`), t.$$.dirty[0] & /*databaseLoaded*/ 1918 16384 | t.$$.dirty[1] & /*database*/ 1919 512) { 1920 async function a() { 1921 Q && n(8, y = await s.getPreferredSkinTone()); 1922 } 1923 a(); 1924 } 1925 if (t.$$.dirty[1] & /*skinToneEmoji*/ 1926 1024 && n(9, H = Array(Tt).fill().map((a, b) => Oo(o, b))), t.$$.dirty[0] & /*skinTones, currentSkinTone*/ 1927 768 && n(21, R = H[y]), t.$$.dirty[0] & /*i18n, currentSkinTone*/ 1928 257 && n(23, se = r.skinToneLabel.replace("{skinTone}", r.skinTones[y])), t.$$.dirty[0] & /*databaseLoaded*/ 1929 16384 | t.$$.dirty[1] & /*database*/ 1930 512) { 1931 async function a() { 1932 n(47, B = (await Promise.all(wo.map((b) => s.getEmojiByUnicodeOrName(b)))).filter(Boolean)); 1933 } 1934 Q && a(); 1935 } 1936 if (t.$$.dirty[0] & /*databaseLoaded*/ 1937 16384 | t.$$.dirty[1] & /*database, numColumns, defaultFavoriteEmojis*/ 1938 197120) { 1939 async function a() { 1940 const b = await s.getTopFavoriteEmoji(z), E = await _e(rn([...b, ...B], (D) => D.unicode || D.name).slice(0, z)); 1941 n(10, ie = E); 1942 } 1943 Q && B && a(); 1944 } 1945 if (t.$$.dirty[0] & /*currentEmojis, tabpanelElement*/ 1946 10 | t.$$.dirty[1] & /*emojiVersion*/ 1947 8192) { 1948 const a = f.filter((b) => b.unicode).filter((b) => St(b) && !ft.has(b.unicode)); 1949 !u && a.length ? Qe(() => ge(a)) : (n(1, f = u ? f : f.filter(M)), Qe(() => No(k))); 1950 } 1951 t.$$.dirty[0] & /*currentEmojis, currentFavorites*/ 1952 1026 | t.$$.dirty[1] & /*initialLoad*/ 1953 16384, t.$$.dirty[0] & /*searchMode, currentEmojis*/ 1954 18 | t.$$.dirty[1] & /*customCategorySorting*/ 1955 4096 && n(15, g = function() { 1956 if (L) 1957 return [{ category: "", emojis: f }]; 1958 const b = /* @__PURE__ */ new Map(); 1959 for (const E of f) { 1960 const D = E.category || ""; 1961 let Y = b.get(D); 1962 Y || (Y = [], b.set(D, Y)), Y.push(E); 1963 } 1964 return [...b.entries()].map(([E, D]) => ({ category: E, emojis: D })).sort((E, D) => m(E.category, D.category)); 1965 }()), t.$$.dirty[0] & /*activeSearchItem, currentEmojis*/ 1966 34 && n(26, le = A !== -1 && f[A].id), t.$$.dirty[0] & /*skinTonePickerExpanded, skinToneDropdown*/ 1967 192 && (I ? G.addEventListener( 1968 "transitionend", 1969 () => { 1970 n(19, V = !0); 1971 }, 1972 { once: !0 } 1973 ) : n(19, V = !1)); 1974 }, [ 1975 r, 1976 f, 1977 h, 1978 k, 1979 L, 1980 A, 1981 I, 1982 G, 1983 y, 1984 H, 1985 ie, 1986 X, 1987 N, 1988 U, 1989 Q, 1990 g, 1991 w, 1992 v, 1993 F, 1994 V, 1995 T, 1996 R, 1997 W, 1998 se, 1999 Be, 2000 ae, 2001 le, 2002 fe, 2003 he, 2004 me, 2005 pe, 2006 ne, 2007 ce, 2008 ze, 2009 ke, 2010 we, 2011 We, 2012 Ee, 2013 Ve, 2014 je, 2015 s, 2016 o, 2017 c, 2018 m, 2019 u, 2020 d, 2021 _, 2022 B, 2023 z, 2024 He, 2025 l, 2026 p, 2027 j, 2028 cn, 2029 un 2030 ]; 2031} 2032class Ho extends po { 2033 constructor(e) { 2034 super(), mo( 2035 this, 2036 e, 2037 Vo, 2038 Wo, 2039 $n, 2040 { 2041 skinToneEmoji: 41, 2042 i18n: 0, 2043 database: 40, 2044 customEmoji: 42, 2045 customCategorySorting: 43, 2046 emojiVersion: 44 2047 }, 2048 null, 2049 [-1, -1, -1] 2050 ); 2051 } 2052} 2053const Xo = "https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json", Yo = "en"; 2054var Zo = { 2055 categoriesLabel: "Categories", 2056 emojiUnsupportedMessage: "Your browser does not support color emoji.", 2057 favoritesLabel: "Favorites", 2058 loadingMessage: "Loadingâ¦", 2059 networkErrorMessage: "Could not load emoji.", 2060 regionLabel: "Emoji picker", 2061 searchDescription: "When search results are available, press up or down to select and enter to choose.", 2062 searchLabel: "Search", 2063 searchResultsLabel: "Search results", 2064 skinToneDescription: "When expanded, press up or down to select and enter to choose.", 2065 skinToneLabel: "Choose a skin tone (currently {skinTone})",
2066 skinTonesLabel: "Skin tones", 2067 skinTones: [ 2068 "Default", 2069 "Light", 2070 "Medium-Light", 2071 "Medium", 2072 "Medium-Dark", 2073 "Dark" 2074 ], 2075 categories: { 2076 custom: "Custom", 2077 "smileys-emotion": "Smileys and emoticons", 2078 "people-body": "People and body", 2079 "animals-nature": "Animals and nature", 2080 "food-drink": "Food and drink", 2081 "travel-places": "Travel and places", 2082 activities: "Activities", 2083 objects: "Objects", 2084 symbols: "Symbols", 2085 flags: "Flags" 2086 } 2087}; 2088const sn = [ 2089 "customEmoji", 2090 "customCategorySorting", 2091 "database", 2092 "dataSource", 2093 "i18n", 2094 "locale", 2095 "skinToneEmoji", 2096 "emojiVersion" 2097], qo = `:host{--emoji-font-family:${on}}`; 2098class an extends HTMLElement { 2099 constructor(e) { 2100 super(), this.attachShadow({ mode: "open" }); 2101 const n = document.createElement("style"); 2102 n.textContent = ":host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}
2102.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.custom-emoji,.emoji,button.emoji{height:var(--total-emoji-size);width:var(--total-emoji-size)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.custom-emoji{padding:var(--emoji-padding);object-fit:contain;pointer-events:none;background-repeat:no-repeat;background-position:center center;background-size:var(--emoji-size) var(--emoji-size)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}" + qo, this.shadowRoot.appendChild(n), this._ctx = { 2103 // Set defaults 2104 locale: Yo, 2105 dataSource: Xo, 2106 skinToneEmoji: ko, 2107 customCategorySorting: Eo, 2108 customEmoji: null, 2109 i18n: Zo, 2110 emojiVersion: null, 2111 ...e 2112 }; 2113 for (const o of sn) 2114 o !== "database" && Object.prototype.hasOwnProperty.call(this, o) && (this._ctx[o] = this[o], delete this[o]); 2115 this._dbFlush(); 2116 } 2117 connectedCallback() { 2118 this._cmp || (this._cmp = new Ho({ 2119 target: this.shadowRoot, 2120 props: this._ctx 2121 })); 2122 } 2123 disconnectedCallback() { 2124 Promise.resolve().then(() => { 2125 if (!this.isConnected && this._cmp) { 2126 this._cmp.$destroy(), this._cmp = void 0; 2127 const { database: e } = this._ctx; 2128 e.close().catch((n) => console.error(n)); 2129 } 2130 }); 2131 } 2132 static get observedAttributes() { 2133 return ["locale", "data-source", "skin-tone-emoji", "emoji-version"]; 2134 } 2135 attributeChangedCallback(e, n, o) { 2136 this._set( 2137 // convert from kebab-case to camelcase 2138 // see https://github.com/sveltejs/svelte/issues/3852#issuecomment-665037015 2139 e.replace(/-([a-z])/g, (r, s) => s.toUpperCase()), 2140 // convert string attribute to float if necessary 2141 e === "emoji-version" ? parseFloat(o) : o 2142 ); 2143 } 2144 _set(e, n) { 2145 this._ctx[e] = n, this._cmp && this._cmp.$set({ [e]: n }), ["locale", "dataSource"].includes(e) && this._dbFlush(); 2146 } 2147 _dbCreate() { 2148 const { locale: e, dataSource: n, database: o } = this._ctx; 2149 (!o || o.locale !== e || o.dataSource !== n) && this._set("database", new Qn({ locale: e, dataSource: n })); 2150 } 2151 // Update the Database in one microtask if the locale/dataSource change. We do one microtask 2152 // so we don't create two Databases if e.g. both the locale and the dataSource change 2153 _dbFlush() { 2154 Promise.resolve().then(() => this._dbCreate()); 2155 } 2156} 2157const ln = {}; 2158for (const t of sn) 2159 ln[t] = { 2160 get() { 2161 return t === "database" && this._dbCreate(), this._ctx[t]; 2162 }, 2163 set(e) { 2164 if (t === "database") 2165 throw new Error("database is read-only"); 2166 this._set(t, e); 2167 } 2168 }; 2169Object.defineProperties(an.prototype, ln); 2170customElements.get("emoji-picker") || customElements.define("emoji-picker", an); 2171export { 2172 Qn as Database, 2173 an as Picker 2174};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.