import{u as B}from"./vue-i18n-90d534a9.js";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-1170722e.js";import{u as z}from"./vue-router-7f882520.js";import{l as V}from"./like-906d1a78.js";import{o as j,ak as C,z as F,A as Y}from"./index-ae60edf9.js";import{d as L,k as h,o as a,c as i,$ as U,u as m,a as r,aX as n,P as u,_ as g,an as R,b as S,l as q,j as A,bj as E,F as O,aI as P,O as X}from"./@vue-cb50a1c4.js";import{b as I,M as D,e as G}from"./moments-b220a7da.js";import{c as H}from"./@vueuse-19adab01.js";import"./@intlify-1c0af683.js";import"./index-597402db.js";import"./arrows_left-f963ef62.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"./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";const J="/assets/zwxgxx-b7da7964.png",K={class:"ml-3 flex flex-1 flex-row items-center justify-between overflow-hidden"},Q={class:"flex flex-col"},W={class:"flex-1 text-sm"},Z={key:0,class:"flex flex-row items-center"},ee=["src"],te={key:1},se={key:2},oe={key:3,class:"break-all"},re={class:"text-primary"},ne={class:"mt-2 text-xs text-sub-text"},ae=["src"],ce=L({__name:"IMessageItem",props:{source:null,border:{type:Boolean}},setup(o){const t=o,s=z(),k=h(()=>{var e;return((e=t.source)==null?void 0:e.type)===3?C(t.source.comments[0].createTime):C(t.source.createTime)}),y=e=>{s.push({path:"/momentsDetails",query:{workMomentID:e}})},l=h(()=>{var e,c;return((e=t.source)==null?void 0:e.type)===1?t.source.likeUsers[0]:((c=t.source)==null?void 0:c.type)===2?t.source:t.source.comments[0]}),p=h(()=>t.source.content.metas.length<=0?"":t.source.content.type===0?t.source.content.metas[0].original:t.source.content.metas[0].thumb);return(e,c)=>{var d,f,_,w,x,M,$,b,v,T;return a(),i("div",{class:R(["flex p-4",{"border-b":o.border}]),onClick:c[0]||(c[0]=ue=>y(t.source.workMomentID))},[U(j,{size:48,src:m(l).faceURL,desc:m(l).nickname},null,8,["src","desc"]),r("div",K,[r("div",Q,[r("div",null,n(m(l).nickname),1),r("div",W,[((d=o.source)==null?void 0:d.type)===1?(a(),i("div",Z,[r("img",{class:"h-[13px] w-[13px]",src:m(V),alt:""},null,8,ee),r("span",null,n(e.$t("momentsTips.likedForYou")),1)])):u("",!0),((f=o.source)==null?void 0:f.type)===2?(a(),i("span",te,n(e.$t("momentsTips.mentionedYou")),1)):u("",!0),((_=o.source)==null?void 0:_.type)===3&&((w=o.source)==null?void 0:w.comments[0].replyUserID)===""?(a(),i("span",se,n(`${e.$t("momentsTips.commentYou")}：${(x=o.source)==null?void 0:x.comments[0].content}`),1)):u("",!0),((M=o.source)==null?void 0:M.type)===3&&(($=o.source)==null?void 0:$.comments[0].replyUserID)!==""?(a(),i("span",oe,[g(n((b=o.source)==null?void 0:b.comments[0].nickname)+" ",1),r("span",re,n(e.$t("buttons.reply")),1),g(" "+n(`${(v=o.source)==null?void 0:v.comments[0].replyNickname}：${(T=o.source)==null?void 0:T.comments[0].content}`),1)])):u("",!0)]),r("div",ne,n(m(k)),1)]),m(p)?(a(),i("img",{key:0,class:"ml-1 h-[62px] w-[62px] shrink-0",src:m(p),alt:""},null,8,ae)):u("",!0)])],2)}}}),ie={class:"page_container !bg-white"},me={key:0,class:"noMoreLogs"},le=r("img",{src:J,alt:""},null,-1),Se=L({__name:"index",setup(o){const t=S(null),s=q({workMoments:[],loading:!1,hasMore:!0,current:1});A(()=>{l(),y()});const{t:k}=B();H(t,()=>{l()},{distance:50});const y=async()=>{await I(D.Count)},l=async()=>{var c;if(!s.hasMore||s.loading)return;s.loading=!0,F({message:k("loading"),forbidClick:!0,duration:0});const{data:e}=await G(s.current);s.workMoments=[...s.workMoments,...e.workMoments??[]],s.current++,s.hasMore=((c=e.workMoments)==null?void 0:c.length)===20,s.loading=!1,Y()},p=async()=>{await I(D.List),s.workMoments=[]};return(e,c)=>(a(),i("div",ie,[U(N,{title:e.$t("momentsTips.logs")},{default:E(()=>[r("div",{onClick:p},n(e.$t("buttons.clear")),1)]),_:1},8,["title"]),r("div",{class:"overflow-y-auto",ref_key:"el",ref:t},[(a(!0),i(O,null,P(s.workMoments,(d,f)=>(a(),X(ce,{source:d,key:d.workMomentID,border:f!==s.workMoments.length-1},null,8,["source","border"]))),128)),s.workMoments.length<=0?(a(),i("div",me,[le,g(" "+n(e.$t("momentsTips.noMoreLogs2"))+"~ ",1)])):u("",!0)],512)]))}});export{Se as default};
