171 lines
85 KiB
JavaScript
Vendored
171 lines
85 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7741],{57741:function(e,t,i){let o;i.d(t,{wU:function(){return tx}});var s,r,a,n,c,l,h,d,m,p,u,g,y,v,w=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},f=(e,t,i)=>(w(e,t,"read from private field"),i?i.call(e):t.get(e)),b=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},C=(e,t,i,o)=>(w(e,t,"write to private field"),o?o.call(e,i):t.set(e,i),i),j=(e,t,i)=>(w(e,t,"access private method"),i);async function _(e,t={}){let i;let{local:o=!1,version:s="latest",cdnUrl:r,...a}=t,n=(i=`https://cdn.jsdelivr.net/npm/emojibase-data@${s}/${e}`,"function"==typeof r?i=r(e,s):"string"==typeof r&&(i=`${r}/${e}`),i),c=o?localStorage:sessionStorage,l=`emojibase/${s}/${e}`,h=c.getItem(l);if(h)return Promise.resolve(JSON.parse(h));let d=await fetch(n,{credentials:"omit",mode:"cors",redirect:"error",...a});if(!d.ok)throw Error("Failed to load Emojibase dataset.");let m=await d.json();try{c.setItem(l,JSON.stringify(m))}catch{}return m}let k={discord:"joypixels",slack:"iamcal"};async function x(e,t,i){var o;return _(`${e}/shortcodes/${null!==(o=k[t])&&void 0!==o?o:t}.json`,i)}function E(e,t){if(0===t.length)return e;let i=new Set(e.shortcodes);return t.forEach(t=>{let o=t[e.hexcode];Array.isArray(o)?o.forEach(e=>i.add(e)):o&&i.add(o)}),e.shortcodes=[...i],e.skins&&e.skins.forEach(e=>{E(e,t)}),e}async function S(e,t={}){var i;let{compact:o=!1,flat:s=!1,shortcodes:r=[],...a}=t,n=await _(`${e}/${o?"compact":"data"}.json`,a),c=[];return r.length>0&&(c=await Promise.all(r.map(t=>{let i;if(t.includes("/")){let[e,o]=t.split("/");i=x(e,o,a)}else i=x(e,t,a);return i.catch(()=>({}))}))),s?function(e,t=[]){let i=[];return e.forEach(e=>{if(e.skins){let{skins:o,...s}=e;i.push(E(s,t)),o.forEach(e=>{let o={...e};s.tags&&(o.tags=[...s.tags]),i.push(E(o,t))})}else i.push(E(e,t))}),i}(n,c):(0===(i=c).length||n.forEach(e=>{E(e,i)}),n)}async function z(e,t){return _(`${e}/messages.json`,t)}function L(e,t){let i=e.target.closest("[data-emoji]");if(i){let e=t.find(e=>e.emoji===i.dataset.emoji);if(e)return e}return null}function P(e){var t;let i=null==(t=window.matchMedia)?void 0:t.call(window,"(prefers-reduced-motion: reduce)");return e.animate&&!(null!=i&&i.matches)}function F(e,t){return e.toLowerCase().includes(t.toLowerCase())}function $(e,t,i,o){if(P(o)&&e.animate)return e.animate(t,i).finished;let s="normal"===i.direction?1:0,r=Object.entries(t).reduce((e,[t,i])=>({...e,[t]:i[s]}),{});return Object.assign(e.style,r),Promise.resolve()}function A(e){var t;let i=document.createElement("template");return i.innerHTML=e,null==(t=i.content)?void 0:t.firstElementChild}async function I(e){let t=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")}function V(...e){return e.reduce((e,t)=>({...e,[t]:T(t)}),{})}function T(e){return`picmo__${e}`}function M(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function R(e,...t){M(e).append(...t)}function B(e){try{return window[e].length,!0}catch{return!1}}function D(e){var t;return{emoji:e.emoji,label:e.label,tags:e.tags,skins:null==(t=e.skins)?void 0:t.map(e=>D(e)),order:e.order,custom:!1,hexcode:e.hexcode,version:e.version}}function N(e,t,i){var o;return(!i||!!i.some(t=>t.order===e.group))&&(F(e.label,t)||(null==(o=e.tags)?void 0:o.some(e=>F(e,t))))}class H{constructor(e="en"){this.locale=e}}let O=[(e,t)=>("1F91D"===e.hexcode&&t<14&&(e.skins=[]),e),(e,t)=>(e.skins&&(e.skins=e.skins.filter(e=>!e.version||e.version<=t)),e)];function U(e,t){return e.filter(e=>null!==(O.some(i=>null===i(e,t))?null:e))}let K={};function W(e){return K[e]||(K[e]=new q(e)),K[e]}W.deleteDatabase=e=>{};class q extends H{open(){return Promise.resolve()}delete(){return Promise.resolve()}close(){}isPopulated(){return Promise.resolve(!1)}getEmojiCount(){return Promise.resolve(this.emojis.length)}getEtags(){return Promise.resolve({foo:"bar"})}getHash(){return Promise.resolve("")}populate(e){return this.categories=e.groups,this.emojis=e.emojis,Promise.resolve()}getCategories(e){var t;let i=this.categories.filter(e=>"component"!==e.key);if(e.showRecents&&i.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&i.push({key:"custom",order:10}),e.categories){let t=e.categories;(i=i.filter(e=>t.includes(e.key))).sort((e,i)=>t.indexOf(e.key)-t.indexOf(i.key))}else i.sort((e,t)=>e.order-t.order);return Promise.resolve(i)}getEmojis(e,t){let i=this.emojis.filter(t=>t.group===e.order).filter(e=>e.version<=t).sort((e,t)=>null!=e.order&&null!=t.order?e.order-t.order:0).map(D);return Promise.resolve(U(i,t))}searchEmojis(e,t,i,o){let s=this.emojis.filter(t=>N(t,e,o)&&t.version<=i).map(D),r=t.filter(t=>N(t,e,o)),a=[...U(s,i),...r];return Promise.resolve(a)}setMeta(e){this.meta=e}}async function G(e){try{return(await fetch(e,{method:"HEAD"})).headers.get("etag")}catch{return null}}async function J(e,t,i){let o;try{o=await e.getEtags()}catch{o={}}let{storedEmojisEtag:s,storedMessagesEtag:r}=o;if(i!==r||t!==s){let[o,s]=await Promise.all([z(e.locale),S(e.locale)]);await e.populate({groups:o.groups,emojis:s,emojisEtag:t,messagesEtag:i})}}async function Y(e,t){let i=await e.getHash();return t!==i}async function Q(e,t,i){let o=i||t(e);try{await o.open()}catch{console.warn("[picmo] IndexedDB not available, falling back to InMemoryStoreFactory"),o=W(e)}return o}async function X(e,t,i){if(!B("sessionStorage")&&"u">typeof window)throw Error("Session storage is required to use CDN emoji data.");let o=await Q(e,t,i),[s,r]=await function(e){let{emojisUrl:t,messagesUrl:i}=function(e,t){let i=`https://cdn.jsdelivr.net/npm/emojibase-data@${e}/${t}`;return{emojisUrl:`${i}/data.json`,messagesUrl:`${i}/messages.json`}}("latest",e);try{return Promise.all([G(t),G(i)])}catch{return Promise.all([null,null])}}(e);if(await o.isPopulated())s&&r&&await J(o,s,r);else{let[t,i]=await Promise.all([z(e),S(e)]);await o.populate({groups:t.groups,emojis:i,emojisEtag:s,messagesEtag:r})}return o}async function Z(e,t,i,o,s){let r=await Q(e,t,s),a=await I(o);return(!await r.isPopulated()||await Y(r,a))&&await r.populate({groups:i.groups,emojis:o,hash:a}),r}async function ee(e,t,i,o,s){return i&&o?Z(e,t,i,o,s):X(e,t,s)}class et{constructor(){this.handleKeyDown=this.handleKeyDown.bind(this)}activate(e){this.rootElement=e,this.rootElement.addEventListener("keydown",this.handleKeyDown)}deactivate(){var e;null==(e=this.rootElement)||e.removeEventListener("keydown",this.handleKeyDown)}get focusableElements(){return this.rootElement.querySelectorAll('input, [tabindex="0"]')}get lastFocusableElement(){return this.focusableElements[this.focusableElements.length-1]}get firstFocusableElement(){return this.focusableElements[0]}checkFocus(e,t,i){e.target===t&&(i.focus(),e.preventDefault())}handleKeyDown(e){"Tab"===e.key&&this.checkFocus(e,e.shiftKey?this.firstFocusableElement:this.lastFocusableElement,e.shiftKey?this.lastFocusableElement:this.firstFocusableElement)}}let{light:ei,dark:eo,auto:es}=V("light","dark","auto");class er{constructor({template:e,classes:t,parent:i}){this.isDestroyed=!1,this.appEvents={},this.uiEvents=[],this.uiElements={},this.ui={},this.template=e,this.classes=t,this.parent=i,this.keyBindingHandler=this.keyBindingHandler.bind(this)}initialize(){this.bindAppEvents()}setCustomEmojis(e){this.customEmojis=e}setEvents(e){this.events=e}setPickerId(e){this.pickerId=e}emit(e,...t){this.events.emit(e,...t)}setI18n(e){this.i18n=e}setRenderer(e){this.renderer=e}setEmojiData(e){this.emojiDataPromise=e,e.then(e=>{this.emojiData=e})}updateEmojiData(e){this.emojiData=e,this.emojiDataPromise=Promise.resolve(e)}setOptions(e){this.options=e}renderSync(e={}){return this.el=this.template.renderSync({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId,...e}),this.postRender(),this.el}async render(e={}){return await this.emojiDataPromise,this.el=await this.template.renderAsync({classes:this.classes,i18n:this.i18n,pickerId:this.pickerId,...e}),this.postRender(),this.el}postRender(){this.bindUIElements(),this.bindKeyBindings(),this.bindUIEvents(),this.scheduleShowAnimation()}bindAppEvents(){Object.keys(this.appEvents).forEach(e=>{this.events.on(e,this.appEvents[e],this)}),this.events.on("data:ready",this.updateEmojiData,this)}unbindAppEvents(){Object.keys(this.appEvents).forEach(e=>{this.events.off(e,this.appEvents[e])}),this.events.off("data:ready",this.updateEmojiData)}keyBindingHandler(e){let t=this.keyBindings[e.key];t&&t.call(this,e)}bindKeyBindings(){this.keyBindings&&this.el.addEventListener("keydown",this.keyBindingHandler)}unbindKeyBindings(){this.keyBindings&&this.el.removeEventListener("keydown",this.keyBindingHandler)}bindUIElements(){this.ui=Object.keys(this.uiElements).reduce((e,t)=>({...e,[t]:this.el.querySelector(this.uiElements[t])}),{})}bindUIEvents(){this.uiEvents.forEach(e=>{e.handler=e.handler.bind(this),(e.target?this.ui[e.target]:this.el).addEventListener(e.event,e.handler,e.options)})}unbindUIEvents(){this.uiEvents.forEach(e=>{(e.target?this.ui[e.target]:this.el).removeEventListener(e.event,e.handler)})}destroy(){this.unbindAppEvents(),this.unbindUIEvents(),this.unbindKeyBindings(),this.el.remove(),this.isDestroyed=!0}scheduleShowAnimation(){if(this.parent){let e=new MutationObserver(t=>{let[i]=t;"childList"===i.type&&i.addedNodes[0]===this.el&&(P(this.options)&&this.animateShow&&this.animateShow(),e.disconnect)});e.observe(this.parent,{childList:!0})}}static childEvent(e,t,i,o={}){return{target:e,event:t,handler:i,options:o}}static uiEvent(e,t,i={}){return{event:e,handler:t,options:i}}static byClass(e){return`.${e}`}}let ea=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
<defs>
|
|
<radialGradient gradientUnits="userSpaceOnUse" cy="10%" id="gradient-0">
|
|
<stop offset="0" stop-color="hsl(50, 100%, 50%)" />
|
|
<stop offset="1" stop-color="hsl(50, 100%, 60%)" />
|
|
</radialGradient>
|
|
</defs>
|
|
<!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
|
|
<ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="172.586" cy="207.006" rx="39.974" ry="39.974"/>
|
|
<ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="334.523" cy="207.481" rx="39.974" ry="39.974"/>
|
|
<ellipse stroke="#000" fill="rgba(0, 0, 0, 0.6)" cx="313.325" cy="356.208" rx="91.497" ry="59.893"/>
|
|
<path fill="#55a7ff" d="M 159.427 274.06 L 102.158 363.286 L 124.366 417.011 L 160.476 423.338 L 196.937 414.736 L 218.502 375.214"></path>
|
|
<path fill="url(#gradient-0)" d="M256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0zM256 352C290.9 352 323.2 367.8 348.3 394.9C354.3 401.4 364.4 401.7 370.9 395.7C377.4 389.7 377.7 379.6 371.7 373.1C341.6 340.5 301 320 256 320C247.2 320 240 327.2 240 336C240 344.8 247.2 352 256 352H256zM208 369C208 349 179.6 308.6 166.4 291.3C163.2 286.9 156.8 286.9 153.6 291.3C140.6 308.6 112 349 112 369C112 395 133.5 416 160 416C186.5 416 208 395 208 369H208zM303.6 208C303.6 225.7 317.1 240 335.6 240C353.3 240 367.6 225.7 367.6 208C367.6 190.3 353.3 176 335.6 176C317.1 176 303.6 190.3 303.6 208zM207.6 208C207.6 190.3 193.3 176 175.6 176C157.1 176 143.6 190.3 143.6 208C143.6 225.7 157.1 240 175.6 240C193.3 240 207.6 225.7 207.6 208z" />
|
|
</svg>`,en=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
<defs>
|
|
<radialGradient id="radial" cy="85%">
|
|
<stop offset="20%" stop-color="var(--color-secondary)" />
|
|
<stop offset="100%" stop-color="var(--color-primary)" />
|
|
</radialGradient>
|
|
</defs>
|
|
<!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
|
|
<path fill="url('#radial')" d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z" />
|
|
</svg>`,ec={clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"/></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"/></svg>',frown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM176.4 240C194 240 208.4 225.7 208.4 208C208.4 190.3 194 176 176.4 176C158.7 176 144.4 190.3 144.4 208C144.4 225.7 158.7 240 176.4 240zM336.4 176C318.7 176 304.4 190.3 304.4 208C304.4 225.7 318.7 240 336.4 240C354 240 368.4 225.7 368.4 208C368.4 190.3 354 176 336.4 176zM259.9 369.4C288.8 369.4 316.2 375.2 340.6 385.5C352.9 390.7 366.7 381.3 361.4 369.1C344.8 330.9 305.6 303.1 259.9 303.1C214.3 303.1 175.1 330.8 158.4 369.1C153.1 381.3 166.1 390.6 179.3 385.4C203.7 375.1 231 369.4 259.9 369.4L259.9 369.4z"/></svg>',gamepad:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M448 64H192C85.96 64 0 149.1 0 256s85.96 192 192 192h256c106 0 192-85.96 192-192S554 64 448 64zM247.1 280h-32v32c0 13.2-10.78 24-23.98 24c-13.2 0-24.02-10.8-24.02-24v-32L136 279.1C122.8 279.1 111.1 269.2 111.1 256c0-13.2 10.85-24.01 24.05-24.01L167.1 232v-32c0-13.2 10.82-24 24.02-24c13.2 0 23.98 10.8 23.98 24v32h32c13.2 0 24.02 10.8 24.02 24C271.1 269.2 261.2 280 247.1 280zM431.1 344c-22.12 0-39.1-17.87-39.1-39.1s17.87-40 39.1-40s39.1 17.88 39.1 40S454.1 344 431.1 344zM495.1 248c-22.12 0-39.1-17.87-39.1-39.1s17.87-40 39.1-40c22.12 0 39.1 17.88 39.1 40S518.1 248 495.1 248z"/></svg>',lightbulb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"/></svg>',mug:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M512 32H120c-13.25 0-24 10.75-24 24L96.01 288c0 53 43 96 96 96h192C437 384 480 341 480 288h32c70.63 0 128-57.38 128-128S582.6 32 512 32zM512 224h-32V96h32c35.25 0 64 28.75 64 64S547.3 224 512 224zM560 416h-544C7.164 416 0 423.2 0 432C0 458.5 21.49 480 48 480h480c26.51 0 48-21.49 48-48C576 423.2 568.8 416 560 416z"/></svg>',plane:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M482.3 192C516.5 192 576 221 576 256C576 292 516.5 320 482.3 320H365.7L265.2 495.9C259.5 505.8 248.9 512 237.4 512H181.2C170.6 512 162.9 501.8 165.8 491.6L214.9 320H112L68.8 377.6C65.78 381.6 61.04 384 56 384H14.03C6.284 384 0 377.7 0 369.1C0 368.7 .1818 367.4 .5398 366.1L32 256L.5398 145.9C.1818 144.6 0 143.3 0 142C0 134.3 6.284 128 14.03 128H56C61.04 128 65.78 130.4 68.8 134.4L112 192H214.9L165.8 20.4C162.9 10.17 170.6 0 181.2 0H237.4C248.9 0 259.5 6.153 265.2 16.12L365.7 192H482.3z"/></svg>',robot:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M9.375 233.4C3.375 239.4 0 247.5 0 256v128c0 8.5 3.375 16.62 9.375 22.62S23.5 416 32 416h32V224H32C23.5 224 15.38 227.4 9.375 233.4zM464 96H352V32c0-17.62-14.38-32-32-32S288 14.38 288 32v64H176C131.8 96 96 131.8 96 176V448c0 35.38 28.62 64 64 64h320c35.38 0 64-28.62 64-64V176C544 131.8 508.3 96 464 96zM256 416H192v-32h64V416zM224 296C201.9 296 184 278.1 184 256S201.9 216 224 216S264 233.9 264 256S246.1 296 224 296zM352 416H288v-32h64V416zM448 416h-64v-32h64V416zM416 296c-22.12 0-40-17.88-40-40S393.9 216 416 216S456 233.9 456 256S438.1 296 416 296zM630.6 233.4C624.6 227.4 616.5 224 608 224h-32v192h32c8.5 0 16.62-3.375 22.62-9.375S640 392.5 640 384V256C640 247.5 636.6 239.4 630.6 233.4z"/></svg>',sad:ea,search:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>',smiley:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256.3 331.8C208.9 331.8 164.1 324.9 124.5 312.8C112.2 309 100.2 319.7 105.2 331.5C130.1 390.6 188.4 432 256.3 432C324.2 432 382.4 390.6 407.4 331.5C412.4 319.7 400.4 309 388.1 312.8C348.4 324.9 303.7 331.8 256.3 331.8H256.3zM176.4 176C158.7 176 144.4 190.3 144.4 208C144.4 225.7 158.7 240 176.4 240C194 240 208.4 225.7 208.4 208C208.4 190.3 194 176 176.4 176zM336.4 240C354 240 368.4 225.7 368.4 208C368.4 190.3 354 176 336.4 176C318.7 176 304.4 190.3 304.4 208C304.4 225.7 318.7 240 336.4 240z"/></svg>',symbols:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"/></svg>',tree:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M413.8 447.1L256 448l0 31.99C256 497.7 241.8 512 224.1 512c-17.67 0-32.1-14.32-32.1-31.99l0-31.99l-158.9-.0099c-28.5 0-43.69-34.49-24.69-56.4l68.98-79.59H62.22c-25.41 0-39.15-29.8-22.67-49.13l60.41-70.85H89.21c-21.28 0-32.87-22.5-19.28-37.31l134.8-146.5c10.4-11.3 28.22-11.3 38.62-.0033l134.9 146.5c13.62 14.81 2.001 37.31-19.28 37.31h-10.77l60.35 70.86c16.46 19.34 2.716 49.12-22.68 49.12h-15.2l68.98 79.59C458.7 413.7 443.1 447.1 413.8 447.1z"/></svg>',users:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M224 256c70.7 0 128-57.31 128-128S294.7 0 224 0C153.3 0 96 57.31 96 128S153.3 256 224 256zM274.7 304H173.3c-95.73 0-173.3 77.6-173.3 173.3C0 496.5 15.52 512 34.66 512H413.3C432.5 512 448 496.5 448 477.3C448 381.6 370.4 304 274.7 304zM479.1 320h-73.85C451.2 357.7 480 414.1 480 477.3C480 490.1 476.2 501.9 470 512h138C625.7 512 640 497.6 640 479.1C640 391.6 568.4 320 479.1 320zM432 256C493.9 256 544 205.9 544 144S493.9 32 432 32c-25.11 0-48.04 8.555-66.72 22.51C376.8 76.63 384 101.4 384 128c0 35.52-11.93 68.14-31.59 94.71C372.7 243.2 400.8 256 432 256z"/></svg>',warning:en,xmark:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>'},el={recents:"clock","smileys-emotion":"smiley","people-body":"users","animals-nature":"tree","food-drink":"mug",activities:"gamepad","travel-places":"plane",objects:"lightbulb",symbols:"symbols",flags:"flag",custom:"robot"};function eh(e,t){if(!(e in ec))return console.warn(`Unknown icon: "${e}"`),document.createElement("div");let i=function(e,t){let i=A(t);return i.dataset.icon=e,i.classList.add(T("icon")),i}(e,ec[e]);return t&&i.classList.add(T(`icon-${t}`)),i}let ed={mode:"sync"};class em{constructor(e,t={}){b(this,a),b(this,c),b(this,h),b(this,s,void 0),b(this,r,void 0),C(this,s,e),C(this,r,t.mode||ed.mode)}renderSync(e={}){let t=A(f(this,s).call(this,e));return j(this,h,d).call(this,t,e),j(this,c,l).call(this,t),j(this,a,n).call(this,t,e),t}async renderAsync(e={}){let t=A(f(this,s).call(this,e));return j(this,h,d).call(this,t,e),j(this,c,l).call(this,t),await j(this,a,n).call(this,t,e),t}render(e){return"sync"===f(this,r)?this.renderSync(e):this.renderAsync(e)}}s=new WeakMap,r=new WeakMap,a=new WeakSet,n=async function(e,t){let i=e.querySelectorAll("[data-view]"),o=[];for(let e of i){let i=t[e.dataset.view];i?"sync"!==e.dataset.render?o.push(i.render().then(t=>(e.replaceWith(t),t))):e.replaceWith(i.renderSync()):e.remove()}return Promise.all(o)},c=new WeakSet,l=function(e){e.querySelectorAll("i[data-icon]").forEach(e=>{let{icon:t,size:i}=e.dataset;e.replaceWith(eh(t,i))})},h=new WeakSet,d=function(e,t){return e.querySelectorAll("[data-placeholder]").forEach(e=>{let i=e.dataset.placeholder;if(i&&t[i]){let o=t[i];e.replaceWith(...[o].flat())}else console.warn(`Missing placeholder element for key "${i}"`)}),e};let ep=V("imagePlaceholder","placeholder"),eu=new em(({classes:e})=>`
|
|
<div class="${e.placeholder} ${e.imagePlaceholder}"></div>
|
|
`);class eg extends er{constructor({classNames:e}={}){super({template:eu,classes:ep}),this.classNames=e}load(e){let t=document.createElement("img");this.classNames&&(t.className=this.classNames),t.addEventListener("load",()=>{this.el.replaceWith(t)},{once:!0}),Promise.resolve(e).then(e=>t.src=e)}renderSync(){return super.renderSync(),this.classNames&&this.classNames.split(" ").forEach(e=>this.el.classList.add(e)),this.el}}let ey=V("customEmoji");class ev{renderElement(e){return{content:e}}renderImage(e="",t){let i=new eg({classNames:e});return i.renderSync(),{content:i,resolver:()=>(i.load(t()),i.el)}}doRender(e,t,i){if(e.custom)return this.renderCustom(e,t,i);let{content:o,resolver:s}=this.render(e,i),r=o instanceof Element?o:o.el;return s&&s(),r}doEmit(e){return e.custom?this.emitCustom(e):this.emit(e)}emitCustom({url:e,label:t,emoji:i,data:o}){return{url:e,label:t,emoji:i,data:o}}renderCustom(e,t,i=""){let o=[ey.customEmoji,i].join(" ").trim(),{content:s,resolver:r}=this.renderImage(o,()=>e.url),a=s instanceof Element?s:s.el;return r&&r(),a}}let ew=new em(({emoji:e})=>`<span>${e}</span>`);class ef extends ev{render(e){return this.renderElement(ew.renderSync({emoji:e.emoji}))}emit({emoji:e,hexcode:t,label:i}){return{emoji:e,hexcode:t,label:i}}}let eb="PicMo";function eC(e){return new ej(e)}eC.deleteDatabase=e=>new Promise((t,i)=>{let o=indexedDB.deleteDatabase(`${eb}-${e}`);o.addEventListener("success",t),o.addEventListener("error",i)});class ej extends H{async open(){let e=indexedDB.open(`${eb}-${this.locale}`);return new Promise((t,i)=>{e.addEventListener("success",e=>{var i;this.db=null==(i=e.target)?void 0:i.result,t()}),e.addEventListener("error",i),e.addEventListener("upgradeneeded",async e=>{var t;this.db=null==(t=e.target)?void 0:t.result,this.db.createObjectStore("category",{keyPath:"order"});let i=this.db.createObjectStore("emoji",{keyPath:"emoji"});i.createIndex("category","group"),i.createIndex("version","version"),this.db.createObjectStore("meta")})})}async delete(){this.close();let e=indexedDB.deleteDatabase(`${eb}-${this.locale}`);await this.waitForRequest(e)}close(){this.db.close()}async getEmojiCount(){let e=this.db.transaction("emoji","readonly").objectStore("emoji");return(await this.waitForRequest(e.count())).target.result}async getEtags(){let e=this.db.transaction("meta","readonly").objectStore("meta"),[t,i]=await Promise.all([this.waitForRequest(e.get("emojisEtag")),this.waitForRequest(e.get("messagesEtag"))]);return{storedEmojisEtag:t.target.result,storedMessagesEtag:i.target.result}}async setMeta(e){let t=this.db.transaction("meta","readwrite"),i=t.objectStore("meta");return new Promise(o=>{t.oncomplete=o,Object.keys(e).filter(Boolean).forEach(t=>{i.put(e[t],t)})})}async getHash(){let e=this.db.transaction("meta","readonly").objectStore("meta");return(await this.waitForRequest(e.get("hash"))).target.result}async isPopulated(){let e=this.db.transaction("category","readonly").objectStore("category");return(await this.waitForRequest(e.count())).target.result>0}async populate({groups:e,emojis:t,emojisEtag:i,messagesEtag:o,hash:s}){await this.removeAllObjects("category","emoji");let r=[this.addObjects("category",e),this.addObjects("emoji",t),this.setMeta({emojisEtag:i,messagesEtag:o,hash:s})];await Promise.all(r)}async getCategories(e){var t;let i=this.db.transaction("category","readonly").objectStore("category"),o=(await this.waitForRequest(i.getAll())).target.result.filter(e=>"component"!==e.key);if(e.showRecents&&o.unshift({key:"recents",order:-1}),null!=(t=e.custom)&&t.length&&o.push({key:"custom",order:10}),e.categories){let t=e.categories;(o=o.filter(e=>t.includes(e.key))).sort((e,i)=>t.indexOf(e.key)-t.indexOf(i.key))}else o.sort((e,t)=>e.order-t.order);return o}async getEmojis(e,t){let i=this.db.transaction("emoji","readonly").objectStore("emoji").index("category"),o=(await this.waitForRequest(i.getAll(e.order))).target.result.filter(e=>e.version<=t).sort((e,t)=>null!=e.order&&null!=t.order?e.order-t.order:0).map(D);return U(o,t)}async searchEmojis(e,t,i,o){let s=[];return new Promise((r,a)=>{let n=this.db.transaction("emoji","readonly").objectStore("emoji").openCursor();n.addEventListener("success",a=>{var n;let c=null==(n=a.target)?void 0:n.result;if(!c)return r([...U(s,i),...t.filter(t=>N(t,e))]);let l=c.value;N(l,e,o)&&l.version<=i&&s.push(D(l)),c.continue()}),n.addEventListener("error",e=>{a(e)})})}async waitForRequest(e){return new Promise((t,i)=>{e.onsuccess=t,e.onerror=i})}withTransaction(e,t="readwrite",i){return new Promise((o,s)=>{let r=this.db.transaction(e,t);r.oncomplete=o,r.onerror=s,i(r)})}async removeAllObjects(...e){let t=this.db.transaction(e,"readwrite"),i=e.map(e=>t.objectStore(e));await Promise.all(i.map(e=>this.waitForRequest(e.clear())))}async addObjects(e,t){return this.withTransaction(e,"readwrite",i=>{let o=i.objectStore(e);t.forEach(e=>{o.add(e)})})}}class e_{}let ek="PicMo:recents";class ex extends e_{constructor(e){super(),this.storage=e}clear(){this.storage.removeItem(ek)}getRecents(e){var t;try{return JSON.parse(null!=(t=this.storage.getItem(ek))?t:"[]").slice(0,e)}catch{return[]}}addOrUpdateRecent(e,t){let i=[e,...this.getRecents(t).filter(t=>t.hexcode!==e.hexcode)].slice(0,t);try{this.storage.setItem(ek,JSON.stringify(i))}catch{console.warn("storage is not available, recent emojis will not be saved")}}}class eE extends ex{constructor(){let e;super(B("localStorage")?localStorage:{getItem:t=>e[t],setItem:(t,i)=>e[t]=i,length:Object.keys(e={}).length,clear:()=>e={},key:t=>Object.keys(e)[t],removeItem:t=>delete e[t]})}}let eS={dataStore:eC,theme:ei,animate:!0,showCategoryTabs:!0,showPreview:!0,showRecents:!0,showSearch:!0,showVariants:!0,emojisPerRow:8,visibleRows:6,emojiVersion:"auto",i18n:{"categories.activities":"Activities","categories.animals-nature":"Animals & Nature","categories.custom":"Custom","categories.flags":"Flags","categories.food-drink":"Food & Drink","categories.objects":"Objects","categories.people-body":"People & Body","categories.recents":"Recently Used","categories.smileys-emotion":"Smileys & Emotion","categories.symbols":"Symbols","categories.travel-places":"Travel & Places","error.load":"Failed to load emojis","recents.clear":"Clear recent emojis","recents.none":"You haven't selected any emojis yet.",retry:"Try again","search.clear":"Clear search","search.error":"Failed to search emojis","search.notFound":"No results found",search:"Search emojis..."},locale:"en",maxRecents:50,custom:[]};class ez{constructor(){b(this,p),b(this,g),b(this,m,new Map)}on(e,t,i){j(this,g,y).call(this,e,t,i)}once(e,t,i){j(this,g,y).call(this,e,t,i,!0)}off(e,t){let i=j(this,p,u).call(this,e);f(this,m).set(e,i.filter(e=>e.handler!==t))}emit(e,...t){j(this,p,u).call(this,e).forEach(i=>{i.handler.apply(i.context,t),i.once&&this.off(e,i.handler)})}removeAll(){f(this,m).clear()}}m=new WeakMap,p=new WeakSet,u=function(e){return f(this,m).has(e)||f(this,m).set(e,[]),f(this,m).get(e)},g=new WeakSet,y=function(e,t,i,o=!1){j(this,p,u).call(this,e).push({context:i,handler:t,once:o})};let eL={injectStyles:!0};class eP extends ez{}class eF extends ez{}let e$=V("emojiCategory","categoryName","noRecents","recentEmojis");class eA extends er{constructor({template:e,category:t,showVariants:i,lazyLoader:o}){super({template:e,classes:e$}),this.baseUIElements={categoryName:er.byClass(e$.categoryName)},this.category=t,this.showVariants=i,this.lazyLoader=o}setActive(e,t,i){this.emojiContainer.setActive(e,t,i)}}let eI=new em(({classes:e,emoji:t})=>`
|
|
<button
|
|
type="button"
|
|
class="${e.emojiButton}"
|
|
title="${t.label}"
|
|
data-emoji="${t.emoji}"
|
|
tabindex="-1">
|
|
<div data-placeholder="emojiContent"></div>
|
|
</button>
|
|
`),eV=V("emojiButton");class eT extends er{constructor({emoji:e,lazyLoader:t,category:i}){super({template:eI,classes:eV}),this.emoji=e,this.lazyLoader=t,this.category=i}initialize(){this.uiEvents=[er.uiEvent("focus",this.handleFocus)],super.initialize()}handleFocus(){this.category&&this.events.emit("focus:change",this.category)}activateFocus(e){this.el.tabIndex=0,e&&this.el.focus()}deactivateFocus(){this.el.tabIndex=-1}renderSync(){return super.renderSync({emoji:this.emoji,emojiContent:this.renderer.doRender(this.emoji,this.lazyLoader)})}}class eM{constructor(e,t,i=0,o=0,s=!1){this.events=new ez,this.keyHandlers={ArrowLeft:this.focusPrevious.bind(this),ArrowRight:this.focusNext.bind(this),ArrowUp:this.focusUp.bind(this),ArrowDown:this.focusDown.bind(this)},this.rowCount=Math.ceil(t/e),this.columnCount=e,this.focusedRow=i,this.focusedColumn=o,this.emojiCount=t,this.wrap=s,this.handleKeyDown=this.handleKeyDown.bind(this)}destroy(){this.events.removeAll()}on(e,t){this.events.on(e,t)}handleKeyDown(e){e.key in this.keyHandlers&&(e.preventDefault(),this.keyHandlers[e.key]())}setCell(e,t,i=!0){let o=this.getIndex();this.focusedRow=e,void 0!==t&&(this.focusedColumn=Math.min(this.columnCount,t)),(this.focusedRow>=this.rowCount||this.getIndex()>=this.emojiCount)&&(this.focusedRow=this.rowCount-1,this.focusedColumn=this.emojiCount%this.columnCount-1),this.events.emit("focus:change",{from:o,to:this.getIndex(),performFocus:i})}setFocusedIndex(e,t=!0){let i=Math.floor(e/this.columnCount),o=e%this.columnCount;this.setCell(i,o,t)}focusNext(){this.focusedColumn<this.columnCount-1&&this.getIndex()<this.emojiCount-1?this.setCell(this.focusedRow,this.focusedColumn+1):this.focusedRow<this.rowCount-1?this.setCell(this.focusedRow+1,0):this.wrap?this.setCell(0,0):this.events.emit("focus:overflow",0)}focusPrevious(){this.focusedColumn>0?this.setCell(this.focusedRow,this.focusedColumn-1):this.focusedRow>0?this.setCell(this.focusedRow-1,this.columnCount-1):this.wrap?this.setCell(this.rowCount-1,this.columnCount-1):this.events.emit("focus:underflow",this.columnCount-1)}focusUp(){this.focusedRow>0?this.setCell(this.focusedRow-1,this.focusedColumn):this.events.emit("focus:underflow",this.focusedColumn)}focusDown(){this.focusedRow<this.rowCount-1?this.setCell(this.focusedRow+1,this.focusedColumn):this.events.emit("focus:overflow",this.focusedColumn)}focusToIndex(e){this.setCell(Math.floor(e/this.columnCount),e%this.columnCount)}getIndex(){return this.focusedRow*this.columnCount+this.focusedColumn}getCell(){return{row:this.focusedRow,column:this.focusedColumn}}getRowCount(){return this.rowCount}}let eR=new em(({classes:e})=>`
|
|
<div class="${e.emojiContainer}">
|
|
<div data-placeholder="emojis"></div>
|
|
</div>
|
|
`),eB=V("emojiContainer");class eD extends er{constructor({emojis:e,showVariants:t,preview:i=!0,lazyLoader:o,category:s,fullHeight:r=!1}){super({template:eR,classes:eB}),this.fullHeight=!1,this.showVariants=t,this.lazyLoader=o,this.preview=i,this.emojis=e,this.category=s,this.fullHeight=r,this.setFocus=this.setFocus.bind(this),this.triggerNextCategory=this.triggerNextCategory.bind(this),this.triggerPreviousCategory=this.triggerPreviousCategory.bind(this)}initialize(){this.grid=new eM(this.options.emojisPerRow,this.emojiCount,0,0,!this.category),this.grid.on("focus:change",this.setFocus),this.grid.on("focus:overflow",this.triggerNextCategory),this.grid.on("focus:underflow",this.triggerPreviousCategory),this.uiEvents=[er.uiEvent("click",this.selectEmoji),er.uiEvent("keydown",this.grid.handleKeyDown)],this.preview&&this.uiEvents.push(er.uiEvent("mouseover",this.showPreview),er.uiEvent("mouseout",this.hidePreview),er.uiEvent("focus",this.showPreview,{capture:!0}),er.uiEvent("blur",this.hidePreview,{capture:!0})),super.initialize()}setFocusedView(e,t){if(e){if("string"==typeof e){let t=this.emojis.findIndex(t=>t.emoji===e);this.grid.setFocusedIndex(t,!1),setTimeout(()=>{var e,i,o,s;let r=this.emojiViews[t].el;r.scrollIntoView();let a=null==(e=r.parentElement)?void 0:e.previousElementSibling,n=null==(o=null==(i=r.parentElement)?void 0:i.parentElement)?void 0:o.parentElement;n.scrollTop-=null!=(s=null==a?void 0:a.offsetHeight)?s:0})}else"first"===e.row||0===e.row?this.grid.setCell(0,e.offset,t):"last"===e.row&&this.grid.setCell(this.grid.getRowCount()-1,e.offset,t)}}setActive(e,t,i){var o;e?this.setFocusedView(t,i):null==(o=this.emojiViews[this.grid.getIndex()])||o.deactivateFocus()}renderSync(){return this.emojiViews=this.emojis.map(e=>this.viewFactory.create(eT,{emoji:e,category:this.category,lazyLoader:this.lazyLoader,renderer:this.renderer})),this.emojiElements=this.emojiViews.map(e=>e.renderSync()),super.renderSync({emojis:this.emojiElements,i18n:this.i18n})}destroy(){super.destroy(),this.emojiViews.forEach(e=>e.destroy()),this.grid.destroy()}triggerPreviousCategory(e){this.events.emit("category:previous",e)}triggerNextCategory(e){this.category&&this.events.emit("category:next",e)}setFocus({from:e,to:t,performFocus:i}){var o,s;null==(o=this.emojiViews[e])||o.deactivateFocus(),null==(s=this.emojiViews[t])||s.activateFocus(i)}selectEmoji(e){e.stopPropagation();let t=L(e,this.emojis);t&&this.events.emit("emoji:select",{emoji:t,showVariants:this.showVariants})}showPreview(e){let t=e.target.closest("button"),i=null==t?void 0:t.firstElementChild,o=L(e,this.emojis);o&&this.events.emit("preview:show",o,null==i?void 0:i.cloneNode(!0))}hidePreview(e){L(e,this.emojis)&&this.events.emit("preview:hide")}get emojiCount(){return this.emojis.length}}let eN=new em(({classes:e,category:t,pickerId:i,icon:o,i18n:s})=>`
|
|
<section class="${e.emojiCategory}" role="tabpanel" aria-labelledby="${i}-category-${t.key}">
|
|
<h3 data-category="${t.key}" class="${e.categoryName}">
|
|
<i data-icon="${o}"></i>
|
|
${s.get(`categories.${t.key}`,t.message||t.key)}
|
|
</h3>
|
|
<div data-view="emojis" data-render="sync"></div>
|
|
</section>
|
|
`);class eH extends eA{constructor({category:e,showVariants:t,lazyLoader:i,emojiVersion:o}){super({category:e,showVariants:t,lazyLoader:i,template:eN}),this.showVariants=t,this.lazyLoader=i,this.emojiVersion=o}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){await this.emojiDataPromise;let e=await this.emojiData.getEmojis(this.category,this.emojiVersion);return this.emojiContainer=this.viewFactory.create(eD,{emojis:e,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:e.length,icon:el[this.category.key]})}}class eO extends eD{constructor({category:e,emojis:t,preview:i=!0,lazyLoader:o}){super({category:e,emojis:t,showVariants:!1,preview:i,lazyLoader:o})}async addOrUpdate(e){let t=this.el.querySelector(`[data-emoji="${e.emoji}"]`);t&&(this.el.removeChild(t),this.emojis=this.emojis.filter(t=>t!==e));let i=this.viewFactory.create(eT,{emoji:e});if(this.el.insertBefore(i.renderSync(),this.el.firstChild),this.emojis=[e,...this.emojis.filter(t=>t!==e)],this.emojis.length>this.options.maxRecents){this.emojis=this.emojis.slice(0,this.options.maxRecents);let e=this.el.childElementCount-this.options.maxRecents;for(let t=0;t<e;t++)this.el.lastElementChild&&this.el.removeChild(this.el.lastElementChild)}}}let eU=new em(({emojiCount:e,classes:t,category:i,pickerId:o,icon:s,i18n:r})=>`
|
|
<section class="${t.emojiCategory}" role="tabpanel" aria-labelledby="${o}-category-${i.key}">
|
|
<h3 data-category="${i.key}" class="${t.categoryName}">
|
|
<i data-icon="${s}"></i>
|
|
${r.get(`categories.${i.key}`,i.message||i.key)}
|
|
</h3>
|
|
<div data-empty="${0===e}" class="${t.recentEmojis}">
|
|
<div data-view="emojis" data-render="sync"></div>
|
|
</div>
|
|
<div class="${t.noRecents}">
|
|
${r.get("recents.none")}
|
|
</div>
|
|
</section>
|
|
`,{mode:"async"}),eK=new em(({classes:e,category:t,pickerId:i,icon:o,i18n:s})=>`
|
|
<section class="${e.emojiCategory}" role="tabpanel" aria-labelledby="${i}-category-${t.key}">
|
|
<h3 data-category="${t.key}" class="${e.categoryName}">
|
|
<i data-icon="${o}"></i>
|
|
${s.get(`categories.${t.key}`,t.message||t.key)}
|
|
</h3>
|
|
<div data-view="emojis" data-render="sync"></div>
|
|
</section>
|
|
`);class eW{constructor(){this.elements=new Map}lazyLoad(e,t){return this.elements.set(e,t),e}observe(e){if(window.IntersectionObserver){let t=new IntersectionObserver(e=>{e.filter(e=>e.intersectionRatio>0).map(e=>e.target).forEach(e=>{let i=this.elements.get(e);null==i||i(),t.unobserve(e)})},{root:e});this.elements.forEach((e,i)=>{t.observe(i)})}else this.elements.forEach(e=>{e()})}}let eq=V("emojiArea"),eG=new em(({classes:e})=>`
|
|
<div class="${e.emojiArea}">
|
|
<div data-placeholder="emojis"></div>
|
|
</div>
|
|
`,{mode:"async"}),eJ={recents:class extends eA{constructor({category:e,lazyLoader:t,provider:i}){super({category:e,showVariants:!1,lazyLoader:t,template:eU}),this.provider=i}initialize(){this.uiElements={...this.baseUIElements,recents:er.byClass(e$.recentEmojis)},this.appEvents={"recent:add":this.addRecent},super.initialize()}async addRecent(e){await this.emojiContainer.addOrUpdate(e),this.ui.recents.dataset.empty="false"}async render(){var e;let t=null==(e=this.provider)?void 0:e.getRecents(this.options.maxRecents);return this.emojiContainer=this.viewFactory.create(eO,{emojis:t,showVariants:!1,lazyLoader:this.lazyLoader,category:this.category.key}),await super.render({category:this.category,emojis:this.emojiContainer,emojiCount:t.length,icon:el[this.category.key]}),this.el}},custom:class extends eA{constructor({category:e,lazyLoader:t}){super({template:eK,showVariants:!1,lazyLoader:t,category:e})}initialize(){this.uiElements={...this.baseUIElements},super.initialize()}async render(){return this.emojiContainer=this.viewFactory.create(eD,{emojis:this.customEmojis,showVariants:this.showVariants,lazyLoader:this.lazyLoader,category:this.category.key}),super.render({category:this.category,emojis:this.emojiContainer,emojiCount:this.customEmojis.length,icon:el[this.category.key]})}}};class eY extends er{constructor({categoryTabs:e,categories:t,emojiVersion:i}){var o;let s;super({template:eG,classes:eq}),this.selectedCategory=0,this.scrollListenerState="active",this.lazyLoader=new eW,this.categoryTabs=e,this.categories=t,this.emojiVersion=i,this.handleScroll=(o=this.handleScroll.bind(this),s=null,()=>{s||(s=window.setTimeout(()=>{o(),s=null},100))})}initialize(){this.appEvents={"category:select":this.handleCategorySelect,"category:previous":this.focusPreviousCategory,"category:next":this.focusNextCategory,"focus:change":this.updateFocusedCategory},this.uiElements={emojis:er.byClass(eq.emojiArea)},this.uiEvents=[er.uiEvent("scroll",this.handleScroll)],super.initialize()}get focusableEmoji(){return this.el.querySelector('[tabindex="0"]')}async render(){this.emojiCategories=this.categories.map(this.createCategory,this);let e={};return this.categories.forEach((t,i)=>{e[`emojis-${t.key}`]=this.emojiCategories[i]}),await super.render({emojis:await Promise.all(this.emojiCategories.map(e=>e.render()))}),this.lazyLoader.observe(this.el),this.el}destroy(){super.destroy(),this.emojiCategories.forEach(e=>{var t;null==(t=this.observer)||t.unobserve(e.el),e.destroy()})}handleCategorySelect(e,t){this.el.style.overflow="hidden",this.selectCategory(e,t),this.el.style.overflow="auto"}createCategory(e){let t=eJ[e.key]||eH;return this.viewFactory.create(t,{category:e,showVariants:!0,lazyLoader:this.lazyLoader,emojiVersion:this.emojiVersion,provider:this.options.recentsProvider})}determineInitialCategory(){var e;return this.options.initialCategory&&this.categories.find(e=>e.key===this.options.initialCategory)?this.options.initialCategory:null==(e=this.categories.find(e=>"recents"!==e.key))?void 0:e.key}determineFocusTarget(e){let t=this.emojiCategories.find(t=>t.category.key===e);return this.options.initialEmoji&&(null==t?void 0:t.el.querySelector(`[data-emoji="${this.options.initialEmoji}"]`))?this.options.initialEmoji:"button"}reset(e=!0){this.events.emit("preview:hide");let t=this.determineInitialCategory();t&&(this.selectCategory(t,{focus:this.determineFocusTarget(t),performFocus:e,scroll:"jump"}),this.selectedCategory=this.getCategoryIndex(t))}getCategoryIndex(e){return this.categories.findIndex(t=>t.key===e)}focusPreviousCategory(e){this.selectedCategory>0&&this.focusCategory(this.selectedCategory-1,{row:"last",offset:null!=e?e:this.options.emojisPerRow})}focusNextCategory(e){this.selectedCategory<this.categories.length-1&&this.focusCategory(this.selectedCategory+1,{row:"first",offset:null!=e?e:0})}focusCategory(e,t){this.selectCategory(e,{focus:t,performFocus:!0})}async selectCategory(e,t={}){var i;this.scrollListenerState="suspend";let{focus:o,performFocus:s,scroll:r}={performFocus:!1,...t};this.emojiCategories[this.selectedCategory].setActive(!1);let a=this.selectedCategory="number"==typeof e?e:this.getCategoryIndex(e);null==(i=this.categoryTabs)||i.setActiveTab(this.selectedCategory,{performFocus:s,scroll:"button"===o});let n=this.emojiCategories[a].el.offsetTop;this.emojiCategories[a].setActive(!0,o&&"button"!==o?o:{row:"first",offset:0},"button"!==o&&s),r&&(this.el.scrollTop=n),this.scrollListenerState="resume"}updateFocusedCategory(e){var t;this.categories[this.selectedCategory].key!==e&&(this.scrollListenerState="suspend",this.selectedCategory=this.getCategoryIndex(e),null==(t=this.categoryTabs)||t.setActiveTab(this.selectedCategory,{changeFocusable:!1,performFocus:!1}),this.scrollListenerState="resume")}handleScroll(){if("suspend"===this.scrollListenerState||!this.categoryTabs)return;if("resume"===this.scrollListenerState){this.scrollListenerState="active";return}let e=this.el.scrollTop,t=this.el.scrollHeight-this.el.offsetHeight,i=this.emojiCategories.findIndex((t,i)=>{var o;return e<(null==(o=this.emojiCategories[i+1])?void 0:o.el.offsetTop)}),o={changeFocusable:!1,performFocus:!1,scroll:!1};0===e?this.categoryTabs.setActiveTab(0,o):Math.floor(e)===Math.floor(t)||i<0?this.categoryTabs.setActiveTab(this.categories.length-1,o):this.categoryTabs.setActiveTab(i,o)}}let eQ=new em(({classList:e,classes:t,icon:i,message:o})=>`
|
|
<div class="${e}" role="alert">
|
|
<div class="${t.iconContainer}"><i data-size="10x" data-icon="${i}"></i></div>
|
|
<h3 class="${t.title}">${o}</h3>
|
|
</div>
|
|
`),eX=V("error","iconContainer","title");class eZ extends er{constructor({message:e,icon:t="warning",template:i=eQ,className:o}){super({template:i,classes:eX}),this.message=e,this.icon=t,this.className=o}renderSync(){let e=[eX.error,this.className].join(" ").trim();return super.renderSync({message:this.message,icon:this.icon,classList:e})}}let e1=new em(({classList:e,classes:t,icon:i,i18n:o,message:s})=>`
|
|
<div class="${e}" role="alert">
|
|
<div class="${t.icon}"><i data-size="10x" data-icon="${i}"></i></div>
|
|
<h3 class="${t.title}">${s}</h3>
|
|
<button type="button">${o.get("retry")}</button>
|
|
</div>
|
|
`),e2=V("dataError");class e0 extends eZ{constructor({message:e}){super({message:e,template:e1,className:e2.dataError})}initialize(){this.uiElements={retryButton:"button"},this.uiEvents=[er.childEvent("retryButton","click",this.onRetry)],super.initialize()}async onRetry(){this.emojiData?await this.emojiData.delete():await this.options.dataStore.deleteDatabase(this.options.locale),this.events.emit("reinitialize");let e=await ee(this.options.locale,this.options.dataStore,this.options.messages,this.options.emojiData,this.emojiData);this.viewFactory.setEmojiData(e),this.events.emit("data:ready",e)}}let e3=V("preview","previewEmoji","previewName","tagList","tag"),e5=new em(({classes:e,tag:t})=>`
|
|
<li class="${e.tag}">${t}</li>
|
|
`),e4=new em(({classes:e})=>`
|
|
<div class="${e.preview}">
|
|
<div class="${e.previewEmoji}"></div>
|
|
<div class="${e.previewName}"></div>
|
|
<ul class="${e.tagList}"></ul>
|
|
</div>
|
|
`);class e6 extends er{constructor(){super({template:e4,classes:e3})}initialize(){this.uiElements={emoji:er.byClass(e3.previewEmoji),name:er.byClass(e3.previewName),tagList:er.byClass(e3.tagList)},this.appEvents={"preview:show":this.showPreview,"preview:hide":this.hidePreview},super.initialize()}showPreview(e,t){if(R(this.ui.emoji,t),this.ui.name.textContent=e.label,e.tags){this.ui.tagList.style.display="flex";let t=e.tags.map(e=>e5.renderSync({tag:e,classes:e3}));R(this.ui.tagList,...t)}}hidePreview(){M(this.ui.emoji),M(this.ui.name),M(this.ui.tagList)}}let e8=new em(({classes:e,i18n:t})=>`
|
|
<button title="${t.get("search.clear")}" class="${e.clearSearchButton}">
|
|
<i data-icon="xmark"></i>
|
|
</button>
|
|
`),e7=new em(({classes:e,i18n:t})=>`
|
|
<div class="${e.searchContainer}">
|
|
<input class="${e.searchField}" placeholder="${t.get("search")}">
|
|
<span class="${e.searchAccessory}"></span>
|
|
</div>
|
|
`,{mode:"async"}),e9=V("searchContainer","searchField","clearButton","searchAccessory","clearSearchButton","notFound");class te extends er{constructor({categories:e,emojiVersion:t}){var i;let o;super({template:e7,classes:e9}),this.categories=e.filter(e=>"recents"!==e.key),this.emojiVersion=t,this.search=(i=this.search.bind(this),o=null,(...e)=>{o&&window.clearTimeout(o),o=window.setTimeout(()=>{i(...e),o=null},100)})}initialize(){this.uiElements={searchField:er.byClass(e9.searchField),searchAccessory:er.byClass(e9.searchAccessory)},this.uiEvents=[er.childEvent("searchField","keydown",this.onKeyDown),er.childEvent("searchField","input",this.onSearchInput)],super.initialize()}async render(){return await super.render(),this.searchIcon=eh("search"),this.notFoundMessage=this.viewFactory.create(eZ,{message:this.i18n.get("search.notFound"),className:e9.notFound,icon:"sad"}),this.notFoundMessage.renderSync(),this.errorMessage=this.viewFactory.create(eZ,{message:this.i18n.get("search.error")}),this.errorMessage.renderSync(),this.clearSearchButton=e8.render({classes:e9,i18n:this.i18n}),this.clearSearchButton.addEventListener("click",e=>this.onClearSearch(e)),this.searchField=this.ui.searchField,this.showSearchIcon(),this.el}showSearchIcon(){this.showSearchAccessory(this.searchIcon)}showClearSearchButton(){this.showSearchAccessory(this.clearSearchButton)}showSearchAccessory(e){R(this.ui.searchAccessory,e)}clear(){this.searchField.value="",this.showSearchIcon()}focus(){this.searchField.focus()}onClearSearch(e){var t;e.stopPropagation(),this.searchField.value="",null==(t=this.resultsContainer)||t.destroy(),this.resultsContainer=null,this.showSearchIcon(),this.events.emit("content:show"),this.searchField.focus()}handleResultsKeydown(e){this.resultsContainer&&"Escape"===e.key&&this.onClearSearch(e)}onKeyDown(e){var t;"Escape"===e.key&&this.searchField.value?this.onClearSearch(e):("Enter"===e.key||"ArrowDown"===e.key)&&this.resultsContainer&&(e.preventDefault(),null==(t=this.resultsContainer.el.querySelector('[tabindex="0"]'))||t.focus())}onSearchInput(e){this.searchField.value?(this.showClearSearchButton(),this.search()):this.onClearSearch(e)}async search(){var e;if(this.searchField.value)try{let t=await this.emojiData.searchEmojis(this.searchField.value,this.customEmojis,this.emojiVersion,this.categories);if(this.events.emit("preview:hide"),t.length){let i=new eW;this.resultsContainer=this.viewFactory.create(eD,{emojis:t,fullHeight:!0,showVariants:!0,lazyLoader:i}),this.resultsContainer.renderSync(),null!=(e=this.resultsContainer)&&e.el&&(i.observe(this.resultsContainer.el),this.resultsContainer.setActive(!0,{row:0,offset:0},!1),this.resultsContainer.el.addEventListener("keydown",e=>this.handleResultsKeydown(e)),this.events.emit("content:show",this.resultsContainer))}else this.events.emit("content:show",this.notFoundMessage)}catch{this.events.emit("content:show",this.errorMessage)}}}let tt=new em(({classes:e})=>`
|
|
<div class="${e.variantOverlay}">
|
|
<div class="${e.variantPopup}">
|
|
<div data-view="emojis" data-render="sync"></div>
|
|
</div>
|
|
</div>
|
|
`),ti=V("variantOverlay","variantPopup"),to={easing:"ease-in-out",duration:250,fill:"both"},ts={opacity:[0,1]},tr={opacity:[0,1],transform:["scale3d(0.8, 0.8, 0.8)","scale3d(1, 1, 1)"]};class ta extends er{constructor({emoji:e,parent:t}){super({template:tt,classes:ti,parent:t}),this.focusedEmojiIndex=0,this.focusTrap=new et,this.animateShow=()=>Promise.all([$(this.el,ts,to,this.options),$(this.ui.popup,tr,to,this.options)]),this.emoji=e}initialize(){this.uiElements={popup:er.byClass(ti.variantPopup)},this.uiEvents=[er.uiEvent("click",this.handleClick),er.uiEvent("keydown",this.handleKeydown)],super.initialize()}animateHide(){let e={...to,direction:"reverse"};return Promise.all([$(this.el,ts,e,this.options),$(this.ui.popup,tr,e,this.options)])}async hide(){await this.animateHide(),this.events.emit("variantPopup:hide")}handleKeydown(e){"Escape"===e.key&&(this.hide(),e.stopPropagation())}handleClick(e){this.ui.popup.contains(e.target)||this.hide()}getEmoji(e){return this.renderedEmojis[e]}setFocusedEmoji(e){let t=this.getEmoji(this.focusedEmojiIndex);t.tabIndex=-1,this.focusedEmojiIndex=e;let i=this.getEmoji(this.focusedEmojiIndex);i.tabIndex=0,i.focus()}destroy(){this.emojiContainer.destroy(),this.focusTrap.deactivate(),super.destroy()}renderSync(){let e={...this.emoji,skins:null},t=(this.emoji.skins||[]).map(e=>({...e,label:this.emoji.label,tags:this.emoji.tags})),i=[e,...t];return this.emojiContainer=this.viewFactory.create(eD,{emojis:i,preview:!1}),super.renderSync({emojis:this.emojiContainer}),i.length<this.options.emojisPerRow&&this.el.style.setProperty("--emojis-per-row",i.length.toString()),this.el}activate(){this.emojiContainer.setActive(!0,{row:0,offset:0},!0),this.focusTrap.activate(this.el)}}let tn=new em(({classes:e,i18n:t,category:i,pickerId:o,icon:s})=>`
|
|
<li class="${e.categoryTab}">
|
|
<button
|
|
aria-selected="false"
|
|
role="tab"
|
|
class="${e.categoryButton}"
|
|
tabindex="-1"
|
|
title="${t.get(`categories.${i.key}`,i.message||i.key)}"
|
|
type="button"
|
|
data-category="${i.key}"
|
|
id="${o}-category-${i.key}"
|
|
>
|
|
<i data-icon="${s}"></i>
|
|
</li>
|
|
`),tc=V("categoryTab","categoryTabActive","categoryButton");class tl extends er{constructor({category:e,icon:t}){super({template:tn,classes:tc}),this.isActive=!1,this.category=e,this.icon=t}initialize(){this.uiElements={button:er.byClass(tc.categoryButton)},this.uiEvents=[er.childEvent("button","click",this.selectCategory),er.childEvent("button","focus",this.selectCategory)],super.initialize()}renderSync(){return super.renderSync({category:this.category,icon:this.icon}),this.ui.button.ariaSelected="false",this.el}setActive(e,t={}){let{changeFocusable:i,performFocus:o,scroll:s}={changeFocusable:!0,performFocus:!0,scroll:!0,...t};this.el.classList.toggle(tc.categoryTabActive,e),i&&(this.ui.button.tabIndex=e?0:-1,this.ui.button.ariaSelected=e.toString()),e&&o&&(this.ui.button.focus(),s&&this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!1})),this.isActive=e}selectCategory(){this.isActive||this.events.emit("category:select",this.category.key,{scroll:"animate",focus:"button",performFocus:!0})}}let th=new em(({classes:e})=>`
|
|
<div class="${e.categoryButtonsContainer}">
|
|
<ul role="tablist" class="${e.categoryButtons}">
|
|
<div data-placeholder="tabs"></div>
|
|
</ul>
|
|
</div>
|
|
`),td=V("categoryButtons","categoryButtonsContainer");class tm extends er{constructor({categories:e}){super({template:th,classes:td}),this.activeCategoryIndex=0,this.categories=e}initialize(){this.keyBindings={ArrowLeft:this.stepSelectedTab(-1),ArrowRight:this.stepSelectedTab(1)},this.uiEvents=[er.uiEvent("scroll",this.checkOverflow)],super.initialize()}checkOverflow(){let e=Math.abs(this.el.scrollLeft-(this.el.scrollWidth-this.el.offsetWidth))>1,t=this.el.scrollLeft>0;this.el.className="categoryButtonsContainer",t&&e?this.el.classList.add("has-overflow-both"):t?this.el.classList.add("has-overflow-left"):e&&this.el.classList.add("has-overflow-right")}renderSync(){return this.tabViews=this.categories.map(e=>this.viewFactory.create(tl,{category:e,icon:el[e.key]})),super.renderSync({tabs:this.tabViews.map(e=>e.renderSync())}),this.el}get currentCategory(){return this.categories[this.activeCategoryIndex]}get currentTabView(){return this.tabViews[this.activeCategoryIndex]}setActiveTab(e,t={}){this.checkOverflow();let i=this.currentTabView,o=this.tabViews[e];i.setActive(!1,t),o.setActive(!0,t),this.activeCategoryIndex=e}getTargetCategory(e){return e<0?this.categories.length-1:e>=this.categories.length?0:e}stepSelectedTab(e){return()=>{let t=this.activeCategoryIndex+e;this.setActiveTab(this.getTargetCategory(t),{changeFocusable:!0,performFocus:!0})}}}let tp=[{version:15,emoji:String.fromCodePoint(129768)},{version:14,emoji:String.fromCodePoint(128733)},{version:13,emoji:String.fromCodePoint(129729)},{version:12,emoji:String.fromCodePoint(129449)},{version:11,emoji:String.fromCodePoint(129463)},{version:5,emoji:String.fromCodePoint(129322)},{version:4,emoji:String.fromCodePoint(9877)},{version:3,emoji:String.fromCodePoint(129314)},{version:2,emoji:String.fromCodePoint(128488)},{version:1,emoji:String.fromCodePoint(128512)}];function tu(e,t){return Array.from({length:e},()=>t).join("")}let tg=new em(e=>e.isLoaded?function(e){let{classes:t,theme:i,className:o=""}=e;return`
|
|
<div class="picmo__picker ${t.picker} ${i} ${o}">
|
|
${function({showHeader:e,classes:t}){return e?`
|
|
<header class="${t.header}">
|
|
<div data-view="search"></div>
|
|
<div data-view="categoryTabs" data-render="sync"></div>
|
|
</header>
|
|
`:""}(e)}
|
|
<div class="${t.content}">
|
|
<div data-view="emojiArea"></div>
|
|
</div>
|
|
<div data-view="preview"></div>
|
|
</div>
|
|
`}(e):function(e){let{emojiCount:t,classes:i,theme:o,className:s,categoryCount:r}=e,a=({showSearch:e,classes:t})=>e?`
|
|
<div class="${t.searchSkeleton}">
|
|
<div class="${t.searchInput} ${t.placeholder}"></div>
|
|
</div>
|
|
`:"",n=({showCategoryTabs:e,classes:t})=>e?`
|
|
<div class="${t.categoryTabsSkeleton}">
|
|
${tu(r,`<div class="${t.placeholder} ${t.categoryTab}"></div>`)}
|
|
</div>
|
|
`:"";return`
|
|
<div class="picmo__picker ${i.skeleton} ${i.picker} ${o} ${s}">
|
|
${(({showHeader:t,classes:i})=>t?`
|
|
<header class="${i.headerSkeleton}">
|
|
${a(e)}
|
|
${n(e)}
|
|
</header>
|
|
`:"")(e)}
|
|
<div class="${i.contentSkeleton}">
|
|
<div class="${i.placeholder} ${i.categoryName}"></div>
|
|
<div class="${i.emojiGrid}">
|
|
${tu(t,`<div class="${i.placeholder} ${i.emoji}"></div>`)}
|
|
</div>
|
|
</div>
|
|
${(({showPreview:e,classes:t})=>e?`
|
|
<div class="${t.previewSkeleton}">
|
|
<div class="${t.placeholder} ${t.previewEmoji}"></div>
|
|
<div class="${t.placeholder} ${t.previewName}"></div>
|
|
<ul class="${t.tagList}">
|
|
${tu(3,`<li class="${t.placeholder} ${t.tag}"></li>`)}
|
|
</ul>
|
|
</div>
|
|
`:"")(e)}
|
|
</div>
|
|
`}(e)),ty=V("picker","skeleton","placeholder","searchSkeleton","searchInput","categoryTabsSkeleton","headerSkeleton","categoryTab","contentSkeleton","categoryName","emojiGrid","emoji","previewSkeleton","previewEmoji","previewName","tagList","tag","overlay","content","fullHeight","pluginContainer","header"),tv={emojisPerRow:"--emojis-per-row",visibleRows:"--row-count",emojiSize:"--emoji-size"};class tw extends er{constructor(){super({template:tg,classes:ty}),this.pickerReady=!1,this.externalEvents=new eF,this.updaters={styleProperty:e=>t=>this.el.style.setProperty(tv[e],t.toString()),theme:e=>{let t=this.options.theme,i=this.el.closest(`.${t}`);this.el.classList.remove(t),null==i||i.classList.remove(t),this.el.classList.add(e),null==i||i.classList.add(e)},className:e=>{this.options.className&&this.el.classList.remove(this.options.className),this.el.classList.add(e)},emojisPerRow:this.updateStyleProperty.bind(this,"emojisPerRow"),emojiSize:this.updateStyleProperty.bind(this,"emojiSize"),visibleRows:this.updateStyleProperty.bind(this,"visibleRows")}}initialize(){this.uiElements={pickerContent:er.byClass(ty.content),header:er.byClass(ty.header)},this.uiEvents=[er.uiEvent("keydown",this.handleKeyDown)],this.appEvents={error:this.onError,reinitialize:this.reinitialize,"data:ready":this.onDataReady,"content:show":this.showContent,"variantPopup:hide":this.hideVariantPopup,"emoji:select":this.selectEmoji},super.initialize(),this.options.recentsProvider}destroy(){var e,t;super.destroy(),null==(e=this.search)||e.destroy(),this.emojiArea.destroy(),null==(t=this.categoryTabs)||t.destroy(),this.events.removeAll(),this.externalEvents.removeAll()}clearRecents(){this.options.recentsProvider.clear()}addEventListener(e,t){this.externalEvents.on(e,t)}removeEventListener(e,t){this.externalEvents.off(e,t)}initializePickerView(){this.pickerReady&&(this.showContent(),this.emojiArea.reset(!1))}handleKeyDown(e){let t=e.ctrlKey||e.metaKey;"s"===e.key&&t&&this.search&&(e.preventDefault(),this.search.focus())}buildChildViews(){return this.options.showPreview&&(this.preview=this.viewFactory.create(e6)),this.options.showSearch&&(this.search=this.viewFactory.create(te,{categories:this.categories,emojiVersion:this.emojiVersion})),this.options.showCategoryTabs&&(this.categoryTabs=this.viewFactory.create(tm,{categories:this.categories})),this.currentView=this.emojiArea=this.viewFactory.create(eY,{categoryTabs:this.categoryTabs,categories:this.categories,emojiVersion:this.emojiVersion}),[this.preview,this.search,this.emojiArea,this.categoryTabs]}setStyleProperties(){this.options.showSearch||this.el.style.setProperty("--search-height-full","0px"),this.options.showCategoryTabs||(this.el.style.setProperty("--category-tabs-height","0px"),this.el.style.setProperty("--category-tabs-offset","0px")),this.options.showPreview||this.el.style.setProperty("--emoji-preview-height-full","0px"),Object.keys(tv).forEach(e=>{this.options[e]&&this.el.style.setProperty(tv[e],this.options[e].toString())})}updateStyleProperty(e,t){this.el.style.setProperty(tv[e],t.toString())}reinitialize(){this.renderSync()}onError(e){let t=this.viewFactory.createWithOptions({data:!1},e0,{message:this.i18n.get("error.load")}),i=this.el.offsetHeight||375;throw this.el.style.height=`${i}px`,R(this.el,t.renderSync()),e}async onDataReady(e){let t=this.el;try{e?this.emojiData=e:await this.emojiDataPromise,"auto"===this.options.emojiVersion?this.emojiVersion=function(){var e;let t=tp.find(e=>(function(e){let t=document.createElement("canvas").getContext("2d");if(t)return t.textBaseline="top",t.font="32px Arial",t.fillText(e,0,0),0!==t.getImageData(16,16,1,1).data[0]})(e.emoji));return null!=(e=null==t?void 0:t.version)?e:1}()||parseFloat("14.0"):this.emojiVersion=this.options.emojiVersion,this.categories=await this.emojiData.getCategories(this.options);let[i,o,s,r]=this.buildChildViews();await super.render({isLoaded:!0,search:o,categoryTabs:r,emojiArea:s,preview:i,showHeader:!!(this.search||this.categoryTabs),theme:this.options.theme,className:this.options.className}),this.el.style.setProperty("--category-count",this.categories.length.toString()),this.pickerReady=!0,t.replaceWith(this.el),this.setStyleProperties(),this.initializePickerView(),this.setInitialFocus(),this.externalEvents.emit("data:ready")}catch(e){this.events.emit("error",e)}}renderSync(){var e;let t=(null==(e=this.options.categories)?void 0:e.length)||10;if(this.options.showRecents&&(t+=1),super.renderSync({isLoaded:!1,theme:this.options.theme,className:this.options.className,showSearch:this.options.showSearch,showPreview:this.options.showPreview,showCategoryTabs:this.options.showCategoryTabs,showHeader:this.options.showSearch||this.options.showCategoryTabs,emojiCount:this.options.emojisPerRow*this.options.visibleRows,categoryCount:t}),this.el.style.setProperty("--category-count",t.toString()),!this.options.rootElement)throw Error("Picker must be given a root element via the rootElement option");return R(this.options.rootElement,this.el),this.setStyleProperties(),this.pickerReady&&this.initializePickerView(),this.el}getInitialFocusTarget(){if("u">typeof this.options.autoFocus)switch(this.options.autoFocus){case"emojis":return this.emojiArea.focusableEmoji;case"search":return this.search;case"auto":return this.search||this.emojiArea.focusableEmoji;default:return null}if(!0===this.options.autoFocusSearch)return console.warn("options.autoFocusSearch is deprecated, please use options.focusTarget instead"),this.search}setInitialFocus(){var e;this.pickerReady&&null!=(e=this.getInitialFocusTarget())&&e.focus()}reset(e=!0){var t;this.pickerReady&&(this.emojiArea.reset(e),this.showContent(this.emojiArea)),null==(t=this.search)||t.clear(),this.hideVariantPopup()}showContent(e=this.emojiArea){var t,i;e!==this.currentView&&(this.currentView!==this.emojiArea&&(null==(t=this.currentView)||t.destroy()),this.ui.pickerContent.classList.toggle(ty.fullHeight,e!==this.emojiArea),R(this.ui.pickerContent,e.el),this.currentView=e,e===this.emojiArea?(this.emojiArea.reset(),this.categoryTabs&&this.ui.header.appendChild(this.categoryTabs.el)):null==(i=this.categoryTabs)||i.el.remove())}hideVariantPopup(){var e;null==(e=this.variantPopup)||e.destroy()}isPickerClick(e){var t,i;let o=e.target,s=this.el.contains(o),r=null==(i=null==(t=this.variantPopup)?void 0:t.el)?void 0:i.contains(o);return s||r}async selectEmoji({emoji:e}){var t,i;(null==(t=e.skins)?void 0:t.length)&&this.options.showVariants&&!this.isVariantPopupOpen?this.showVariantPopup(e):(await (null==(i=this.variantPopup)?void 0:i.animateHide()),this.events.emit("variantPopup:hide"),await this.emitEmoji(e))}get isVariantPopupOpen(){return this.variantPopup&&!this.variantPopup.isDestroyed}async showVariantPopup(e){let t=document.activeElement;this.events.once("variantPopup:hide",()=>{null==t||t.focus()}),this.variantPopup=this.viewFactory.create(ta,{emoji:e,parent:this.el}),this.el.appendChild(this.variantPopup.renderSync()),this.variantPopup.activate()}async emitEmoji(e){this.externalEvents.emit("emoji:select",await this.renderer.doEmit(e)),this.options.recentsProvider.addOrUpdateRecent(e,this.options.maxRecents),this.events.emit("recent:add",e)}updateOptions(e){Object.keys(e).forEach(t=>{this.updaters[t](e[t])}),Object.assign(this.options,e)}}class tf{constructor({events:e,i18n:t,renderer:i,emojiData:o,options:s,customEmojis:r=[],pickerId:a}){this.events=e,this.i18n=t,this.renderer=i,this.emojiData=o,this.options=s,this.customEmojis=r,this.pickerId=a}setEmojiData(e){this.emojiData=Promise.resolve(e)}createWithOptions(e={},t,...i){let o=new t(...i);return o.setPickerId(this.pickerId),o.setEvents(this.events),o.setI18n(this.i18n),o.setRenderer(this.renderer),!1!==e.data&&o.setEmojiData(this.emojiData),o.setOptions(this.options),o.setCustomEmojis(this.customEmojis),o.viewFactory=this,o.initialize(),o}create(e,...t){return this.createWithOptions({},e,...t)}}class tb{constructor(e={}){b(this,v,void 0),C(this,v,new Map(Object.entries(e)))}get(e,t=e){return f(this,v).get(e)||t}}v=new WeakMap;let tC=`.picmo__picker .picmo__icon{width:1.25em;height:1em;fill:currentColor}.picmo__icon-small{font-size:.8em}.picmo__icon-medium{font-size:1em}.picmo__icon-large{font-size:1.25em}.picmo__icon-2x{font-size:2em}.picmo__icon-3x{font-size:3em}.picmo__icon-4x{font-size:4em}.picmo__icon-5x{font-size:5em}.picmo__icon-8x{font-size:8em}.picmo__icon-10x{font-size:10em}.picmo__light,.picmo__auto{color-scheme:light;--accent-color: #4f46e5;--background-color: #f9fafb;--border-color: #cccccc;--category-name-background-color: #f9fafb;--category-name-button-color: #999999;--category-name-text-color: hsl(214, 30%, 50%);--category-tab-active-background-color: rgba(255, 255, 255, .6);--category-tab-active-color: var(--accent-color);--category-tab-color: #666;--category-tab-highlight-background-color: rgba(0, 0, 0, .15);--error-color-dark: hsl(0, 100%, 45%);--error-color: hsl(0, 100%, 40%);--focus-indicator-background-color: hsl(198, 65%, 85%);--focus-indicator-color: #333333;--hover-background-color: #c7d2fe;--placeholder-background-color: #cccccc;--search-background-color: #f9fafb;--search-focus-background-color: #ffffff;--search-icon-color: #999999;--search-placeholder-color: #71717a;--secondary-background-color: #e2e8f0;--secondary-text-color: #666666;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #000000;--variant-popup-background-color: #ffffff}.picmo__dark{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}@media (prefers-color-scheme: dark){.picmo__auto{color-scheme:dark;--accent-color: #A580F9;--background-color: #333333;--border-color: #666666;--category-name-background-color: #333333;--category-name-button-color: #eeeeee;--category-name-text-color: #ffffff;--category-tab-active-background-color: #000000;--category-tab-active-color: var(--accent-color);--category-tab-color: #cccccc;--category-tab-highlight-background-color: #4A4A4A;--error-color-dark: hsl(0, 7%, 3%);--error-color: hsl(0, 30%, 60%);--focus-indicator-background-color: hsl(0, 0%, 50%);--focus-indicator-color: #999999;--hover-background-color: hsla(0, 0%, 40%, .85);--image-placeholder-color: #ffffff;--placeholder-background-color: #666666;--search-background-color: #71717a;--search-focus-background-color: #52525b;--search-icon-color: #cccccc;--search-placeholder-color: #d4d4d8;--secondary-background-color: #000000;--secondary-text-color: #999999;--tag-background-color: rgba(162, 190, 245, .3);--text-color: #ffffff;--variant-popup-background-color: #333333}}.picmo__picker .picmo__categoryButtonsContainer{overflow:auto;padding:2px 0}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-right{mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(270deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-left{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%)}.picmo__picker .picmo__categoryButtonsContainer.picmo__has-overflow-both{mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%);-webkit-mask-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 10%,rgba(255,255,255,1) 90%,rgba(255,255,255,0) 100%)}.picmo__picker .picmo__categoryButtons{display:flex;flex-direction:row;gap:var(--tab-gap);margin:0;padding:0 .5em;align-items:center;height:var(--category-tabs-height);box-sizing:border-box;width:100%;justify-content:space-between;position:relative;list-style-type:none;justify-self:center;max-width:min(23.55rem,calc(var(--category-count, 1) * 2.5rem))}.picmo__picker .picmo__categoryButtons .picmo__categoryTab{display:flex;align-items:center;transition:all .1s;width:2em}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton{color:var(--category-tab-active-color);background:linear-gradient(rgba(255,255,255,.75) 0%,rgba(255,255,255,.75) 100%),linear-gradient(var(--category-tab-active-color) 0%,var(--category-tab-active-color) 100%);border:2px solid var(--category-tab-active-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab.picmo__categoryTabActive .picmo__categoryButton:hover{background-color:var(--category-tab-active-background-color)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton{border-radius:5px;background:transparent;border:2px solid transparent;color:var(--category-tab-color);cursor:pointer;padding:2px;vertical-align:middle;display:flex;align-items:center;justify-content:center;font-size:1.2rem;width:1.6em;height:1.6em;transition:all .1s}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:is(img){width:var(--category-tab-size);height:var(--category-tab-size)}.picmo__picker .picmo__categoryButtons .picmo__categoryTab button.picmo__categoryButton:hover{background:var(--category-tab-highlight-background-color)}.picmo__dataError [data-icon]{opacity:.8}@keyframes appear{0%{opacity:0}to{opacity:.8}}@keyframes appear-grow{0%{opacity:0;transform:scale(.8)}to{opacity:.8;transform:scale(1)}}.picmo__picker .picmo__error{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--secondary-text-color)}.picmo__picker .picmo__error .picmo__iconContainer{opacity:.8;animation:appear-grow .25s cubic-bezier(.175,.885,.32,1.275);--color-primary: var(--error-color);--color-secondary: var(--error-color-dark)}.picmo__picker .picmo__error .picmo__title{animation:appear .25s;animation-delay:50ms;animation-fill-mode:both}.picmo__picker .picmo__error button{padding:8px 16px;cursor:pointer;background:var(--background-color);border:1px solid var(--text-color);border-radius:5px;color:var(--text-color)}.picmo__picker .picmo__error button:hover{background:var(--text-color);color:var(--background-color)}.picmo__emojiButton{background:transparent;border:none;border-radius:15px;cursor:pointer;display:flex;font-family:var(--emoji-font);font-size:var(--emoji-size);height:100%;justify-content:center;align-items:center;margin:0;overflow:hidden;padding:0;width:100%}.picmo__emojiButton:hover{background:var(--hover-background-color)}.picmo__emojiButton:focus{border-radius:0;background:var(--focus-indicator-background-color);outline:1px solid var(--focus-indicator-color)}.picmo__picker .picmo__emojiArea{height:var(--emoji-area-height);overflow-y:auto;position:relative}.picmo__picker .picmo__emojiCategory{position:relative}.picmo__picker .picmo__emojiCategory .picmo__categoryName{font-size:.9em;padding:.5rem;margin:0;background:var(--category-name-background-color);color:var(--category-name-text-color);top:0;z-index:1;display:grid;gap:4px;grid-template-columns:auto 1fr auto;align-items:center;line-height:1;box-sizing:border-box;height:var(--category-name-height);justify-content:flex-start;text-transform:uppercase}.picmo__picker .picmo__emojiCategory .picmo__categoryName button{background:transparent;border:none;display:flex;align-items:center;cursor:pointer;color:var(--category-name-button-color)}.picmo__picker .picmo__emojiCategory .picmo__categoryName button:hover{opacity:1}.picmo__picker .picmo__emojiCategory .picmo__noRecents{color:var(--secondary-text-color);grid-column:1 / span var(--emojis-per-row);font-size:.9em;text-align:center;display:flex;align-items:center;justify-content:center;min-height:calc(var(--emoji-size) * var(--emoji-size-multiplier))}.picmo__picker .picmo__emojiCategory .picmo__recentEmojis[data-empty=true]{display:none}:is(.picmo__picker .picmo__emojiCategory) .picmo__recentEmojis[data-empty=false]+div{display:none}.picmo__picker .picmo__emojiContainer{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center}.picmo__picker.picmo__picker{--border-radius: 5px;--emoji-area-height: calc( (var(--row-count) * var(--emoji-size) * var(--emoji-size-multiplier)) + var(--category-name-height) );--content-height: var(--emoji-area-height);--emojis-per-row: 8;--row-count: 6;--emoji-preview-margin: 4px;--emoji-preview-height: calc(var(--emoji-preview-size) + 1em + 1px);--emoji-preview-height-full: calc(var(--emoji-preview-height) + var(--emoji-preview-margin));--emoji-preview-size: 2.75em;--emoji-size: 2rem;--emoji-size-multiplier: 1.3;--content-margin: 8px;--category-tabs-height:calc(1.5em + 9px);--category-tabs-offset: 8px;--category-tab-size: 1.2rem;--category-name-height: 2rem;--category-name-padding-y: 6px;--search-height: 2em;--search-margin: .5em;--search-margin-bottom: 4px;--search-height-full: calc(var(--search-height) + var(--search-margin) + var(--search-margin-bottom));--overlay-background-color: rgba(0, 0, 0, .8);--emoji-font: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "EmojiOne Color", "Android Emoji";--ui-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;--ui-font-size: 16px;--picker-width: calc(var(--emojis-per-row) * var(--emoji-size) * var(--emoji-size-multiplier) + 2.75rem);--preview-background-color: var(--secondary-background-color);background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);font-size:var(--ui-font-size);overflow:hidden;position:relative;width:var(--picker-width);display:grid;gap:8px}.picmo__picker.picmo__picker>*{font-family:var(--ui-font)}.picmo__picker.picmo__skeleton{background:var(--background-color);border-radius:var(--border-radius);border:1px solid var(--border-color);font-family:var(--ui-font);width:var(--picker-width);color:var(--secondary-text-color)}.picmo__picker.picmo__skeleton *{box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__picker.picmo__skeleton .picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}.picmo__picker.picmo__skeleton .picmo__headerSkeleton{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:flex;flex-direction:column;overflow:hidden;gap:8px;border-bottom:1px solid var(--border-color);width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton{padding:0 8px;height:var(--search-height)}.picmo__picker.picmo__skeleton .picmo__searchSkeleton .picmo__searchInput{width:100%;height:28px;border-radius:3px}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton{height:var(--category-tabs-height);display:flex;flex-direction:row;align-items:center;justify-self:center;width:calc(2rem * var(--category-count, 1))}.picmo__picker.picmo__skeleton .picmo__categoryTabsSkeleton .picmo__categoryTab{width:25px;height:25px;padding:2px;border-radius:5px;margin:.25em}.picmo__picker.picmo__skeleton .picmo__contentSkeleton{height:var(--content-height);padding-right:8px;opacity:.7}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__categoryName{width:50%;height:1rem;margin:.5rem;box-sizing:border-box}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid{display:grid;justify-content:space-between;gap:1px;padding:0 .5em;grid-template-columns:repeat(var(--emojis-per-row),calc(var(--emoji-size) * var(--emoji-size-multiplier)));grid-auto-rows:calc(var(--emoji-size) * var(--emoji-size-multiplier));align-items:center;justify-items:center;width:var(--picker-width)}.picmo__picker.picmo__skeleton .picmo__contentSkeleton .picmo__emojiGrid .picmo__emoji{width:var(--emoji-size);height:var(--emoji-size);border-radius:50%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton{height:var(--emoji-preview-height);border-top:1px solid var(--border-color);display:grid;align-items:center;padding:.5em;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags"}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewEmoji{grid-area:emoji;border-radius:50%;width:var(--emoji-preview-size);height:var(--emoji-preview-size)}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__previewName{grid-area:name;height:.8em;width:80%}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0}.picmo__picker.picmo__skeleton .picmo__previewSkeleton .picmo__tagList .picmo__tag{border-radius:3px;padding:2px 8px;margin-right:.25em;height:1em;width:20%}.picmo__overlay{background:rgba(0,0,0,.75);height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.picmo__content{position:relative;overflow:hidden;height:var(--content-height)}.picmo__content.picmo__fullHeight{height:calc(var(--content-height) + var(--category-tabs-height) + var(--category-tabs-offset));overflow-y:auto}.picmo__pluginContainer{margin:.5em;display:flex;flex-direction:row}.picmo__header{background-color:var(--secondary-background-color);padding-top:8px;padding-bottom:8px;display:grid;gap:8px;border-bottom:1px solid var(--border-color)}@media (prefers-reduced-motion: reduce){.picmo__placeholder{background:var(--placeholder-background-color);position:relative;overflow:hidden}.picmo__placeholder:after{display:none}}.picmo__picker .picmo__preview{border-top:1px solid var(--border-color);display:grid;align-items:center;gap:6px;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;grid-template-areas:"emoji name" "emoji tags";height:var(--emoji-preview-height);box-sizing:border-box;padding:.5em;position:relative;background:var(--preview-background-color)}.picmo__picker .picmo__preview .picmo__previewEmoji{grid-area:emoji;font-size:var(--emoji-preview-size);font-family:var(--emoji-font);width:1.25em;display:flex;align-items:center;justify-content:center}.picmo__picker .picmo__preview .picmo__previewName{grid-area:name;color:var(--text-color);font-size:.8em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.picmo__picker .picmo__preview .picmo__tagList{grid-area:tags;list-style-type:none;display:flex;flex-direction:row;padding:0;margin:0;font-size:.75em;overflow:hidden}.picmo__picker .picmo__preview .picmo__tag{border-radius:3px;background:var(--tag-background-color);color:var(--text-color);padding:2px 8px;margin-right:.25em;white-space:nowrap}.picmo__picker .picmo__preview .picmo__tag:last-child{margin-right:0}.picmo__picker .picmo__searchContainer{display:flex;height:var(--search-height);box-sizing:border-box;padding:0 8px;position:relative}.picmo__picker .picmo__searchContainer .picmo__searchField{background:var(--search-background-color);border-radius:3px;border:none;box-sizing:border-box;color:var(--text-color);font-size:.9em;outline:none;padding:.5em 2.25em .5em .5em;width:100%}.picmo__picker .picmo__searchContainer .picmo__searchField:focus{background:var(--search-focus-background-color)}.picmo__picker .picmo__searchContainer .picmo__searchField::placeholder{color:var(--search-placeholder-color)}.picmo__picker .picmo__searchContainer .picmo__searchAccessory{color:var(--search-icon-color);height:100%;position:absolute;right:1em;top:0;width:1.25rem;display:flex;align-items:center}.picmo__picker .picmo__searchContainer .picmo__searchAccessory svg{fill:var(--search-icon-color)}.picmo__picker .picmo__searchContainer .picmo__clearButton{border:0;color:var(--search-icon-color);background:transparent;cursor:pointer}.picmo__picker .picmo__searchContainer .picmo__clearSearchButton{cursor:pointer;border:none;background:transparent;color:var(--search-icon-color);font-size:1em;width:100%;height:100%;display:flex;align-items:center;padding:0}.picmo__picker .picmo__searchContainer .picmo__notFound [data-icon]{fill:#f3e265}.picmo__picker .picmo__variantOverlay{background:var(--overlay-background-color);border-radius:5px;display:flex;flex-direction:column;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.picmo__picker .picmo__variantOverlay .picmo__variantPopup{background:var(--variant-popup-background-color);border-radius:5px;margin:.5em;padding:.5em;text-align:center;user-select:none;display:flex;align-items:center;justify-content:center}.picmo__customEmoji{width:1em;height:1em}@keyframes shine{to{transform:translate(100%)}}.picmo__picker .picmo__imagePlaceholder{width:2rem;height:2rem;border-radius:50%}.picmo__placeholder{background:#DDDBDD;position:relative}.picmo__placeholder:after{position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background-image:linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,.2) 20%,rgba(255,255,255,.5) 60%,rgba(255,255,255,0) 100%);animation:shine 2s infinite;content:""}
|
|
`,tj=0,t_,tk=(o=!1,function(e){eL.injectStyles&&!o&&(function(e,t){void 0===t&&(t={});var i=t.insertAt;if(!(!e||typeof document>"u")){var o=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&o.firstChild?o.insertBefore(s,o.firstChild):o.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(e),o=!0)});function tx(e){tk(tC);let t=function(e={}){return{...eS,...e,renderer:e.renderer||new ef,recentsProvider:e.recentsProvider||new eE}}(e),i=((null==t?void 0:t.custom)||[]).map(e=>({...e,custom:!0,tags:["custom",...e.tags||[]]})),o=new eP;t_||(t_=ee(t.locale,t.dataStore,t.messages,t.emojiData));let s=new tb(t.i18n);t_.then(e=>{o.emit("data:ready",e)}).catch(e=>{o.emit("error",e)});let r=new tf({events:o,i18n:s,customEmojis:i,renderer:t.renderer,options:t,emojiData:t_,pickerId:`picmo-${Date.now()}-${tj++}`}).create(tw);return r.renderSync(),r}}}]); |