import{k as gt,j as a,t as xt,m as p,n as $,p as e,q as _,v as F,i as g,A as u,x,s as mt}from"./web.Os7kOAdY.js";import{c as vt}from"./clipboard.BNxbz_oK.js";import{g as G,t as bt}from"./i18n-runtime._BAkvU05.js";var ft=u('<div class=panel style=display:flex;flex-direction:column;gap:18px><section class=panel style=padding:14px><h3 style="margin:0 0 10px;font-size:14px;color:var(--muted)"></h3><div class=tool-grid-2><div class=tool-field><span class=tool-label></span><input class=tool-input type=number></div><div class=tool-field><span class=tool-label></span><input class=tool-input type=number></div></div><div class=tool-field style=margin-top:10px><span class=tool-label></span><input class=tool-input type=number min=1 max=100></div><div class=tool-actions style=margin-top:10px><button class="tool-btn is-primary"></button><!$><!/></div><!$><!/><!$><!/></section><section class=panel style=padding:14px><h3 style="margin:0 0 10px;font-size:14px;color:var(--muted)"></h3><div class=tool-field><span class=tool-label></span><textarea class=tool-input rows=5></textarea></div><div class=tool-actions style=margin-top:10px><button class="tool-btn is-primary"></button></div><!$><!/>'),ht=u("<button class=tool-btn>"),St=u("<span class=tool-error>× <!$><!/>"),yt=u("<pre class=tool-pre style=margin-top:10px>"),Ct=u("<pre class=tool-pre style=margin-top:10px;font-size:18px;text-align:center>");function Nt(){const[J,f]=a(G(),{equals:!1}),s=t=>bt(t,J());xt(()=>{const t=i=>{const o=i.detail?.locale;o&&f(o)};window.addEventListener("taitan:locale-change",t),f(G()),mt(()=>window.removeEventListener("taitan:locale-change",t))});const[h,K]=a("1"),[S,Q]=a("100"),[y,U]=a("1"),[d,V]=a([]),[C,m]=a(""),[M,W]=a(`选项 A
选项 B
选项 C`),[k,E]=a(""),X=()=>{const t=parseInt(h()),i=parseInt(S()),o=Math.min(parseInt(y())||1,100);if(isNaN(t)||isNaN(i)){m("请输入有效数字");return}if(t>i){m("最小值不能大于最大值");return}m("");const r=[];for(let c=0;c<o;c++)r.push(Math.floor(Math.random()*(i-t+1))+t);V(r)},Y=()=>{const t=M().split(`
`).map(i=>i.trim()).filter(Boolean);if(t.length===0){E("");return}E(t[Math.floor(Math.random()*t.length)])};return(()=>{var t=p(ft),i=t.firstChild,o=i.firstChild,r=o.nextSibling,c=r.firstChild,N=c.firstChild,w=N.nextSibling,Z=c.nextSibling,T=Z.firstChild,L=T.nextSibling,j=r.nextSibling,z=j.firstChild,I=z.nextSibling,v=j.nextSibling,b=v.firstChild,tt=b.nextSibling,[et,lt]=$(tt.nextSibling),nt=v.nextSibling,[q,it]=$(nt.nextSibling),st=q.nextSibling,[at,ot]=$(st.nextSibling),A=i.nextSibling,B=A.firstChild,P=B.nextSibling,R=P.firstChild,H=R.nextSibling,O=P.nextSibling,D=O.firstChild,rt=O.nextSibling,[ct,pt]=$(rt.nextSibling);return e(o,()=>s("区间随机数")),e(N,()=>s("最小")),w.$$input=l=>K(l.currentTarget.value),e(T,()=>s("最大")),L.$$input=l=>Q(l.currentTarget.value),e(z,()=>s("个数（最多 100）")),I.$$input=l=>U(l.currentTarget.value),b.$$click=X,e(b,()=>s("生成")),e(v,(()=>{var l=_(()=>d().length>0);return()=>l()&&(()=>{var n=p(ht);return n.$$click=()=>vt(d().join(" ")),e(n,()=>s("复制")),F(),n})()})(),et,lt),e(i,(()=>{var l=_(()=>!!C());return()=>l()&&(()=>{var n=p(St),$t=n.firstChild,ut=$t.nextSibling,[dt,_t]=$(ut.nextSibling);return e(n,C,dt,_t),n})()})(),q,it),e(i,(()=>{var l=_(()=>d().length>0);return()=>l()&&(()=>{var n=p(yt);return e(n,()=>d().join("  ")),n})()})(),at,ot),e(B,()=>s("文本抽签")),e(R,()=>s("候选项（每行一个）")),H.$$input=l=>W(l.currentTarget.value),D.$$click=Y,e(D,()=>s("抽签")),e(A,(()=>{var l=_(()=>!!k());return()=>l()&&(()=>{var n=p(Ct);return e(n,k),n})()})(),ct,pt),g(()=>x(w,"value",h())),g(()=>x(L,"value",S())),g(()=>x(I,"value",y())),g(()=>x(H,"value",M())),F(),t})()}gt(["input","click"]);export{Nt as default};
