const s=/[\s,，]+/,f=/[^a-z0-9.-]/g,u=/[^a-z0-9.-]/,a=/^@+/,l=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;function c(n){let t=String(n||"").trim().toLowerCase();return t?(t=t.replace(a,""),t=t.replace(f,""),t):""}function m(n){if(!n||n.length===0)return[];const t=new Set,i=[];for(const r of n){const e=c(r);!o(e)||t.has(e)||(t.add(e),i.push(e))}return i}function _(n){if(!n||!n.trim())return[];const t=new Set,i=[];for(const r of n.split(s)){const e=I(r);!o(e)||t.has(e)||(t.add(e),i.push(e))}return i}function E(n){return m(n).map(t=>`@${t}`)}function S(n){const t=String(n||"").trim().toLowerCase();if(!t)return"";const i=t.indexOf("@");return i<=0||i>=t.length-1||t.indexOf("@",i+1)!==-1?"":t.slice(i+1)}function R(n,t){const i=E(t);if(i.length===0)return!0;const r=S(n);if(!r)return!1;const e=`@${r}`;return i.includes(e)}function I(n){let t=String(n||"").trim().toLowerCase();return!t||(t=t.replace(a,""),!t||u.test(t))?"":t}function o(n){return n?l.test(n):!1}export{o as a,m as b,E as c,R as i,c as n,_ as p};
