// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later // @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c var e=`#[\\p{L}\\p{N}_](?:[\\p{L}\\p{N}_-]*[\\p{L}\\p{N}_])?`;function t(){return new RegExp(e,`gu`)}function n(e){return e.match(t())?.map(e=>e.slice(1).toLowerCase())??[]}function r(e,t=64){if(typeof e!=`string`)return;let n=e.trim().replace(/^#/,``).toLowerCase();if(!(!n||n.length>t))return RegExp(`^#[\\p{L}\\p{N}_](?:[\\p{L}\\p{N}_-]*[\\p{L}\\p{N}_])?$`,`u`).test(`#${n}`)?n:void 0}export{n,r,e as t}; // @license-end