import{_ as w,a as I}from"./B8IDXpRD.js";import{d as b,u as B,a6 as N,r as c,ah as T,x as l,a5 as m,y as s,z as $,a9 as S,A as u,B as V,T as A,a1 as D,ai as L,K as z,v as p,O as E,Q as F}from"./D3l4Cb4m.js";import{u as K}from"./BGlfPyXw.js";import{l as O}from"./BTYgDOhz.js";import"./BLZQuouS.js";import"./C6entnFp.js";import"./Cy9jV2HZ.js";import"./BbpBKUVh.js";import"./C7eKbJgs.js";import"./BrmPz7i0.js";import"./WIvQOhpN.js";import"./B8v3cc24.js";import"./CxVDiOZo.js";import"./6dRv2cdq.js";import"./C4Om2k4R.js";const Q=s("img",{"w-6":"","h-6":"","mb-2":"",src:w},null,-1),R={fixed:"","bottom-4":"","right-4":""},ne=b({__name:"index",setup(U){const v=B(),{chatToBottom:f}=K(),{companyCode:d,guestSign:j,userId:a,userName:_,token:n,sessionId:i,accountId:g}=L();(!i.value||!n.value)&&v.push("/login");const{t:h}=N(),x=c(!1),o=c(!1);y();function y(){const t={companyCode:d.value,userName:a.value};return O(t).then(e=>{a.value=e.uuid,_.value=e.nickname,n.value=e.token,i.value=e.sessionId,g.value=e.accountId,x.value=!0}).catch(e=>{T.error(h(e.message||"登录失败，请稍后再试"))}).finally(()=>{})}async function r(t=!0){o.value=t,t&&(await z(),f(0))}return(t,e)=>{const C=I;return p(),l(D,null,[m(o)?S("",!0):(p(),l("div",{key:0,fixed:"","bottom-30":"","right-0":"",flex:"","flex-col":"","items-center":"","rounded-l-4":"","bg-white":"","py-3.5":"","px-2":"",shadow:"[0_0_8px_0_rgba(0,0,0,0.1)]","cv-primary-hover":"",text:"3.5 #333",onClick:e[0]||(e[0]=k=>r())},[Q,s("span",null,$(t.$t("联系客服")),1)])),u(A,{"enter-active-class":"transition origin-center","leave-active-class":"transition origin-center","enter-from-class":"opacity-0 scale-75","leave-to-class":"opacity-1 scale-75"},{default:V(()=>[E(s("div",R,[u(C,{onClose:e[1]||(e[1]=k=>r(!1))})],512),[[F,m(o)]])]),_:1})],64)}}});export{ne as default};
