import{r as e,p as s,bf as t,bg as a,x as n,bh as r}from"./index-WeUkftbp.js";const c=e(!1),u=e("获取验证码"),i=()=>{if(c.value)return;c.value=!0;let e=60;u.value="剩余 "+e+"s";const s=setInterval((()=>{e-=1,e<0&&clearInterval(s),u.value="剩余 "+e+"s",u.value<"剩余 0s"&&(c.value=!1,u.value="重新获取")}),1e3)};function o(){return{text:u,disabled:c,sendCode:i}}function l(){return{getKeyVerify:(e,s=0)=>{t().then((async t=>{const c=t.data.key,u={phone:e,key:c,types:0,from:1};1===s?await a(e).then((e=>{i(),n.success(e.message,"none")})).catch((e=>{n.error(e.message)})):await r(u).then((e=>{i(),n.success(e.message,"none")})).catch((e=>{n.error(e.message)}))}))}}}function h(){const t=e(0);return{height:t,getBarHeight:(e,a,n=!0)=>{let r=s().in(a);r.select(e).fields({size:!0,rect:!0},(()=>{})),r.exec((e=>{t.value=n?e[0].height+"px":e[0].height}))}}}export{o as a,l as b,h as u};
