"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("regex-combined-emojis"),C=require("emoji-toolkit/emoji_strategy.json"),f=new RegExp(y.emojiPattern,"g"),j="9.0",u="https://cdn.jsdelivr.net/joypixels/assets/"+j+"/png/unicode/32/";exports.customEmojiAssetUrl=null;exports.emojiImageUrlSmall=u;exports.emojiFileExtensionSmall=".png";exports.emojiImageUrlLarge=u;exports.emojiFileExtensionLarge=".png";const m=C,d=new RegExp("(^| |(?<=:))(:\\w+:)","g");function g(){return m}function x(e,t=".png"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlSmall=e,exports.emojiFileExtensionSmall=t}function A(e,t=".svg"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlLarge=e,exports.emojiFileExtensionLarge=t}function P(e){exports.customEmojiAssetUrl=e}function T(e){E(e)}function E(e){const t=["extension","custom"],o=["name","category","shortname","extension","custom"],n=(s,i,r)=>{if(s[i]===void 0){if(!t.includes(i))return;s[i]=r}else Array.isArray(s[i])?s[i]=s[i].concat(r):s[i]=r};Object.entries(e).forEach(s=>{const[i,r]=s;if(i in m){const a=m[i];for(const c in r){const U=r[c];n(a,c,U)}}else o.every(c=>r[c]!==void 0)?m[i]=r:console.error("The following custom emoji doesn't contain the required properties:",r)})}function l(e){function t(n,s){if(!(!n||typeof n!="object")){if("shortname"in n&&(n.shortname===e||n.shortname_alternates.includes(e)))return n.key=s,o=n,!0;Object.keys(n).some(function(i){return t(n[i],i)})}}let o;return t(g(),null),o}function h(e){let t="";for(const o of e){const n=o.codePointAt(0).toString(16).padStart(4,"0");["200d","fe0f"].includes(n)||(t!==""&&(t=t+"-"),t=t+n)}return t}function v(e){const t=e.split("-");let o="";return t.forEach(n=>{o=o+String.fromCodePoint(parseInt(n,16))}),o}function p(e){if(e=e==null?void 0:e.trim(),e.startsWith(":")&&e.endsWith(":"))return l(e);{const t=h(e),o=m[t];return o&&(o.key=t),o}}function R(e){const t=(e.match(d)||[]).map(o=>o.trim());return S(t)}function S(e){const t=e?e.filter(o=>l(o)):[];return new Set(t)}function J(e){const t=[...e.matchAll(f)],o=t.length?t.map(n=>n[0]):[];return new Set(o)}exports.codeToEmojiData=p;exports.defaultEmojiAssetUrl=u;exports.emojiJson=m;exports.emojiRegex=f;exports.emojiShortCodeRegex=d;exports.emojiVersion=j;exports.filterValidShortCodes=S;exports.findEmojis=J;exports.findShortCodes=R;exports.getEmojiData=g;exports.setCustomEmojiJson=T;exports.setCustomEmojiUrl=P;exports.setEmojiAssetUrlLarge=A;exports.setEmojiAssetUrlSmall=x;exports.shortcodeToEmojiData=l;exports.stringToUnicode=v;exports.unicodeToString=h;exports.validateCustomEmojiJson=E;
//# sourceMappingURL=index.cjs.map
