From 1f42f9f644a2617f7cb3b2e89ab7cf5a49453060 Mon Sep 17 00:00:00 2001 From: Oliver Wilkie <87673524+oliw-figma@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:07:48 -0800 Subject: [PATCH] emoji-mart: expose NativeSupport tools (#23) Expose the NativeSupport helper library so that clients can use its methods to infer what version of emojis are supported --- dist/index.js | 2 +- packages/emoji-mart/src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index fde2ac2..1c154b8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,2 @@ -function f(f){return f&&f.__esModule?f.default:f}var e,i,n,d,a,u,o={},t=[],r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function l(f,e){for(var i in e)f[i]=e[i];return f}function c(f){var e=f.parentNode;e&&e.removeChild(f)}function s(f,i,n){var d,a,u,o={};for(u in i)"key"==u?d=i[u]:"ref"==u?a=i[u]:o[u]=i[u];if(arguments.length>2&&(o.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof f&&null!=f.defaultProps)for(u in f.defaultProps)void 0===o[u]&&(o[u]=f.defaultProps[u]);return _(f,o,d,a,null)}function _(f,e,d,a,u){var o={type:f,props:e,key:d,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==u?++n:u};return null==u&&null!=i.vnode&&i.vnode(o),o}function g(f){return f.children}function b(f,e){this.props=f,this.context=e}function h(f,e){if(null==e)return f.__?h(f.__,f.__.__k.indexOf(f)+1):null;for(var i;e0?_(p.type,p.props,p.key,null,p.__v):p)){if(p.__=i,p.__b=i.__b+1,null===(m=j[s])||m&&p.key==m.key&&p.type===m.type)j[s]=void 0;else for(b=0;b`0x${f}`));return String.fromCodePoint(...e)}};const H=["heavy_plus_sign","+1","-1","eyes","heart_eyes","joy","fire","grinning","sweat_smile","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let $=null;var K={add:function(f){$||($=Z.get("frequently")||{});const e=f.id||f;e&&($[e]||($[e]=0),$[e]+=1,Z.set("last",e),Z.set("frequently",$))},get:function({maxFrequentRows:f,perLine:e}){$||($=Z.get("frequently"));let i=[];if(!$){$={};for(let f in H.slice(0,e)){const n=H[f];$[n]=e-f,i.push(n)}return i}const n=f*e,d=Z.get("last");for(let f in $)i.push(f);if(i.sort(((f,e)=>{const i=$[e],n=$[f];return i==n?f.localeCompare(e):i-n})),i.length>n){const f=i.slice(n);i=i.slice(0,n);for(let e of f)e!=d&&delete $[e];d&&-1==i.indexOf(d)&&(delete $[i[i.length-1]],i.splice(-1,1,d)),Z.set("frequently",$)}return i}};let W=null;function V(f,{maxResults:e}={}){const i=f.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter(((f,e,i)=>f.trim()&&i.indexOf(f)==e));if(!i.length)return;let n,d,a=W||(W=Object.values(Y.emojis));for(const f of i){if(!a.length)break;n=[],d={};for(const e of a){if(!e.search)continue;const i=e.search.indexOf(`,${f}`);-1!=i&&(n.push(e),d[e.id]||(d[e.id]=0),d[e.id]+=e.id==f?0:i+1)}a=n}return n.length<2||(n.sort(((f,e)=>{const i=d[f.id],n=d[e.id];return i==n?f.id.localeCompare(e.id):i-n})),n.length>e&&(n=n.slice(0,e))),n}var G={search:async function(f,{maxResults:e}={}){return f&&f.trim().length?(e||(e=90),await df(),V(f,{maxResults:e})):null},searchSynchronized:function(f,{maxResults:e}={}){return f&&f.trim().length?(e||(e=90),df(),V(f,{maxResults:e})):null},get:function(f){return f.id?f:Y.emojis[f]||Y.emojis[Y.aliases[f]]||Y.emojis[Y.natives[f]]},getShortcodeFromNative:function(f){return Y.natives[f]},SHORTCODES_REGEX:/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/};var J={getUrl:function(f){return"https://static.figma.com/emoji/4/64/"+f.unified?.toLowerCase()+".png"}};let X=f(A),Y=function(f){f.natives={};const e=function(f){const e={};for(const i of Object.keys(f.aliases))e[f.aliases[i]]=i;return e}(f);return Object.keys(f.emojis).forEach((i=>{const n={};n.id=i,n.search=","+[...new Set([n.id,...n.id.split(/[-|_|\s]+/),...(e[n.id]||"").split(/[-|_|\s]+/)].map((f=>f?f.toLowerCase():"")).filter((f=>f&&f.trim())))].join(","),n.skins=f.emojis[i],n.skins.forEach(((e,i)=>{if(e){const d=i+1==1?"":`:skin-tone-${i+1}:`;e.shortcodes=`:${n.id}:${d}`;const a=F.unifiedToNative(e.unified);f.natives[a]=e.shortcodes}})),f.emojis[i]=n})),f}(f(D));const Q={autoFocus:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:34},emojiSize:{value:22},emojiVersion:{value:14,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14]},locale:{value:"en",choices:["en","fr"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},stickySearch:{value:!0},theme:{value:"auto",choices:["auto","light","dark"]}};let ff=null,ef=!1,nf=null;function df(f){return ff||(ff=new Promise((f=>{nf=f}))),ef||(ef=!0,function(f,e){const{i18n:i}=f,n=function(f,e){function i(i){const n=Q[i];let d=e&&e.getAttribute(i)||f[i];return null!=d&&n.value&&typeof n.value!=typeof d&&(d="boolean"==typeof n.value?"false"!=d:n.value.constructor(d)),(null==d||n.choices&&-1==n.choices.indexOf(d))&&(d=n.value),d}f||(f={});const n={};for(let f in Q)n[f]=i(f);return n}(f,e);f.i18n&&(X=i);if(n.maxFrequentRows){const f=K.get(n);f.length&&Y.categories.unshift({id:"frequent",emojis:f})}nf(n)}(f||{})),ff}var af={categories:{activity:T("svg",{width:"19",height:"19",viewBox:"0 0 19 19",version:"1.1",children:[T("path",{d:"M 2.83936 4.21875C 3.89404 5.54712 4.55981 7.19824 4.66431 9L 5.66577 9C 5.55701 6.90271 4.76794 4.98523 3.51514 3.46411C 4.9408 2.05042 6.86462 1.13831 9 1.0144L 9.5 0C 4.2533 0 0 4.2533 0 9.5L 1.0144 9C 1.1189 7.19824 1.78467 5.54712 2.83936 4.21875Z"}),T("path",{d:"M 10 10L 13.5485 10L 14.5499 10L 14.5499 9L 13.5485 9L 10 9L 10 1.0144L 9.5 0L 9 1.0144L 9 9L 5.66577 9L 4.66431 9L 4.66431 10L 5.66577 10L 9 10L 9 17.9856L 9.5 19L 10 17.9856L 10 10Z"}),T("path",{d:"M 16.2678 4.35657C 17.2604 5.66052 17.8846 7.26001 17.9856 9L 19 9.5C 19 4.2533 14.7467 0 9.5 0L 10 1.0144C 12.1947 1.14172 14.1659 2.10168 15.6025 3.58313C 14.4058 5.08472 13.6544 6.95703 13.5485 9L 14.5499 9C 14.6509 7.26001 15.2753 5.66064 16.2678 4.35657Z"}),T("path",{d:"M 1.0144 10L 4.66431 10L 4.66431 9L 1.0144 9L 0 9.5L 1.0144 10Z"}),T("path",{d:"M 3.51514 15.5359C 4.76794 14.0148 5.55701 12.0973 5.66577 10L 4.66431 10C 4.55981 11.8018 3.89404 13.4529 2.83936 14.7812C 1.78467 13.4529 1.1189 11.8018 1.0144 10L 0 9.5C 0 14.7467 4.2533 19 9.5 19L 9 17.9856C 6.86462 17.8617 4.9408 16.9496 3.51514 15.5359Z"}),T("path",{d:"M 15.6025 15.4169C 14.1659 16.8983 12.1947 17.8583 10 17.9856L 9.5 19C 14.7467 19 19 14.7467 19 9.5L 17.9856 10C 17.8846 11.74 17.2604 13.3395 16.2678 14.6434C 15.2753 13.3394 14.6509 11.74 14.5499 10L 13.5485 10C 13.6544 12.043 14.4058 13.9153 15.6025 15.4169Z"}),T("path",{d:"M 14.5499 10L 17.9856 10L 19 9.5L 17.9856 9L 14.5499 9L 14.5499 10Z"})]}),flags:T("svg",{width:"12",height:"18",viewBox:"0 -1 12 18",version:"1.1",children:[T("path",{d:"M 1 0L 0 0L 0 1L 0 8L 0 9L 0 17L 1 17L 1 9L 1 8L 1 1L 1 0Z"}),T("path",{d:"M 1 9L 11 9L 12 9L 12 8L 12 1L 12 0L 11 0L 1 0L 1 1L 11 1L 11 8L 1 8L 1 9Z"})]}),foods:T("svg",{width:"17",height:"19",viewBox:"0 0 17 19",version:"1.1",children:[T("path",{d:"M 12.1183 6.48747C 11.4751 6.23515 10.7572 6.10832 10 6.10832C 9.88623 6.10832 9.77332 6.11296 9.66138 6.12187C 9.07397 6.16911 8.5144 6.33805 8 6.60771L 8 1.6082L 7.5 8.12834L 8.07019 7.73258C 8.68677 7.29289 9.25342 7.09477 10 7.10832C 11.1823 7.10832 12.1726 7.46806 12.8571 8.10026C 13.5286 8.72062 14 9.68937 14 11.1083C 14 12.462 13.3236 13.9887 12.2791 15.1969C 11.2169 16.4257 9.96875 17.1083 9 17.1083C 8.54712 17.1144 8.26135 17.0506 7.92432 16.886L 7.5 16.6873L 7.5 17.7915C 7.93848 17.997 8.43762 18.1083 9 18.1083C 11.7615 18.1083 15 14.422 15 11.1083C 15 8.70329 13.8208 7.15556 12.1183 6.48747Z"}),T("path",{d:"M 6 18.1083C 6.56238 18.1083 7.06152 17.997 7.5 17.7915L 7.5 16.6873L 7.07568 16.886C 6.73865 17.0506 6.45288 17.1144 6 17.1083C 5.03125 17.1083 3.78308 16.4257 2.72095 15.1969C 1.67639 13.9887 1 12.462 1 11.1083C 1 9.68937 1.47144 8.72062 2.14294 8.10026C 2.82739 7.46806 3.81775 7.10832 5 7.10832C 5.74658 7.09477 6.31323 7.29289 6.92981 7.73258L 7.5 8.12834L 8 1.6082L 7 1.6082L 7 6.60758C 6.38757 6.28642 5.71118 6.10832 5 6.10832C 2.23853 6.10832 0 7.7946 0 11.1083C 0 14.422 3.23853 18.1083 6 18.1083Z"}),T("path",{d:"M 11.4785 0.600017C 9.95911 1.47721 9.13403 3.11283 9.20801 4.76139L 10.2225 4.18717C 10.3368 3.08537 10.9589 2.05473 11.9785 1.46611C 12.9932 0.88029 14.1703 0.864665 15.1501 1.31889L 16.1647 0.74467C 14.8052 -0.16158 12.9978 -0.27718 11.4785 0.600017Z"}),T("path",{d:"M 13.8942 4.90605C 15.4136 4.02885 16.2386 2.39323 16.1647 0.74467L 15.1501 1.31889C 15.0359 2.42082 14.4138 3.45133 13.3942 4.04008C 12.3795 4.6259 11.2024 4.64152 10.2225 4.18717L 9.20801 4.76139C 9.4104 4.8964 9.6228 5.01371 9.84253 5.11296C 9.89465 5.13652 9.94714 5.15898 10 5.18034C 10.7045 5.46611 11.4779 5.56913 12.244 5.46842C 12.8082 5.39433 13.3684 5.20964 13.8942 4.90605Z"})]}),frequent:T("svg",{width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",children:[T("path",{d:"M 9 4L 10 4L 10 10L 16 10L 16 11L 10 11L 9 11L 9 10L 9 4Z"}),T("path",{d:"M 10 20C 4.47717 20 0 15.5228 0 10C 0 4.47717 4.47717 0 10 0L 10 1C 5.02942 1 1 5.02942 1 10C 1 14.9706 5.02942 19 10 19L 10 20Z"}),T("path",{d:"M 20 10C 20 15.5228 15.5228 20 10 20L 10 19C 14.9706 19 19 14.9706 19 10C 19 5.02942 14.9706 1 10 1L 10 0C 15.5228 0 20 4.47717 20 10Z"})]}),nature:T("svg",{width:"18",height:"18",viewBox:"0 0 18 18",version:"1.1",children:[T("path",{d:"M 4.77954 12.2311L 0 17.0106L 0.707153 17.7177L 5.39307 13.0318L 4.77954 12.2311Z"}),T("path",{d:"M 6.16248 12.2624L 5.56335 11.4472L 4.77954 12.2311L 5.39307 13.0318L 6.16248 12.2624Z"}),T("path",{d:"M 5.39307 13.0318C 8.67566 14.4375 12.6239 13.8008 15.3032 11.1214C 18.0741 8.35044 18.6605 4.22227 17.0624 0.876806L 16.4442 1.98069C 17.4929 4.82078 16.8754 8.13498 14.5961 10.4143C 12.3169 12.6936 9.00244 13.3111 6.16248 12.2624L 5.39307 13.0318Z"}),T("path",{d:"M 15.6292 1.38144L 5.56335 11.4472L 6.16248 12.2624L 16.4442 1.98069L 15.6292 1.38144Z"}),T("path",{d:"M 7.52515 3.34299C 9.7168 1.15134 12.8655 0.496191 15.6292 1.38144L 17.0624 0.876806C 13.717 -0.721216 9.58887 -0.134912 6.81799 2.63596C 4.22388 5.23008 3.54431 9.01377 4.77954 12.2311L 5.56335 11.4472C 4.6781 8.68345 5.33337 5.53477 7.52515 3.34299Z"}),T("path",{d:"M 17.0624 0.876806L 15.6292 1.38144L 16.4442 1.98069L 17.0624 0.876806Z"})]}),objects:T("svg",{width:"18",height:"17",viewBox:"0 0 18 17",version:"1.1",children:T("path",{d:"M 15.6673 1.61096C 13.5194 -0.536987 10.037 -0.536987 7.88901 1.61096L 1.1716 8.32849C -0.390533 9.8905 -0.390533 12.4232 1.1716 13.9854C 2.73361 15.5472 5.26572 15.5481 6.82785 13.9858L 9.30331 11.5105L 9.65683 11.1569L 12.1318 8.68213C 13.108 7.70581 13.108 6.12292 12.1318 5.14661C 11.1555 4.17029 9.57248 4.17029 8.59616 5.14661L 3.29294 10.45L 3.99997 11.157L 9.30331 5.85376C 9.88913 5.26794 10.8388 5.26794 11.4247 5.85376C 12.0105 6.43945 12.0105 7.38928 11.4247 7.97498L 8.9498 10.4498L 8.59616 10.8035L 6.12082 13.2787C 4.94931 14.4502 3.05038 14.4498 1.87863 13.2782C 0.707123 12.1066 0.707123 10.2072 1.87863 9.03552L 8.59616 2.31812C 10.3535 0.560669 13.2029 0.560669 14.9602 2.31812C 16.7176 4.07544 16.7176 6.9248 14.9602 8.68213L 8.24277 15.3997L 8.9498 16.1067L 15.6673 9.38928C 17.8152 7.24133 17.8152 3.75891 15.6673 1.61096Z"})}),people:T("svg",{width:"19",height:"19",viewBox:"0 0 19 19",version:"1.1",children:[T("path",{d:"M 9.5 15C 7.08093 15 5.06323 13.2822 4.59998 11L 5.62598 11C 6.07007 12.7252 7.63623 14 9.5 14C 11.3638 14 12.9299 12.7252 13.374 11L 14.4 11C 13.9368 13.2822 11.9191 15 9.5 15Z"}),T("path",{d:"M 7 7.5C 7 8.05225 6.55225 8.5 6 8.5C 5.44775 8.5 5 8.05225 5 7.5C 5 6.94775 5.44775 6.5 6 6.5C 6.55225 6.5 7 6.94775 7 7.5Z"}),T("path",{d:"M 13 8.5C 13.5522 8.5 14 8.05225 14 7.5C 14 6.94775 13.5522 6.5 13 6.5C 12.4478 6.5 12 6.94775 12 7.5C 12 8.05225 12.4478 8.5 13 8.5Z"}),T("path",{d:"M 9.5 18C 4.80554 18 1 14.1945 1 9.5C 1 4.80554 4.80554 1 9.5 1L 9.5 0C 4.2533 0 0 4.2533 0 9.5C 0 14.7467 4.2533 19 9.5 19L 9.5 18Z"}),T("path",{d:"M 18 9.5C 18 14.1945 14.1945 18 9.5 18L 9.5 19C 14.7467 19 19 14.7467 19 9.5C 19 4.2533 14.7467 0 9.5 0L 9.5 1C 14.1945 1 18 4.80554 18 9.5Z"})]}),places:T("svg",{width:"18",height:"18",viewBox:"0 0 18 18",version:"1.1",children:[T("path",{d:"M 11.9747 1.55383C 12.5566 1.17468 13.1697 0.994873 13.8641 1L 17.861 1L 17.861 0L 13.8641 0C 13.0276 0.00512695 12.1419 0.264648 11.4349 0.712036L 2.07887 6.71204C -1.70385 9.13794 0.0142913 15 4.50807 15L 9.39637 15L 10.411 15L 12.6918 15L 15.3109 15L 16.3256 15L 17.861 15L 17.861 14L 12.6918 14L 4.50807 14C 1.26454 14 -0.119864 10.0732 2.0492 8L 3.48231 7L 7.38062 4.5L 8.93995 3.5L 11.9747 1.55383Z"}),T("path",{d:"M 13.111 3.5L 8.93995 3.5L 7.38062 4.5L 13.111 4.5C 13.8013 4.5 14.361 5.05969 14.361 5.75C 14.361 6.44031 13.8013 7 13.111 7L 3.48231 7L 2.0492 8L 13.111 8C 14.3536 8 15.361 6.99268 15.361 5.75C 15.361 4.50732 14.3536 3.5 13.111 3.5Z"}),T("path",{d:"M 12.861 18C 14.6242 18 16.0829 16.6962 16.3256 15L 15.3109 15C 15.0794 16.1411 14.0704 17 12.861 17C 11.6515 17 10.6426 16.1411 10.411 15L 9.39637 15C 9.63905 16.6962 11.0978 18 12.861 18Z"})]}),symbols:T("svg",{width:"19",height:"16",viewBox:"0 0 19 16",version:"1.1",children:[T("path",{d:"M 1 5C 1 2.79091 2.79091 1 5 1C 6.54723 1 7.89015 1.8784 8.55585 3.16603L 9 4.02513L 9 1.99968C 8.08821 0.786061 6.63622 0 5 0C 2.23863 0 0 2.23863 0 5C 0 6.63571 0.786056 8.08793 1.99875 8.99938L 8.65451 15.3614L 9 15.6917L 9 14.3083L 2.66775 8.2555L 2.64519 8.23393L 2.62011 8.21534C 1.63619 7.48562 1 6.31713 1 5Z"}),T("path",{d:"M 15.3322 8.2555L 9 14.3083L 9 15.6917L 9.34549 15.3614L 16.0013 8.99938C 17.2139 8.08793 18 6.63571 18 5C 18 2.23863 15.7614 0 13 0C 11.3638 0 9.91179 0.786061 9 1.99968L 9 4.02513L 9.44415 3.16603C 10.1099 1.8784 11.4528 1 13 1C 15.2091 1 17 2.79091 17 5C 17 6.31713 16.3638 7.48562 15.3799 8.21534L 15.3548 8.23393L 15.3322 8.2555Z"})]})},search:{loupe:T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:T("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:T("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})}};function uf(f){let{id:e,skin:i,shortcodes:n,emoji:d,set:a,size:u}=f;if(!d&&!e&&n){const f=n.match(G.SHORTCODES_REGEX);f&&(e=f[1],f[2]&&(i=f[2]))}if(d||(d=G.get(e)),!d||"female_sign"===d.id||"male_sign"===d.id)return f.fallback;const o=d.skins[i-1]||d.skins[0];if("native"===a){return T("span",{style:{fontSize:u||22,fontFamily:"EmojiMart, Segoe UI Emoji, Segoe UI Symbol, Segoe UI, Apple Color Emoji, Twemoji Mozilla, Noto Color Emoji, Android Emoji"},children:F.unifiedToNative(o.unified)})}const t=J.getUrl(o);return T("img",{style:{height:f.size||"1em",width:"auto",display:"inline-block",position:"relative"},alt:o.native,src:t})}class of extends window.HTMLElement{constructor(f={}){if(super(),this.props=f,f.parent||f.ref){const e=f.parent||f.ref&&f.ref.current;e&&e.appendChild(this)}}}class tf extends of{constructor(f,{styles:e}={}){super(f),this.setShadow(),this.injectStyles(e)}setShadow(){this.attachShadow({mode:"open"})}injectStyles(f){if(!f)return;const e=document.createElement("style");e.textContent=f,this.shadowRoot.insertBefore(e,this.shadowRoot.firstChild)}}class rf extends of{async connectedCallback(){const f=await df(),e=this.getAttribute("native");let i=null;e&&(i=G.get(e));R(T(uf,{...{...f,emoji:i,id:this.getAttribute("id"),set:this.getAttribute("set")||f.set,size:this.getAttribute("size"),fallback:this.getAttribute("fallback"),shortcodes:this.getAttribute("shortcodes")}}),this)}}"customElements"in window&&!customElements.get("em-emoji")&&customElements.define("em-emoji",rf);var lf,cf,sf=[],_f=i.__b,gf=i.__r,bf=i.diffed,hf=i.__c,mf=i.unmount;function pf(){var f;for(sf.sort((function(f,e){return f.__v.__b-e.__v.__b}));f=sf.pop();)if(f.__P)try{f.__H.__h.forEach(kf),f.__H.__h.forEach(yf),f.__H.__h=[]}catch(e){f.__H.__h=[],i.__e(e,f.__v)}}i.__b=function(f){lf=null,_f&&_f(f)},i.__r=function(f){gf&&gf(f),0;var e=(lf=f.__c).__H;e&&(e.__h.forEach(kf),e.__h.forEach(yf),e.__h=[])},i.diffed=function(f){bf&&bf(f);var e=f.__c;e&&e.__H&&e.__H.__h.length&&(1!==sf.push(e)&&cf===i.requestAnimationFrame||((cf=i.requestAnimationFrame)||function(f){var e,i=function(){clearTimeout(n),wf&&cancelAnimationFrame(e),setTimeout(f)},n=setTimeout(i,100);wf&&(e=requestAnimationFrame(i))})(pf)),lf=null},i.__c=function(f,e){e.some((function(f){try{f.__h.forEach(kf),f.__h=f.__h.filter((function(f){return!f.__||yf(f)}))}catch(n){e.some((function(f){f.__h&&(f.__h=[])})),e=[],i.__e(n,f.__v)}})),hf&&hf(f,e)},i.unmount=function(f){mf&&mf(f);var e,n=f.__c;n&&n.__H&&(n.__H.__.forEach((function(f){try{kf(f)}catch(f){e=f}})),e&&i.__e(e,n.__v))};var wf="function"==typeof requestAnimationFrame;function kf(f){var e=lf,i=f.__c;"function"==typeof i&&(f.__c=void 0,i()),lf=e}function yf(f){var e=lf;f.__c=f.__(),lf=e}function vf(f,e){for(var i in e)f[i]=e[i];return f}function xf(f,e){for(var i in f)if("__source"!==i&&!(i in e))return!0;for(var n in e)if("__source"!==n&&f[n]!==e[n])return!0;return!1}function jf(f){this.props=f}(jf.prototype=new b).isPureReactComponent=!0,jf.prototype.shouldComponentUpdate=function(f,e){return xf(this.props,f)||xf(this.state,e)};var Cf=i.__b;i.__b=function(f){f.type&&f.type.__f&&f.ref&&(f.props.ref=f.ref,f.ref=null),Cf&&Cf(f)};"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Lf=i.__e;i.__e=function(f,e,i){if(f.then)for(var n,d=e;d=d.__;)if((n=d.__c)&&n.__c)return null==e.__e&&(e.__e=i.__e,e.__k=i.__k),n.__c(f,e);Lf(f,e,i)};var Sf=i.unmount;function zf(){this.__u=0,this.t=null,this.__b=null}function Ef(f){var e=f.__.__c;return e&&e.__e&&e.__e(f)}function qf(){this.u=null,this.o=null}i.unmount=function(f){var e=f.__c;e&&e.__R&&e.__R(),e&&!0===f.__h&&(f.type=null),Sf&&Sf(f)},(zf.prototype=new b).__c=function(f,e){var i=e.__c,n=this;null==n.t&&(n.t=[]),n.t.push(i);var d=Ef(n.__v),a=!1,u=function(){a||(a=!0,i.__R=null,d?d(o):o())};i.__R=u;var o=function(){if(!--n.__u){if(n.state.__e){var f=n.state.__e;n.__v.__k[0]=function f(e,i,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return f(e,i,n)})),e.__c&&e.__c.__P===i&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}(f,f.__c.__P,f.__c.__O)}var e;for(n.setState({__e:n.__b=null});e=n.t.pop();)e.forceUpdate()}},t=!0===e.__h;n.__u++||t||n.setState({__e:n.__b=n.__v.__k[0]}),f.then(u,u)},zf.prototype.componentWillUnmount=function(){this.t=[]},zf.prototype.render=function(f,e){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function f(e,i,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(f){"function"==typeof f.__c&&f.__c()})),e.__c.__H=null),null!=(e=vf({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=i),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return f(e,i,n)}))),e}(this.__b,i,n.__O=n.__P)}this.__b=null}var d=e.__e&&s(g,null,f.fallback);return d&&(d.__h=null),[s(g,null,e.__e?null:f.children),d]};var Mf=function(f,e,i){if(++i[1]===i[0]&&f.o.delete(e),f.props.revealOrder&&("t"!==f.props.revealOrder[0]||!f.o.size))for(i=f.u;i;){for(;i.length>3;)i.pop()();if(i[1]!f.target)),this.state={categoryId:this.categories[0].id}}renderIcon(f){const{icon:e}=f;if(e){if(e.svg)return T("span",{class:"flex",dangerouslySetInnerHTML:{__html:e.svg}});if(e.src)return T("img",{src:e.src})}return af.categories[f.id]}render(){let f=null;return T("nav",{id:"nav",class:"padding","data-position":this.props.position,children:T("div",{class:"flex relative",children:[this.categories.map(((e,i)=>{const n=e.name||X.categories[e.id],d=!this.props.unfocused&&e.id==this.state.categoryId;return d&&(f=i),T("button",{"aria-label":n,"aria-selected":d||void 0,title:n,type:"button",class:"flex flex-grow flex-center",onClick:()=>{this.props.onClick({category:e,i:i})},children:this.renderIcon(e)})})),T("div",{class:"bar",style:{width:100/this.categories.length+"%",opacity:null==f?0:1,transform:`translateX(${100*f}%)`}})]})})}}class Ff extends jf{shouldComponentUpdate(f){for(let e in f)if("children"!=e&&f[e]!=this.props[e])return!0;return!1}render(){return this.props.children}}const Hf=10;class $f extends b{constructor(f){super(),this.state={pos:[-1,-1],skin:Z.get("skin")||f.skin,theme:this.initTheme(f.theme),visibleRows:{0:!0}}}componentWillMount(){const{categories:f}=Y;this.refs={categories:new Map,menu:{current:null},navigation:{current:null},scroll:{current:null},search:{current:null},searchInput:{current:null},skinToneButton:{current:null},skinToneRadio:{current:null}},this.grid=[],this.grid.setsize=0;const e=(f,e)=>{const i=[];i.__categoryId=e.id,i.__index=f.length,this.grid.push(i);const n=this.grid.length-1,d=n%Hf?{}:{current:null};return d.index=n,d.posinset=this.grid.setsize+1,f.push(d),i};for(let i of f){const f=[];let n=e(f,i);for(let d of i.emojis)n.length==this.props.perLine&&(n=e(f,i)),this.grid.setsize+=1,n.push(d);this.refs.categories.set(i.id,{root:{current:null},rows:f})}}componentDidMount(){this.observeCategories(),this.observeRows(),this.shadowRoot=this.base.parentNode,this.props.autoFocus&&this.refs.searchInput.current&&this.refs.searchInput.current.focus()}initTheme(f){if("auto"!=f)return f;const e=matchMedia("(prefers-color-scheme: dark)");return e.media.match(/^not/)?"light":(e.addListener((()=>{this.setState({theme:e.matches?"dark":"light"})})),e.matches?"dark":"light")}handleBaseClick=f=>{this.state.showSkins&&(f.target.closest(".menu")||(f.preventDefault(),f.stopImmediatePropagation(),this.closeSkins()))};handleBaseKeydown=f=>{this.state.showSkins&&"Escape"==f.key&&(f.preventDefault(),f.stopImmediatePropagation(),this.closeSkins(),this.refs.skinToneButton.current.focus())};getEmojiByPos([f,e]){const i=this.state.searchResults||this.grid,n=i[f]&&i[f][e];if(n)return G.get(n)}observeCategories(){const f=this.refs.navigation.current;if(!f)return;const e=new Map,i=e=>{e!=f.state.categoryId&&f.setState({categoryId:e})},n={root:this.refs.scroll.current,threshold:[0,1]},d=new IntersectionObserver((f=>{for(const i of f){const f=i.target.dataset.id;e.set(f,i.intersectionRatio)}const n=[...e],d=n[n.length-1];if(1==d[1])return i(d[0]);for(const[f,e]of n)if(e){i(f);break}}),n);for(const{root:f}of this.refs.categories.values())d.observe(f.current)}observeRows(){const f={...this.state.visibleRows},e=new IntersectionObserver((e=>{for(const i of e){const e=parseInt(i.target.dataset.index);i.isIntersecting?f[e]=!0:delete f[e]}this.setState({visibleRows:f})}),{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(Hf+5)}px 0px ${this.props.emojiButtonSize*Hf}px`});for(const{rows:f}of this.refs.categories.values())for(const i of f)i.current&&e.observe(i.current)}preventDefault(f){f.preventDefault()}handleSearchClick=()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})};handleSearchInput=async()=>{const f=this.refs.searchInput.current;if(!f)return;const{value:e}=f,i=await G.search(e),n=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!i)return this.setState({searchResults:i,pos:[-1,-1]},n);const d=f.selectionStart==f.value.length?[0,0]:[-1,-1],a=[];a.setsize=i.length;let u=null;for(let f of i)a.length&&u.length!=this.props.perLine||(u=[],u.__categoryId="search",u.__index=a.length,a.push(u)),u.push(f);this.ignoreMouse(),this.setState({searchResults:a,pos:d},n)};handleKeyDown=f=>{if(f.stopImmediatePropagation(),"Escape"===f.key)this.props.onEscapeKeydown&&this.props.onEscapeKeydown()};handleSearchKeyDown=f=>{const e=f.currentTarget;switch(f.stopImmediatePropagation(),f.key){case"ArrowLeft":this.navigate({e:f,input:e,left:!0});break;case"ArrowRight":this.navigate({e:f,input:e,right:!0});break;case"ArrowUp":this.navigate({e:f,input:e,up:!0});break;case"ArrowDown":this.navigate({e:f,input:e,down:!0});break;case"Enter":f.preventDefault(),this.handleEmojiClick({pos:this.state.pos});break;case"Escape":f.preventDefault(),this.state.searchResults?this.clearSearch():this.props.onEscapeKeydown?this.props.onEscapeKeydown():this.unfocusSearch()}};clearSearch=()=>{const f=this.refs.searchInput.current;f&&(f.value="",f.focus(),this.handleSearchInput())};unfocusSearch(){const f=this.refs.searchInput.current;f&&f.blur()}navigate({e:f,input:e,left:i,right:n,up:d,down:a}){const u=this.state.searchResults||this.grid;if(!u.length)return;let[o,t]=this.state.pos;const r=(()=>{if(0==o&&0==t&&!f.repeat&&(i||d))return null;if(-1==o)return f.repeat||!n&&!a||e.selectionStart!=e.value.length?null:[0,0];if(i||n){let f=u[o];const e=i?-1:1;if(t+=e,!f[t]){if(o+=e,f=u[o],!f)return o=i?0:u.length-1,t=i?0:u[o].length-1,[o,t];t=i?f.length-1:0}return[o,t]}if(d||a){o+=d?-1:1;const f=u[o];return f?(f[t]||(t=f.length-1),[o,t]):(o=d?0:u.length-1,t=d?0:u[o].length-1,[o,t])}})();r?(f.preventDefault(),this.setState({pos:r,keyboard:!0},(()=>{this.scrollTo({row:r[0]})}))):this.state.pos[0]>-1&&this.setState({pos:[-1,-1]})}scrollTo({categoryId:f,row:e}){const i=this.state.searchResults||this.grid;if(!i.length)return;const n=this.refs.scroll.current,d=n.getBoundingClientRect();let a=0;if(e>=0&&(f=i[e].__categoryId),f){a=(this.refs[f]||this.refs.categories.get(f).root).current.getBoundingClientRect().top-(d.top-n.scrollTop)+1}if(e>=0)if(e){const f=a+i[e].__index*this.props.emojiButtonSize,u=f+this.props.emojiButtonSize+.88*this.props.emojiButtonSize;if(fn.scrollTop+d.height))return;a=u-d.height}}else a=0;this.ignoreMouse(),n.scrollTop=a}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout((()=>{delete this.mouseIsIgnored}),100)}handleCategoryClick=({category:f,i:e})=>{this.scrollTo(0==e?{row:-1}:{categoryId:f.id})};handleEmojiOver(f){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:f||[-1,-1],keyboard:!1})}handleEmojiClick({emoji:f,pos:e}){if(this.props.onEmojiSelect&&(!f&&e&&(f=this.getEmojiByPos(e)),f)){const e=f.skins[this.state.skin-1]||f.skins[0],i={id:f.id,unified:e.unified,keywords:f?.keywords||[],shortcodes:e.shortcodes||f.shortcodes};e.src&&(i.src=e.src),f.aliases&&f.aliases.length&&(i.aliases=f.aliases),this.props.maxFrequentRows&&K.add(i,this.props),this.props.onEmojiSelect(i)}}openSkins=f=>{const{currentTarget:e}=f,i=e.getBoundingClientRect();this.setState({showSkins:i},(async()=>{await I(2);const f=this.refs.menu.current;f&&(f.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))}))};closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(f){this.setState({tempSkin:f})}handleSkinClick(f){this.ignoreMouse(),this.closeSkins(),this.setState({skin:f,tempSkin:null}),Z.set("skin",f)}renderNav(){return T(Uf,{ref:this.refs.navigation,theme:this.state.theme,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick})}renderPreview(){const f=this.getEmojiByPos(this.state.pos),e=this.state.searchResults&&!this.state.searchResults.length;return T("div",{id:"preview",class:"flex flex-middle","data-position":this.props.previewPosition,children:[T("div",{class:"flex flex-middle flex-grow",style:{padding:"4px 0px"},children:[T("div",{class:"flex flex-auto flex-middle flex-center",style:{height:30,width:30,fontSize:30},children:T(uf,{emoji:f,id:e?this.props.noResultsEmoji||"cry":this.props.previewEmoji||("top"==this.props.previewPosition?"point_down":"point_up"),set:this.props.set,size:22,skin:this.state.tempSkin||this.state.skin,spritesheet:!0})}),T("div",f?{class:"ellipsis color-c",children:f.skins[0].shortcodes}:e?{class:"ellipsis color-c",children:X.search_no_results}:{class:"color-c",children:X.pick})]}),!f&&this.renderSkinToneButton()]})}renderEmojiButton(f,{pos:e,posinset:i,grid:n}){const d=this.props.emojiButtonSize,a=this.state.tempSkin||this.state.skin,u=(o=this.state.pos,t=e,Array.isArray(o)&&Array.isArray(t)&&o.length===t.length&&o.every(((f,e)=>f==t[e])));var o,t;const r=e.concat(f.id).join("");return T(Ff,{selected:u,skin:a,size:d,children:T("button",{"aria-label":f.id,"aria-selected":u||void 0,"aria-posinset":i,"aria-setsize":n.setsize,"data-keyboard":this.state.keyboard,title:"none"==this.props.previewPosition?f.id:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:()=>this.handleEmojiClick({emoji:f}),onMouseEnter:()=>this.handleEmojiOver(e),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0,fontFamily:"EmojiMart, Segoe UI Emoji, Segoe UI Symbol, Segoe UI, Apple Color Emoji, Twemoji Mozilla, Noto Color Emoji, Android Emoji"},children:[T("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(i-1)%this.props.emojiButtonColors.length]:void 0}}),T(uf,{emoji:f,set:this.props.set,size:this.props.emojiSize,skin:a,spritesheet:!0})]})},r)}renderSearch(){return T("div",{children:[T("div",{class:"spacer"}),T("div",{class:"flex flex-middle",children:[T("div",{class:"search relative flex-grow",children:[T("input",{type:"search",autoFocus:this.props.autoFocus,ref:this.refs.searchInput,placeholder:X.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown}),T("span",{class:"icon loupe flex",children:af.search.loupe}),this.state.searchResults&&T("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:af.search.delete})]}),"none"==this.props.previewPosition&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:f}=this.state;return f?T("div",{class:"category",ref:this.refs.search,children:[T("div",{class:"sticky padding-small",children:X.categories.search}),T("div",{children:f.map(((e,i)=>T("div",{class:"flex",children:e.map(((e,n)=>this.renderEmojiButton(e,{pos:[i,n],posinset:i*this.props.perLine+n+1,grid:f})))})))})]}):null}renderCategories(){const{categories:f}=Y,e=!!this.state.searchResults;return T("div",{style:{visibility:e?"hidden":void 0,display:e?"none":void 0},children:f.map((f=>{const{root:e,rows:i}=this.refs.categories.get(f.id);return T("div",{"data-id":f.target?f.target.id:f.id,class:"category",ref:e,children:[T("div",{class:"sticky padding-small",children:f.name||X.categories[f.id]}),T("div",{class:"relative",style:{height:i.length*this.props.emojiButtonSize},children:i.map(((e,i)=>{const n=e.index-e.index%Hf,d=this.state.visibleRows[n],a="current"in e?e:void 0;if(!d&&!a)return null;const u=i*this.props.perLine,o=u+this.props.perLine,t=f.emojis.slice(u,o);return T("div",{"data-index":e.index,ref:a,class:"flex row",style:{top:i*this.props.emojiButtonSize},children:d&&t.map(((f,i)=>{const n=G.get(f);return this.renderEmojiButton(n,{pos:[e.index,i],posinset:e.posinset+i,grid:this.grid})}))},e.index)}))})]})}))})}renderSkinToneButton(){return T("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:T("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":X.skins.choose,title:X.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:T("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderSkins(){const f=this.refs.skinToneButton.current.getBoundingClientRect(),e=this.base.getBoundingClientRect(),i={right:e.right-f.right-3};return"bottom"==this.props.previewPosition?i.bottom=e.bottom-f.top+4:(i.top=f.bottom-e.top+3,i.bottom="auto"),T("div",{ref:this.refs.menu,role:"radiogroup","aria-label":X.skins.choose,class:"menu hidden","data-position":i.top?"top":"bottom",style:i,children:[...Array(6).keys()].map((f=>{const e=f+1,i=this.state.skin==e;return T("div",{children:[T("input",{type:"radio",name:"skin-tone",value:e,"aria-label":X.skins[e],ref:i?this.refs.skinToneRadio:null,defaultChecked:i,onChange:()=>this.handleSkinMouseOver(e),onKeyDown:f=>{"Enter"!=f.code&&"Space"!=f.code&&"Tab"!=f.code||(f.preventDefault(),this.handleSkinClick(e),this.refs.skinToneButton.current.focus())}}),T("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(e),onMouseEnter:()=>this.handleSkinMouseOver(e),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[T("span",{class:`skin-tone skin-tone-${e}`}),T("span",{class:"margin-small-lr",children:X.skins[e]})]})]})}))})}render(){return T("section",{id:"root",class:"flex flex-column",style:{width:this.props.perLine*this.props.emojiButtonSize+28},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,onKeyDown:this.handleKeyDown,children:["top"==this.props.previewPosition&&this.renderPreview(),"top"==this.props.navPosition&&this.renderNav(),this.props.stickySearch&&T("div",{class:"padding-lr",children:this.renderSearch()}),T("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:T("div",{style:{width:this.props.perLine*this.props.emojiButtonSize},children:[!this.props.stickySearch&&this.renderSearch(),this.renderSearchResults(),this.renderCategories(),T("div",{class:"spacer"})]})}),"bottom"==this.props.navPosition&&this.renderNav(),"bottom"==this.props.previewPosition&&this.renderPreview(),this.state.showSkins&&this.renderSkins()]})}}class Kf extends tf{constructor(e){super(e,{styles:f(Wf)})}async connectedCallback(){const f=await df(this.props),{onEmojiSelect:e,onClickOutside:i,onEscapeKeydown:n}=this.props,d={...f,element:this,onEmojiSelect:e,onClickOutside:i,onEscapeKeydown:n};R(T($f,{...d}),this.shadowRoot)}}"customElements"in window&&!customElements.get("em-emoji-picker")&&customElements.define("em-emoji-picker",Kf);var Wf={};Wf=':host{width:min-content;height:405px;min-height:230px;box-shadow:var(--shadow);--category-icon-size:18px;--font-family-fallback:-apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;--font-family:var(--font-family-ui,--font-family-fallback);--font-size:13px;--shadow-color:0deg 0% 0%;--shadow:.3px .5px 2.7px hsl(var(--shadow-color)/.14),.4px .8px 1px -3.2px hsl(var(--shadow-color)/.14),1px 2px 2.5px -4.5px hsl(var(--shadow-color)/.14);display:flex}[data-theme=light]{--em-color:var(--color-text,#222427);--em-color-secondary:var(--color-text-secondary,#323437);--em-color-tertiary:var(--color-text-tertiary,#505255);--em-accent:var(--color-border-selected,#2266ed);--em-background:var(--color-bg,#fff);--em-input:var(--color-bg-secondary,#fff);--em-color-border:var(--color-border,#0000000d);--em-color-border-over:var(--color-border-over,#0000001a)}[data-theme=dark]{--em-color:var(--color-text,#dededd);--em-color-secondary:var(--color-text-secondary,#b6b6b5);--em-color-tertiary:var(--color-text-tertiary,#7a7a79);--em-accent:var(--color-border-selected,#3a82f7);--em-background:var(--color-bg,#2c2c2c);--em-input:var(--color-bg-secondary,#000);--em-color-border:var(--color-border,#ffffff1a);--em-color-border-over:var(--color-border-over,#fff3)}#root{--color-a:var(--em-color);--color-b:var(--em-color-secondary);--color-c:var(--em-color-tertiary);--padding:12px;--padding-small:calc(var(--padding)/2);--sidebar-width:16px;--duration:225ms;--duration-fast:125ms;--duration-instant:50ms;--easing:cubic-bezier(.4,0,.2,1);width:100%;text-align:left;background-color:var(--em-background);position:relative}@media (prefers-reduced-motion){#root{--duration:0;--duration-fast:0;--duration-instant:0}}#root[data-menu] button{cursor:auto}#root[data-menu] .menu button{cursor:pointer}:host,#root,input,button{color:var(--em-color);font-family:var(--font-family);font-size:var(--font-size);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:normal}*,:before,:after{box-sizing:border-box;min-width:0;margin:0;padding:0}.relative{position:relative}.flex{display:flex}.flex-auto{flex:none}.flex-center{justify-content:center}.flex-column{flex-direction:column}.flex-grow{flex:auto}.flex-middle{align-items:center}.flex-wrap{flex-wrap:wrap}.padding{padding:var(--padding)}.padding-t{padding-top:var(--padding)}.padding-lr{padding-left:var(--padding);padding-right:var(--padding)}.padding-r{padding-right:var(--padding)}.padding-small{padding:var(--padding-small)}.padding-small-b{padding-bottom:var(--padding-small)}.padding-small-lr{padding-left:var(--padding-small);padding-right:var(--padding-small)}.margin{margin:var(--padding)}.margin-l{margin-left:var(--padding)}.margin-small-l{margin-left:var(--padding-small)}.margin-small-lr{margin-left:var(--padding-small);margin-right:var(--padding-small)}.color-a{color:var(--color-a)}.color-b{color:var(--color-b)}.color-c{color:var(--color-c)}.ellipsis{white-space:nowrap;max-width:100%;width:auto;text-overflow:ellipsis;overflow:hidden}a{cursor:pointer;color:var(--em-accent)}a:hover{text-decoration:underline}.spacer{height:10px}.scroll{padding-right:0;overflow-x:hidden;overflow-y:auto}.scroll::-webkit-scrollbar{width:var(--sidebar-width);height:var(--sidebar-width)}.scroll::-webkit-scrollbar-track{border:0}.scroll::-webkit-scrollbar-button{width:0;height:0;display:none}.scroll::-webkit-scrollbar-corner{background-color:#0000}.scroll::-webkit-scrollbar-thumb{min-height:20%;min-height:65px;border:4px solid var(--em-background);border-radius:8px}.scroll::-webkit-scrollbar-thumb:hover{background-color:var(--em-color-border-over)!important}.scroll:hover::-webkit-scrollbar-thumb{background-color:var(--em-color-border)}.sticky{z-index:1;background-color:var(--em-background);font-weight:500;position:sticky;top:-1px}.search{z-index:2;position:relative}.search input,.search button{font-size:calc(var(--font-size) - 1px)}.search input[type=search]{width:100%;background-color:var(--em-color-border);border:1px solid #0000;border-radius:10px;outline:0;padding:10px 2em 10px 2.2em;display:block}.search input[type=search]::placeholder{color:inherit;opacity:.6}.search input[type=search],.search input[type=search]::-webkit-search-decoration,.search input[type=search]::-webkit-search-cancel-button,.search input[type=search]::-webkit-search-results-button,.search input[type=search]::-webkit-search-results-decoration{appearance:none}.search input[type=search]:focus{background-color:var(--em-input);border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent)}.search .icon{z-index:1;color:var(--em-color);position:absolute;top:50%;transform:translateY(-50%)}.search .loupe{pointer-events:none;left:.7em}.search .delete{border:1px solid #0000;padding:4px;right:.6em}.search .delete:focus-visible{border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent);outline:none}svg{fill:currentColor;width:1em;height:1em}button{appearance:none;cursor:pointer;color:currentColor;background-color:#0000;border:0}#nav{z-index:2;padding-top:8px;padding-bottom:8px;padding-right:var(--sidebar-width);position:relative}#nav button{color:var(--color-b);border:1px solid #0000;padding-top:4px;padding-bottom:4px}#nav button:hover{color:var(--color-a)}#nav button:focus-visible{border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent);outline:none}#nav svg,#nav img{width:var(--category-icon-size);height:var(--category-icon-size)}#nav .bar{width:100%;height:2px;background-color:var(--em-accent);position:absolute;bottom:-11px;left:0}#nav button[aria-selected]{color:var(--em-accent)}#preview{z-index:2;padding:0px var(--padding);padding-right:var(--sidebar-width);position:relative}#nav:before,#preview:before{content:"";height:2px;position:absolute;left:0;right:0}#nav[data-position=top]:before,#preview[data-position=top]:before{background:linear-gradient(to bottom,var(--em-color-border),transparent);top:100%}#nav[data-position=bottom]:before,#preview[data-position=bottom]:before{background:linear-gradient(to top,var(--em-color-border),transparent);bottom:100%}.category button{font-family:var(--font-family);position:relative}.category button>*{position:relative}.category button .background{opacity:0;background-color:var(--em-color-border);position:absolute;inset:0}.category button[aria-selected] .background{opacity:1}.row{width:100%;position:absolute;top:0;left:0}.skin-tone-button{border:1px solid #0000;border-radius:100%}.skin-tone-button:hover{border-color:var(--em-color-border)}.skin-tone-button:active .skin-tone{transform:scale(.85)!important}.skin-tone-button:focus-visible{border-color:var(--em-accent);box-shadow:0 0 0 1px var(--em-accent);outline:none}.skin-tone-button[aria-selected]{background-color:var(--em-color-border);border-top-color:#0000000d;border-bottom-color:#0000;border-left-width:0;border-right-width:0}.skin-tone-button[aria-selected] .skin-tone{transform:scale(.9)}.menu{z-index:2;white-space:nowrap;border:1px solid var(--em-color-border);background-color:var(--em-background);backdrop-filter:blur(4px);border-radius:10px;padding:4px;position:absolute;box-shadow:1px 1px 5px #0000000d}.menu.hidden{opacity:0}.menu[data-position=bottom]{transform-origin:100% 100%}.menu[data-position=bottom].hidden{transform:scale(.9)rotate(-3deg)translateY(5%)}.menu[data-position=top]{transform-origin:100% 0}.menu[data-position=top].hidden{transform:scale(.9)rotate(3deg)translateY(-5%)}.menu input[type=radio]{clip:rect(0 0 0 0);width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.menu input[type=radio]:checked+.option{border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent)}.option{width:100%;border:1px solid #0000;border-radius:6px;padding:4px 6px}.option:hover{color:#fff;background-color:var(--em-accent)}.skin-tone{width:16px;height:16px;border-radius:100%;display:inline-block;position:relative;overflow:hidden}.skin-tone:after{content:"";mix-blend-mode:overlay;background:linear-gradient(#fff3,#0000);border:1px solid #000c;border-radius:100%;position:absolute;inset:0;box-shadow:inset 0 -2px 3px #000,inset 0 1px 2px #fff}.skin-tone-1{background-color:#ffc93a}.skin-tone-2{background-color:#ffdab7}.skin-tone-3{background-color:#e7b98f}.skin-tone-4{background-color:#c88c61}.skin-tone-5{background-color:#a46134}.skin-tone-6{background-color:#5d4437}[data-emoji-set=twitter] .skin-tone:after{box-shadow:none;border-color:#00000080}[data-emoji-set=twitter] .skin-tone-1{background-color:#fade72}[data-emoji-set=twitter] .skin-tone-2{background-color:#f3dfd0}[data-emoji-set=twitter] .skin-tone-3{background-color:#eed3a8}[data-emoji-set=twitter] .skin-tone-4{background-color:#cfad8d}[data-emoji-set=twitter] .skin-tone-5{background-color:#a8805d}[data-emoji-set=twitter] .skin-tone-6{background-color:#765542}[data-emoji-set=google] .skin-tone:after{box-shadow:inset 0 0 2px 2px #0006}[data-emoji-set=google] .skin-tone-1{background-color:#f5c748}[data-emoji-set=google] .skin-tone-2{background-color:#f1d5aa}[data-emoji-set=google] .skin-tone-3{background-color:#d4b48d}[data-emoji-set=google] .skin-tone-4{background-color:#aa876b}[data-emoji-set=google] .skin-tone-5{background-color:#916544}[data-emoji-set=google] .skin-tone-6{background-color:#61493f}[data-emoji-set=facebook] .skin-tone:after{border-color:#0006;box-shadow:inset 0 -2px 3px #000,inset 0 1px 4px #fff}[data-emoji-set=facebook] .skin-tone-1{background-color:#f5c748}[data-emoji-set=facebook] .skin-tone-2{background-color:#f1d5aa}[data-emoji-set=facebook] .skin-tone-3{background-color:#d4b48d}[data-emoji-set=facebook] .skin-tone-4{background-color:#aa876b}[data-emoji-set=facebook] .skin-tone-5{background-color:#916544}[data-emoji-set=facebook] .skin-tone-6{background-color:#61493f}';export{Kf as Picker,rf as Emoji,G as SearchIndex,Z as Store,df as init,Y as Data,X as I18n}; +function f(f){return f&&f.__esModule?f.default:f}var e,i,n,d,a,u,o={},t=[],r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function l(f,e){for(var i in e)f[i]=e[i];return f}function c(f){var e=f.parentNode;e&&e.removeChild(f)}function s(f,i,n){var d,a,u,o={};for(u in i)"key"==u?d=i[u]:"ref"==u?a=i[u]:o[u]=i[u];if(arguments.length>2&&(o.children=arguments.length>3?e.call(arguments,2):n),"function"==typeof f&&null!=f.defaultProps)for(u in f.defaultProps)void 0===o[u]&&(o[u]=f.defaultProps[u]);return _(f,o,d,a,null)}function _(f,e,d,a,u){var o={type:f,props:e,key:d,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==u?++n:u};return null==u&&null!=i.vnode&&i.vnode(o),o}function g(f){return f.children}function b(f,e){this.props=f,this.context=e}function h(f,e){if(null==e)return f.__?h(f.__,f.__.__k.indexOf(f)+1):null;for(var i;e0?_(p.type,p.props,p.key,null,p.__v):p)){if(p.__=i,p.__b=i.__b+1,null===(m=j[s])||m&&p.key==m.key&&p.type===m.type)j[s]=void 0;else for(b=0;b`0x${f}`));return String.fromCodePoint(...e)}};const H=["heavy_plus_sign","+1","-1","eyes","heart_eyes","joy","fire","grinning","sweat_smile","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let $=null;var K={add:function(f){$||($=Z.get("frequently")||{});const e=f.id||f;e&&($[e]||($[e]=0),$[e]+=1,Z.set("last",e),Z.set("frequently",$))},get:function({maxFrequentRows:f,perLine:e}){$||($=Z.get("frequently"));let i=[];if(!$){$={};for(let f in H.slice(0,e)){const n=H[f];$[n]=e-f,i.push(n)}return i}const n=f*e,d=Z.get("last");for(let f in $)i.push(f);if(i.sort(((f,e)=>{const i=$[e],n=$[f];return i==n?f.localeCompare(e):i-n})),i.length>n){const f=i.slice(n);i=i.slice(0,n);for(let e of f)e!=d&&delete $[e];d&&-1==i.indexOf(d)&&(delete $[i[i.length-1]],i.splice(-1,1,d)),Z.set("frequently",$)}return i}};let W=null;function V(f,{maxResults:e}={}){const i=f.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter(((f,e,i)=>f.trim()&&i.indexOf(f)==e));if(!i.length)return;let n,d,a=W||(W=Object.values(Y.emojis));for(const f of i){if(!a.length)break;n=[],d={};for(const e of a){if(!e.search)continue;const i=e.search.indexOf(`,${f}`);-1!=i&&(n.push(e),d[e.id]||(d[e.id]=0),d[e.id]+=e.id==f?0:i+1)}a=n}return n.length<2||(n.sort(((f,e)=>{const i=d[f.id],n=d[e.id];return i==n?f.id.localeCompare(e.id):i-n})),n.length>e&&(n=n.slice(0,e))),n}var G={search:async function(f,{maxResults:e}={}){return f&&f.trim().length?(e||(e=90),await df(),V(f,{maxResults:e})):null},searchSynchronized:function(f,{maxResults:e}={}){return f&&f.trim().length?(e||(e=90),df(),V(f,{maxResults:e})):null},get:function(f){return f.id?f:Y.emojis[f]||Y.emojis[Y.aliases[f]]||Y.emojis[Y.natives[f]]},getShortcodeFromNative:function(f){return Y.natives[f]},SHORTCODES_REGEX:/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/};var J={getUrl:function(f){return"https://static.figma.com/emoji/4/64/"+f.unified?.toLowerCase()+".png"}};let X=f(A),Y=function(f){f.natives={};const e=function(f){const e={};for(const i of Object.keys(f.aliases))e[f.aliases[i]]=i;return e}(f);return Object.keys(f.emojis).forEach((i=>{const n={};n.id=i,n.search=","+[...new Set([n.id,...n.id.split(/[-|_|\s]+/),...(e[n.id]||"").split(/[-|_|\s]+/)].map((f=>f?f.toLowerCase():"")).filter((f=>f&&f.trim())))].join(","),n.skins=f.emojis[i],n.skins.forEach(((e,i)=>{if(e){const d=i+1==1?"":`:skin-tone-${i+1}:`;e.shortcodes=`:${n.id}:${d}`;const a=F.unifiedToNative(e.unified);f.natives[a]=e.shortcodes}})),f.emojis[i]=n})),f}(f(D));const Q={autoFocus:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:34},emojiSize:{value:22},emojiVersion:{value:14,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14]},locale:{value:"en",choices:["en","fr"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},stickySearch:{value:!0},theme:{value:"auto",choices:["auto","light","dark"]}};let ff=null,ef=!1,nf=null;function df(f){return ff||(ff=new Promise((f=>{nf=f}))),ef||(ef=!0,function(f,e){const{i18n:i}=f,n=function(f,e){function i(i){const n=Q[i];let d=e&&e.getAttribute(i)||f[i];return null!=d&&n.value&&typeof n.value!=typeof d&&(d="boolean"==typeof n.value?"false"!=d:n.value.constructor(d)),(null==d||n.choices&&-1==n.choices.indexOf(d))&&(d=n.value),d}f||(f={});const n={};for(let f in Q)n[f]=i(f);return n}(f,e);f.i18n&&(X=i);if(n.maxFrequentRows){const f=K.get(n);f.length&&Y.categories.unshift({id:"frequent",emojis:f})}nf(n)}(f||{})),ff}var af={categories:{activity:T("svg",{width:"19",height:"19",viewBox:"0 0 19 19",version:"1.1",children:[T("path",{d:"M 2.83936 4.21875C 3.89404 5.54712 4.55981 7.19824 4.66431 9L 5.66577 9C 5.55701 6.90271 4.76794 4.98523 3.51514 3.46411C 4.9408 2.05042 6.86462 1.13831 9 1.0144L 9.5 0C 4.2533 0 0 4.2533 0 9.5L 1.0144 9C 1.1189 7.19824 1.78467 5.54712 2.83936 4.21875Z"}),T("path",{d:"M 10 10L 13.5485 10L 14.5499 10L 14.5499 9L 13.5485 9L 10 9L 10 1.0144L 9.5 0L 9 1.0144L 9 9L 5.66577 9L 4.66431 9L 4.66431 10L 5.66577 10L 9 10L 9 17.9856L 9.5 19L 10 17.9856L 10 10Z"}),T("path",{d:"M 16.2678 4.35657C 17.2604 5.66052 17.8846 7.26001 17.9856 9L 19 9.5C 19 4.2533 14.7467 0 9.5 0L 10 1.0144C 12.1947 1.14172 14.1659 2.10168 15.6025 3.58313C 14.4058 5.08472 13.6544 6.95703 13.5485 9L 14.5499 9C 14.6509 7.26001 15.2753 5.66064 16.2678 4.35657Z"}),T("path",{d:"M 1.0144 10L 4.66431 10L 4.66431 9L 1.0144 9L 0 9.5L 1.0144 10Z"}),T("path",{d:"M 3.51514 15.5359C 4.76794 14.0148 5.55701 12.0973 5.66577 10L 4.66431 10C 4.55981 11.8018 3.89404 13.4529 2.83936 14.7812C 1.78467 13.4529 1.1189 11.8018 1.0144 10L 0 9.5C 0 14.7467 4.2533 19 9.5 19L 9 17.9856C 6.86462 17.8617 4.9408 16.9496 3.51514 15.5359Z"}),T("path",{d:"M 15.6025 15.4169C 14.1659 16.8983 12.1947 17.8583 10 17.9856L 9.5 19C 14.7467 19 19 14.7467 19 9.5L 17.9856 10C 17.8846 11.74 17.2604 13.3395 16.2678 14.6434C 15.2753 13.3394 14.6509 11.74 14.5499 10L 13.5485 10C 13.6544 12.043 14.4058 13.9153 15.6025 15.4169Z"}),T("path",{d:"M 14.5499 10L 17.9856 10L 19 9.5L 17.9856 9L 14.5499 9L 14.5499 10Z"})]}),flags:T("svg",{width:"12",height:"18",viewBox:"0 -1 12 18",version:"1.1",children:[T("path",{d:"M 1 0L 0 0L 0 1L 0 8L 0 9L 0 17L 1 17L 1 9L 1 8L 1 1L 1 0Z"}),T("path",{d:"M 1 9L 11 9L 12 9L 12 8L 12 1L 12 0L 11 0L 1 0L 1 1L 11 1L 11 8L 1 8L 1 9Z"})]}),foods:T("svg",{width:"17",height:"19",viewBox:"0 0 17 19",version:"1.1",children:[T("path",{d:"M 12.1183 6.48747C 11.4751 6.23515 10.7572 6.10832 10 6.10832C 9.88623 6.10832 9.77332 6.11296 9.66138 6.12187C 9.07397 6.16911 8.5144 6.33805 8 6.60771L 8 1.6082L 7.5 8.12834L 8.07019 7.73258C 8.68677 7.29289 9.25342 7.09477 10 7.10832C 11.1823 7.10832 12.1726 7.46806 12.8571 8.10026C 13.5286 8.72062 14 9.68937 14 11.1083C 14 12.462 13.3236 13.9887 12.2791 15.1969C 11.2169 16.4257 9.96875 17.1083 9 17.1083C 8.54712 17.1144 8.26135 17.0506 7.92432 16.886L 7.5 16.6873L 7.5 17.7915C 7.93848 17.997 8.43762 18.1083 9 18.1083C 11.7615 18.1083 15 14.422 15 11.1083C 15 8.70329 13.8208 7.15556 12.1183 6.48747Z"}),T("path",{d:"M 6 18.1083C 6.56238 18.1083 7.06152 17.997 7.5 17.7915L 7.5 16.6873L 7.07568 16.886C 6.73865 17.0506 6.45288 17.1144 6 17.1083C 5.03125 17.1083 3.78308 16.4257 2.72095 15.1969C 1.67639 13.9887 1 12.462 1 11.1083C 1 9.68937 1.47144 8.72062 2.14294 8.10026C 2.82739 7.46806 3.81775 7.10832 5 7.10832C 5.74658 7.09477 6.31323 7.29289 6.92981 7.73258L 7.5 8.12834L 8 1.6082L 7 1.6082L 7 6.60758C 6.38757 6.28642 5.71118 6.10832 5 6.10832C 2.23853 6.10832 0 7.7946 0 11.1083C 0 14.422 3.23853 18.1083 6 18.1083Z"}),T("path",{d:"M 11.4785 0.600017C 9.95911 1.47721 9.13403 3.11283 9.20801 4.76139L 10.2225 4.18717C 10.3368 3.08537 10.9589 2.05473 11.9785 1.46611C 12.9932 0.88029 14.1703 0.864665 15.1501 1.31889L 16.1647 0.74467C 14.8052 -0.16158 12.9978 -0.27718 11.4785 0.600017Z"}),T("path",{d:"M 13.8942 4.90605C 15.4136 4.02885 16.2386 2.39323 16.1647 0.74467L 15.1501 1.31889C 15.0359 2.42082 14.4138 3.45133 13.3942 4.04008C 12.3795 4.6259 11.2024 4.64152 10.2225 4.18717L 9.20801 4.76139C 9.4104 4.8964 9.6228 5.01371 9.84253 5.11296C 9.89465 5.13652 9.94714 5.15898 10 5.18034C 10.7045 5.46611 11.4779 5.56913 12.244 5.46842C 12.8082 5.39433 13.3684 5.20964 13.8942 4.90605Z"})]}),frequent:T("svg",{width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",children:[T("path",{d:"M 9 4L 10 4L 10 10L 16 10L 16 11L 10 11L 9 11L 9 10L 9 4Z"}),T("path",{d:"M 10 20C 4.47717 20 0 15.5228 0 10C 0 4.47717 4.47717 0 10 0L 10 1C 5.02942 1 1 5.02942 1 10C 1 14.9706 5.02942 19 10 19L 10 20Z"}),T("path",{d:"M 20 10C 20 15.5228 15.5228 20 10 20L 10 19C 14.9706 19 19 14.9706 19 10C 19 5.02942 14.9706 1 10 1L 10 0C 15.5228 0 20 4.47717 20 10Z"})]}),nature:T("svg",{width:"18",height:"18",viewBox:"0 0 18 18",version:"1.1",children:[T("path",{d:"M 4.77954 12.2311L 0 17.0106L 0.707153 17.7177L 5.39307 13.0318L 4.77954 12.2311Z"}),T("path",{d:"M 6.16248 12.2624L 5.56335 11.4472L 4.77954 12.2311L 5.39307 13.0318L 6.16248 12.2624Z"}),T("path",{d:"M 5.39307 13.0318C 8.67566 14.4375 12.6239 13.8008 15.3032 11.1214C 18.0741 8.35044 18.6605 4.22227 17.0624 0.876806L 16.4442 1.98069C 17.4929 4.82078 16.8754 8.13498 14.5961 10.4143C 12.3169 12.6936 9.00244 13.3111 6.16248 12.2624L 5.39307 13.0318Z"}),T("path",{d:"M 15.6292 1.38144L 5.56335 11.4472L 6.16248 12.2624L 16.4442 1.98069L 15.6292 1.38144Z"}),T("path",{d:"M 7.52515 3.34299C 9.7168 1.15134 12.8655 0.496191 15.6292 1.38144L 17.0624 0.876806C 13.717 -0.721216 9.58887 -0.134912 6.81799 2.63596C 4.22388 5.23008 3.54431 9.01377 4.77954 12.2311L 5.56335 11.4472C 4.6781 8.68345 5.33337 5.53477 7.52515 3.34299Z"}),T("path",{d:"M 17.0624 0.876806L 15.6292 1.38144L 16.4442 1.98069L 17.0624 0.876806Z"})]}),objects:T("svg",{width:"18",height:"17",viewBox:"0 0 18 17",version:"1.1",children:T("path",{d:"M 15.6673 1.61096C 13.5194 -0.536987 10.037 -0.536987 7.88901 1.61096L 1.1716 8.32849C -0.390533 9.8905 -0.390533 12.4232 1.1716 13.9854C 2.73361 15.5472 5.26572 15.5481 6.82785 13.9858L 9.30331 11.5105L 9.65683 11.1569L 12.1318 8.68213C 13.108 7.70581 13.108 6.12292 12.1318 5.14661C 11.1555 4.17029 9.57248 4.17029 8.59616 5.14661L 3.29294 10.45L 3.99997 11.157L 9.30331 5.85376C 9.88913 5.26794 10.8388 5.26794 11.4247 5.85376C 12.0105 6.43945 12.0105 7.38928 11.4247 7.97498L 8.9498 10.4498L 8.59616 10.8035L 6.12082 13.2787C 4.94931 14.4502 3.05038 14.4498 1.87863 13.2782C 0.707123 12.1066 0.707123 10.2072 1.87863 9.03552L 8.59616 2.31812C 10.3535 0.560669 13.2029 0.560669 14.9602 2.31812C 16.7176 4.07544 16.7176 6.9248 14.9602 8.68213L 8.24277 15.3997L 8.9498 16.1067L 15.6673 9.38928C 17.8152 7.24133 17.8152 3.75891 15.6673 1.61096Z"})}),people:T("svg",{width:"19",height:"19",viewBox:"0 0 19 19",version:"1.1",children:[T("path",{d:"M 9.5 15C 7.08093 15 5.06323 13.2822 4.59998 11L 5.62598 11C 6.07007 12.7252 7.63623 14 9.5 14C 11.3638 14 12.9299 12.7252 13.374 11L 14.4 11C 13.9368 13.2822 11.9191 15 9.5 15Z"}),T("path",{d:"M 7 7.5C 7 8.05225 6.55225 8.5 6 8.5C 5.44775 8.5 5 8.05225 5 7.5C 5 6.94775 5.44775 6.5 6 6.5C 6.55225 6.5 7 6.94775 7 7.5Z"}),T("path",{d:"M 13 8.5C 13.5522 8.5 14 8.05225 14 7.5C 14 6.94775 13.5522 6.5 13 6.5C 12.4478 6.5 12 6.94775 12 7.5C 12 8.05225 12.4478 8.5 13 8.5Z"}),T("path",{d:"M 9.5 18C 4.80554 18 1 14.1945 1 9.5C 1 4.80554 4.80554 1 9.5 1L 9.5 0C 4.2533 0 0 4.2533 0 9.5C 0 14.7467 4.2533 19 9.5 19L 9.5 18Z"}),T("path",{d:"M 18 9.5C 18 14.1945 14.1945 18 9.5 18L 9.5 19C 14.7467 19 19 14.7467 19 9.5C 19 4.2533 14.7467 0 9.5 0L 9.5 1C 14.1945 1 18 4.80554 18 9.5Z"})]}),places:T("svg",{width:"18",height:"18",viewBox:"0 0 18 18",version:"1.1",children:[T("path",{d:"M 11.9747 1.55383C 12.5566 1.17468 13.1697 0.994873 13.8641 1L 17.861 1L 17.861 0L 13.8641 0C 13.0276 0.00512695 12.1419 0.264648 11.4349 0.712036L 2.07887 6.71204C -1.70385 9.13794 0.0142913 15 4.50807 15L 9.39637 15L 10.411 15L 12.6918 15L 15.3109 15L 16.3256 15L 17.861 15L 17.861 14L 12.6918 14L 4.50807 14C 1.26454 14 -0.119864 10.0732 2.0492 8L 3.48231 7L 7.38062 4.5L 8.93995 3.5L 11.9747 1.55383Z"}),T("path",{d:"M 13.111 3.5L 8.93995 3.5L 7.38062 4.5L 13.111 4.5C 13.8013 4.5 14.361 5.05969 14.361 5.75C 14.361 6.44031 13.8013 7 13.111 7L 3.48231 7L 2.0492 8L 13.111 8C 14.3536 8 15.361 6.99268 15.361 5.75C 15.361 4.50732 14.3536 3.5 13.111 3.5Z"}),T("path",{d:"M 12.861 18C 14.6242 18 16.0829 16.6962 16.3256 15L 15.3109 15C 15.0794 16.1411 14.0704 17 12.861 17C 11.6515 17 10.6426 16.1411 10.411 15L 9.39637 15C 9.63905 16.6962 11.0978 18 12.861 18Z"})]}),symbols:T("svg",{width:"19",height:"16",viewBox:"0 0 19 16",version:"1.1",children:[T("path",{d:"M 1 5C 1 2.79091 2.79091 1 5 1C 6.54723 1 7.89015 1.8784 8.55585 3.16603L 9 4.02513L 9 1.99968C 8.08821 0.786061 6.63622 0 5 0C 2.23863 0 0 2.23863 0 5C 0 6.63571 0.786056 8.08793 1.99875 8.99938L 8.65451 15.3614L 9 15.6917L 9 14.3083L 2.66775 8.2555L 2.64519 8.23393L 2.62011 8.21534C 1.63619 7.48562 1 6.31713 1 5Z"}),T("path",{d:"M 15.3322 8.2555L 9 14.3083L 9 15.6917L 9.34549 15.3614L 16.0013 8.99938C 17.2139 8.08793 18 6.63571 18 5C 18 2.23863 15.7614 0 13 0C 11.3638 0 9.91179 0.786061 9 1.99968L 9 4.02513L 9.44415 3.16603C 10.1099 1.8784 11.4528 1 13 1C 15.2091 1 17 2.79091 17 5C 17 6.31713 16.3638 7.48562 15.3799 8.21534L 15.3548 8.23393L 15.3322 8.2555Z"})]})},search:{loupe:T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:T("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:T("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:T("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})}};function uf(f){let{id:e,skin:i,shortcodes:n,emoji:d,set:a,size:u}=f;if(!d&&!e&&n){const f=n.match(G.SHORTCODES_REGEX);f&&(e=f[1],f[2]&&(i=f[2]))}if(d||(d=G.get(e)),!d||"female_sign"===d.id||"male_sign"===d.id)return f.fallback;const o=d.skins[i-1]||d.skins[0];if("native"===a){return T("span",{style:{fontSize:u||22,fontFamily:"EmojiMart, Segoe UI Emoji, Segoe UI Symbol, Segoe UI, Apple Color Emoji, Twemoji Mozilla, Noto Color Emoji, Android Emoji"},children:F.unifiedToNative(o.unified)})}const t=J.getUrl(o);return T("img",{style:{height:f.size||"1em",width:"auto",display:"inline-block",position:"relative"},alt:o.native,src:t})}class of extends window.HTMLElement{constructor(f={}){if(super(),this.props=f,f.parent||f.ref){const e=f.parent||f.ref&&f.ref.current;e&&e.appendChild(this)}}}class tf extends of{constructor(f,{styles:e}={}){super(f),this.setShadow(),this.injectStyles(e)}setShadow(){this.attachShadow({mode:"open"})}injectStyles(f){if(!f)return;const e=document.createElement("style");e.textContent=f,this.shadowRoot.insertBefore(e,this.shadowRoot.firstChild)}}class rf extends of{async connectedCallback(){const f=await df(),e=this.getAttribute("native");let i=null;e&&(i=G.get(e));R(T(uf,{...{...f,emoji:i,id:this.getAttribute("id"),set:this.getAttribute("set")||f.set,size:this.getAttribute("size"),fallback:this.getAttribute("fallback"),shortcodes:this.getAttribute("shortcodes")}}),this)}}"customElements"in window&&!customElements.get("em-emoji")&&customElements.define("em-emoji",rf);var lf,cf,sf=[],_f=i.__b,gf=i.__r,bf=i.diffed,hf=i.__c,mf=i.unmount;function pf(){var f;for(sf.sort((function(f,e){return f.__v.__b-e.__v.__b}));f=sf.pop();)if(f.__P)try{f.__H.__h.forEach(kf),f.__H.__h.forEach(yf),f.__H.__h=[]}catch(e){f.__H.__h=[],i.__e(e,f.__v)}}i.__b=function(f){lf=null,_f&&_f(f)},i.__r=function(f){gf&&gf(f),0;var e=(lf=f.__c).__H;e&&(e.__h.forEach(kf),e.__h.forEach(yf),e.__h=[])},i.diffed=function(f){bf&&bf(f);var e=f.__c;e&&e.__H&&e.__H.__h.length&&(1!==sf.push(e)&&cf===i.requestAnimationFrame||((cf=i.requestAnimationFrame)||function(f){var e,i=function(){clearTimeout(n),wf&&cancelAnimationFrame(e),setTimeout(f)},n=setTimeout(i,100);wf&&(e=requestAnimationFrame(i))})(pf)),lf=null},i.__c=function(f,e){e.some((function(f){try{f.__h.forEach(kf),f.__h=f.__h.filter((function(f){return!f.__||yf(f)}))}catch(n){e.some((function(f){f.__h&&(f.__h=[])})),e=[],i.__e(n,f.__v)}})),hf&&hf(f,e)},i.unmount=function(f){mf&&mf(f);var e,n=f.__c;n&&n.__H&&(n.__H.__.forEach((function(f){try{kf(f)}catch(f){e=f}})),e&&i.__e(e,n.__v))};var wf="function"==typeof requestAnimationFrame;function kf(f){var e=lf,i=f.__c;"function"==typeof i&&(f.__c=void 0,i()),lf=e}function yf(f){var e=lf;f.__c=f.__(),lf=e}function vf(f,e){for(var i in e)f[i]=e[i];return f}function xf(f,e){for(var i in f)if("__source"!==i&&!(i in e))return!0;for(var n in e)if("__source"!==n&&f[n]!==e[n])return!0;return!1}function jf(f){this.props=f}(jf.prototype=new b).isPureReactComponent=!0,jf.prototype.shouldComponentUpdate=function(f,e){return xf(this.props,f)||xf(this.state,e)};var Cf=i.__b;i.__b=function(f){f.type&&f.type.__f&&f.ref&&(f.props.ref=f.ref,f.ref=null),Cf&&Cf(f)};"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Lf=i.__e;i.__e=function(f,e,i){if(f.then)for(var n,d=e;d=d.__;)if((n=d.__c)&&n.__c)return null==e.__e&&(e.__e=i.__e,e.__k=i.__k),n.__c(f,e);Lf(f,e,i)};var Sf=i.unmount;function zf(){this.__u=0,this.t=null,this.__b=null}function Ef(f){var e=f.__.__c;return e&&e.__e&&e.__e(f)}function qf(){this.u=null,this.o=null}i.unmount=function(f){var e=f.__c;e&&e.__R&&e.__R(),e&&!0===f.__h&&(f.type=null),Sf&&Sf(f)},(zf.prototype=new b).__c=function(f,e){var i=e.__c,n=this;null==n.t&&(n.t=[]),n.t.push(i);var d=Ef(n.__v),a=!1,u=function(){a||(a=!0,i.__R=null,d?d(o):o())};i.__R=u;var o=function(){if(!--n.__u){if(n.state.__e){var f=n.state.__e;n.__v.__k[0]=function f(e,i,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return f(e,i,n)})),e.__c&&e.__c.__P===i&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}(f,f.__c.__P,f.__c.__O)}var e;for(n.setState({__e:n.__b=null});e=n.t.pop();)e.forceUpdate()}},t=!0===e.__h;n.__u++||t||n.setState({__e:n.__b=n.__v.__k[0]}),f.then(u,u)},zf.prototype.componentWillUnmount=function(){this.t=[]},zf.prototype.render=function(f,e){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function f(e,i,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(f){"function"==typeof f.__c&&f.__c()})),e.__c.__H=null),null!=(e=vf({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=i),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return f(e,i,n)}))),e}(this.__b,i,n.__O=n.__P)}this.__b=null}var d=e.__e&&s(g,null,f.fallback);return d&&(d.__h=null),[s(g,null,e.__e?null:f.children),d]};var Mf=function(f,e,i){if(++i[1]===i[0]&&f.o.delete(e),f.props.revealOrder&&("t"!==f.props.revealOrder[0]||!f.o.size))for(i=f.u;i;){for(;i.length>3;)i.pop()();if(i[1]!f.target)),this.state={categoryId:this.categories[0].id}}renderIcon(f){const{icon:e}=f;if(e){if(e.svg)return T("span",{class:"flex",dangerouslySetInnerHTML:{__html:e.svg}});if(e.src)return T("img",{src:e.src})}return af.categories[f.id]}render(){let f=null;return T("nav",{id:"nav",class:"padding","data-position":this.props.position,children:T("div",{class:"flex relative",children:[this.categories.map(((e,i)=>{const n=e.name||X.categories[e.id],d=!this.props.unfocused&&e.id==this.state.categoryId;return d&&(f=i),T("button",{"aria-label":n,"aria-selected":d||void 0,title:n,type:"button",class:"flex flex-grow flex-center",onClick:()=>{this.props.onClick({category:e,i:i})},children:this.renderIcon(e)})})),T("div",{class:"bar",style:{width:100/this.categories.length+"%",opacity:null==f?0:1,transform:`translateX(${100*f}%)`}})]})})}}class Ff extends jf{shouldComponentUpdate(f){for(let e in f)if("children"!=e&&f[e]!=this.props[e])return!0;return!1}render(){return this.props.children}}const Hf=10;class $f extends b{constructor(f){super(),this.state={pos:[-1,-1],skin:Z.get("skin")||f.skin,theme:this.initTheme(f.theme),visibleRows:{0:!0}}}componentWillMount(){const{categories:f}=Y;this.refs={categories:new Map,menu:{current:null},navigation:{current:null},scroll:{current:null},search:{current:null},searchInput:{current:null},skinToneButton:{current:null},skinToneRadio:{current:null}},this.grid=[],this.grid.setsize=0;const e=(f,e)=>{const i=[];i.__categoryId=e.id,i.__index=f.length,this.grid.push(i);const n=this.grid.length-1,d=n%Hf?{}:{current:null};return d.index=n,d.posinset=this.grid.setsize+1,f.push(d),i};for(let i of f){const f=[];let n=e(f,i);for(let d of i.emojis)n.length==this.props.perLine&&(n=e(f,i)),this.grid.setsize+=1,n.push(d);this.refs.categories.set(i.id,{root:{current:null},rows:f})}}componentDidMount(){this.observeCategories(),this.observeRows(),this.shadowRoot=this.base.parentNode,this.props.autoFocus&&this.refs.searchInput.current&&this.refs.searchInput.current.focus()}initTheme(f){if("auto"!=f)return f;const e=matchMedia("(prefers-color-scheme: dark)");return e.media.match(/^not/)?"light":(e.addListener((()=>{this.setState({theme:e.matches?"dark":"light"})})),e.matches?"dark":"light")}handleBaseClick=f=>{this.state.showSkins&&(f.target.closest(".menu")||(f.preventDefault(),f.stopImmediatePropagation(),this.closeSkins()))};handleBaseKeydown=f=>{this.state.showSkins&&"Escape"==f.key&&(f.preventDefault(),f.stopImmediatePropagation(),this.closeSkins(),this.refs.skinToneButton.current.focus())};getEmojiByPos([f,e]){const i=this.state.searchResults||this.grid,n=i[f]&&i[f][e];if(n)return G.get(n)}observeCategories(){const f=this.refs.navigation.current;if(!f)return;const e=new Map,i=e=>{e!=f.state.categoryId&&f.setState({categoryId:e})},n={root:this.refs.scroll.current,threshold:[0,1]},d=new IntersectionObserver((f=>{for(const i of f){const f=i.target.dataset.id;e.set(f,i.intersectionRatio)}const n=[...e],d=n[n.length-1];if(1==d[1])return i(d[0]);for(const[f,e]of n)if(e){i(f);break}}),n);for(const{root:f}of this.refs.categories.values())d.observe(f.current)}observeRows(){const f={...this.state.visibleRows},e=new IntersectionObserver((e=>{for(const i of e){const e=parseInt(i.target.dataset.index);i.isIntersecting?f[e]=!0:delete f[e]}this.setState({visibleRows:f})}),{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(Hf+5)}px 0px ${this.props.emojiButtonSize*Hf}px`});for(const{rows:f}of this.refs.categories.values())for(const i of f)i.current&&e.observe(i.current)}preventDefault(f){f.preventDefault()}handleSearchClick=()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})};handleSearchInput=async()=>{const f=this.refs.searchInput.current;if(!f)return;const{value:e}=f,i=await G.search(e),n=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!i)return this.setState({searchResults:i,pos:[-1,-1]},n);const d=f.selectionStart==f.value.length?[0,0]:[-1,-1],a=[];a.setsize=i.length;let u=null;for(let f of i)a.length&&u.length!=this.props.perLine||(u=[],u.__categoryId="search",u.__index=a.length,a.push(u)),u.push(f);this.ignoreMouse(),this.setState({searchResults:a,pos:d},n)};handleKeyDown=f=>{if(f.stopImmediatePropagation(),"Escape"===f.key)this.props.onEscapeKeydown&&this.props.onEscapeKeydown()};handleSearchKeyDown=f=>{const e=f.currentTarget;switch(f.stopImmediatePropagation(),f.key){case"ArrowLeft":this.navigate({e:f,input:e,left:!0});break;case"ArrowRight":this.navigate({e:f,input:e,right:!0});break;case"ArrowUp":this.navigate({e:f,input:e,up:!0});break;case"ArrowDown":this.navigate({e:f,input:e,down:!0});break;case"Enter":f.preventDefault(),this.handleEmojiClick({pos:this.state.pos});break;case"Escape":f.preventDefault(),this.state.searchResults?this.clearSearch():this.props.onEscapeKeydown?this.props.onEscapeKeydown():this.unfocusSearch()}};clearSearch=()=>{const f=this.refs.searchInput.current;f&&(f.value="",f.focus(),this.handleSearchInput())};unfocusSearch(){const f=this.refs.searchInput.current;f&&f.blur()}navigate({e:f,input:e,left:i,right:n,up:d,down:a}){const u=this.state.searchResults||this.grid;if(!u.length)return;let[o,t]=this.state.pos;const r=(()=>{if(0==o&&0==t&&!f.repeat&&(i||d))return null;if(-1==o)return f.repeat||!n&&!a||e.selectionStart!=e.value.length?null:[0,0];if(i||n){let f=u[o];const e=i?-1:1;if(t+=e,!f[t]){if(o+=e,f=u[o],!f)return o=i?0:u.length-1,t=i?0:u[o].length-1,[o,t];t=i?f.length-1:0}return[o,t]}if(d||a){o+=d?-1:1;const f=u[o];return f?(f[t]||(t=f.length-1),[o,t]):(o=d?0:u.length-1,t=d?0:u[o].length-1,[o,t])}})();r?(f.preventDefault(),this.setState({pos:r,keyboard:!0},(()=>{this.scrollTo({row:r[0]})}))):this.state.pos[0]>-1&&this.setState({pos:[-1,-1]})}scrollTo({categoryId:f,row:e}){const i=this.state.searchResults||this.grid;if(!i.length)return;const n=this.refs.scroll.current,d=n.getBoundingClientRect();let a=0;if(e>=0&&(f=i[e].__categoryId),f){a=(this.refs[f]||this.refs.categories.get(f).root).current.getBoundingClientRect().top-(d.top-n.scrollTop)+1}if(e>=0)if(e){const f=a+i[e].__index*this.props.emojiButtonSize,u=f+this.props.emojiButtonSize+.88*this.props.emojiButtonSize;if(fn.scrollTop+d.height))return;a=u-d.height}}else a=0;this.ignoreMouse(),n.scrollTop=a}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout((()=>{delete this.mouseIsIgnored}),100)}handleCategoryClick=({category:f,i:e})=>{this.scrollTo(0==e?{row:-1}:{categoryId:f.id})};handleEmojiOver(f){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:f||[-1,-1],keyboard:!1})}handleEmojiClick({emoji:f,pos:e}){if(this.props.onEmojiSelect&&(!f&&e&&(f=this.getEmojiByPos(e)),f)){const e=f.skins[this.state.skin-1]||f.skins[0],i={id:f.id,unified:e.unified,keywords:f?.keywords||[],shortcodes:e.shortcodes||f.shortcodes};e.src&&(i.src=e.src),f.aliases&&f.aliases.length&&(i.aliases=f.aliases),this.props.maxFrequentRows&&K.add(i,this.props),this.props.onEmojiSelect(i)}}openSkins=f=>{const{currentTarget:e}=f,i=e.getBoundingClientRect();this.setState({showSkins:i},(async()=>{await I(2);const f=this.refs.menu.current;f&&(f.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))}))};closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(f){this.setState({tempSkin:f})}handleSkinClick(f){this.ignoreMouse(),this.closeSkins(),this.setState({skin:f,tempSkin:null}),Z.set("skin",f)}renderNav(){return T(Uf,{ref:this.refs.navigation,theme:this.state.theme,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick})}renderPreview(){const f=this.getEmojiByPos(this.state.pos),e=this.state.searchResults&&!this.state.searchResults.length;return T("div",{id:"preview",class:"flex flex-middle","data-position":this.props.previewPosition,children:[T("div",{class:"flex flex-middle flex-grow",style:{padding:"4px 0px"},children:[T("div",{class:"flex flex-auto flex-middle flex-center",style:{height:30,width:30,fontSize:30},children:T(uf,{emoji:f,id:e?this.props.noResultsEmoji||"cry":this.props.previewEmoji||("top"==this.props.previewPosition?"point_down":"point_up"),set:this.props.set,size:22,skin:this.state.tempSkin||this.state.skin,spritesheet:!0})}),T("div",f?{class:"ellipsis color-c",children:f.skins[0].shortcodes}:e?{class:"ellipsis color-c",children:X.search_no_results}:{class:"color-c",children:X.pick})]}),!f&&this.renderSkinToneButton()]})}renderEmojiButton(f,{pos:e,posinset:i,grid:n}){const d=this.props.emojiButtonSize,a=this.state.tempSkin||this.state.skin,u=(o=this.state.pos,t=e,Array.isArray(o)&&Array.isArray(t)&&o.length===t.length&&o.every(((f,e)=>f==t[e])));var o,t;const r=e.concat(f.id).join("");return T(Ff,{selected:u,skin:a,size:d,children:T("button",{"aria-label":f.id,"aria-selected":u||void 0,"aria-posinset":i,"aria-setsize":n.setsize,"data-keyboard":this.state.keyboard,title:"none"==this.props.previewPosition?f.id:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:()=>this.handleEmojiClick({emoji:f}),onMouseEnter:()=>this.handleEmojiOver(e),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0,fontFamily:"EmojiMart, Segoe UI Emoji, Segoe UI Symbol, Segoe UI, Apple Color Emoji, Twemoji Mozilla, Noto Color Emoji, Android Emoji"},children:[T("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(i-1)%this.props.emojiButtonColors.length]:void 0}}),T(uf,{emoji:f,set:this.props.set,size:this.props.emojiSize,skin:a,spritesheet:!0})]})},r)}renderSearch(){return T("div",{children:[T("div",{class:"spacer"}),T("div",{class:"flex flex-middle",children:[T("div",{class:"search relative flex-grow",children:[T("input",{type:"search",autoFocus:this.props.autoFocus,ref:this.refs.searchInput,placeholder:X.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown}),T("span",{class:"icon loupe flex",children:af.search.loupe}),this.state.searchResults&&T("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:af.search.delete})]}),"none"==this.props.previewPosition&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:f}=this.state;return f?T("div",{class:"category",ref:this.refs.search,children:[T("div",{class:"sticky padding-small",children:X.categories.search}),T("div",{children:f.map(((e,i)=>T("div",{class:"flex",children:e.map(((e,n)=>this.renderEmojiButton(e,{pos:[i,n],posinset:i*this.props.perLine+n+1,grid:f})))})))})]}):null}renderCategories(){const{categories:f}=Y,e=!!this.state.searchResults;return T("div",{style:{visibility:e?"hidden":void 0,display:e?"none":void 0},children:f.map((f=>{const{root:e,rows:i}=this.refs.categories.get(f.id);return T("div",{"data-id":f.target?f.target.id:f.id,class:"category",ref:e,children:[T("div",{class:"sticky padding-small",children:f.name||X.categories[f.id]}),T("div",{class:"relative",style:{height:i.length*this.props.emojiButtonSize},children:i.map(((e,i)=>{const n=e.index-e.index%Hf,d=this.state.visibleRows[n],a="current"in e?e:void 0;if(!d&&!a)return null;const u=i*this.props.perLine,o=u+this.props.perLine,t=f.emojis.slice(u,o);return T("div",{"data-index":e.index,ref:a,class:"flex row",style:{top:i*this.props.emojiButtonSize},children:d&&t.map(((f,i)=>{const n=G.get(f);return this.renderEmojiButton(n,{pos:[e.index,i],posinset:e.posinset+i,grid:this.grid})}))},e.index)}))})]})}))})}renderSkinToneButton(){return T("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:T("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":X.skins.choose,title:X.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:T("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderSkins(){const f=this.refs.skinToneButton.current.getBoundingClientRect(),e=this.base.getBoundingClientRect(),i={right:e.right-f.right-3};return"bottom"==this.props.previewPosition?i.bottom=e.bottom-f.top+4:(i.top=f.bottom-e.top+3,i.bottom="auto"),T("div",{ref:this.refs.menu,role:"radiogroup","aria-label":X.skins.choose,class:"menu hidden","data-position":i.top?"top":"bottom",style:i,children:[...Array(6).keys()].map((f=>{const e=f+1,i=this.state.skin==e;return T("div",{children:[T("input",{type:"radio",name:"skin-tone",value:e,"aria-label":X.skins[e],ref:i?this.refs.skinToneRadio:null,defaultChecked:i,onChange:()=>this.handleSkinMouseOver(e),onKeyDown:f=>{"Enter"!=f.code&&"Space"!=f.code&&"Tab"!=f.code||(f.preventDefault(),this.handleSkinClick(e),this.refs.skinToneButton.current.focus())}}),T("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(e),onMouseEnter:()=>this.handleSkinMouseOver(e),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[T("span",{class:`skin-tone skin-tone-${e}`}),T("span",{class:"margin-small-lr",children:X.skins[e]})]})]})}))})}render(){return T("section",{id:"root",class:"flex flex-column",style:{width:this.props.perLine*this.props.emojiButtonSize+28},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,onKeyDown:this.handleKeyDown,children:["top"==this.props.previewPosition&&this.renderPreview(),"top"==this.props.navPosition&&this.renderNav(),this.props.stickySearch&&T("div",{class:"padding-lr",children:this.renderSearch()}),T("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:T("div",{style:{width:this.props.perLine*this.props.emojiButtonSize},children:[!this.props.stickySearch&&this.renderSearch(),this.renderSearchResults(),this.renderCategories(),T("div",{class:"spacer"})]})}),"bottom"==this.props.navPosition&&this.renderNav(),"bottom"==this.props.previewPosition&&this.renderPreview(),this.state.showSkins&&this.renderSkins()]})}}class Kf extends tf{constructor(e){super(e,{styles:f(Wf)})}async connectedCallback(){const f=await df(this.props),{onEmojiSelect:e,onClickOutside:i,onEscapeKeydown:n}=this.props,d={...f,element:this,onEmojiSelect:e,onClickOutside:i,onEscapeKeydown:n};R(T($f,{...d}),this.shadowRoot)}}"customElements"in window&&!customElements.get("em-emoji-picker")&&customElements.define("em-emoji-picker",Kf);var Wf={};Wf=':host{width:min-content;height:405px;min-height:230px;box-shadow:var(--shadow);--category-icon-size:18px;--font-family-fallback:-apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;--font-family:var(--font-family-ui,--font-family-fallback);--font-size:13px;--shadow-color:0deg 0% 0%;--shadow:.3px .5px 2.7px hsl(var(--shadow-color)/.14),.4px .8px 1px -3.2px hsl(var(--shadow-color)/.14),1px 2px 2.5px -4.5px hsl(var(--shadow-color)/.14);display:flex}[data-theme=light]{--em-color:var(--color-text,#222427);--em-color-secondary:var(--color-text-secondary,#323437);--em-color-tertiary:var(--color-text-tertiary,#505255);--em-accent:var(--color-border-selected,#2266ed);--em-background:var(--color-bg,#fff);--em-input:var(--color-bg-secondary,#fff);--em-color-border:var(--color-border,#0000000d);--em-color-border-over:var(--color-border-over,#0000001a)}[data-theme=dark]{--em-color:var(--color-text,#dededd);--em-color-secondary:var(--color-text-secondary,#b6b6b5);--em-color-tertiary:var(--color-text-tertiary,#7a7a79);--em-accent:var(--color-border-selected,#3a82f7);--em-background:var(--color-bg,#2c2c2c);--em-input:var(--color-bg-secondary,#000);--em-color-border:var(--color-border,#ffffff1a);--em-color-border-over:var(--color-border-over,#fff3)}#root{--color-a:var(--em-color);--color-b:var(--em-color-secondary);--color-c:var(--em-color-tertiary);--padding:12px;--padding-small:calc(var(--padding)/2);--sidebar-width:16px;--duration:225ms;--duration-fast:125ms;--duration-instant:50ms;--easing:cubic-bezier(.4,0,.2,1);width:100%;text-align:left;background-color:var(--em-background);position:relative}@media (prefers-reduced-motion){#root{--duration:0;--duration-fast:0;--duration-instant:0}}#root[data-menu] button{cursor:auto}#root[data-menu] .menu button{cursor:pointer}:host,#root,input,button{color:var(--em-color);font-family:var(--font-family);font-size:var(--font-size);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:normal}*,:before,:after{box-sizing:border-box;min-width:0;margin:0;padding:0}.relative{position:relative}.flex{display:flex}.flex-auto{flex:none}.flex-center{justify-content:center}.flex-column{flex-direction:column}.flex-grow{flex:auto}.flex-middle{align-items:center}.flex-wrap{flex-wrap:wrap}.padding{padding:var(--padding)}.padding-t{padding-top:var(--padding)}.padding-lr{padding-left:var(--padding);padding-right:var(--padding)}.padding-r{padding-right:var(--padding)}.padding-small{padding:var(--padding-small)}.padding-small-b{padding-bottom:var(--padding-small)}.padding-small-lr{padding-left:var(--padding-small);padding-right:var(--padding-small)}.margin{margin:var(--padding)}.margin-l{margin-left:var(--padding)}.margin-small-l{margin-left:var(--padding-small)}.margin-small-lr{margin-left:var(--padding-small);margin-right:var(--padding-small)}.color-a{color:var(--color-a)}.color-b{color:var(--color-b)}.color-c{color:var(--color-c)}.ellipsis{white-space:nowrap;max-width:100%;width:auto;text-overflow:ellipsis;overflow:hidden}a{cursor:pointer;color:var(--em-accent)}a:hover{text-decoration:underline}.spacer{height:10px}.scroll{padding-right:0;overflow-x:hidden;overflow-y:auto}.scroll::-webkit-scrollbar{width:var(--sidebar-width);height:var(--sidebar-width)}.scroll::-webkit-scrollbar-track{border:0}.scroll::-webkit-scrollbar-button{width:0;height:0;display:none}.scroll::-webkit-scrollbar-corner{background-color:#0000}.scroll::-webkit-scrollbar-thumb{min-height:20%;min-height:65px;border:4px solid var(--em-background);border-radius:8px}.scroll::-webkit-scrollbar-thumb:hover{background-color:var(--em-color-border-over)!important}.scroll:hover::-webkit-scrollbar-thumb{background-color:var(--em-color-border)}.sticky{z-index:1;background-color:var(--em-background);font-weight:500;position:sticky;top:-1px}.search{z-index:2;position:relative}.search input,.search button{font-size:calc(var(--font-size) - 1px)}.search input[type=search]{width:100%;background-color:var(--em-color-border);border:1px solid #0000;border-radius:10px;outline:0;padding:10px 2em 10px 2.2em;display:block}.search input[type=search]::placeholder{color:inherit;opacity:.6}.search input[type=search],.search input[type=search]::-webkit-search-decoration,.search input[type=search]::-webkit-search-cancel-button,.search input[type=search]::-webkit-search-results-button,.search input[type=search]::-webkit-search-results-decoration{appearance:none}.search input[type=search]:focus{background-color:var(--em-input);border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent)}.search .icon{z-index:1;color:var(--em-color);position:absolute;top:50%;transform:translateY(-50%)}.search .loupe{pointer-events:none;left:.7em}.search .delete{border:1px solid #0000;padding:4px;right:.6em}.search .delete:focus-visible{border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent);outline:none}svg{fill:currentColor;width:1em;height:1em}button{appearance:none;cursor:pointer;color:currentColor;background-color:#0000;border:0}#nav{z-index:2;padding-top:8px;padding-bottom:8px;padding-right:var(--sidebar-width);position:relative}#nav button{color:var(--color-b);border:1px solid #0000;padding-top:4px;padding-bottom:4px}#nav button:hover{color:var(--color-a)}#nav button:focus-visible{border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent);outline:none}#nav svg,#nav img{width:var(--category-icon-size);height:var(--category-icon-size)}#nav .bar{width:100%;height:2px;background-color:var(--em-accent);position:absolute;bottom:-11px;left:0}#nav button[aria-selected]{color:var(--em-accent)}#preview{z-index:2;padding:0px var(--padding);padding-right:var(--sidebar-width);position:relative}#nav:before,#preview:before{content:"";height:2px;position:absolute;left:0;right:0}#nav[data-position=top]:before,#preview[data-position=top]:before{background:linear-gradient(to bottom,var(--em-color-border),transparent);top:100%}#nav[data-position=bottom]:before,#preview[data-position=bottom]:before{background:linear-gradient(to top,var(--em-color-border),transparent);bottom:100%}.category button{font-family:var(--font-family);position:relative}.category button>*{position:relative}.category button .background{opacity:0;background-color:var(--em-color-border);position:absolute;inset:0}.category button[aria-selected] .background{opacity:1}.row{width:100%;position:absolute;top:0;left:0}.skin-tone-button{border:1px solid #0000;border-radius:100%}.skin-tone-button:hover{border-color:var(--em-color-border)}.skin-tone-button:active .skin-tone{transform:scale(.85)!important}.skin-tone-button:focus-visible{border-color:var(--em-accent);box-shadow:0 0 0 1px var(--em-accent);outline:none}.skin-tone-button[aria-selected]{background-color:var(--em-color-border);border-top-color:#0000000d;border-bottom-color:#0000;border-left-width:0;border-right-width:0}.skin-tone-button[aria-selected] .skin-tone{transform:scale(.9)}.menu{z-index:2;white-space:nowrap;border:1px solid var(--em-color-border);background-color:var(--em-background);backdrop-filter:blur(4px);border-radius:10px;padding:4px;position:absolute;box-shadow:1px 1px 5px #0000000d}.menu.hidden{opacity:0}.menu[data-position=bottom]{transform-origin:100% 100%}.menu[data-position=bottom].hidden{transform:scale(.9)rotate(-3deg)translateY(5%)}.menu[data-position=top]{transform-origin:100% 0}.menu[data-position=top].hidden{transform:scale(.9)rotate(3deg)translateY(-5%)}.menu input[type=radio]{clip:rect(0 0 0 0);width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.menu input[type=radio]:checked+.option{border-color:var(--em-accent);box-shadow:inset 0 0 0 1px var(--em-accent)}.option{width:100%;border:1px solid #0000;border-radius:6px;padding:4px 6px}.option:hover{color:#fff;background-color:var(--em-accent)}.skin-tone{width:16px;height:16px;border-radius:100%;display:inline-block;position:relative;overflow:hidden}.skin-tone:after{content:"";mix-blend-mode:overlay;background:linear-gradient(#fff3,#0000);border:1px solid #000c;border-radius:100%;position:absolute;inset:0;box-shadow:inset 0 -2px 3px #000,inset 0 1px 2px #fff}.skin-tone-1{background-color:#ffc93a}.skin-tone-2{background-color:#ffdab7}.skin-tone-3{background-color:#e7b98f}.skin-tone-4{background-color:#c88c61}.skin-tone-5{background-color:#a46134}.skin-tone-6{background-color:#5d4437}[data-emoji-set=twitter] .skin-tone:after{box-shadow:none;border-color:#00000080}[data-emoji-set=twitter] .skin-tone-1{background-color:#fade72}[data-emoji-set=twitter] .skin-tone-2{background-color:#f3dfd0}[data-emoji-set=twitter] .skin-tone-3{background-color:#eed3a8}[data-emoji-set=twitter] .skin-tone-4{background-color:#cfad8d}[data-emoji-set=twitter] .skin-tone-5{background-color:#a8805d}[data-emoji-set=twitter] .skin-tone-6{background-color:#765542}[data-emoji-set=google] .skin-tone:after{box-shadow:inset 0 0 2px 2px #0006}[data-emoji-set=google] .skin-tone-1{background-color:#f5c748}[data-emoji-set=google] .skin-tone-2{background-color:#f1d5aa}[data-emoji-set=google] .skin-tone-3{background-color:#d4b48d}[data-emoji-set=google] .skin-tone-4{background-color:#aa876b}[data-emoji-set=google] .skin-tone-5{background-color:#916544}[data-emoji-set=google] .skin-tone-6{background-color:#61493f}[data-emoji-set=facebook] .skin-tone:after{border-color:#0006;box-shadow:inset 0 -2px 3px #000,inset 0 1px 4px #fff}[data-emoji-set=facebook] .skin-tone-1{background-color:#f5c748}[data-emoji-set=facebook] .skin-tone-2{background-color:#f1d5aa}[data-emoji-set=facebook] .skin-tone-3{background-color:#d4b48d}[data-emoji-set=facebook] .skin-tone-4{background-color:#aa876b}[data-emoji-set=facebook] .skin-tone-5{background-color:#916544}[data-emoji-set=facebook] .skin-tone-6{background-color:#61493f}';export{Kf as Picker,rf as Emoji,G as SearchIndex,Z as Store,F as NativeSupport,df as init,Y as Data,X as I18n}; //# sourceMappingURL=index.js.map diff --git a/packages/emoji-mart/src/index.js b/packages/emoji-mart/src/index.js index ff5d101..5bce0e1 100644 --- a/packages/emoji-mart/src/index.js +++ b/packages/emoji-mart/src/index.js @@ -1,5 +1,5 @@ export { PickerElement as Picker } from './components/Picker' export { EmojiElement as Emoji } from './components/Emoji' -export { SearchIndex, Store } from './helpers' +export { SearchIndex, Store, NativeSupport } from './helpers' export { init, Data, I18n } from './config'