"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const o=require("../../../../utils/env.js"),i=require("../../../../../common/assets.js"),n=require("../../utils/utils.js"),r=require("../../offlinePushInfoManager/index.js"),a=require("../../config.js");Math||u();const u=()=>"../toolbar-item-container/index.js",l=e.defineComponent({__name:"index",props:{videoSourceType:{type:String,default:"album"}},setup(u){const l=u,s=e.ref(),t=e.ref();e.Jt.watch(e.o.CONV,{currentConversation:e=>{t.value=e}});const c=()=>{if(!o.isUniFrameWork){return"dark"===a.ChatConfig.getTheme()?i.videoIconDark:i.videoIconLight}switch(l.videoSourceType){case"album":default:return i.videoUniIcon;case"camera":return i.cameraUniIcon}},d=()=>{var i,n,r,a,u;o.isUniFrameWork?o.isWeChat&&(null==(i=e.i)?void 0:i.chooseMedia)?null==(n=e.i)||n.chooseMedia({mediaType:["video"],count:1,sourceType:[l.videoSourceType],maxDuration:60,success:function(e){p(e)}}):null==(r=e.i)||r.chooseVideo({count:1,sourceType:[l.videoSourceType],compressed:!1,success:function(e){p(e)}}):(null==(a=null==s?void 0:s.value)?void 0:a.click)&&(null==(u=null==s?void 0:s.value)||u.click())},v=e=>{var o,i;(null==(i=null==(o=null==e?void 0:e.target)?void 0:o.files)?void 0:i.length)<=0||(p(null==e?void 0:e.target),e.target.value="")},p=o=>{var i,a,u,l,s;if(!o)return;const c={to:(null==(a=null==(i=null==t?void 0:t.value)?void 0:i.groupProfile)?void 0:a.groupID)||(null==(l=null==(u=null==t?void 0:t.value)?void 0:u.userProfile)?void 0:l.userID),conversationType:null==(s=null==t?void 0:t.value)?void 0:s.type,payload:{file:o},needReadReceipt:n.isEnabledMessageReadReceiptGlobal()},d={conversation:t.value,payload:c.payload,messageType:e.qt.TYPES.MSG_VIDEO},v={offlinePushInfo:r.OfflinePushInfoManager.create(d)};e.Qt.sendVideoMessage(c,v)};return(i,n)=>({a:e.o$1(v),b:e.n(!e.unref(o.isPC)&&"video-upload-h5"),c:e.o$1(d),d:e.p({iconFile:c(),title:o.isUniFrameWork&&"camera"===l.videoSourceType?"录制":"视频",needDialog:!1,iconWidth:e.unref(o.isUniFrameWork)?"32px":"20px",iconHeight:e.unref(o.isUniFrameWork)?"album"===l.videoSourceType?"20px":"25px":"18px"})})}}),s=e._export_sfc(l,[["__scopeId","data-v-d124a627"]]);wx.createComponent(s);
