"use strict";const e=require("../../../../common/vendor.js"),t={props:{message:{type:Object,default:()=>({})},senderId:{type:String,default:""},userId:{type:Number},playbackStatus:{type:Boolean}},data:()=>({innerAudioContext:null,NumberClicks:0}),watch:{playbackStatus(e){e?this.$emit("notplayVoice",!0):this.innerAudioContext?(this.innerAudioContext.pause(),this.innerAudioContext.destroy(),this.innerAudioContext=null,this.NumberClicks=0,this.$emit("notplayVoice",!0)):this.$emit("notplayVoice",!0)}},methods:{floor:e=>Math.floor(e),Play(){this.$emit("notplayVoice",!1),setTimeout((()=>{this.innerAudioContext=e.index.createInnerAudioContext(),this.innerAudioContext.src=this.message.url,this.innerAudioContext.onEnded((()=>{this.NumberClicks=0,this.innerAudioContext.destroy(),this.innerAudioContext=null})),this.innerAudioContext.onError((e=>{this.NumberClicks=0,this.innerAudioContext.destroy(),this.innerAudioContext=null})),this.innerAudioContext.play(),this.NumberClicks=1}),500)}}};const i=e._export_sfc(t,[["render",function(t,i,n,o,s,r){return e.e({a:n.senderId==n.userId},n.senderId==n.userId?e.e({b:e.t(r.floor(n.message.duration)),c:0==s.NumberClicks},(s.NumberClicks,{}),{d:1==s.NumberClicks},(s.NumberClicks,{}),{e:2==s.NumberClicks},(s.NumberClicks,{})):e.e({f:0==s.NumberClicks},(s.NumberClicks,{}),{g:1==s.NumberClicks},(s.NumberClicks,{}),{h:2==s.NumberClicks},(s.NumberClicks,{}),{i:e.t(r.floor(n.message.duration))}),{j:e.o(((...e)=>r.Play&&r.Play(...e)))})}],["__scopeId","data-v-e16cb73c"]]);wx.createComponent(i);
