import{k as Pe,j as D,t as We,h as Ze,m as G,n,p as t,q as Q,i as He,v as Oe,A as X,x as Re,s as Ue}from"./web.Os7kOAdY.js";import{g as V,t as Be}from"./i18n-runtime._BAkvU05.js";var De=X('<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"style=min-height:240px></textarea></div><div class=tool-grid-3><div class=panel style=padding:16px><div class=tool-label></div><div style=font-size:28px;font-weight:700></div><div class=tool-hint><!$><!/><!$><!/></div></div><div class=panel style=padding:16px><div class=tool-label></div><div style=font-size:28px;font-weight:700></div><div class=tool-hint><!$><!/><!$><!/> <!$><!/><!$><!/></div></div><div class=panel style=padding:16px><div class=tool-label></div><div style=font-size:28px;font-weight:700><!$><!/> <!$><!/></div><div class=tool-hint><!$><!/><!$><!/> <!$><!/><!$><!/></div></div></div><table class=tool-table><thead><tr><th></th><th></th><th></th></tr></thead><tbody><!$><!/><tr><td><strong></strong></td><td style=font-family:ui-monospace,monospace></td><td>—</td></tr></tbody></table><p class=tool-hint>'),Ge=X("<tr><td></td><td style=font-family:ui-monospace,monospace></td><td><!$><!/>%");function Qe(e){return e>=19968&&e<=40959||e>=12352&&e<=12543||e>=44032&&e<=55215?"cjk":e>=126976&&e<=131071?"emoji":e>=48&&e<=57?"digit":e>=65&&e<=90||e>=97&&e<=122?"latin":e===32||e===9||e===10||e===13?"space":e<128?"punct":"other"}function Ve(e){let r=0,l=0,c=0,b=0,i=0,s=0,$=0,a=0;for(const g of e){a++;const m=g.codePointAt(0),o=Qe(m);o==="cjk"?r++:o==="latin"?l++:o==="digit"?c++:o==="space"?i++:o==="punct"?b++:o==="emoji"?s++:$++}const S=e?e.split(/\r?\n/).length:0,v=e?e.split(/\n\s*\n+/).filter(g=>g.trim()).length:0,d=(e.match(/[A-Za-z][A-Za-z'-]*/g)||[]).length,u=d+r,p=new TextEncoder().encode(e).length,_=d/250+r/300;return{chars:a,charsNoSpace:a-i,lines:S,paragraphs:v,words:u,enWords:d,cjk:r,latin:l,digit:c,punct:b,space:i,emoji:s,other:$,bytes:p,readMin:_}}function et(){const[e,r]=D(V(),{equals:!1}),l=s=>Be(s,e());We(()=>{const s=$=>{const a=$.detail?.locale;a&&r(a)};window.addEventListener("taitan:locale-change",s),r(V()),Ue(()=>window.removeEventListener("taitan:locale-change",s))});const[c,b]=D(`在 LvOnce Tools 上敲一段文字看看吧。
粘贴一篇博客，立刻得到字符 / 词 / 段 / 阅读时长统计。

This tool runs entirely in your browser.`),i=Ze(()=>Ve(c()));return(()=>{var s=G(De),$=s.firstChild,a=$.firstChild,S=a.nextSibling,v=$.nextSibling,d=v.firstChild,u=d.firstChild,p=u.nextSibling,_=p.nextSibling,g=_.firstChild,[m,o]=n(g.nextSibling),Y=m.nextSibling,[ee,te]=n(Y.nextSibling),y=d.nextSibling,j=y.firstChild,w=j.nextSibling,x=w.nextSibling,ie=x.firstChild,[k,le]=n(ie.nextSibling),ne=k.nextSibling,[L,se]=n(ne.nextSibling),ae=L.nextSibling,oe=ae.nextSibling,[E,re]=n(oe.nextSibling),$e=E.nextSibling,[de,ce]=n($e.nextSibling),_e=y.nextSibling,M=_e.firstChild,C=M.nextSibling,ge=C.firstChild,[T,xe]=n(ge.nextSibling),fe=T.nextSibling,he=fe.nextSibling,[be,Se]=n(he.nextSibling),f=C.nextSibling,ve=f.firstChild,[z,ue]=n(ve.nextSibling),pe=z.nextSibling,[A,me]=n(pe.nextSibling),Ce=A.nextSibling,ye=Ce.nextSibling,[N,je]=n(ye.nextSibling),we=N.nextSibling,[ke,Le]=n(we.nextSibling),I=v.nextSibling,q=I.firstChild,Ee=q.firstChild,F=Ee.firstChild,J=F.nextSibling,Me=J.nextSibling,K=q.nextSibling,Te=K.firstChild,[P,ze]=n(Te.nextSibling),Ae=P.nextSibling,W=Ae.firstChild,Ne=W.firstChild,Ie=W.nextSibling,qe=I.nextSibling;return t(a,()=>l("输入")),S.$$input=h=>b(h.currentTarget.value),t(u,()=>l("字符")),t(p,()=>i().chars.toLocaleString()),t(_,()=>l("不含空白："),m,o),t(_,()=>i().charsNoSpace.toLocaleString(),ee,te),t(j,()=>l("词数")),t(w,()=>i().words.toLocaleString()),t(x,()=>l("英文"),k,le),t(x,()=>i().enWords,L,se),t(x,()=>l("· 中文/CJK"),E,re),t(x,()=>i().cjk,de,ce),t(M,()=>l("阅读时长")),t(C,(()=>{var h=Q(()=>i().readMin<1);return()=>h()?"< 1":Math.round(i().readMin)})(),T,xe),t(C,()=>l("分钟"),be,Se),t(f,()=>l("行数"),z,ue),t(f,()=>i().lines,A,me),t(f,()=>l("· 段落"),N,je),t(f,()=>i().paragraphs,ke,Le),t(F,()=>l("类别")),t(J,()=>l("数量")),t(Me,()=>l("占比")),t(K,()=>[["CJK 中日韩",i().cjk],["拉丁字母",i().latin],["数字",i().digit],["ASCII 标点",i().punct],["空白",i().space],["Emoji",i().emoji],["其它",i().other]].map(([h,Z])=>(()=>{var H=G(Ge),O=H.firstChild,R=O.nextSibling,U=R.nextSibling,Fe=U.firstChild,[B,Je]=n(Fe.nextSibling);return B.nextSibling,t(O,h),t(R,()=>Z.toLocaleString()),t(U,(()=>{var Ke=Q(()=>!!i().chars);return()=>Ke()?(Z/i().chars*100).toFixed(1):"0.0"})(),B,Je),H})()),P,ze),t(Ne,()=>l("UTF-8 字节")),t(Ie,()=>i().bytes.toLocaleString()),t(qe,()=>l("阅读时长按 250wpm 英文 + 300 字/分钟中文加权估算。")),He(()=>Re(S,"value",c())),Oe(),s})()}Pe(["input"]);export{et as default};
