import{k as B,j as I,t as R,h as N,m as p,p as a,i as M,v as F,q as h,n as H,A as d,e as U,x as W,s as X}from"./web.Os7kOAdY.js";import{c as J}from"./clipboard.BNxbz_oK.js";import{g as O,t as K}from"./i18n-runtime._BAkvU05.js";var Q=d('<div class=panel style=display:flex;flex-direction:column;gap:14px><div class=tool-field><span class=tool-label></span><textarea class="tool-textarea is-wrap"></textarea></div><table class=tool-table><thead><tr><th></th><th></th><th></th></tr></thead><tbody></tbody></table><div class=tool-actions><button class="tool-btn is-primary"></button></div><p class=tool-hint>'),V=d("<tr><td style=font-family:ui-monospace,monospace></td><td style=font-family:ui-monospace,monospace></td><td>"),Y=d("<div><span>"),Z=d("<span class=tool-hint>"),tt=d('<span class=tool-error style="padding:4px 8px">× <!$><!/>');const et=new Set(["gmail.com","googlemail.com","protonmail.com","proton.me","pm.me","icloud.com","me.com","mac.com"]),at=new Set(["gmail.com","googlemail.com"]),b={"googlemail.com":"gmail.com","me.com":"icloud.com","mac.com":"icloud.com","pm.me":"proton.me","protonmail.com":"proton.me"},ot=new Set(["mailinator.com","10minutemail.com","guerrillamail.com","yopmail.com","trashmail.com","tempmail.org","temp-mail.org","sharklasers.com","maildrop.cc","getnada.com","dispostable.com","spamgourmet.com","fakeinbox.com","throwawaymail.com"]);function lt(f){const s=f.trim().toLowerCase();if(!s)return{ok:!1,err:"空"};const o=s.match(/^([^@]+)@([a-z0-9.\-]+\.[a-z]{2,})$/i);if(!o)return{ok:!1,err:"不是合法的邮箱格式"};let e=o[1],l=o[2];const r=[];if(b[l]&&(r.push(`域名规范化 → ${b[l]}`),l=b[l]),et.has(l)&&e.includes("+")){const c=e;e=e.split("+")[0],r.push(`去掉 + 别名 (${c})`)}if(at.has(l)&&e.includes(".")){const c=e;e=e.replace(/\./g,""),r.push(`Gmail 忽略点号 (${c})`)}return ot.has(l)&&r.push("⚠ 一次性邮箱域名"),{ok:!0,canonical:`${e}@${l}`,local:e,domain:l,flags:r}}function st(){const[f,s]=I(O(),{equals:!1}),o=t=>K(t,f());R(()=>{const t=u=>{const m=u.detail?.locale;m&&s(m)};window.addEventListener("taitan:locale-change",t),s(O()),X(()=>window.removeEventListener("taitan:locale-change",t))});const[e,l]=I(`Foo.Bar+promo@Gmail.com
user@mailinator.com
alice+work@protonmail.com`),r=N(()=>e().split(/\r?\n/).map(t=>({raw:t,n:lt(t)}))),c=N(()=>r().map(t=>t.n.ok?t.n.canonical:`# ${t.raw} (${t.n.err})`).join(`
`));return(()=>{var t=p(Q),u=t.firstChild,m=u.firstChild,x=m.nextSibling,v=u.nextSibling,S=v.firstChild,D=S.firstChild,w=D.firstChild,y=w.nextSibling,z=y.nextSibling,G=S.nextSibling,k=v.nextSibling,C=k.firstChild,P=k.nextSibling;return a(m,()=>o("邮箱列表（每行一个）")),x.$$input=n=>l(n.currentTarget.value),a(w,()=>o("原文")),a(y,()=>o("规范化")),a(z,()=>o("说明")),a(G,()=>r().filter(n=>n.raw.trim()).map(n=>(()=>{var A=p(V),E=A.firstChild,L=E.nextSibling,T=L.nextSibling;return a(E,()=>n.raw),a(L,(()=>{var _=h(()=>!!n.n.ok);return()=>_()?n.n.canonical:"-"})()),a(T,(()=>{var _=h(()=>!!n.n.ok);return()=>_()?h(()=>!!n.n.flags.length)()?n.n.flags.map(i=>(()=>{var $=p(Y),g=$.firstChild;return a(g,i),M(()=>U(g,`tool-chip ${i.startsWith("⚠")?"is-warn":""}`)),$})()):(()=>{var i=p(Z);return a(i,()=>o("无变化")),i})():(()=>{var i=p(tt),$=i.firstChild,g=$.nextSibling,[j,q]=H(g.nextSibling);return a(i,()=>n.n.err,j,q),i})()})()),A})())),C.$$click=()=>J(c()),a(C,()=>o("复制规范化结果")),a(P,()=>o("规则覆盖 Gmail 点号、加号别名、Proton/iCloud 域名归一、常见一次性邮箱黑名单。判断仅供参考，业务校验请配合后端 MX 检查。")),M(()=>W(x,"value",e())),F(),t})()}B(["input","click"]);export{st as default};
