import{u as _}from"./vue-i18n-90d534a9.js";import{u as b}from"./vue-router-7f882520.js";import{l as g,v as k,I as i,q as l}from"./index-ae60edf9.js";import{S as B}from"./index-ce3b9548.js";import{_ as y}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{_ as u}from"./index.vue_vue_type_script_setup_true_lang-65f30884.js";import{C as S}from"./data-7f4000cb.js";import{d as w,k as U,b as $,o as x,c as N,$ as c,a as p,bj as A,u as F}from"./@vue-cb50a1c4.js";import{s as T}from"./function-call-079e4448.js";import{B as M}from"./index-e4a7d928.js";import"./@intlify-1c0af683.js";import"./open-im-sdk-wasm-f19f04ec.js";import"./dayjs-4460abc8.js";import"./@amap-aca98dec.js";import"./pinia-de4079f2.js";import"./axios-7d5a0a64.js";import"./form-data-497f8b5e.js";import"./uuid-a960c1f4.js";import"./date-fns-f56f60e6.js";import"./@babel-7fd5df1e.js";import"./mitt-f7ef348c.js";import"./@vueuse-19adab01.js";import"./livekit-client-ca552de3.js";import"./@livekit-3058dbe8.js";import"./loglevel-e40a507a.js";import"./rxjs-2154ddb2.js";import"./tslib-8dbab242.js";import"./@vuemap-5ebdc63e.js";import"./lodash-es-91418b19.js";import"./index-597402db.js";import"./arrows_left-f963ef62.js";const O={class:"page_container"},R={class:"overflow-hidden"},V={class:"mb-2 my-2 overflow-hidden"},q={class:""},Ie=w({__name:"index",setup(E){const n=g(),{t:f}=_(),m=b(),o=k(),C=U(()=>o.storeBlackList.findIndex(e=>{var t;return e.userID===((t=o.storeUserCardData.baseInfo)==null?void 0:t.userID)})>-1),d=$(!1),h=e=>{var t,a,r;if(d.value=!0,e){i.deleteConversationAndDeleteAllMsg(n.storeCurrentConversation.conversationID).then(()=>n.delConversationByCID(n.storeCurrentConversation.conversationID)).catch(s=>l({error:s})),i.addBlack({toUserID:(t=o.storeUserCardData.baseInfo)==null?void 0:t.userID,ex:""}).catch(s=>l({error:s})).finally(()=>d.value=!1),i.deleteFriend((a=o.storeUserCardData.baseInfo)==null?void 0:a.userID).then(()=>m.push("/conversation")).catch(s=>l({error:s})).finally();return}i.removeBlack((r=o.storeUserCardData.baseInfo)==null?void 0:r.userID).catch(s=>l({error:s})).finally(()=>d.value=!1)},v=()=>{m.push({path:"changeNameOrRemark",query:{friendInfo:JSON.stringify(o.storeUserCardData.baseInfo)}})},I=()=>{m.push({path:"chooseUser",state:{chooseType:S.ShareCard,extraData:JSON.stringify(o.storeUserCardData.baseInfo)}})},D=()=>{T({message:f("messageTip.unfriend"),beforeClose:e=>new Promise(t=>{var a;e==="confirm"?(i.deleteConversationAndDeleteAllMsg(n.storeCurrentConversation.conversationID).then(()=>n.delConversationByCID(n.storeCurrentConversation.conversationID)).catch(r=>l({error:r})),i.deleteFriend((a=o.storeUserCardData.baseInfo)==null?void 0:a.userID).then(()=>m.back()).catch(r=>l({error:r})).finally(()=>t(!0))):t(!0)})})};return(e,t)=>{const a=B,r=M;return x(),N("div",O,[c(y,{title:e.$t("friendSettings")},null,8,["title"]),p("div",R,[c(u,{lable:e.$t("setNickname"),arrow:"",onClick:v},null,8,["lable"]),c(u,{lable:e.$t("shareFriend"),arrow:"",onClick:I},null,8,["lable"])]),p("div",V,[c(u,{lable:e.$t("checks.addToBlack"),arrow:""},{default:A(()=>[c(a,{size:"20",loading:d.value,"model-value":F(C),"onUpdate:modelValue":h},null,8,["loading","model-value"])]),_:1},8,["lable"])]),p("div",q,[c(r,{class:"w-full !border-0 !text-base !text-error-text",plain:"",type:"default",text:e.$t("unfriend"),onClick:D},null,8,["text"])])])}}});export{Ie as default};
