PageSourceSearch

https://www.moretickets.com/assets/packages-TUIKit-components-TUIChat-index.ConyUmQu.js

js moretickets.com collected 2026-09-25 07:17:20 UTC 955,165 bytes, 102 lines download raw bytes

1var lh=Object.defineProperty,ch=Object.defineProperties;var uh=Object.getOwnPropertyDescriptors;var Tr=Object.getOwnPropertySymbols;var Gl=Object.prototype.hasOwnProperty,Hl=Object.prototype.propertyIsEnumerable;var Vo=(i,e,t)=>e in i?lh(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,F=(i,e)=>{for(var t in e||(e={}))Gl.call(e,t)&&Vo(i,t,e[t]);if(Tr)for(var t of Tr(e))Hl.call(e,t)&&Vo(i,t,e[t]);return i},Z=(i,e)=>ch(i,uh(e));var $l=(i,e)=>{var t={};for(var n in i)Gl.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&Tr)for(var n of Tr(i))e.indexOf(n)<0&&Hl.call(i,n)&&(t[n]=i[n]);return t};var xe=(i,e,t)=>(Vo(i,typeof e!="symbol"?e+"":e,t),t);var ye=(i,e,t)=>new Promise((n,s)=>{var r=l=>{try{a(t.next(l))}catch(c){s(c)}},o=l=>{try{a(t.throw(l))}catch(c){s(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(r,o);a((t=t.apply(i,e)).next())});import{o as Dn,r as P,V as et,a5 as st,x as $e,w as Ye,j as ie,aN as jl,C as ge,N as G,I as w,F as v,U as Ve,aC as An,_ as ve,a7 as q,D as ne,E as X,T as ae,Y as ze,a0 as vr,J as Y,G as re,S as qe,aj as ln,Z as pt,m as Bo,aO as ku,ag as _t,ah as yt,ad as It,aP as dh,v as ei,au as Wl,B as Qa,am as mo,aQ as qs,aR as fh,s as Lr,aF as Nu,H as fi,L as xu,O as hh,P as Za,Q as Xa,ay as ph,R as vo,ak as sr,aS as gh,aT as mh,a9 as el,aU as vh,$ as Ch,W as Uu,X as Pu,av as _h,aB as yh,a4 as tl,ar as Ih,as as Eh}from"./vendor-vue.D9QQoaml.js";import{s as nl,g as wr}from"./vendor-utils.CHnM5obH.js";import{f as Sh,T as Js,Q as Ee,o as be,X as Fe,e as pe,n as bt,i as ts,d as il,h as Vr,b as jr}from"./vendor-chat-uikit-engine.B3EjdNYx.js";import{R as Fn,E as ct,A as Th,i as nt,a as zl,T as rr,P as va,g as Lh,v as wh,O as Vu,f as Bu}from"./vendor-tui-core.CTfI3_LQ.js";import{r as Ah}from"./vendor-trtc.BtAxU8o-.js";import{a as Ze,n as fe,ao as bh}from"./vendor-dcloudio.upkQA-fz.js";import{u as Us,q as Wr,p as Jt,r as ns,P as bi,X as Fu,U as Gu,g as Rh,ao as Oh,_ as or,b as Dh,n as Mh}from"./index-DhGNiy9L.js";import{u as sl,q as Ot,U as Hu,M as rl,G as kh,r as Nh,s as xh,t as Uh}from"./im.OnDHQUL2.js";import{O as Co,i as Ui,A as ar,c as Ca,s as Ph,g as _a,I as ya,a as Vh,D as Bh}from"./utils.MruXTa66.js";import{T as $u,a as ju}from"./edit.CeRNY-0h.js";import{w as Ps,T as tn,a as He,h as pn,I as dt,i as Se,c as Kn,b as gn,L as Wu,M as Fh,N as Gh,x as xt,J as Gn,y as Hh,o as ol,m as zu,O as Ku,n as al,P as $h,Q as jn,R as Kl,S as jh}from"./address.VENuOrvR.js";import{_ as ll}from"./faq-api.Dg97QsrL.js";import{p as Yu,k as Wh,l as zh}from"./agreement.BA4QGRS1.js";import{_ as Yl}from"./use-select-language.ClDeM6Lb.js";import{S as Kh}from"./supplement-address-popup.m2V3wwqH.js";import{a as Yh}from"./env.BebwN3XW.js";import qh from"./packages-TUIKit-components-location.C1XOVe2y.js";import Jh from"./packages-TUIKit-components-TUIChat-evaluation.DyvhaA-k.js";import{a as Qh}
1from"./mt-page.sd7hUmoC.js";import{c as Zh}from"./verification-popup.D_8F_Av1.js";import"./vendor-analytics.Ca58H-PE.js";import"./use-recommend-show.Brk1O9cS.js";import"./mt-input.D2Fg7b3H.js";import"./pc-address-list.Cq9nWZMj.js";import"./mt-empty.ILq52UPF.js";import"./address-row.Vis_0W1L.js";import"./create-container.o3UL3cAi.js";import"./constants.TfIc4VlC.js";import"./coupon-state.C9Ot1upg.js";var j=(i=>(i.CALL="call",i.CUSTOM="custom",i))(j||{}),rt=(i=>(i[i.UNKNOWN=0]="UNKNOWN",i[i.AUDIO=1]="AUDIO",i[i.VIDEO=2]="VIDEO",i))(rt||{}),Dt=(i=>(i.UNKNOWN="unknown",i.CALLEE="callee",i.CALLER="caller",i))(Dt||{}),Be=(i=>(i.IDLE="idle",i.CALLING="calling",i.CONNECTED="connected",i))(Be||{}),Qs=(i=>(i.CONTAIN="contain",i.COVER="cover",i.FILL="fill",i))(Qs||{}),Zs=(i=>(i.RESOLUTION_480P="480p",i.RESOLUTION_720P="720p",i.RESOLUTION_1080P="1080p",i))(Zs||{}),qu=(i=>(i.EN="en",i["ZH-CN"]="zh-cn",i.JA_JP="ja_JP",i))(qu||{});const Yt={IDLE:"idle",BE_INVITED:"be-invited",DIALING_C2C:"dialing-c2c",DIALING_GROUP:"dialing-group",CALLING_C2C_AUDIO:"calling-c2c-audio",CALLING_C2C_VIDEO:"calling-c2c-video",CALLING_GROUP_AUDIO:"calling-group-audio",CALLING_GROUP_VIDEO:"calling-group-video"},Ju={unknown:0,audio:1,video:2};var $s=(i=>(i.EAR="ear",i.SPEAKER="speaker",i))($s||{}),qt=(i=>(i.MICROPHONE="microphone",i.CAMERA="camera",i.SPEAKER="speaker",i))(qt||{}),Xs=(i=>(i[i.FRONT=0]="FRONT",i[i.BACK=1]="BACK",i))(Xs||{}),oi=(i=>(i.Camera="camera",i.Microphone="microphone",i.SwitchCamera="switchCamera",i.InviteUser="inviteUser",i))(oi||{}),As=(i=>(i.Open="open",i.Close="close",i))(As||{}),Xn=(i=>(i.LOCAL="local",i.REMOTE="remote",i))(Xn||{}),zr=(i=>(i.LocalInLargeView="local",i.RemoteInLargeView="remote",i))(zr||{}),ys=(i=>(i[i.INVITE=1]="INVITE",i[i.CANCEL_INVITE=2]="CANCEL_INVITE",i[i.ACCEPT_INVITE=3]="ACCEPT_INVITE",i[i.REJECT_INVITE=4]="REJECT_INVITE",i[i.INVITE_TIMEOUT=5]="INVITE_TIMEOUT",i))(ys||{});const ql={SWITCH_TO_AUDIO_CALL_FAILED:60001,SWITCH_TO_VIDEO_CALL_FAILED:60002,MICROPHONE_UNAVAILABLE:60003,CAMERA_UNAVAILABLE:60004,BAN_DEVICE:60005,NOT_SUPPORTED_WEBRTC:60006,ERROR_BLACKLIST:20007},Xh={SWITCH_TO_AUDIO_CALL_FAILED:"switchToAudioCall-call-failed",SWITCH_TO_VIDEO_CALL_FAILED:"switchToVideoCall-call-failed",MICROPHONE_UNAVAILABLE:"microphone-unavailable",CAMERA_UNAVAILABLE:"camera-unavailable",BAN_DEVICE:"ban-device",NOT_SUPPORTED_WEBRTC:"not-supported-webrtc",ERROR_BLACKLIST:"blacklist-user-tips"};var Qu=(i=>(i[i.NORMAL=0]="NORMAL",i[i.RELEASE=1]="RELEASE",i[i.WARNING=2]="WARNING",i[i.ERROR=3]="ERROR",i[i.NONE=4]="NONE",i))(Qu||{});const Br={CALL_STATUS:"callStatus",CALL_ROLE:"callRole",CALL_MEDIA_TYPE:"callMediaType",LOCAL_USER_INFO:"localUserInfo",LOCAL_USER_INFO_EXCLUDE_VOLUMN:"localUserInfoExcludeVolume",REMOTE_USER_INFO_LIST:"remoteUserInfoList",REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST:"remoteUserInfoExcludeVolumeList",CALLER_USER_INFO:"callerUserInfo",IS_GROUP:"isGroup",CALL_DURATION:"callDuration",CALL_TIPS:"callTips",TOAST_INFO:"toastInfo",IS_MINIMIZED:"isMinimized",ENABLE_FLOAT_WINDOW:"enableFloatWindow",BIG_SCREEN_USER_ID:"bigScreenUserId",LANGUAGE:"language",IS_CLICKABLE:"isClickable",DISPLAY_MODE:"displayMode",VIDEO_RESOLUTION:"videoResolution",PUSHER:"pusher",PLAYER:"player",IS_EAR_PHONE:"isEarPhone",IS_MUTE_SPEAKER:"isMuteSpeaker",SHOW_PERMISSION_TIP:"SHOW_PERMISSION_TIP",NETWORK_STATUS:"NetWorkStatus",GROUP_ID:"groupID",ROOM_ID:"roomID",ROOM_ID_TYPE:"roomIdType",SHOW_SELECT_USER:"showSelectUser",IS_SHOW_ENABLE_VIRTUAL_BACKGROUND:"isShowEnableVirtualBackground",ENABLE_VIRTUAL_BACKGROUND:"enableVirtualBackground",GROUP_CALL_MEMBERS:"groupCallMembers",PUSHER_ID:"pusherId"},ep={INNER_ATTR_KIT_INFO:"inner_attr_kit_info"},tp={INITIAL_PUSHER:"initialPusher",NEW_PUSHER:"newPusher"},N=F(F(F({PREFIX:"【CallService】",AUDIO:"audio",VIDEO:"video",LOCAL_VIDEO:"localVideo",ERROR:"error",TIMEOUT:"timeout",RAF:"raf",INTERVAL:"interval",DEFAULT:"default",BOOLEAN:"boolean",STRING:"string",NUMBER:"number",OBJECT:"object",ARRAY:"array",FUNCTION:"function",UNDEFINED:"undefined",UNKNOWN:"unknown",ALL:"all",MYSELF:"myself",DEVICE_LIST:"deviceList",CAMERA_POSITION:"cameraPosition",CUSTOM_UI_CONFIG:"
1customUIConfig"},tp),Br),ep),np="https://web.sdk.qcloud.com/component/TUIKit/assets/call.png",ip="https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg",Jl=2147483647,sp=3,rp=4;var Ia=(i=>(i.MAC="mac",i.WIN="win",i))(Ia||{}),cl=(i=>(i[i.TUI_CALL_KIT=14]="TUI_CALL_KIT",i[i.TIM_CALL_KIT=15]="TIM_CALL_KIT",i))(cl||{}),Ea=(i=>(i[i.NUMBER_ROOM_ID=1]="NUMBER_ROOM_ID",i[i.STRING_ROOM_ID=2]="STRING_ROOM_ID",i))(Ea||{}),Zu={exports:{}};(function(i,e){(function(t,n){i.exports=n(Ah(),Sh)})(window,function(t,n){return function(s){var r={};function o(a){if(r[a])return r[a].exports;var l=r[a]={i:a,l:!1,exports:{}};return s[a].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=s,o.c=r,o.d=function(a,l,c){o.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:c})},o.r=function(a){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,l){if(1&l&&(a=o(a)),8&l||4&l&&typeof a=="object"&&a&&a.__esModule)return a;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:a}),2&l&&typeof a!="string")for(var u in a)o.d(c,u,function(f){return a[f]}.bind(null,u));return c},o.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(l,"a",l),l},o.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},o.p="",o(o.s=32)}([function(s,r,o){o.r(r),o.d(r,"mainUrl",function(){return c}),o.d(r,"backupUrl",function(){return u}),o.d(r,"Mode",function(){return f}),o.d(r,"Role",function(){return d}),o.d(r,"VIDEO_STAT_BIT",function(){return p}),o.d(r,"AUDIO_STAT_BIT",function(){return g}),o.d(r,"AUDIO_MUTE_BIT",function(){return h}),o.d(r,"VIDEO_MUTE_BIT",function(){return m}),o.d(r,"VIDEO_MUTED_MASK",function(){return y}),o.d(r,"AUX_VIDEO_MUTED_MASK",function(){return R}),o.d(r,"AUDIO_MUTED_MASK",function(){return I}),o.d(r,"MAIN_STREAM_MSID",function(){return T}),o.d(r,"AUX_STREAM_MSID",function(){return C}),o.d(r,"StreamType",function(){return _}),o.d(r,"TRTC_QUALITY_UNKNOWN",function(){return A}),o.d(r,"TRTC_QUALITY_EXCELLENT",function(){return L}),o.d(r,"TRTC_QUALITY_GOOD",function(){return E}),o.d(r,"TRTC_QUALITY_POOR",function(){return M}),o.d(r,"TRTC_QUALITY_BAD",function(){return B}),o.d(r,"TRTC_QUALITY_VBAD",function(){return b}),o.d(r,"TRTC_QUALITY_DISCONNECTED",function(){return k}),o.d(r,"DTLS_STATE_UNKNOWN",function(){return U}),o.d(r,"SuccessRate",function(){return O}),o.d(r,"MTA_API_PENDING",function(){return D}),o.d(r,"MTA_API_SUCCESS",function(){return J}),o.d(r,"ConnectionState",function(){return ee}),o.d(r,"UPLINK_RECONNECTION_COUNT",function(){return se}),o.d(r,"DOWNLINK_RECONNECTION_COUNT",function(){return ue}),o.d(r,"SIGNAL_RECONNECTION_COUNT",function(){return oe}),o.d(r,"KIBANA_EVENT",function(){return W}),o.d(r,"SIGNAL_PING_TIMEOUT",function(){return V}),o.d(r,"SIGNAL_PING_PONG_INTERVAL",function(){return S}),o.d(r,"INNER_EVENT",function(){return x}),o.d(r,"AI_NOISE_REDUCE_ASSETS_PATH",function(){return H}),o.d(r,"MAX_NUMBER_ROOM_ID",function(){return z}),o.d(r,"NAME",function(){return de}),o.d(r,"CUSTOM_STATUS_MAP",function(){return he}),o.d(r,"VIDEO_ENCODER_MAP",function(){return Te}),o.d(r,"CONSOLE_DOMESTIC",function(){return Oe}),o.d(r,"CONSOLE_FOREIGN",function(){return $}),o.d(r,"BUY_ADDRESS_DOMESTIC",function(){return Q}),o.d(r,"BUY_ADDRESS_FOREIGN",function(){return Ce}),o.d(r,"REGION_CHINA",function(){return Ie}),o.d(r,"REGION_SINGAPORE",function(){return _e}),o.d(r,"REGION_FRANKFURT",function(){return K}),o.d(r,"REGION_SEOUL",function(){return ce}),o.d(r,"REGION_BOMBAY",function(){return Le}),o.d(r,"REGION_SILICON",function(){return Ue});var a=o(6),l=o(14);const c="wss://qcloud.rtc.qq.com:8687",u="wss://bk.rtc.qq.com:8687",f={RTC:1,LIVE:2},d={HOST:20,AUDIENCE:21},p=1,g=8,h=64,m=16,y=1,R=2,I=4,T="5Y2wZK8nANNAoVw6dSAHVjNxrD1ObBM2kBPV",C="224d130c-7b5c-415b-aaa2-79c2eb5a6df2",_={NONE:0,AUDIO:1,MAIN:2,AUX:7},A=0,L=1,E=2,M=3,B=4,b=5,k=6,U="unknown",O={JOIN:"join",PUBLISH:"publish",UNPUBLISH:"unpublish",LOCAL_STREAM_INITIALIZE:"local_stream_initialize",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscibe",UPLINK_CONNECTION:"uplink_connection",UPLINK_RECONNECTION:"uplink_reconnection",DOWNLINK_CONNECTION:"downlink_connection",DOWNLINK_RECONNECTION:"downlink_reconnection",SIGNAL_CONNECTION:"signal_connection",SIGNAL_RECONNECTION:"signal_reconnection",UPDATE_STREAM:"update_stream"},D="pending",J="success",ee={CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected"},se=30,ue=30,oe=30,W={SDK_CONSTRUCT:"sdkConstruct",SDK_LOGIN:"sdkLogin",DELTA_JOIN:"delta-join",REJOIN:"rejoin",LEAVE:"leave",DELTA_LEAVE:"delta-leave",PUBLISH:"publish",DELTA_PUBLISH:"delta-publish",UNPUBLISH:"unpublish",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",UPLINK_CONNECTION:"uplink-connection",UPLINK_RECONNECTION:"uplink-reconnection",DOWNLINK_CONNECTION:"downlink-connection",DOWNLINK_RECONNECTION:"downlink-reconnection",ON_TRACK:"ontrack",SET_LOCAL_DESCRIPTION:"setLocalDescription",SET_REMOTE_DESCRIPTION:"setRemoteDescription",ICE_CONNECTION_STATE:"iceConnectionState",LOCAL_STREAM_INITIALIZE:"stream-initialize",SIGNAL_CONNECTION:"websocketConnectionState",SIGNAL_RECONNECTION:"websocketReconnectionState",UPDATE_STREAM:"update-stream",RECOVER_SUBSCRIPTION:"recover-subscription"}
1,V=6e3,S=1e4,x={SET_REMOTE_OFFER_FINISHED:"set-remote-offer-finished"},H="https://web.sdk.qcloud.com/trtc/webrtc/download/aiNoiseReduce/",z=2147483647,de={DEFAULT:"default",BOOLEAN:"boolean",STRING:"string",NUMBER:"number",OBJECT:"object",ARRAY:"array",FUNCTION:"function",FILE:"file",MAP:"map",SET:"set",UNDEFINED:"undefined",VIDEO:"video",AUDIO:"audio",ON_ERROR:"onError",MAIN:"main",RTC:"rtc",LIVE:"live",SMALL:"small",BIG:"big",AUXILIARY:"auxiliary",INVITER:"inviter",INVITEE:"invitee",VIDEO_INPUT:"videoinput",AUDIO_INPUT:"audioinput",LOCAL:"local",REMOTE:"remote",TRTC:"TRTC",WEB:"web",NORMAL:"normal",REJECT:"reject",IGNORE:"ignore",TIMEOUT:"timeout",RIC:"ric",RAF:"raf",INTERVAL:"interval",CANCEL:"cancel",BUSYLINE:"busyline",UNKNOWN:"unknown",SINGLE_CALL:"SingleCall",GROUP_CALL:"groupCall",CALLER:"caller",CALLEE:"callee",COVER:"cover",CONTAIN:"contain",FILL:"fill",AV_CALL:"av_call",CALLKIT_RECORDS_SVR:"callkit_records_svr",SINGLE:"single",GROUP:"group",START_CALL:"start_call",RECEIVE_CALL:"receive_call",CALL_ACCEPTED:"call_accepted",ACCEPT_CALL:"accept_call",CALL_MISSED:"call_missed",NOT_ANSWER_CALL:"not_answer_call",CALL_REJECTED:"call_rejected",REJECT_CALL:"reject_call",CALL_BUSY:"call_busy",IGNORE_CALL:"ignore_call",CANCEL_CALL:"cancel_call",CALL_CANCELED:"call_canceled",CALL_FAILED:"call_failed",CALL_END:"call_end",CALL_INTERRUPTED:"call_interrupted",INVITE_USER:"invite_user",JOIN_IN_GROUP_CALL:"join_in_group_call",EVENT_REPORT:"event_report",HEART_BEAT:"heartbeat",CALLING:"calling",BANNED:"banned",WAITING:"waiting",CONNECTED:"connected",MICROPHONE:"microphone",CAMERA:"camera",MICROPHONES:"microphones",SPEAKER:"speaker",ENABLE_VIRTUAL_BACKGROUND:"enableVirtualBackground",BLUR:"blur",IMAGE:"image"},he={"":a.CALL_STATUS.IDLE,call_wait:a.CALL_STATUS.CALLING,call_accept:a.CALL_STATUS.CONNECTED},Te={"480p":{videoResolution:l.TRTCVideoResolution.TRTCVideoResolution_640_480,videoFps:15,videoBitrate:900},"720p":{videoResolution:l.TRTCVideoResolution.TRTCVideoResolution_1280_720,videoFps:15,videoBitrate:1500},"1080p":{videoResolution:l.TRTCVideoResolution.TRTCVideoResolution_1920_1080,videoFps:15,videoBitrate:2e3}},Oe="https://console.cloud.tencent.com/im/detail",$="https://console.intl.cloud.tencent.com/im/detail",Q="https://buy.cloud.tencent.com/avc?addRavLicense=1",Ce="https://buy.tencentcloud.com/avc?addRavLicense=1",Ie=1,_e=9,K=17,ce=18,Le=21,Ue=15},function(s,r,o){o.r(r),o.d(r,"isMap",function(){return u}),o.d(r,"isSet",function(){return f}),o.d(r,"isFile",function(){return d}),o.d(r,"isNumber",function(){return p}),o.d(r,"isString",function(){return g}),o.d(r,"isObject",function(){return h}),o.d(r,"isBoolean",function(){return m}),o.d(r,"isPlainObject",function(){return y}),o.d(r,"isArray",function(){return R}),o.d(r,"isUndefined",function(){return I}),o.d(r,"isNativeClass",function(){return C}),o.d(r,"isArrayOrObject",function(){return _}),o.d(r,"isFunction",function(){return A}),o.d(r,"isInstanceOfError",function(){return L}),o.d(r,"getType",function(){return E}),o.d(r,"TimeUtil",function(){return B}),o.d(r,"stringifyError",function(){return b}),o.d(r,"map2String",function(){return k}),o.d(r,"randomString",function(){return D}),o.d(r,"isValidType",function(){return J}),o.d(r,"mapKeys",function(){return ee}),o.d(r,"mapValues",function(){return se}),o.d(r,"generateRandomRoomID",function(){return ue}),o.d(r,"analyzeRoomId",function(){return oe}),o.d(r,"formatDuration",function(){return V}),o.d(r,"compareVersion",function(){return S}),o.d(r,"date2ISOString",function(){return x}),o.d(r,"getHostType",function(){return H}),o.d(r,"isCallSignaling",function(){return z}),o.d(r,"performanceNow",function(){return de}),o.d(r,"isDomesticSDKAppID",function(){return he}),o.d(r,"getPurchaseAddress",function(){return Te}),o.d(r,"getRegionId",function(){return Oe}),o.d(r,"timeoutForFun",function(){return $}),o.d(r,"analyzeVideoRenderParams",function(){return Q}),o.d(r,"getValueType",function(){return Ce}),o.d(r,"safelyParse",function(){return Ie}),o.d(r,"generateRandomString",function(){return _e});var a=o(5),l=o(9),c=o(0);const u=function(K){return E(K)===c.NAME.MAP},f=function(K){return E(K)===c.NAME.SET},d=function(K){return E(K)===c.NAME.FILE},p=function(K){return K!==null&&(typeof K===c.NAME.NUMBER&&!isNaN(K-0)||typeof K===c.NAME.OBJECT&&K.c
1onstructor===Number)},g=function(K){return typeof K===c.NAME.STRING},h=function(K){return K!==null&&typeof K===c.NAME.OBJECT},m=function(K){return typeof K===c.NAME.BOOLEAN},y=function(K){if(typeof K!==c.NAME.OBJECT||K===null)return!1;const ce=Object.getPrototypeOf(K);if(ce===null)return!0;let Le=ce;for(;Object.getPrototypeOf(Le)!==null;)Le=Object.getPrototypeOf(Le);return ce===Le},R=function(K){return typeof Array.isArray===c.NAME.FUNCTION?Array.isArray(K):E(K)===c.NAME.ARRAY},I=function(K){return typeof K===c.NAME.UNDEFINED},T=/^class\s/,C=function(K){return typeof K===c.NAME.FUNCTION&&T.test(K.toString())},_=function(K){return R(K)||h(K)},A=function(K){return typeof K===c.NAME.FUNCTION},L=function(K){return K instanceof Error},E=function(K){return Object.prototype.toString.call(K).match(/^\[object (.*)\]$/)[1].toLowerCase()};let M=0;Date.now||(Date.now=function(){return new Date().getTime()});const B={now(){M===0&&(M=Date.now()-1);const K=Date.now()-M;return K>4294967295?(M+=4294967295,Date.now()-M):K},utc:()=>Math.round(Date.now()/1e3)},b=function(K){return JSON.stringify(K,["message","code"])},k=function(K){if(!u(K))return"not a map!!!";let ce="";for(const[Le,Ue]of K.entries()){if(u(Ue))return`[k=${Le} -> ${k(Ue)}`;ce+=`[k=${Le} v=${Ue}] `}return ce},U="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",O=U.length,D=function(){let K="";for(let ce=32;ce>0;--ce)K+=U[Math.floor(Math.random()*O)];return K},J=function(K,ce){for(const Le in K)if(K[Le]===ce)return!0;return!1};function ee(K,ce){const Le={};return Object.keys(K).forEach(Ue=>{Le[ce(K[Ue],Ue)]=K[Ue]}),Le}function se(K,ce){const Le={};return Object.keys(K).forEach(Ue=>{Le[Ue]=ce(K[Ue],Ue)}),Le}function ue(){return Math.round(1e8*Math.random())}function oe(K,ce){return p(K)&&K>0?K:K===0&&ce?ce:ue()}function W(K){return K<10?"0"+K:K}function V(K){if(K<60)return"00:00:"+W(K);if(K<3600){const te=parseInt(K/60),De=K-60*te;return`00:${W(te)}:${W(De)}`}const ce=parseInt(K/3600),Le=K-3600*ce,Ue=parseInt(Le/60),St=Le-60*Ue;return`${W(ce)}:${W(Ue)}:${W(St)}`}function S(K,ce){K=K.split("."),ce=ce.split(".");const Le=Math.max(K.length,ce.length);for(;K.length<Le;)K.push("0");for(;ce.length<Le;)ce.push("0");for(let Ue=0;Ue<Le;Ue++){const St=parseInt(K[Ue]),te=parseInt(ce[Ue]);if(St>te)return 1;if(St<te)return-1}return 0}const x=function(){const K=new Date,ce=K.toISOString(),Le=K.getTimezoneOffset()/60;let Ue="";return Ue=Le<0?Le>-10?"+0"+Math.abs(100*Le):"+"+Math.abs(100*Le):Le>=10?"-"+100*Le:"-0"+100*Le,ce.replace("Z",Ue)};function H(){let K="unknown";return a.IS_MAC&&(K="mac"),a.IS_WIN&&(K="windows"),a.IS_IOS&&(K="ios"),a.IS_ANDROID&&(K="android"),K}function z(K){return K===c.NAME.AV_CALL}function de(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function he(K){const ce=String(K);return ce.startsWith("14")||ce.startsWith("16")||ce.startsWith("17")}function Te(K){return`${he(K)?c.BUY_ADDRESS_DOMESTIC:c.BUY_ADDRESS_FOREIGN}&position=${K}&regionId=${Oe(K)}`}function Oe(K){return K>=2e7&&K<3e7||K>=172e7&&K<173e7?c.REGION_SINGAPORE:K>=3e7&&K<4e7||K>=173e7&&K<174e7?c.REGION_SEOUL:K>=4e7&&K<5e7||K>=174e7&&K<175e7?c.REGION_FRANKFURT:K>=5e7&&K<6e7||K>=175e7&&K<176e7?c.REGION_BOMBAY:K>=7e7&&K<8e7||K>=177e7&&K<178e7?c.REGION_SILICON:c.REGION_CHINA}function $(K,ce){return ye(this,null,function*(){return Promise.race([K(),new Promise((Le,Ue)=>{setTimeout(()=>{Le()},ce)})])})}function Q(K){const ce={};return K.rotation&&(ce.rotation=K.rotation),K.objectFit&&(K.objectFit===c.NAME.COVER?ce.fillMode=l.TRTCVideoFillMode.TRTCVideoFillMode_Fill:ce.fillMode=l.TRTCVideoFillMode.TRTCVideoFillMode_Fit),m(K.mirror)&&(ce.mirrorType=K.mirror?l.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable:l.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable),ce}function Ce(K){return Reflect.apply(Object.prototype.toString,K,[]).replace(/^\[object\s(\w+)\]$/,"$1").toLowerCase()}function Ie(K){if(typeof K!="string")return K;let ce;try{const Le=JSON.parse(K);ce=typeof Le=="object"&&Le?Le:K}catch(Le){ce=K}return ce}function _e(K){K=K||32;const ce="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";let Le="";for(let Ue=0;Ue<K;Ue++)Le+=ce.charAt(Math.floor(Math.random()*ce.length));return Le}},function(s,r,o){o.r(r),o.d(r,"LOGLEVEL_INFO",function(){return u});var a=o(4),l=o(1),c=o(5);const u=1;let f=0;const d=new Map,p="%cCallEngine%c%s",g="padding: 1px 4px;border-radius: 3px;color: #fff;background: #444;",h="display: inline",m=!(c.IS_IOS||c.IS_ANDROID||c.IS_HEADLESS_CHROME);function y(){const I=new Date;return`[${I.toLocaleTimeString("en-US",{hour12:!1})}.${function(T){let C;switch(T.toString().length){case 1:C="00"+T;break;case 2:C="0"+T;break;default:C=T}return C}(I.getMilliseconds())}]`}const R={_data:[],_length:0,_visible:!1,arguments2String(I,T){let C;if(T.length===1)C=`${y()} <${I}> ${T[0]}`;else{C=`${y()} <${I}> `;for(let _=0,{length:A}=T;_<A;_++)Object(l.isArrayOrObject)(T[_])?Object(l.isInstanceOfError)(T[_])?C+=Object(l.stringifyError)(T[_]):C+=JSON.stringify(T[_]):C+=T[_],C+=" "}return C},debug(){if(f<=-1){const I=this.arguments2String("DEBUG",arguments);R.record(I,"debug"),m?a.a.debug(p,g,h,I):a.a.debug(I)}},log(){if(f<=0){const I=this.arguments2String("LOG",arguments);R.record(I,"log"),m?a.a.log(p,g,h,I):a.a.log(I)}},info(){if(f<=u){const I=this.arguments2String("INFO",arguments);R.record(I,"info"),m?a.a.info(p,g,h,I):a.a.info(I)}},warn(){if(f<=2){const I=this.arguments2String("WARN",arguments);R.record(I,"warn"),m?a.a.warn(p,g,h,I):a.a.warn(I)}},error(){if(f<=3){const I=this.arguments2String("ERROR",arguments);R.record(I,"error"),m?a.a.error(p,g,h,I):a.a.error(I)}},time(I){d.set(I,l.TimeUtil.now())}
1,timeEnd(I){if(d.has(I)){const T=l.TimeUtil.now()-d.get(I);return d.delete(I),T}return a.a.warn(`未找到对应label: ${I}, 请在调用 logger.timeEnd 前,调用 logger.time`),0},setLevel(I){I<4&&a.a.log(`${y()}set level from ${f} to ${I}`),f=I},getLevel:()=>f,record(I,T){R._length===1100&&(R._data.splice(0,100),R._length=1e3),R._length++,R._data.push(`${I} [${T}] 
2`)},getLog:()=>R._data};r.default=R},function(s,r,o){var a=o(21),l=Object.prototype.toString;function c(h){return l.call(h)==="[object Array]"}function u(h){return h===void 0}function f(h){return h!==null&&typeof h=="object"}function d(h){if(l.call(h)!=="[object Object]")return!1;var m=Object.getPrototypeOf(h);return m===null||m===Object.prototype}function p(h){return l.call(h)==="[object Function]"}function g(h,m){if(h!=null)if(typeof h!="object"&&(h=[h]),c(h))for(var y=0,R=h.length;y<R;y++)m.call(null,h[y],y,h);else for(var I in h)Object.prototype.hasOwnProperty.call(h,I)&&m.call(null,h[I],I,h)}s.exports={isArray:c,isArrayBuffer:function(h){return l.call(h)==="[object ArrayBuffer]"},isBuffer:function(h){return h!==null&&!u(h)&&h.constructor!==null&&!u(h.constructor)&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)},isFormData:function(h){return typeof FormData!="undefined"&&h instanceof FormData},isArrayBufferView:function(h){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(h):h&&h.buffer&&h.buffer instanceof ArrayBuffer},isString:function(h){return typeof h=="string"},isNumber:function(h){return typeof h=="number"},isObject:f,isPlainObject:d,isUndefined:u,isDate:function(h){return l.call(h)==="[object Date]"},isFile:function(h){return l.call(h)==="[object File]"},isBlob:function(h){return l.call(h)==="[object Blob]"},isFunction:p,isStream:function(h){return f(h)&&p(h.pipe)},isURLSearchParams:function(h){return typeof URLSearchParams!="undefined"&&h instanceof URLSearchParams},isStandardBrowserEnv:function(){return(typeof navigator=="undefined"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window!="undefined"&&typeof document!="undefined"},forEach:g,merge:function h(){var m={};function y(T,C){d(m[C])&&d(T)?m[C]=h(m[C],T):d(T)?m[C]=h({},T):c(T)?m[C]=T.slice():m[C]=T}for(var R=0,I=arguments.length;R<I;R++)g(arguments[R],y);return m},extend:function(h,m,y){return g(m,function(R,I){h[I]=y&&typeof R=="function"?a(R,y):R}),h},trim:function(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")},stripBOM:function(h){return h.charCodeAt(0)===65279&&(h=h.slice(1)),h}}},function(s,r,o){(function(a){let l,c;l=typeof console!="undefined"?console:a!==void 0&&a.console?a.console:typeof window!="undefined"&&window.console?window.console:{};const u=function(){},f=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];let{length:d}=f;for(;d--;)c=f[d],console[c]||(l[c]=u);l.methods=f,r.a=l}).call(this,o(36))},function(s,r,o){o.r(r),o.d(r,"IN_Browser",function(){return a}),o.d(r,"IN_WXMiniProgram",function(){return l}),o.d(r,"USER_AGENT",function(){return c}),o.d(r,"IS_IPAD",function(){return d}),o.d(r,"IS_IPHONE",function(){return p}),o.d(r,"IS_IPOD",function(){return g}),o.d(r,"IS_IOS",function(){return h}),o.d(r,"IOS_VERSION",function(){return m}),o.d(r,"IS_ANDROID",function(){return y}),o.d(r,"ANDROID_VERSION",function(){return R}),o.d(r,"IS_OLD_ANDROID",function(){return I}),o.d(r,"IS_NATIVE_ANDROID",function(){return T}),o.d(r,"IS_FIREFOX",function(){return C}),o.d(r,"FIREFOX_VERSION",function(){return _}),o.d(r,"IS_EDGE",function(){return A}),o.d(r,"EDGE_VERSION",function(){return L}),o.d(r,"IS_EDG",function(){return E}),o.d(r,"EDG_VERSION",function(){return M}),o.d(r,"IS_CHROME",function(){return B}),o.d(r,"CHROME_MAJOR_VERSION",function(){return b}),o.d(r,"CHROME_VERSION",function(){return k}),o.d(r,"IS_IE8",function(){return U}),o.d(r,"IE_VERSION",function(){return O}),o.d(r,"IS_SAFARI",function(){return D}),o.d(r,"IS_ANY_SAFARI",function(){return J}),o.d(r,"SAFARI_VERSION",function(){return ee}),o.d(r,"IS_TBS",function(){return se}),o.d(r,"TBS_VERSION",function(){return ue}),o.d(r,"IS_X5MQQB",function(){return oe}),o.d(r,"IS_MQQB",function(){return W}),o.d(r,"MQQB_VERSION",function(){return V}),o.d(r,"IS_QQB",function(){return S}),o.d(r,"IS_WECHAT",function(){return x}),o.d(r,"WECHAT_VERSION",function(){return H}),o.d(r,"IS_WIN",function(){return z}),o.d(r,"IS_MAC",function(){return de}),o.d(r,"IS_LINUX",function(){return he}),o.d(r,"IS_WX",function(){return Te}),o.d(r,"IS_UCBROWSER",function(){return Oe}),o.d(r,"IS_MIUIBROWSER",function(){return $}),o.d(r,"IS_HUAWEIBROWSER",function(){return Q}),o.d(r,"HUAWEI_VERSION",function(){return Ce}),o.d(r,"BROWSER_VERSION",function(){return Ie}),o.d(r,"IS_LOCAL",function(){return _e}),o.d(r,"IS_HEADLESS_CHROME",function(){return K}),o.d(r,"getBrowserInfo",function(){return Le}),o.d(r,"getOsInfo",function(){return Ue}),o.d(r,"isMobile",function(){return St});const a=typeof window!="undefined",l=typeof wx!="undefined",c=window.navigator&&window.navigator.userAgent||"",u=/AppleWeb
2Kit\/([\d.]+)/i.exec(c),f=u?parseFloat(u.pop()):null,d=/iPad/i.test(c),p=/iPhone/i.test(c)&&!d,g=/iPod/i.test(c),h=p||d||g,m=function(){const te=c.match(/OS (\d+)_/i);return te&&te[1]?te[1]:null}(),y=/Android/i.test(c),R=function(){const te=c.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!te)return null;const De=te[1]&&parseFloat(te[1]),ut=te[2]&&parseFloat(te[2]);return De&&ut?parseFloat(`${te[1]}.${te[2]}`):De||null}(),I=y&&/webkit/i.test(c)&&R<2.3,T=y&&R<5&&f<537,C=/Firefox/i.test(c),_=function(){const te=c.match(/Firefox\/(\d+)/);return te&&te[1]?parseFloat(te[1]):null}(),A=/Edge\//i.test(c),L=A&&function(){const te=c.match(/Edge\/(\d+)/i);if(te&&te[1])return te[1]}(),E=/Edg\//i.test(c),M=function(){const te=c.match(/Edg\/(\d+)/);return te&&te[1]?parseFloat(te[1]):null}(),B=!A&&/Chrome/i.test(c),b=function(){const te=c.match(/Chrome\/(\d+)/);return te&&te[1]?parseFloat(te[1]):null}(),k=function(){const te=c.match(/Chrome\/([\d.]+)/);return te&&te[1]?te[1]:null}(),U=/MSIE\s8\.0/.test(c),O=function(){const te=/MSIE\s(\d+)\.\d/.exec(c);let De=te&&parseFloat(te[1]);return!De&&/Trident\/7.0/i.test(c)&&/rv:11.0/.test(c)&&(De=11),De}(),D=/Safari/i.test(c)&&!B&&!y&&!A,J=D||h,ee=function(){const te=c.match(/Version\/([\d.]+)/);return te&&te[1]?te[1]:null}(),se=/TBS\/\d+/i.test(c),ue=function(){const te=c.match(/TBS\/(\d+)/i);if(te&&te[1])return te[1]}(),oe=!se&&/MQQBrowser\/\d+/i.test(c)&&/COVC\/\d+/i.test(c),W=!se&&/MQQBrowser\/\d+/i.test(c),V=(W||oe)&&function(){const te=c.match(/ MQQBrowser\/([\d.]+)/);return te&&te[1]?te[1]:null}(),S=!se&&/ QQBrowser\/\d+/i.test(c),x=/(micromessenger|webbrowser)/i.test(c),H=x&&function(){const te=c.match(/MicroMessenger\/(\d+)/i);if(te&&te[1])return te[1]}(),z=/Windows/i.test(c),de=/MAC OS X/i.test(c),he=/Linux/i.test(c),Te=/MicroMessenger/i.test(c),Oe=/UCBrowser/i.test(c),$=/MiuiBrowser/i.test(c),Q=/HuaweiBrowser/i.test(c),Ce=Q&&function(){const te=c.match(/HuaweiBrowser\/([\d.]+)/);return te&&te[1]?te[1]:null}(),Ie=B?"Chrome/"+k:D?"Safari/"+ee:"NotSupportedBrowser",_e=location.protocol==="file:"||location.hostname==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname),K=new RegExp("HeadlessChrome","i").test(c),ce=new Map([[C,["Firefox",_]],[E,["Edg",M]],[B,["Chrome",k]],[D,["Safari",ee]],[se,["TBS",ue]],[x&&p,["WeChat",H]],[W,["QQ(Mobile)",V]],[oe,["QQ(Mobile X5)",V]],[Q,["HW",Ce]],[A,["EDGE",L]]]);function Le(){let te="unknown",De="unknown";return ce.get(!0)&&(te=ce.get(!0)[0],De=ce.get(!0)[1]),{name:te,version:De}}function Ue(){let te="unknown";return de&&(te="mac"),z&&(te="windows"),y&&(te="android"),h&&(te="iOS"),{name:te}}function St(){return y||p||d}},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.USER_CUSTOM_STATUS=r.CALL_EXPERMENTEL_API_TYPE=r.LOG_LEVEL=r.MODE_TYPE=r.VALID_VIDEO_PROFILE_LIST=r.BUSINESS_ID=r.ACTION_TYPE=r.CALL_ROLE=r.CALL_STATUS=r.CMD_TYPE=r.CMD_TYPE_LIST=r.CALL_TYPE=r.IOSOfflinePushType=void 0;var a=o(12);(function(l){l[l.APNs=0]="APNs",l[l.VoIP=1]="VoIP"})(r.IOSOfflinePushType||(r.IOSOfflinePushType={})),function(l){l[l.UNKNOWN=0]="UNKNOWN",l[l.AUDIO_CALL=1]="AUDIO_CALL",l[l.VIDEO_CALL=2]="VIDEO_CALL"}(r.CALL_TYPE||(r.CALL_TYPE={})),r.CMD_TYPE_LIST=["","audioCall","videoCall"],function(l){l.AUDIO_CALL="audioCall",l.VIDEO_CALL="videoCall",l.HANG_UP="hangup",l.SWITCH_TO_AUDIO="switchToAudio",l.SWITCH_TO_AUDIO_CALL="switch_to_audio_call",l.SWITCH_TO_VIDEO="switchToVideo"}(r.CMD_TYPE||(r.CMD_TYPE={})),function(l){l.IDLE="idle",l.CALLING="calling",l.CONNECTED="connected"}(r.CALL_STATUS||(r.CALL_STATUS={})),function(l){l.UNKNOWN="",l.INVITER="inviter",l.INVITEE="invitee"}(r.CALL_ROLE||(r.CALL_ROLE={})),function(l){l[l.INVITE=1]="INVITE",l[l.CANCEL_INVITE=2]="CANCEL_INVITE",l[l.ACCEPT_INVITE=3]="ACCEPT_INVITE",l[l.REJECT_INVITE=4]="REJECT_INVITE",l[l.INVITE_TIMEOUT=5]="INVITE_TIMEOUT"}(r.ACTION_TYPE||(r.ACTION_TYPE={})),function(l){l[l.SIGNAL=1]="SIGNAL"}(r.BUSINESS_ID||(r.BUSINESS_ID={})),r.VALID_VIDEO_PROFILE_LIST=Object.keys(a.TUICommonDefine.VideoEncoderParams),function(l){l.AUDIO="audio",l.VIDEO="video"}(r.MODE_TYPE||(r.MODE_TYPE={})),function(l){l[l.NORMAL=0]="NORMAL",l[l.RELEASE=1]="RELEASE",l[l.WARNING=2]="WARNING",l[l.E
2RROR=3]="ERROR",l[l.NONE=4]="NONE"}(r.LOG_LEVEL||(r.LOG_LEVEL={})),function(l){l[l.BASE=Math.pow(2,16)]="BASE",l[l.PRO=Math.pow(2,17)]="PRO",l[l.ULTIMATE=Math.pow(2,18)]="ULTIMATE"}(r.CALL_EXPERMENTEL_API_TYPE||(r.CALL_EXPERMENTEL_API_TYPE={})),function(l){l.NULL="",l.CALLING_USER_CUSTOM_STATUS_CALL_WAIT="call_wait",l.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT="call_accept"}(r.USER_CUSTOM_STATUS||(r.USER_CUSTOM_STATUS={}))},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorCodeDictionary=void 0,function(a){a[a.UNKNOWN=65535]="UNKNOWN",a[a.NO_NETWORK=2805]="NO_NETWORK",a[a.FAILURE_SWITCH_TO_AUDIO=60001]="FAILURE_SWITCH_TO_AUDIO",a[a.FAILURE_SWITCH_TO_VIDEO=60002]="FAILURE_SWITCH_TO_VIDEO",a[a.NOT_MICROPHONE_LIST=60003]="NOT_MICROPHONE_LIST",a[a.NOT_CAMERA_LIST=60004]="NOT_CAMERA_LIST",a[a.NOT_SUPPORT=60006]="NOT_SUPPORT",a[a.ERROR_PACKAGE_NOT_PURCHASED=-1001]="ERROR_PACKAGE_NOT_PURCHASED",a[a.ERROR_PACKAGE_NOT_SUPPORTED=-1002]="ERROR_PACKAGE_NOT_SUPPORTED",a[a.ERROR_TIM_VERSION_OUTDATED=-1003]="ERROR_TIM_VERSION_OUTDATED",a[a.ERROR_PERMISSION_DENIED=-1101]="ERROR_PERMISSION_DENIED",a[a.ERROR_GET_DEVICE_LIST_FAIL=-1102]="ERROR_GET_DEVICE_LIST_FAIL",a[a.ERROR_INIT_FAIL=-1201]="ERROR_INIT_FAIL",a[a.ERROR_PARAM_INVALID=-1202]="ERROR_PARAM_INVALID",a[a.ERROR_REQUEST_REFUSED=-1203]="ERROR_REQUEST_REFUSED",a[a.ERROR_REQUEST_REPEATED=-1204]="ERROR_REQUEST_REPEATED",a[a.ERROR_SCENE_NOT_SUPPORTED=-1205]="ERROR_SCENE_NOT_SUPPORTED",a[a.INVALID_PARAMETER_REQUIRED=-120200]="INVALID_PARAMETER_REQUIRED",a[a.INVALID_PARAMETER_TYPE=-120201]="INVALID_PARAMETER_TYPE",a[a.INVALID_PARAMETER_EMPTY=-120202]="INVALID_PARAMETER_EMPTY",a[a.INVALID_PARAMETER_RANGE=-120203]="INVALID_PARAMETER_RANGE",a[a.ERROR_SIGNALING_SEND_FAIL=-1401]="ERROR_SIGNALING_SEND_FAIL",a[a.ERROR_INVALID_INVITEID=8010]="ERROR_INVALID_INVITEID",a[a.ERROR_INVALID_SEND_FAIL=8021]="ERROR_INVALID_SEND_FAIL",a[a.ERROR_HTTP=3e4]="ERROR_HTTP",a[a.ERROR_BLACKLIST=20007]="ERROR_BLACKLIST"}(r.ErrorCodeDictionary||(r.ErrorCodeDictionary={})),r.default={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,NOT_MICROPHONE_LIST:60003,NOT_CAMERA_LIST:60004,NOT_SUPPORT:60006,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,INVALID_PARAMETER_REQUIRED:-120200,INVALID_PARAMETER_TYPE:-120201,INVALID_PARAMETER_EMPTY:-120202,INVALID_PARAMETER_RANGE:-120203,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:8021,ERROR_HTTP:3e4,ERROR_BLACKLIST:20007}},function(s,r,o){var a;a=()=>(()=>{var l={902:function(d,p,g){var h=this&&this.__assign||function(){return(h=Object.assign||function(O){for(var D,J=1,ee=arguments.length;J<ee;J++)for(var se in D=arguments[J])Object.prototype.hasOwnProperty.call(D,se)&&(O[se]=D[se]);return O}).apply(this,arguments)},m=this&&this.__awaiter||function(O,D,J,ee){return new(J||(J=Promise))(function(se,ue){function oe(S){try{V(ee.next(S))}catch(x){ue(x)}}function W(S){try{V(ee.throw(S))}catch(x){ue(x)}}function V(S){var x;S.done?se(S.value):(x=S.value,x instanceof J?x:new J(function(H){H(x)})).then(oe,W)}V((ee=ee.apply(O,D||[])).next())})},y=this&&this.__generator||function(O,D){var J,ee,se,ue,oe={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return ue={next:W(0),throw:W(1),return:W(2)},typeof Symbol=="function"&&(ue[Symbol.iterator]=function(){return this}),ue;function W(V){return function(S){return function(x){if(J)throw new TypeError("Generator is already executing.");for(;ue&&(ue=0,x[0]&&(oe=0)),oe;)try{if(J=1,ee&&(se=2&x[0]?ee.return:x[0]?ee.throw||((se=ee.return)&&se.call(ee),0):ee.next)&&!(se=se.call(ee,x[1])).done)return se;switch(ee=0,se&&(x=[2&x[0],se.value]),x[0]){case 0:case 1:se=x;break;case 4:return oe.label++,{value:x[1],done:!1};case 5:oe.label++,ee=x[1],x=[0];continue;case 7:x=oe.ops.pop(),oe.trys.pop();continue;
2default:if(!((se=(se=oe.trys).length>0&&se[se.length-1])||x[0]!==6&&x[0]!==2)){oe=0;continue}if(x[0]===3&&(!se||x[1]>se[0]&&x[1]<se[3])){oe.label=x[1];break}if(x[0]===6&&oe.label<se[1]){oe.label=se[1],se=x;break}if(se&&oe.label<se[2]){oe.label=se[2],oe.ops.push(x);break}se[2]&&oe.ops.pop(),oe.trys.pop();continue}x=D.call(O,oe)}catch(H){x=[6,H],ee=0}finally{J=se=0}if(5&x[0])throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}([V,S])}}};Object.defineProperty(p,"__esModule",{value:!0});var R,I=g(266),T=g(466),C=g(402),_=g(882),A=g(271),L=g(884),E=g(900),M=g(172);(function(O){O[O.DEBUG=0]="DEBUG",O[O.INFO=1]="INFO",O[O.WARING=2]="WARING",O[O.ERROR=3]="ERROR"})(R||(R={}));var B={metric:!0,context:!0},b=function(O,D,J){return J===void 0&&(J=0),(0,I.isPlainObject)(O)?((0,I.isPlainObject)(D)&&Object.keys(D).forEach(function(ee){var se=O[ee],ue=D[ee];O[ee]=B[ee]&&J===0?b(se,ue,1):ue}),O):(0,I.isPlainObject)(D)?D:{}},k={clsConfig:{endpoint:"",topicId:""}},U=function(){function O(D){var J=this;this.url="",this.uploadChannel="",this.sendClsPipe=null,this.sendEsPipe=null,this._logLevel=R.INFO,this._getReportDataList=[],this._blacklist=[];var ee=D||k,se=ee.clsConfig,ue=ee.esConfig,oe=se.endpoint,W=se.topicId;this.esConfig=ue,this.endpoint=oe,this.topicId=W;var V=this.buildUploadUrl();this.url=V,this.initPageUnloadMonitor(),V&&(this.sendClsPipe=(0,C.createPipeline)([(0,E.filterSdkappIdPipe)(this),(0,L.createThrottlePipe)(this,5),(0,_.formatClsLog)(),(0,A.limitLengthPipe)(),function(S){return m(J,void 0,void 0,function(){var x,H,z=this;return y(this,function(de){return x=0,(H=function(){return m(z,void 0,void 0,function(){var he;return y(this,function(Te){switch(Te.label){case 0:return Te.trys.push([0,2,,3]),[4,this.send({url:V,data:S})];case 1:return Te.sent(),[3,3];case 2:return he=Te.sent(),x<=2&&(x++,setTimeout(function(){H()},1e3)),[3,3];case 3:return[2]}})})})(),[2]})})}])),this.updateBlacklist()}return O.prototype.initPageUnloadMonitor=function(){var D=this,J=this;!(0,I.isMiniProgram)()&&document&&typeof document.addEventListener=="function"&&document.addEventListener("visibilitychange",function(){if(document.visibilityState==="hidden"){var ee=D.getCommonReportData(),se=b(ee,{level:R.WARING,method:"PAGE_UNLOAD",type:"event"});if(J.esConfig)try{var ue=J.esConfig,oe=ue.url,W=ue.table;(0,C.createPipeline)([(0,E.filterSdkappIdPipe)(J),(0,L.createThrottlePipe)(J,1),(0,_.formatESLog)({table:W}),(0,A.limitLengthPipe)(),function(V){return m(D,void 0,void 0,function(){var S;return y(this,function(x){try{S=new Blob([JSON.stringify(V)],{type:"application/x-www-form-urlencoded"}),navigator==null||navigator.sendBeacon(oe,S)}catch(H){}return[2]})})}])(se)}catch(V){}}})},O.prototype.updateEsConfig=function(D){var J=this;try{if(D){this.esConfig=D;var ee=D.url,se=D.table;ee&&se&&(this.uploadChannel=ee,this.sendEsPipe=(0,C.createPipeline)([(0,E.filterSdkappIdPipe)(this),(0,L.createThrottlePipe)(this,5),(0,_.formatESLog)({table:se}),(0,A.limitLengthPipe)(),function(ue){return m(J,void 0,void 0,function(){var oe,W,V=this;return y(this,function(S){return oe=0,(W=function(){return m(V,void 0,void 0,function(){var x;return y(this,function(H){switch(H.label){case 0:return H.trys.push([0,2,,3]),[4,this.send({url:ee,data:ue})];case 1:return H.sent(),[3,3];case 2:return x=H.sent(),oe<=2&&(oe++,setTimeout(function(){W()},1e3)),[3,3];case 3:return[2]}})})})(),[2]})})}]))}}catch(ue){}},O.prototype.updateGetReportData=function(D){typeof D=="function"&&this._getReportDataList.push(D)},O.prototype.updateBlacklist=function(){return m(this,void 0,void 0,function(){var D,J,ee;return y(this,function(se){switch(se.label){case 0:return se.trys.push([0,2,,3]),[4,(0,T.request)({url:M.RAINBOW_BLACK_LIST_API})];case 1:return D=se.sent().data,typeof(J=D==null?void 0:D.blackList)=="string"&&(this._blacklist=J.split(",")),[3,3];case 2:return ee=se.sent(),[3,3];case 3:return[2]}})})},O.prototype.getBlackList=function(){return this._blacklist},O.prototype.setLogLevel=function(D){typeof D!="number"&&(D=R.INFO),this._logLevel=D},O.prototype.createLogFunc=function(D){var J=this;return function(ee,se){J.log(ee,se,{level:D})}},O.prototype.buildUploadUrl=function(){return this.endpoint&&this.topicId?"".concat(this.endpoint,"/tracklog?topic_id=").concat(this.topicId):""},O.prototype.sendPipe=function(D){typeof this.sendClsPipe=="function"&&this.sendClsPipe(D),typeof this.sendEsPipe=="function"&&this.sendEsPipe(D)},O.prototype.info=function(D,J){this.log(D,J,{level:R.INFO})},O.prototype.debug=function(D,J){this.log(D,J,{level:R.DEBUG})},O.prototype.warn=function(D,J){this.log(D,J,{level:R.WARING})},O.prototype.error=function(D,J){this.log(D,J,{level:R.ERROR})},O.prototype.log=function(D,J,ee){try{var se=ee||{},ue=se.level;if(se.topicId,this._logLevel<=ue){var oe=this.getCommonReportData(),W=b(oe,h({level:ue,method:D},J));this.sendPipe(W)}}catch(V){}},O.prototype.getCommonReportData=function(){for(var D={},J=0;J<this._getReportDataList.length;J++)D=b(D,this._getReportDataList[J]());return D},O.prototype.send=function(D){return m(this,void 0,void 0,function(){var J,ee,se,ue;return y(this,function(oe){switch(oe.label){case 0:ee=(J=D||{}).url,se=J.data,oe.label=1;case 1:return oe.trys.push([1,4,,5]),ee?[4,(0,T.request)({url:ee,data:se,method:"post"})]:[3,3];case 2:oe.sent(),oe.label=3;case 3:return[3,5];case 4:throw ue=oe.sent(),new Error(ue);case 5:return[2]}})})},O}();p.default=U},900:(d,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.filterSdkappIdPipe=void 0,p.filterSdkappIdPipe=function(g){return function(h,m){try{var y=h.sdkappid,R=g.getBlackList();if(R!=null&&R.includes(String(y)))throw new Error("this sdkappid in blacklist");m(h)}catch(I){}}}},793:(d,p,g)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.formatClsLog=void 0;var h=g(266);p.formatClsLog=function(){return function(m,y){try{y({logs:m==null?void 0:m.map(function(R){var I={};
2return Object.keys(R).forEach(function(T){if((0,h.isPlainObject)(R[T]))try{I[T]=(0,h.stringifyPlus)(R[T])}catch(C){}else T==="time"&&(I[T]=new Date(R[T]).toISOString()),I[T]=R[T]+""}),{contents:I,time:R.time}}),source:""})}catch(R){}}}},713:(d,p,g)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.formatESLog=void 0;var h=g(266);p.formatESLog=function(m){var y=m.table;return function(R,I){try{var T=R==null?void 0:R.map(function(C){var _={};return Object.keys(C).forEach(function(A){if((0,h.isPlainObject)(C[A]))try{_[A]=(0,h.stringifyPlus)(C[A])}catch(L){}else _[A]=A==="level"?C[A]+"":A==="time"?new Date(C[A]).toISOString():C[A]}),_});I({table:y,report:T})}catch(C){}}}},882:(d,p,g)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.formatClsLog=p.formatESLog=void 0;var h=g(793);Object.defineProperty(p,"formatClsLog",{enumerable:!0,get:function(){return h.formatClsLog}});var m=g(713);Object.defineProperty(p,"formatESLog",{enumerable:!0,get:function(){return m.formatESLog}})},402:(d,p,g)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.createPipeline=void 0;var h=g(266);p.createPipeline=function(m){if(!m||!m.reduce||!m.length)throw new TypeError("createPipeline need at least one function param");return m.length===1?function(y,R){m[0](y,R||h.noop)}:m.reduce(function(y,R){return function(I,T){return T===void 0&&(T=h.noop),y(I,function(C){return R==null?void 0:R(C,T)})}})}},271:(d,p,g)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.limitLengthPipe=p.MAX_LOG_LENGTH=void 0;var h=g(266);p.MAX_LOG_LENGTH=102400,p.limitLengthPipe=function(){return function(m,y){try{var R=(m=m||{}).logs,I=R===void 0?[]:R;m.logs=I==null?void 0:I.map(function(T){var C=p.MAX_LOG_LENGTH,_=T.contents;return Object.keys(_).forEach(function(A){var L=_[A];try{L&&L.length>C&&(_[A]=L==null?void 0:L.substring(0,C))}catch(E){_[A]=(0,h.stringifyPlus)(L).substring(0,C)}}),T}),y(m)}catch(T){}}}},884:(d,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.createThrottlePipe=void 0,p.createThrottlePipe=function(g,h){var m,y=[];return function(R,I){if(Array.isArray(R)?y=y.concat(R):y.push(R),h&&y.length>=h||g.sendNow&&y.length>0)return I(y.splice(0,y.length)),void(m&&clearTimeout(m));m&&clearTimeout(m),m=setTimeout(function(){m=null,y.length>0&&I(y.splice(0,y.length))},g.delay||1e3)}}},466:function(d,p,g){var h=this&&this.__assign||function(){return(h=Object.assign||function(_){for(var A,L=1,E=arguments.length;L<E;L++)for(var M in A=arguments[L])Object.prototype.hasOwnProperty.call(A,M)&&(_[M]=A[M]);return _}).apply(this,arguments)},m=this&&this.__awaiter||function(_,A,L,E){return new(L||(L=Promise))(function(M,B){function b(O){try{U(E.next(O))}catch(D){B(D)}}function k(O){try{U(E.throw(O))}catch(D){B(D)}}function U(O){var D;O.done?M(O.value):(D=O.value,D instanceof L?D:new L(function(J){J(D)})).then(b,k)}U((E=E.apply(_,A||[])).next())})},y=this&&this.__generator||function(_,A){var L,E,M,B,b={label:0,sent:function(){if(1&M[0])throw M[1];return M[1]},trys:[],ops:[]};return B={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function k(U){return function(O){return function(D){if(L)throw new TypeError("Generator is already executing.");for(;B&&(B=0,D[0]&&(b=0)),b;)try{if(L=1,E&&(M=2&D[0]?E.return:D[0]?E.throw||((M=E.return)&&M.call(E),0):E.next)&&!(M=M.call(E,D[1])).done)return M;switch(E=0,M&&(D=[2&D[0],M.value]),D[0]){case 0:case 1:M=D;break;case 4:return b.label++,{value:D[1],done:!1};case 5:b.label++,E=D[1],D=[0];continue;case 7:D=b.ops.pop(),b.trys.pop();continue;default:if(!((M=(M=b.trys).length>0&&M[M.length-1])||D[0]!==6&&D[0]!==2)){b=0;continue}if(D[0]===3&&(!M||D[1]>M[0]&&D[1]<M[3])){b.label=D[1];break}if(D[0]===6&&b.label<M[1]){b.label=M[1],M=D;break}if(M&&b.label<M[2]){b.label=M[2],b.ops.push(D);break}M[2]&&b.ops.pop(),b.trys.pop();continue}D=A.call(_,b)}catch(J){D=[6,J],E=0}finally{L=M=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([U,O])}}},R=this&&this.__rest||function(_,A){var L={};for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&A.indexOf(E)<0&&(L[E]=_[E]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(E=Object.getOwnPropertySymbols(_);M<E.length;M++)A.indexOf(E[M])<0&&Object.prototype.propertyIsEnumerable.call(_,E[M])&&(L[E[M]]=_[E[M]])}return L};Object.defineProperty(p,"__esModule",{value:!0}),p.request=void 0;var I=g(732),T=g(377),C=g(266);p.request=function(_){return m(void 0,void 0,void 0,function(){var A=_.url,L=_.data,E=_.header,M=E===void 0?{}:E,B=_.method,b=B===void 0?"GET":B,k=_.dataType,U=_.responseType,O=R(_,["url","data","header","method","dataType","responseType"]);return y(this,function(D){return(0,C.isBrowser)()?[2,(0,T.requestXHR)(A,L,{headers:M,method:b,responseType:U,dataType:k})]:(0,C.isMiniProgram)()?[2,(0,I.requestWeapp)(h({url:A,data:L,header:M,method:b,dataType:k,responseType:U},O))]:[2]})})}},732:function(d,p,g){var h=this&&this.__assign||function(){return(
2h=Object.assign||function(C){for(var _,A=1,L=arguments.length;A<L;A++)for(var E in _=arguments[A])Object.prototype.hasOwnProperty.call(_,E)&&(C[E]=_[E]);return C}).apply(this,arguments)},m=this&&this.__awaiter||function(C,_,A,L){return new(A||(A=Promise))(function(E,M){function B(U){try{k(L.next(U))}catch(O){M(O)}}function b(U){try{k(L.throw(U))}catch(O){M(O)}}function k(U){var O;U.done?E(U.value):(O=U.value,O instanceof A?O:new A(function(D){D(O)})).then(B,b)}k((L=L.apply(C,_||[])).next())})},y=this&&this.__generator||function(C,_){var A,L,E,M,B={label:0,sent:function(){if(1&E[0])throw E[1];return E[1]},trys:[],ops:[]};return M={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function b(k){return function(U){return function(O){if(A)throw new TypeError("Generator is already executing.");for(;M&&(M=0,O[0]&&(B=0)),B;)try{if(A=1,L&&(E=2&O[0]?L.return:O[0]?L.throw||((E=L.return)&&E.call(L),0):L.next)&&!(E=E.call(L,O[1])).done)return E;switch(L=0,E&&(O=[2&O[0],E.value]),O[0]){case 0:case 1:E=O;break;case 4:return B.label++,{value:O[1],done:!1};case 5:B.label++,L=O[1],O=[0];continue;case 7:O=B.ops.pop(),B.trys.pop();continue;default:if(!((E=(E=B.trys).length>0&&E[E.length-1])||O[0]!==6&&O[0]!==2)){B=0;continue}if(O[0]===3&&(!E||O[1]>E[0]&&O[1]<E[3])){B.label=O[1];break}if(O[0]===6&&B.label<E[1]){B.label=E[1],E=O;break}if(E&&B.label<E[2]){B.label=E[2],B.ops.push(O);break}E[2]&&B.ops.pop(),B.trys.pop();continue}O=_.call(C,B)}catch(D){O=[6,D],L=0}finally{A=E=0}if(5&O[0])throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}([k,U])}}};Object.defineProperty(p,"__esModule",{value:!0}),p.requestWeapp=function(C){return m(this,void 0,void 0,function(){var _;return y(this,function(A){switch(A.label){case 0:A.trys.push([0,5,6,7]),A.label=1;case 1:return T>=I?[4,(0,R.startBlocking)()]:[3,3];case 2:return A.sent(),[3,1];case 3:return T++,[4,new Promise(function(L,E){wx.request(h(h({},C),{success:function(M){L(M)},fail:function(M){E(M)}}))})];case 4:return[2,A.sent()];case 5:return _=A.sent(),[2,Promise.reject(_)];case 6:return T--,(0,R.resolveFirstBlock)(),[7];case 7:return[2]}})})};var R=g(640),I=2,T=0},377:function(d,p,g){var h=this&&this.__awaiter||function(_,A,L,E){return new(L||(L=Promise))(function(M,B){function b(O){try{U(E.next(O))}catch(D){B(D)}}function k(O){try{U(E.throw(O))}catch(D){B(D)}}function U(O){var D;O.done?M(O.value):(D=O.value,D instanceof L?D:new L(function(J){J(D)})).then(b,k)}U((E=E.apply(_,A||[])).next())})},m=this&&this.__generator||function(_,A){var L,E,M,B,b={label:0,sent:function(){if(1&M[0])throw M[1];return M[1]},trys:[],ops:[]};return B={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function k(U){return function(O){return function(D){if(L)throw new TypeError("Generator is already executing.");for(;B&&(B=0,D[0]&&(b=0)),b;)try{if(L=1,E&&(M=2&D[0]?E.return:D[0]?E.throw||((M=E.return)&&M.call(E),0):E.next)&&!(M=M.call(E,D[1])).done)return M;switch(E=0,M&&(D=[2&D[0],M.value]),D[0]){case 0:case 1:M=D;break;case 4:return b.label++,{value:D[1],done:!1};case 5:b.label++,E=D[1],D=[0];continue;case 7:D=b.ops.pop(),b.trys.pop();continue;default:if(!((M=(M=b.trys).length>0&&M[M.length-1])||D[0]!==6&&D[0]!==2)){b=0;continue}if(D[0]===3&&(!M||D[1]>M[0]&&D[1]<M[3])){b.label=D[1];break}if(D[0]===6&&b.label<M[1]){b.label=M[1],M=D;break}if(M&&b.label<M[2]){b.label=M[2],b.ops.push(D);break}M[2]&&b.ops.pop(),b.trys.pop();continue}D=A.call(_,b)}catch(J){D=[6,J],E=0}finally{L=M=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([U,O])}}};Object.defineProperty(p,"__esModule",{value:!0}),p.default=C,p.requestXHR=function(_){return h(this,arguments,void 0,function(A,L,E){var M,B=this;return L===void 0&&(L={}),E===void 0&&(E={}),m(this,function(b){switch(b.label){case 0:return b.trys.push([0,2,3,4]),[4,new Promise(function(k,U){return h(B,void 0,void 0,function(){var O,D,J,ee,se,ue;return m(this,function(oe){switch(oe.label){case 0:return T>=I?[4,(0,R.startBlocking)()]:[3,2];case 1:return oe.sent(),[3,0];case 2:return T++,O=E.method,D=E.headers,J=D===void 0?{}:D,ee=E.responseType,se=ee===void 0?"json":ee,O=(O||"get").toUpperCase(),Object.assign(J,{"Content-type":"application/json"}),(ue=new window.XMLHttpRequest).responseType=se,ue.timeout=1e4,ue.onreadystatechange=function(){ue.readyState===4&&(ue.status===200?k({data:ue.response}):U({code:ue.status,msg:ue.statusText}))},ue.ontimeout=function(W){U({code:ue.status,msg:ue.statusText})},ue.onloadend=function(){ue&&(C(function(W){k(W)},function(W){U(W)},{status:ue.status,statusText:ue.statusText}),ue=null)},ue.onabort=function(){ue&&(U(new Error("Request aborted")),ue=null)},ue.onerror=function(){U(new Error("Network Error")),ue=null}
2,O==="GET"?A="".concat(A).concat(A.indexOf("?")===-1?"?":"&").concat(y.default.stringify(L)):O==="POST"&&(L=JSON.stringify(L)),ue.open(O,A,!0),Object.keys(J).forEach(function(W){ue.setRequestHeader(W,J[W])}),ue.send(O==="POST"?L:null),[2]}})})})];case 1:return[2,b.sent()];case 2:throw M=b.sent(),new Error(M);case 3:return T--,(0,R.resolveFirstBlock)(),[7];case 4:return[2]}})})};var y=g(383),R=g(640),I=2,T=0;function C(_,A,L){L.status?A(new Error("Request failed with status code "+L.status)):_(L)}},172:(d,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.RAINBOW_BLACK_LIST_API=void 0,p.RAINBOW_BLACK_LIST_API="https://jsonschema.qpic.cn/87084b1b6d263426b92926cfa5fa23af/18f29786d25587b5eb162d5e9f724b1e/blackList"},266:(d,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.date2ISOString=p.stringifyPlus=p.noop=p.isBrowser=p.isMiniProgram=p.isPlainObject=p.appendParams=void 0,p.appendParams=function(h,m){m===void 0&&(m={});var y=[];return Object.keys(m).forEach(function(R){var I=m[R];if(I!==void 0){if((0,p.isPlainObject)(I))try{I=JSON.stringify(I)}catch(T){}y.push("".concat(R,"=").concat(encodeURIComponent(I)))}}),y.length?(h.indexOf("?")>-1?"".concat(h,"&"):"".concat(h,"?"))+y.join("&"):h},p.isPlainObject=function(h){if(typeof h!="object"||h===null)return!1;var m=Object.getPrototypeOf(h);if(m===null)return!0;for(var y=m;Object.getPrototypeOf(y)!==null;)y=Object.getPrototypeOf(y);return m===y},p.isMiniProgram=function(){try{return!(!(wx!=null&&wx.request)||!(wx!=null&&wx.connectSocket))}catch(h){return!1}},p.isBrowser=function(){try{return!(0,p.isMiniProgram)()&&typeof window!="undefined"&&window.document!==void 0}catch(h){return!1}},p.noop=function(){};var g=function(){var h=new WeakSet;return function(m,y){if(y instanceof Error)return"Error.message: ".concat(y.message,` 
3  Error.stack: `).concat(y.stack);if(typeof y=="object"&&y!==null){if(h.has(y))return"[Circular ".concat(m||"root","]");h.add(y)}return y}};p.stringifyPlus=function(h){if(typeof h=="string")return h;try{return h instanceof Error?(JSON.stringify(h,g())||"undefined").replace(/"/gim,""):JSON.stringify(h,g())||"undefined"}catch(m){return`error happen when aegis stringify: 
4 `.concat(m.message,` 
5 `).concat(m.stack)}},p.date2ISOString=function(){var h,m=new Date,y=m.toISOString(),R=m.getTimezoneOffset()/60;return h=R<0?R>-10?"+0".concat(Math.abs(100*R)):"+".concat(Math.abs(100*R)):R>=10?"-".concat(100*R):"-0".concat(100*R),y.replace("Z",h)}},383:(d,p,g)=>{Object.defineProperty(p,"__esModule",{value:!0});var h=g(266);p.default={stringify:function(m){return m?Object.keys(m).map(function(y){var R=m[y];if((0,h.isPlainObject)(R))R=JSON.stringify(R);else{if(typeof R!="string"&&typeof R!="number")return"";R=+R}return encodeURIComponent(y)+"="+encodeURIComponent(R)}).filter(function(y){return y.length>0}).join("&"):""}}},640:(d,p)=>{Object.defineProperty(p,"__esModule",{value:!0}),p.startBlocking=p.resolveFirstBlock=void 0;var g=[];p.startBlocking=function(){var h,m=new Promise(function(y){h=y});return g.push({promise:m,resolve:h}),m},p.resolveFirstBlock=function(){g.length&&(g[0].resolve(),g.shift())}}},c={};function u(d){var p=c[d];if(p!==void 0)return p.exports;var g=c[d]={exports:{}};return l[d].call(g.exports,g,g.exports,u),g.exports}var f={};return(()=>{var d=f;Object.defineProperty(d,"__esModule",{value:!0});var p=u(902),g=null;d.default=function(h){return g||(g=new p.default(h)),g}})(),f})(),s.exports=a()},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.TRTCQuality=r.DEVICE_TYPE=r.TRTCVideoMirrorType=r.TRTCVideoFillMode=r.TRTCVideoRotation=void 0,function(a){a[a.TRTCVideoRotation0=0]="TRTCVideoRotation0",a[a.TRTCVideoRotation90=1]="TRTCVideoRotation90",a[a.TRTCVideoRotation180=2]="TRTCVideoRotation180",a[a.TRTCVideoRotation270=3]="TRTCVideoRotation270"}(r.TRTCVideoRotation||(r.TRTCVideoRotation={})),function(a){a[a.TRTCVideoFillMode_Fill=0]="TRTCVideoFillMode_Fill",a[a.TRTCVideoFillMode_Fit=1]="TRTCVideoFillMode_Fit"}(r.TRTCVideoFillMode||(r.TRTCVideoFillMode={})),function(a){a[a.TRTCVideoMirrorType_Auto=0]="TRTCVideoMirrorType_Auto",a[a.TRTCVideoMirrorType_Enable=1]="TRTCVideoMirrorType_Enable",a[a.TRTCVideoMirrorType_Disable=2]="TRTCVideoMirrorType_Disable"}(r.TRTCVideoMirrorType||(r.TRTCVideoMirrorType={})),function(a){a.CAMERA="camera",a.SPEAKER="speaker",a.MICROPHONES="microphones",a.MICROPHONE="microphone",a.AUDIO="audio",a.VIDEO="video"}(r.DEVICE_TYPE||(r.DEVICE_TYPE={})),function(a){a[a.TRTCQuality_Unknown=0]="TRTCQuality_Unknown",a[a.TRTCQuality_Excellent=1]="TRTCQuality_Excellent",a[a.TRTCQuality_Good=2]="TRTCQuality_Good",a[a.TRTCQuality_Poor=3]="TRTCQuality_Poor",a[a.TRTCQuality_Bad=4]="TRTCQuality_Bad",a[a.TRTCQuality_Vbad=5]="TRTCQuality_Vbad",a[a.TRTCQuality_Down=6]="TRTCQuality_Down"}(r.TRTCQuality||(r.TRTCQuality={}))},function(s,r,o){var a,l=this&&this.__extends||(a=function(p,g){return(a=Object.
5setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,m){h.__proto__=m}||function(h,m){for(var y in m)m.hasOwnProperty(y)&&(h[y]=m[y])})(p,g)},function(p,g){function h(){this.constructor=p}a(p,g),p.prototype=g===null?Object.create(g):(h.prototype=g.prototype,new h)}),c=this&&this.__assign||function(){return(c=Object.assign||function(p){for(var g,h=1,m=arguments.length;h<m;h++)for(var y in g=arguments[h])Object.prototype.hasOwnProperty.call(g,y)&&(p[y]=g[y]);return p}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0});var u=o(7),f=o(15),d=function(p){function g(h){var m=h.name,y=m===void 0?"":m,R=h.code,I=R===void 0?u.default.UNKNOWN:R,T=h.message,C=T===void 0?"":T,_=h.messageParams,A=_===void 0?{}:_,L=(h.extraCode,h.fnName),E=L===void 0?"":L,M=p.call(this,C||f.getErrorMessage({code:I,params:c({fnName:E},A)}))||this;return M.name="TUICallEngineError",M.functionName="",M.name=y||M.name,M.code=I,M.functionName=E||M.functionName,M}return l(g,p),g.prototype.getCode=function(){return this.code},g}(Error);r.default=d},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.ERROR_CN_MESSAGE=r.ERROR_MESSAGE=void 0,r.ERROR_MESSAGE={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"switch to audio call error",FAILURE_SWITCH_TO_VIDEO:"switch to video call error",NOT_MICROPHONE_LIST:"No microphone device",NOT_CAMERA_LIST:"No camera device",ERROR_PACKAGE_NOT_PURCHASED:"You do not have TUICallKit package, please open the free experience in the console: https://console.intl.cloud.tencent.com/im/detail or purchase the official package: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"The package you purchased does not support this ability. You can refer to here to purchase: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK version is too old, Please upgrade version",ERROR_PERMISSION_DENIED:"camera permission refused / microphone permission refused. You can perform the trtc capability test at https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html to check whether the current environment supports audio and video calls",ERROR_GET_DEVICE_LIST_FAIL:"Failed to get device list",ERROR_INIT_FAIL:"init or login is not complete, this API needs to be used after init. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"The API is not support in the current state. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"The current method is being executed, please do not call it repeatedly",ERROR_REQUEST_REPEATED_SWITCH:"Consistent with the current call type, please do not switch repeatedly",ERROR_SCENE_NOT_SUPPORTED:"In the current call scene, this function is not supported",ERROR_SIGNALING_SEND_FAIL:"signaling failed to send",ERROR_INVALID_INVITEID:"inviteID is invali
5d or invitation has been processed. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"Failed to send message, common reasons: the called userID or groupID does not exist. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"invalid parameter",ERROR_HTTP:"The current page is detected to be using the http protocol(or localhost). To ensure smooth access and experience of all functions of TUICallEngine SDK for production environment users, please use the https protocol to access the audio and video application page. More Info: https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/tutorial-05-info-browser.html#h2-3",NOT_SUPPORT:"The current page does not have webRTC capability. You can perform the trtc capability test at https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html to check whether the current environment supports audio and video calls"},r.ERROR_CN_MESSAGE={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"切换语音通话失败",FAILURE_SWITCH_TO_VIDEO:"切换视频通话失败",NOT_MICROPHONE_LIST:"没有麦克风设备",NOT_CAMERA_LIST:"没有摄像头设备",ERROR_PACKAGE_NOT_PURCHASED:"您的应用还未开通音视频通话(TUICallKit)能力,您可以去控制台申请免费体验: https://console.cloud.tencent.com/im/detail 或购买通话能力套餐包: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"您暂不支持使用该能力,请前往如下购买页购买开通: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK 版本太旧,请升级版本",ERROR_PERMISSION_DENIED:"摄像头/麦克风权限被拒绝,可以前往: https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html 进行 trtc 能力测试,查看当前环境是否支持音视频通话",ERROR_GET_DEVICE_LIST_FAIL:"获取设备列表失败",ERROR_INIT_FAIL:"TUICallEngine 初始化登录未完成,需要在 init 或 login 完成后使用此 API 。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"当前通话状态无法使用该 API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"当前方法正在执行中,请勿重复调用",ERROR_REQUEST_REPEATED_SWITCH:"与当前通话类型一致,请勿重复切换",ERROR_SCENE_NOT_SUPPORTED:"当前通话场景不支持该功能",ERROR_SIGNALING_SEND_FAIL:"信令发送失败",ERROR_INVALID_INVITEID:"邀请 ID 无效或邀请已处理。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"消息发送失败,常见原因:被叫用户 userID 或群 groupID 不存在。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"参数错误",ERROR_HTTP:"检测到当前页面正处于 http 协议下,为确保生产环境用户顺畅接入和体验 TUICallEngine SDK 的全部功能,请使用 https 协议(或 localhost)访问音视频应用页面。详情请前往:https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-05-info-browser.html#h2-3",NOT_SUPPORT:"当前页面不具备 webRTC 能力。可以前往: https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html 进行 trtc 能力测试,查看当前环境是否支持音视频通话"}},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.TUICallCameraPosition=r.TUICommonDefine=r.TUICallType=void 0,r.TUICallType={AUDIO_CALL:1,VIDEO_CALL:2,DEVCIED_CAMERA:"camera",DEVCIED_MICROPHONES:"microphones"},r.TUICommonDefine={VideoEncoderParams:{"120p":"120p","120p_2":"120p_2","180p":"180p","180p_2":"180p_2","240p":"240p","360p":"360p","360p_2":"360p_2","480p":"480p","480p_2":"480p_2","720p":"720p","1080p":"1080p","1440p":"1440p","4K":"4K"}},function(a){a[a.FRONT=0]="FRONT",a[a.BACK=1]="BACK"}(r.TUICallCameraPosition||(r.TUICallCameraPosition={}))},function(s,r,o){o.r(r);var a=o(1),l=o(2),c=o(7),u=o.n(c),f=o(11);class d{constructor(g){this.sdkappid="",this.version="",this.userid="",this.platform="",this.useragent="",this.method=g,this.co
5deint=1,this.calltype=1,this.talktime=0,this.message="",this.text="",this.startts=Date.now(),this.endts=0,this.timespan=0,this.time="",this.networktype="",this.host=Object(a.getHostType)()}static bindController(g){d.prototype._eventStatController=g}setCommonInfo(g){const{SDKAppID:h,version:m,userID:y,platform:R,scene:I}=g;this.sdkappid=h,this.version=""+m,this.userid=y,this.platform=R,this.scene=I,this.time=Object(a.date2ISOString)(),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}setEnd(g=!1){this.endts=Date.now(),g?this._eventStatController.pushIn(this):setTimeout(()=>{this._eventStatController.pushIn(this)},0)}setError(g,h,m){return this.setNetworkType(m),h?(g.code&&this.setCode(g.code),g.message&&this.setMessage(g.message)):(this.setCode(u.a.NO_NETWORK),this.setMessage(f.ERROR_MESSAGE.NO_NETWORK)),this}setCode(g){return g==="ECONNABORTED"&&(this.codeint=103),Object(a.isNumber)(g)?this.codeint=g:l.default.warn("SSOLogData.setCode value not a number, please check!",g,typeof g),this}setMessage(g){return Object(a.isString)(g)?(this.message=g,this):this}setText(g){return Object(a.isNumber)(g)?this.text=g.toString():Object(a.isString)(g)&&(this.text=g),this}setTalkTime(g){return this.talktime=g,this}setMessageType(g){return this.msgType=g,this}setCallType(g){return this.calltype=g,this}setNetworkType(g){return Object(a.isUndefined)(g)?l.default.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=g,this}}r.default=d},function(s,r){s.exports=t},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorMessageCN=r.ErrorMessage=r.getErrorMessage=void 0;var a=o(1),l=o(7),c=o(11);r.getErrorMessage=function(u){var f,d=u.code,p=u.params,g=u.enableDocLink,h=g!==void 0&&g,m=u.languageList,y=m===void 0?["en","zh-CN"]:m,R="",I=l.ErrorCodeDictionary[d];try{y.forEach(function(T){switch(T){case"en":f=r.ErrorMessage[I];break;case"zh-CN":f=r.ErrorMessageCN[I]}a.isFunction(f)?(R=R&&R+" ",R+=f(p)):a.isString(f)&&(R=f)})}catch(T){f=r.ErrorMessage.UNKNOWN_ERROR}return h&&(R+=" doc:"),R},r.ErrorMessage={ERROR_INIT_FAIL:function(u){return u.fnName+": "+c.ERROR_MESSAGE.ERROR_INIT_FAIL+"."},ERROR_SCENE_NOT_SUPPORTED:function(u){return u.fnName+": "+c.ERROR_MESSAGE.ERROR_SCENE_NOT_SUPPORTED+"."},ERROR_REQUEST_REFUSED:function(u){var f=u.value;return c.ERROR_MESSAGE.ERROR_REQUEST_REFUSED+". customStatus: "+f+"."},ERROR_PARAM_INVALID:function(u){return"the parameters of the '"+u.fnName+"' you called does not meet the requirements, please check the API documentation."},INVALID_PARAMETER_REQUIRED:function(u){var f=u.key,d=u.rule,p=u.fnName,g=u.value;return"'"+(f||d.name)+"' is a required param when calling "+p+"(), received: "+g+"."},INVALID_PARAMETER_TYPE:function(u){var f=u.key,d=u.rule,p=u.fnName,g=u.value;return"'"+(""+(f||d.name))+"' must be type of "+(Array.isArray(d.type)?d.type.join("|"):d.type)+" when calling "+p+"(), received type: "+a.getValueType(g)+"."},INVALID_PARAMETER_EMPTY:function(u){var f=u.key,d=u.rule,p=u.fnName;return"'"+(f||d.name)+"' cannot be empty when calling "+p+"()."},INVALID_PARAMETER_RANGE:function(u){var f=u.key,d=u.rule,p=u.fnName,g=u.value;return a.isArray(d.values)?"'"+(f||d.name)+"' must be one of "+d.values.join("|")+" when calling "+p+"(), received: "+g+".":a.isString(d.values)&&d.values.indexOf("~")!==-1?"'"+(f||d.name)+"' must be the range of "+d.values+" when calling "+p+"(), received: "+g+".":void 0},ERROR_REQUEST_REPEATED:function(u){var f=u.fnName;return"you are already "+f+"(), cannot repeated call '"+f+"'."},ERROR_HTTP:function(){return c.ERROR_MESSAGE.ERROR_HTTP+"."},ERROR_TIM_VERSION_OUTDATED:function(){return c.ERROR_MESSAGE.ERROR_TIM_VERSION_OUTDATED+" >= 2.21.2."},ERROR_PACKAGE_NOT_SUPPORTED:function(){return c.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED+"."},FAILURE_SWITCH_TO_AUDIO:function(){return c.ERROR_MESSAGE.FAILURE_SWITCH_TO_AUDIO+"."},NOT_MICROPHONE_LIST:function(u){var f=u.fnName,d=u.error;return"NotFoundError, no microphone detected, please check your device and the configuration on '"+f+"'"+(d?", error: "+d.toString()+".":".")},NOT_CAMERA_LIST:function(u){var f=u.fnName,d=u.error;return"NotFoundError, no camera detected, please check your device and the configuration on '"+f+"'"+(d?", error: "+d.toString()+".":".")},ERROR_PERMISSION_DENIED:function(u){var f=u.fnName,d=u.error;return"NotAllowedError, you have disabled camera/microphone access, please allow the current application "+f+" to use the camera/microphone. "+(d?", error: "+d.toString()+".":".")},ERROR_INVALID_SEND_FAIL:function(){return c.ERROR_MESSAGE.ERROR_INVALID_SEND_FAIL+"."},UNKNOWN_ERROR:function(u){var f=u.fnName,d=u.error;return"'"+f+"' throw unknown exception"+(d?", error: "+d.toString()+".":".")}},r.ErrorMessageCN={ERROR_INIT_FAIL:function(u){return u.fnName+": "+c.ERROR_CN_MESSAGE.ERROR_INIT_FAIL+"。"},ERROR_SCENE_NOT_SUPPORTED:function(u){return u.fnName+": "+c.ERROR_CN_MESSAGE.ERROR_SCENE_NOT_SUPPORTED+"。"},ERROR_REQUEST_REFUSED:function(u){var f=u.value;return c.ERROR_CN_MESSAGE.ERROR_REQUEST_REFUSED+". customStatus: "+f+"。"},ERROR_PARAM_INVALID:function(u){return"the parameters of the '"+u.fnName+"' you called does not meet the requirements, please check the API documentation."},INVALID_PARAMETER_REQUIRED:function(u){var f=u.key,d=u.rule,p=u.fnName,g=u.value;return"调用 "+p+"() 方法的时候 '"+(f||d.name)+"' 是必须的参数, 收到的值为: "+g+"。"},INVALID_PARAMETER_TYPE:function(u){var f=u.key,d=u.rule,p=u.fnName,g=u.value;return"调用 "+p+"() 方法的时候 '"+(""+(f||d.name))+"' 必须是 "+(Array.isArray(d.type)?d.t
5ype.join("|"):d.type)+" 类型, 收到的类型是: "+a.getValueType(g)+"。"},INVALID_PARAMETER_EMPTY:function(u){var f=u.key,d=u.rule,p=u.fnName;return u.value,"调用 "+p+"() 的时候 '"+(f||d.name)+"' 不能是空。"},INVALID_PARAMETER_RANGE:function(u){var f=u.key,d=u.rule,p=u.fnName,g=u.value;return a.isArray(d.values)?"调用 "+p+"() 的时候 '"+(f||d.name)+"' 必须是 "+d.values.join("|")+" 的其中一种, 收到的是: "+g+"。":a.isString(d.values)&&d.values.indexOf("~")!==-1?"调用 "+p+"() 的时候 '"+(f||d.name)+"' 范围是 "+d.values+", 收到的是: "+g+"。":void 0},ERROR_REQUEST_REPEATED:function(u){var f=u.fnName;return"你已经调用 "+f+"(), 请勿重复调用 '"+f+"'。"},ERROR_HTTP:function(){return c.ERROR_CN_MESSAGE.ERROR_HTTP+"。"},ERROR_TIM_VERSION_OUTDATED:function(){return c.ERROR_CN_MESSAGE.ERROR_TIM_VERSION_OUTDATED+" >= 2.21.2。"},ERROR_PACKAGE_NOT_SUPPORTED:function(){return c.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED+"。"},FAILURE_SWITCH_TO_AUDIO:function(){return c.ERROR_CN_MESSAGE.FAILURE_SWITCH_TO_AUDIO+"。"},NOT_MICROPHONE_LIST:function(u){var f=u.fnName,d=u.error;return"NotFoundError,未检测到麦克风设备,请检查您的设备和麦克风上的配置 '"+f+"'"+(d?", error: "+d.toString()+".":".")},NOT_CAMERA_LIST:function(u){var f=u.fnName,d=u.error;return"NotFoundError,未检测到摄像头设备,请检查您的设备和摄像头上的配置 '"+f+"'"+(d?", error: "+d.toString()+".":".")},ERROR_PERMISSION_DENIED:function(u){u.fnName;var f=u.error;return"NotAllowedError, 您已禁用摄像头/麦克风访问权限,请允许当前应用程序使用摄像头/麦克风。"+(f?", error: "+f.toString()+".":".")},ERROR_INVALID_SEND_FAIL:function(){return c.ERROR_CN_MESSAGE.ERROR_INVALID_SEND_FAIL+"."}}},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.TUICallEvent=void 0,r.TUICallEvent={ERROR:"onError",SDK_READY:"sdkReady",ON_CALL_BEGIN:"onCallBegin",INVITED:"onInvited",ON_CALL_RECEIVED:"onCallReceived",USER_ACCEPT:"onUserAccept",USER_ENTER:"onUserEnter",USER_LEAVE:"onUserLeave",REJECT:"onReject",NO_RESP:"onNoResp",LINE_BUSY:"onLineBusy",CALLING_CANCEL:"onCallingCancel",ON_CALL_CANCELED:"onCallCanceled",KICKED_OUT:"onKickedOut",CALLING_TIMEOUT:"onCallingTimeout",CALL_END:"onCallEnd",CALLING_END:"onCallEnd",USER_VIDEO_AVAILABLE:"onUserVideoAvailable",USER_AUDIO_AVAILABLE:"onUserAudioAvailable",USER_VOICE_VOLUME:"onUserVoiceVolume",GROUP_CALL_INVITEE_LIST_UPDATE:"onGroupCallInviteeListUpdate",CALL_TYPE_CHANGED:"onCallTypeChanged",DEVICED_UPDATED:"onDeviceUpdated",ON_USER_NETWORK_QUALITY_CHANGED:"onUserNetworkQualityChanged",MESSAGE_SENT_BY_ME:"onMessageSentByMe",CALL_MESSAGE:"CALL_MESSAGE"}},function(s,r,o){(function(a){var l=o(3),c=o(46),u=o(23),f={"Content-Type":"application/x-www-form-urlencoded"};function d(h,m){!l.isUndefined(h)&&l.isUndefined(h["Content-Type"])&&(h["Content-Type"]=m)}var p,g={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||a!==void 0&&Object.prototype.toString.call(a)==="[object process]")&&(p=o(24)),p),transformRequest:[function(h,m){return c(m,"Accept"),c(m,"Content-Type"),l.isFormData(h)||l.isArrayBuffer(h)||l.isBuffer(h)||l.isStream(h)||l.isFile(h)||l.isBlob(h)?h:l.isArrayBufferView(h)?h.buffer:l.isURLSearchParams(h)?(d(m,"application/x-www-form-urlencoded;charset=utf-8"),h.toString()):l.isObject(h)||m&&m["Content-Type"]==="application/json"?(d(m,"application/json"),function(y,R,I){if(l.isString(y))try{return(R||JSON.parse)(y),l.trim(y)}catch(T){if(T.name!=="SyntaxError")throw T}return(I||JSON.stringify)(y)}(h)):h}],transformResponse:[function(h){var m=this.transitional,y=m&&m.silentJSONParsing,R=m&&m.forcedJSONParsing,I=!y&&this.responseType==="json";if(I||R&&l.isString(h)&&h.length)try{return JSON.parse(h)}catch(T){if(I)throw T.name==="SyntaxError"?u(T,this,"E_JSON_PARSE"):T}return h}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(h){return h>=200&&h<300}};g.headers={common:{Accept:"application/json, text/plain, */*"}},l.forEach(["delete","get","head"],function(h){g.headers[h]={}}),l.forEach(["post","put","patch"],function(h){g.headers[h]=l.merge(f)}),s.exports=g}).call(this,o(45))},function(s,r,o){o.r(r),o.d(r,"default",function(){return R});var a=o(2),l=o(1);class c{constructor(){this._table="timweb-trtccalling",this._report=[]}pushIn(T){a.default.debug("SSOLogBody.pushIn",this._report.length,T),this._report.push(T)}backfill(T){Object(l.isArray)(T)&&T.length!==0&&(a.default.debug("SSOLogBody.backfill",this._report.length,T.length),this._report.unshift(...T))}getLogsNumInMemory(){return this._report.length}isEmpty(){return this._report.length===0}_reset(){this._report.length=0,this._report=[]}getTable(){return this._table}getLogsInMemory(){const T=this._report.slice();return this._reset(),T}}var u=o(13),f=o(19),d=o(31),p=o.n(d);const g={CURRENT:{COMMON:"https://webim.tim.qq.com"}},h={IM_OPEN_STAT:"imopenstat"},m={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},y={imopenstat:"v4"};class R{constructor(){this.TAG="trtccalling-ssolog-event",this._reportBody=new c,this._version=f.version||"",this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}reportAtOnce(){a.default.debug("EventStatController.reportAtOnce"),this._report()}pushIn(T){T instanceof u.default&&(T.setCommonInfo({SDKAppID:Number(sessionStorage.getItem("sdkAppId")),version:this._version,userID:sessionStorage.getItem("userId")}),this._reportBody.pushIn(T),this._report())}_resetLastReportTime(){this._lastReportTime=Date.now()}_startReportTimer(){this._timerID=setInterval(()=>{Date.now()<this._lastReportTime+this.WAITING_TIME||this._reportBody.isEmpty()||this._report()},this.INTERVAL)}_stopReportTimer(){this._timerID>0&&(clearInterval(this._timerID),this._timerID=0)}_report(){if(this._reportBody.isEmpty())return;const T=Math.ceil(+new Date/1e3),C=sessionStorage.getItem("sdkAppId"),_=this._reportBody.getLogsInMemory(),A={table:this._reportBody.getTable(),report:_},L=`${g.CURRENT.COMMON}/${y.imopenstat}/${h.IM_OPEN_STAT}/${m.TIM_WEB_TRTCCALLING_REPORT}/?sdkappid=${C}&reqtime=${T}`;p.a.post(L,JSON.stringify(A)).then(()=>{this._resetLastReportTime(),this._retryCount>0&&(a.default.debug("EventStatController.report retry success"),this._retryCount=0)}).catch(E=>{a.default.warn("EventStatController.report, error:"+Object(l.stringifyError)(E)),this._reportBody.backfill(_),this._reportBody.getLogsNumInMemory()>this.MAX_THRESHOLD||this._retryCount===this.MAX_RETRY_COUNT||this._timerID===0?this._retryCount=0:this._retryCount+=1})}reset(){a.default.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}},function(s){s.exports=JSON.parse(`{"name":"tuicall-engine-webrtc","version":"3.1.7","description":"腾讯云 tuicall-engine-webrtc","main":"index","private":true,"dependencies":{"@tencentcloud/chat":"latest","axios":"^0.21.0","EventEmitter":"^1.0.0","rtc-ai-denoiser":"latest","trtc-cloud-js-sdk":"^2.4.0","trtc-js-sdk":"latest","tuikit-logger":"latest"},"devDependencies":{"@babel/preset-typescript":"^7.12.7","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","docdash-blue":"^1.1.9","eslint":"^7.27.0","eslint-config-google":"^0.14.0","eslint-plugin-
5prettier":"^4.0.0","fs-extra":"^9.0.1","jsdoc":"^3.6.11","prettier":"^2.5.0","pretty":"^2.0.0","replace":"^1.2.2","rimraf":"^4.1.2","ts-loader":"^8.4.0","typescript":"^3.9.7","watch":"^1.0.2","webpack":"^4.44.1","webpack-cli":"^3.3.12"},"scripts":{"watch":"watch 'npm run build_withcopy4' src","dev":"npm run watch","build":"webpack --config webpack.config.js","build_withcopy":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ../../github/TUICalling/Web/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_withcopy2":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ../sdk/trtc-calling-webrtc-demo/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_withcopy3":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./example-js/tuicall-engine-webrtc.js","build_withcopy4":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./example/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_demo3":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./examples/call-engine-demo-vue3/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build:package":"node build/package-bundle.js","lint":"./node_modules/.bin/eslint ./src; exit 0","fix":"./node_modules/.bin/eslint --fix ./src; exit 0","prerelease":"npm run lint && npm run build && npm run doc && npm run build:package","doc":"npm run doc:clean && tsc  --target ESNEXT && npm run doc:build","doc:build":"npm run changelog && npm run main && ./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js","doc:clean":"node ./build/jsdoc/clean-doc.js","doc-en":"npm run doc:clean && tsc  --target ESNEXT && npm run doc:build-en","doc:build-en":"npm run changelog && npm run main && ./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc-en.json && node ./build/jsdoc/fix-doc-en.js","changelog":"cp CHANGELOG.md build/jsdoc/tutorials/20-CHANGELOG.md","main":"cp README.md build/jsdoc/main.md"},"repository":{"type":"git","url":"https://github.com/tencentyun/TUICallKit/tree/main/Web"},"author":"Tencent Cloud Terminal R&D Center","license":"ISC"}`)},function(s,r){s.exports=n},function(s,r,o){s.exports=function(a,l){return function(){for(var c=new Array(arguments.length),u=0;u<c.length;u++)c[u]=arguments[u];return a.apply(l,c)}}},function(s,r,o){var a=o(3);function l(c){return encodeURIComponent(c).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}s.exports=function(c,u,f){if(!u)return c;var d;if(f)d=f(u);else if(a.isURLSearchParams(u))d=u.toString();else{var p=[];a.forEach(u,function(h,m){h!=null&&(a.isArray(h)?m+="[]":h=[h],a.forEach(h,function(y){a.isDate(y)?y=y.toISOString():a.isObject(y)&&(y=JSON.stringify(y)),p.push(l(m)+"="+l(y))}))}),d=p.join("&")}if(d){var g=c.indexOf("#");g!==-1&&(c=c.slice(0,g)),c+=(c.indexOf("?")===-1?"?":"&")+d}return c}},function(s,r,o){s.exports=function(a,l,c,u,f){return a.config=l,c&&(a.code=c),a.request=u,a.response=f,a.isAxiosError=!0,a.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},a}},function(s,r,o){var a=o(3),l=o(47),c=o(48),u=o(22),f=o(49),d=o(52),p=o(53),g=o(25);s.exports=function(h){return new Promise(function(m,y){var R=h.data,I=h.headers,T=h.responseType;a.isFormData(R)&&delete I["Content-Type"];var C=new XMLHttpRequest;if(h.auth){var _=h.auth.username||"",A=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";I.Authorization="Basic "+btoa(_+":"+A)}var L=f(h.baseURL,h.url);function E(){if(C){var B="getAllResponseHeaders"in C?d(C.getAllResponseHeaders()):null,b={data:T&&T!=="text"&&T!=="json"?C.response:C.responseText,status:C.status,statusText:C.statusText,headers:B,config:h,request:C};l(m,y,b),C=null}}if(C.open(h.method.toUpperCase(),u(L,h.params,h.paramsSerializer),!0),C.timeout=h.timeout,"onloadend"in C?C.onloadend=E:C.onreadystatechange=function(){C&&C.readyState===4&&(C.status!==0||C.responseURL&&C.responseURL.indexOf("file:")===0)&&setTimeout(E)},C.onabort=function(){C&&(y(g("Request aborted",h,"ECONNABORTED",C)),C=null)},C.onerror=function(){y(g("Network Error",h,null,C)),C=null},C.ontimeout=function(){var B="timeout of "+h.timeout+"ms exceeded";h.timeoutErrorMessage&&(B=h.timeoutErrorMessage),y(g(B,h,h.transitional&&h.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",C)),C=null},a.isStandardBrowserEnv()){var M=(h.withCredentials||p(L))&&h.xsrfCookieName?c.read(h.xsrfCookieName):void 0;M&&(I[h.xsrfHeaderName]=M)}"setRequestHeader"in C&&a.forEach(I,function(B,b){R===void 0&&b.toLowerCase()==="content-type"?delete I[b]:C.setRequestHeader(b,B)}),a.isUndefined(h.withCredentials)||(C.withCredentials=!!h.withCredentials),T&&T!=="json"&&(C.responseType=h.responseType),typeof h.onDownloadProgress=="function"&&C.addEventListener("progress",h.onDownloadProgress),typeof h.onUploadProgress=="function"&&C.upload&&C.upload.addEventListener("progress",h.onUploadProgress),h.cancelToken&&h.cancelToken.promise.then(function(B){C&&(C.abort(),y(B),C=null)}),R||(R=null),C.send(R)})}},function(s,r,o){var a=o(23);s.exports=function(l,c,u,f,d){var p=new Error(l);return a(p,c,u,f,d)}},function(s,r,o){s.exports=function(a){return!(!a||!a.__CANCEL__)}},function(s,r,o){var a=o(3);s.exports=function(l,c){c=c||{};var u={},f=["url","method","data"],d=["headers","auth","proxy","params"],p=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],g=["validateStatus"];
5function h(I,T){return a.isPlainObject(I)&&a.isPlainObject(T)?a.merge(I,T):a.isPlainObject(T)?a.merge({},T):a.isArray(T)?T.slice():T}function m(I){a.isUndefined(c[I])?a.isUndefined(l[I])||(u[I]=h(void 0,l[I])):u[I]=h(l[I],c[I])}a.forEach(f,function(I){a.isUndefined(c[I])||(u[I]=h(void 0,c[I]))}),a.forEach(d,m),a.forEach(p,function(I){a.isUndefined(c[I])?a.isUndefined(l[I])||(u[I]=h(void 0,l[I])):u[I]=h(void 0,c[I])}),a.forEach(g,function(I){I in c?u[I]=h(l[I],c[I]):I in l&&(u[I]=h(void 0,l[I]))});var y=f.concat(d).concat(p).concat(g),R=Object.keys(l).concat(Object.keys(c)).filter(function(I){return y.indexOf(I)===-1});return a.forEach(R,m),u}},function(s,r,o){function a(l){this.message=l}a.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},a.prototype.__CANCEL__=!0,s.exports=a},function(s,r,o){o.r(r),r.default={SDK_CONSTRUCT:"sdkConstruct",SDK_READY:"sdkReady",SDK_NOT_READY:"sdkNotReady",LOGIN:"login",LOGOUT:"logout",CALL:"call",GROUP_CALL:"groupCall",ACCEPT:"accept",REJECT:"reject",HANGUP:"hangup",START_REMOTE_VIEW:"startRemoteView",STOP_REMOTE_VIEW:"stopRemoteView",START_LOCAL_VIEW:"startLocalView",STOP_LOCAL_VIEW:"stopLocalView",OPEN_CAMERA:"openCamera",CLOSE_CAMERA:"closeCamera",SET_MIC_MUTE:"setMicMute",SET_VIDEO_QUALITY:"setVideoQuality",SWITCH_TO_AUDIO_CALL:"switchToAudioCall",SWITCH_TO_VIDEO_CALL:"switchToVideoCall",CHANGE_CALL_STATUS:"changeCallStatus",TALK_TIME:"talktime",ERROR:"error",INVITED:"invited",GROUP_CALL_INVITEE_LIST_UPDATE:"group_call_invitee_list_update",USER_ENTER:"user_enter",USER_LEAVE:"user_leave",NO_RESP:"no_resp",LINE_BUSY:"line_busy",CALLING_CANCEL:"calling_cancel",KICKED_OUT:"kicked_out",CALLING_TIMEOUT:"calling_timeout",CALLING_END:"calling_end",USER_VIDEO_AVAILABLE:"user_video_available",USER_AUDIO_AVAILABLE:"user_audio_available",USER_VOICE_VOLUME:"user_voice_volume",CALL_TYPE_CHANGED:"call_type_changed",DEVICED_UPDATED:"deviced_updated",QUALITY_REPORT:"quality_report"}},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.callRoleMapping=r.callTypeMapping=void 0;var a=o(6),l=o(0);r.callTypeMapping=function(c){var u=l.NAME.UNKNOWN;switch(c){case a.CALL_TYPE.AUDIO_CALL:u=l.NAME.AUDIO;break;case a.CALL_TYPE.VIDEO_CALL:u=l.NAME.VIDEO}return u},r.callRoleMapping=function(c){var u=c;return u===a.CALL_ROLE.INVITER?u=l.NAME.CALLER:u===a.CALL_ROLE.INVITEE&&(u=l.NAME.CALLEE),u}},function(s,r,o){s.exports=o(40)},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0});var a=o(33),l=o(16),c=o(12);r.default={TUICallEngine:a.default,TUICallEvent:l.TUICallEvent,TUICallType:c.TUICallType,TUICallCameraPosition:c.TUICallCameraPosition}},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(V){for(var S,x=1,H=arguments.length;x<H;x++)for(var z in S=arguments[x])Object.prototype.hasOwnProperty.call(S,z)&&(V[z]=S[z]);return V}).apply(this,arguments)},l=this&&this.__decorate||function(V,S,x,H){var z,de=arguments.length,he=de<3?S:H===null?H=Object.getOwnPropertyDescriptor(S,x):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")he=Reflect.decorate(V,S,x,H);else for(var Te=V.length-1;Te>=0;Te--)(z=V[Te])&&(he=(de<3?z(he):de>3?z(S,x,he):z(S,x))||he);return de>3&&he&&Object.defineProperty(S,x,he),he},c=this&&this.__metadata||function(V,S){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(V,S)},u=this&&this.__awaiter||function(V,S,x,H){return new(x||(x=Promise))(function(z,de){function he($){try{Oe(H.next($))}catch(Q){de(Q)}}function Te($){try{Oe(H.throw($))}catch(Q){de(Q)}}function Oe($){var Q;$.done?z($.value):(Q=$.value,Q instanceof x?Q:new x(function(Ce){Ce(Q)})).then(he,Te)}Oe((H=H.apply(V,S||[])).next())})},f=this&&this.__generator||function(V,S){var x,H,z,de,he={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return de={next:Te(0),throw:Te(1),return:Te(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Te(Oe){return function($){return function(Q){if(x)throw new TypeError("Generator is already executing.");for(;he;)try{if(x=1,H&&(z=2&Q[0]?H.return:Q[0]?H.throw||((z=H.return)&&z.call(H),0):H.next)&&!(z=z.call(H,Q[1])).done)return z;
5switch(H=0,z&&(Q=[2&Q[0],z.value]),Q[0]){case 0:case 1:z=Q;break;case 4:return he.label++,{value:Q[1],done:!1};case 5:he.label++,H=Q[1],Q=[0];continue;case 7:Q=he.ops.pop(),he.trys.pop();continue;default:if(z=he.trys,!((z=z.length>0&&z[z.length-1])||Q[0]!==6&&Q[0]!==2)){he=0;continue}if(Q[0]===3&&(!z||Q[1]>z[0]&&Q[1]<z[3])){he.label=Q[1];break}if(Q[0]===6&&he.label<z[1]){he.label=z[1],z=Q;break}if(z&&he.label<z[2]){he.label=z[2],he.ops.push(Q);break}z[2]&&he.ops.pop(),he.trys.pop();continue}Q=S.call(V,he)}catch(Ce){Q=[6,Ce],H=0}finally{x=z=0}if(5&Q[0])throw Q[1];return{value:Q[0]?Q[1]:void 0,done:!0}}([Oe,$])}}},d=this&&this.__spreadArrays||function(){for(var V=0,S=0,x=arguments.length;S<x;S++)V+=arguments[S].length;var H=Array(V),z=0;for(S=0;S<x;S++)for(var de=arguments[S],he=0,Te=de.length;he<Te;he++,z++)H[z]=de[he];return H};Object.defineProperty(r,"__esModule",{value:!0});var p=o(34),g=o(8),h=o(1),m=o(35),y=o(20),R=o(38),I=o(39),T=o(13),C=o(29),_=o(18),A=o(5),L=o(59),E=o(2),M=o(6),B=o(9),b=o(10),k=o(7),U=o(11),O=o(0),D=o(60),J=o(67),ee=o(69),se=o(71),ue=(o(12),o(19)),oe=g.default(),W=function(){function V(S){this._roomID=0,this._strRoomId="",this._quality="1080p",this._localPlayOptions={rotation:B.TRTCVideoRotation.TRTCVideoRotation0,fillMode:B.TRTCVideoFillMode.TRTCVideoFillMode_Fill,muted:!0},this._remotePlayOptions={rotation:B.TRTCVideoRotation.TRTCVideoRotation0,fillMode:B.TRTCVideoFillMode.TRTCVideoFillMode_Fill,mirrorType:B.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable,muted:!1},this._initialCallId="",this._isEnableMultiDeviceAbility=!1,this._logLevel=E.LOGLEVEL_INFO,this._component=17,this._uniqueLoginId="",this._sdkAppID=S.SDKAppID,this._isLogin=!1,this._trtcClient=null,this._userID="",this._userSig="",this._switchCallModeStatus=!0,this._timExternal=!1,this._inviterInviteID={},this._audioVideoSwitchIdList=[],this._acceptedUserObject={},this._callTimeout=30,this._callStatus=M.CALL_STATUS.IDLE,this._callType=M.CALL_TYPE.UNKNOWN,this._isInviter=!1,this._isGroupCall=!1,this._inviteeList=[],this._unHandledInviteeList=[],this._handledInviteeList=[],sessionStorage.setItem("sdkAppId",""+this._sdkAppID),this._language=S.language,this._initLogger(S),S.component&&this.setComponent(S.component),this._netMonitor=new L.default,this._outerEmitter=new p.default,this._delegate=new I.default(this._outerEmitter),this._callDataReport=new J.CallDataReport({version:ue.version,sdkAppId:S.SDKAppID}),this._dataReportObserver=new J.TUICallEngineObserver(this._outerEmitter,this._callDataReport),this._connectStartTime=0,S.tim&&(this._timExternal=!0,h.isFunction(S.tim.addSignalingListener)||(this._logger.info("constructor.start",{text:{data:S},type:"api"}),E.default.error("constructor.start, you need to pass in an instance of @tencentcloud/chat, please use @tencentcloud/chat instead of tim-js-sdk. 需要传入 @tencentcloud/chat 的实例"))),this.tim=S.tim||y.create(S),this._tsignalingClient=new R.default(this,a(a({},S),{tim:this.tim,isRejectNotifyAll:!0})),this.setLogLevel(this._logLevel),this._callRecordReport=new ee.CallRecordReport({version:ue.version,tim:this.tim}),this._recordReportObserver=new ee.TUICallEngineRecordObserver(this._outerEmitter,this._callRecordReport);var x=new T.default(C.default.SDK_CONSTRUCT);this._eventStatController=new _.default,T.default.bindController(this._eventStatController),x.setText("version="+ue.version+"-ua="+A.USER_AGENT).setEnd(),this._logger.info("constructor.start",{text:{data:S},type:"api"}),E.default.info("SDK Version:"+ue.version+", SDKAppID:"+S.SDKAppID+".")}return V.prototype._initLogger=function(S){var x=this;this._logger=oe,this._logger.updateGetReportData(function(){return{app:"TUICallEngine-web",version:ue.version,useragent:{userAgent:window.navigator.userAgent,language:window.navigator.language,platform:window.navigator.platform},platform:O.NAME.WEB,sdkappid:S.SDKAppID,time:+new Date,userid:x.getUserId(),uniqueloginid:x._uniqueLoginId,roomid:String(x.getRoomId()||x.getStrRoomId()),callinfo:{inviteid:x.getInitialCallId(),callrole:x.isInviter()?O.NAME.INVITER:O.NAME.INVITEE,groupid:x.getGroupId(),calltype:x.getCallType(),handledInviteeList:x.getHandledInviteeList(
5),unHandledInviteeList:x.getUnHandledInviteeList()},callkitversion:S.callkitVersion||O.NAME.UNKNOWN,framework:S.frameWork||O.NAME.UNKNOWN,isfromchat:S.chat?"true":"false"}})},V.prototype.getCallType=function(){return this._callType},V.prototype.setCallType=function(S){this._callType=S},V.prototype.isInviter=function(){return this._isInviter},V.prototype.setConnectStartTime=function(S){this._connectStartTime=S},V.prototype.getConnectStartTime=function(){return this._connectStartTime},V.prototype.getInviteeList=function(){return this._inviteeList},V.prototype.setInviteeList=function(S){this._inviteeList=d(S)},V.prototype.getCallDataReport=function(){return this._callDataReport},V.prototype.getCallRecordReport=function(){return this._callRecordReport},V.prototype.getUnHandledInviteeList=function(){return this._unHandledInviteeList||[]},V.prototype.setUnHandledInviteeList=function(S){this._unHandledInviteeList=d(S),E.default.log("setUnHandledInviteeList",this._unHandledInviteeList)},V.prototype.addUnHandledInviteeList=function(S){var x=this;
5S===void 0&&(S=[]),S.length!==0&&S.forEach(function(H){x._unHandledInviteeList.indexOf(H)===-1&&x._unHandledInviteeList.push(H)})},V.prototype.deleteUnHandledInviteeList=function(S){var x=this;S===void 0&&(S=[]),S.length!==0&&S.forEach(function(H){x._unHandledInviteeList=x._unHandledInviteeList.filter(function(z){return z!==H})})},V.prototype.getHandledInviteeList=function(){return this._handledInviteeList||[]},V.prototype.setHandledInviteeList=function(S){this._handledInviteeList=d(S),E.default.log("setHandledInviteeList",this._handledInviteeList)},V.prototype.addHandledInviteeList=function(S){var x=this;S===void 0&&(S=[]),S.length!==0&&S.forEach(function(H){x._handledInviteeList.indexOf(H)===-1&&x._handledInviteeList.push(H)})},V.prototype.deleteHandledInviteeList=function(S){var x=this;S===void 0&&(S=[]),S.length!==0&&S.forEach(function(H){x._handledInviteeList=x._handledInviteeList.filter(function(z){return z!==H})})},V.prototype.isGroupCall=function(){return this._isGroupCall},V.prototype.setIsGroupCall=function(S){this._isGroupCall=S},V.prototype.getGroupId=function(){return this._groupID},V.prototype.setGroupId=function(S){this._groupID=S},V.prototype.getExcludeFromHistoryMessage=function(){return this._excludeFromHistoryMessage},V.prototype.setLocalPlayOptions=function(S){S===void 0&&(S={}),this._localPlayOptions=a(a({},this._localPlayOptions),S)},V.prototype.getLocalPlayOptions=function(){return this._localPlayOptions||{}},V.prototype.setRemotePlayOptions=function(S){S===void 0&&(S={}),this._remotePlayOptions=a(a({},this._remotePlayOptions),S)},V.prototype.getRemotePlayOptions=function(){return this._remotePlayOptions||{}},V.prototype.addAcceptedUserList=function(S,x){var H=this;if(x.length!==0)if(S)(this._acceptedUserObject[S]||[]).length===0?this._acceptedUserObject[S]=x:x.forEach(function(Oe){H._acceptedUserObject[S].indexOf(Oe)===-1&&H._acceptedUserObject[S].push(Oe)});else for(var z=this.getInviterInviteIdList(),de=function(Oe){var $=z[Oe],Q=he.getInviterInviteIdUserList($),Ce=x.filter(function(Ie){return Q.indexOf(Ie)!==-1});(he._acceptedUserObject[$]||[]).length===0?he._acceptedUserObject[$]=Ce:Ce.forEach(function(Ie){H._acceptedUserObject[$].indexOf(Ie)===-1&&H._acceptedUserObject[$].push(Ie)})},he=this,Te=0;Te<z.length;Te++)de(Te)},V.prototype.getAcceptedUserList=function(S){return this._acceptedUserObject[S]||[]},V.prototype.setIsLogin=function(S){this._isLogin=S},V.prototype.getIsLogin=function(){return this._isLogin},V.createInstance=function(S){return oe.updateEsConfig({url:se.ES_URL+"?sdkappid="+(S==null?void 0:S.SDKAppID),table:se.ES_TABLE}),V.instance||(V.instance=new V(S)),V.instance},V.prototype.destroyInstance=function(){var S,x;return u(this,void 0,void 0,function(){return f(this,function(H){switch(H.label){case 0:return this.getIsLogin()?this._timExternal?[4,this.logout()]:[3,2]:[3,4];case 1:return H.sent(),[3,4];case 2:return[4,this.tim.destroy()];case 3:H.sent(),H.label=4;case 4:return this._callDataReport.reset(),this._dataReportObserver.removeLister(),this._callRecordReport.reset(),this._recordReportObserver.removeLister(),(S=this._trtcClient)===null||S===void 0||S.removeTRTCEvents(),this._trtcClient=null,(x=this._tsignalingClient)===null||x===void 0||x.removeTSignalEvents(),this._tsignalingClient=null,V.instance=null,[2]}})})},V.prototype.setLogLevel=function(S){E.default.info("setLogLevel level: "+S),this._logLevel=S,E.default.setLevel(S),this._tsignalingClient&&this._tsignalingClient.setLogLevel(S),this._trtcClient&&this._trtcClient.setLogLevel(S)},V.prototype.on=function(S,x,H){this._outerEmitter.on(S,x,H||this)},V.prototype.off=function(S,x,H){this._outerEmitter.off(S,x,H||this)},V.prototype.init=function(S){return u(this,void 0,void 0,function(){return f(this,function(x){return[2,this.login(S)]})})},V.prototype.login=function(S){return u(this,void 0,void 0,function(){var x,H,z,de,he,Te=this;return f(this,function(Oe){switch(Oe.label){case 0:if(this._uniqueLoginId=h.generateRandomString(6),this._logger.updateGetReportData(function(){return{userid:S.userID,uniqueloginid:Te._uniqueLoginId}}),this._logger.info("login.start",{text:{data:a(a({},S),{userSig:""})},type:"api"}),this.getIsLogin())return this._logger.warn("login.fail",{text:{error:"userId has been login"},type:"api"}),E.default.warn("login - userId has been login"),[2];Oe.label=1;case 1:return Oe.trys.push([1,4,,5]),E.default.log("login - params:",S),this._netMonitor.start(),x=S.userID,H=S.userSig,z=S.assetsPath,this._userID=x,this._callDataReport.setUserID(x),this._userSig=H,this._trtcClient=new m.default({sdkAppID:this._sdkAppID,userID:x,userSig:H,tuiCallEngine:this,assetsPath:z,logLevel:this._logLevel}),sessionStorage.setItem("userId",""+this._userID),[4,this._tsignalingClient.login({userID:x,userSig:H})];case 2:return de=Oe.sent(),this.setIsLogin(!0),[4,this.setSelfIMCallStatus(M.CALL_STATUS.IDLE)];case 3:return Oe.sent(),[2,de];case 4:throw he=Oe.sent(),this._logger.error("login.fail",{text:{error:he},type:"api"}),new Error("login - userId: "+this._userID+" login failed, error: "+he+" ");case 5:return[2]}})})},V.prototype.logout=function(){var S;return u(this,void 0,void 0,function(){var x;return f(this,function(H){switch(H.label){case 0:if(this._logger.info("logout.start",{text:{data:{userID:this._userID,timExternal:this._timExternal}},type:"api"}),E.default.debug("logout"),!this.getIsLogin())return[2];this._userID="",this._uniqueLoginId="",this._userSig="",H.label=1;case 1:return H.trys.push([1,5,,6]),[4,this._resetTUICallEngine()];case 2:return H.sent(),(S=this._trtcClient)===null||S===void 0||S.removeTRTCEvents(),this._trtcClient=null,this.setIsLogin(!1),this._timExternal?[3,4]:[4,this._tsignalingClient.logout()];case 3:H.sent(),H.label=4;case 4:return[2,!0];case 5:throw x=H.sent(),this._logger.error("logout.fail",{text:{data:{userID:this._userID},error:x},type:"api"}),new Error("logout failed, error: "+x+" ");case 6:return[2]}})})},V.prototype.call=function(S){var x,H;return u(this,void 0,void 0,function(){var z,de,he,Te,Oe,$,Q,Ce,Ie,_e,K,ce;return f(this,function(Le){switch(Le.label){case 0:return this._logger.info("call.start",{text:{data:S},type:"api"}
5),E.default.info("call - params:",S),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((z=Le.sent())!==M.CALL_STATUS.IDLE)throw this._logger.error("call.failed",{text:{data:{params:S,customStatus:z}},type:"api"}),new b.default({code:k.default.ERROR_REQUEST_REFUSED,messageParams:{value:z},fnName:"call"});return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(O.NAME.SINGLE_CALL),[4,(x=this._trtcClient)===null||x===void 0?void 0:x.getMediaDevicesAuth({audio:!0})];case 2:if(Le.sent(),de=S.userID,he=S.type,Te=S.offlinePushInfo,Oe=S.roomID,$=S.strRoomID,Q=S.timeout,Ce=S.userData,this.getUserId()===de)throw this._logger.error("call.fail",{text:{error:"Called id can not be yourself. userId:"+this.getUserId()+", inviteeId:"+de},type:"api"}),E.default.error("call failed. Called id can't be yourself. userId:"+this.getUserId()+", inviteeId:"+de),new Error("call failed. Called id can't be yourself. userId:"+this.getUserId()+", inviteeId:"+de);this._callStatus=M.CALL_STATUS.CALLING,this._callType=he,this._isInviter=!0,this._inviterID=this._userID,this._inviteeID=de,this._isGroupCall=!1,this.setGroupId(""),this.analyzeAndSetRoomId(Oe,$),this._callTimeout=h.isUndefined(Q)?this._callTimeout:Q,Ie={callType:O.NAME.SINGLE,mediaType:he,inviteeList:[de]},Le.label=3;case 3:return Le.trys.push([3,9,,11]),[4,(H=this._trtcClient)===null||H===void 0?void 0:H.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return Le.sent(),this._callDataReport.setEnterRoomTime(new Date().getTime()),this._tsignalingClient.setTSignalingIsJoined(!0),_e=this._callDataReport.getCallData(),_e=a(a({},_e),{roomID:this.getRoomId(),callRole:M.CALL_ROLE.INVITER,callType:this._callType,inviteeList:[de]}),this._callDataReport.setCallData(_e),[4,this._tsignalingClient.invite({userID:de,type:he,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,offlinePushInfo:Te,userIDList:[de],userData:Ce})];case 5:return K=Le.sent(),this._callDataReport.setSendSignalingTime(new Date().getTime()),this.setHandledInviteeList([this._userID]),this.setUnHandledInviteeList([de]),K.code!==0?[3,6]:(this.addInviterInviteId(K.inviteID,[this._userID,de]),this._callDataReport.setInviteID(K.inviteID),this.setInitialCallId(K.inviteID),this._callRecordUpload(a({eventType:O.NAME.START_CALL},Ie)),this._callRecordReport.startHeartbeat(),[3,8]);case 6:return this._callDataReport.setCodeAndMessage(K.code,K.message),this._callDataReport.uploadToKibana(),this._callRecordUpload(a({eventType:O.NAME.CALL_FAILED},Ie)),this._logger.error("call.fail",{text:{error:K},type:"api"}),[4,this._resetTUICallEngine()];case 7:Le.sent(),Le.label=8;case 8:return[2,K];case 9:return(ce=Le.sent()).getCode?this._callDataReport.setCodeAndMessage(ce.getCode(),ce.message):ce.code===k.default.ERROR_BLACKLIST?(this._delegate.onError(k.default.ERROR_BLACKLIST,ce.message),this._callDataReport.setCodeAndMessage(k.default.ERROR_BLACKLIST,ce.message)):this._callDataReport.setCodeAndMessage(k.default.UNKNOWN,JSON.stringify(ce)),this._callDataReport.uploadToKibana(),this._callRecordUpload(a({eventType:O.NAME.CALL_FAILED},Ie)),this._logger.error("call.fail",{text:{error:ce},type:"api"}),[4,this._resetTUICallEngine()];case 10:throw Le.sent(),new b.default({message:"<call>: failed "+ce.message,code:ce.code});case 11:return[2]}})})},V.prototype.reportLog=function(S){var x,H;try{if(h.isObject(S)){var z=S||{},de=z.name,he=de===void 0?"":de,Te=z.data,Oe=z.error,$=z.type,Q=$===void 0?"api":$,Ce=z.level,Ie=Ce===void 0?"info":Ce,_e=Ie==="error"?{error:Oe,data:Te}:{data:Te};(H=(x=this._logger)===null||x===void 0?void 0:x[Ie])===null||H===void 0||H.call(x,he,{text:_e,type:Q})}}catch(K){}},V.prototype.addAudioVideoSwitchIdList=function(S){S&&this._audioVideoSwitchIdList.push(S)},V.prototype.getAudioVideoSwitchIdList=function(){return this._audioVideoSwitchIdList||[]},V.prototype.addInviterInviteId=function(S,x){x.length!==0&&((this._inviterInviteID[S]||[]).length===0?this._inviterInviteID[S]=x:this._inviterInviteID[S]=d(this._inviterInviteID[S],x))},V.prototype.getInviterInviteIdList=function(){return Object.keys(this._inviterInviteID||{})},V.prototype.getTotalInviterInviteIdList=function(){var S=this.getInviterInviteIdList();return d(this._audioVideoSwitchIdList,S)},V.prototype.getInviterInviteIdUserList=function(S){var x=this,H=[];return S?H=this._inviterInviteID[S]||[]:this.getInviterInviteIdList().forEac
5h(function(z){H=d(H,x.getInviterInviteIdUserList(z))}),H},V.prototype.getInviterID=function(){return this._inviterID},V.prototype.setInviterID=function(S){this._inviterID=S},V.prototype.groupCall=function(S){var x,H;return u(this,void 0,void 0,function(){var z,de,he,Te,Oe,$,Q,Ce,Ie,_e,K,ce;return f(this,function(Le){switch(Le.label){case 0:return this._logger.info("groupCall.start",{text:{data:S},type:"api"}),E.default.debug("groupCall - params:",S),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((z=Le.sent())!==M.CALL_STATUS.IDLE)throw this._logger.error("groupCall.failed",{text:{data:{params:S,customStatus:z}},type:"api"}),new b.default({code:k.default.ERROR_REQUEST_REFUSED,messageParams:{value:z},fnName:"groupCall"});return[4,(x=this._trtcClient)===null||x===void 0?void 0:x.getMediaDevicesAuth({audio:!0})];case 2:if(Le.sent(),de=S.userIDList,he=S.type,Te=S.groupID,Oe=S.offlinePushInfo,$=S.roomID,Q=S.strRoomID,Ce=S.timeout,Ie=S.userData,(de=d(de)).indexOf(this.getUserId())!==-1)throw E.default.error("groupCall failed. Called list can't contain yourself. userId:"+this.getUserId()+", inviteeIdList:"+de),new Error("groupCall failed. Called list can't contain yourself. userId:"+this.getUserId()+", inviteeIdList:"+de);this._callStatus=M.CALL_STATUS.CALLING,this._callType=he,this._isInviter=!0,this._isGroupCall=!0,this._inviterID=this._userID,this.setGroupId(Te||""),this.setInviteeList(de),this.setHandledInviteeList([this._userID]),this.setUnHandledInviteeList(de),this.analyzeAndSetRoomId($,Q),this._callTimeout=h.isUndefined(Ce)?this._callTimeout:Ce,this._callDataReport.setCallScene(O.NAME.GROUP_CALL),_e={callType:O.NAME.GROUP,mediaType:he,inviteeList:de},Le.label=3;case 3:return Le.trys.push([3,9,,11]),[4,(H=this._trtcClient)===null||H===void 0?void 0:H.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return Le.sent(),this._tsignalingClient.setTSignalingIsJoined(!0),[4,this._tsignalingClient.inviteInGroup({groupID:this.getGroupId(),userIDList:de,type:he,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,offlinePushInfo:Oe,userData:Ie})];case 5:return K=Le.sent(),E.default.log("groupCall res",K),Te?K.code!==0?[3,6]:(this.addInviterInviteId(K.inviteID,d([this._userID],de)),this.setInitialCallId(K.inviteID),this._callRecordUpload(a({eventType:O.NAME.START_CALL},_e)),this._callRecordReport.startHeartbeat(),[3,8]):[3,8];case 6:return this._callRecordUpload(a({eventType:O.NAME.CALL_FAILED},_e)),this._logger.error("inviteInGroup.fail",{text:{data:K},type:"api"}),[4,this._resetTUICallEngine()];case 7:Le.sent(),Le.label=8;case 8:return[2,K];case 9:return ce=Le.sent(),this._callRecordUpload(a({eventType:O.NAME.CALL_FAILED},_e)),this._logger.error("groupCall.fail",{text:{error:ce},type:"api"}),[4,this._resetTUICallEngine()];case 10:throw Le.sent(),new b.default({message:"<groupCall>: failed "+ce.message,code:ce.code});case 11:return[2]}})})},V.prototype.joinInGroupCall=function(S){var x,H;return u(this,void 0,void 0,function(){var z,de,he,Te,Oe,$,Q;return f(this,function(Ce){switch(Ce.label){case 0:return this._logger.info("joinInGroupCall.start",{text:{data:S},type:"api"}),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((z=Ce.sent())!==M.CALL_STATUS.IDLE)throw this._logger.error("joinInGroupCall.failed",{text:{data:{params:S,customStatus:z}},type:"api"}),new b.default({code:k.default.ERROR_REQUEST_REFUSED,messageParams:{value:z},fnName:"joinInGroupCall"});return[4,(x=this._trtcClient)===null||x===void 0?void 0:x.getMediaDevicesAuth({audio:!0})];case 2:Ce.sent(),Ce.label=3;case 3:return Ce.trys.push([3,6,,8]),de=S.roomID,he=S.strRoomID,Te=S.type,Oe=S.groupID,this._callType=Te,this.setGroupId(Oe||""),this.analyzeAndSetRoomId(de,he),this._isGroupCall=!0,this._isInviter=!1,this.addHandledInviteeList([this.getUserId()]),this.changeCallStatus(M.CALL_STATUS.CALLING),[4,(H=this._trtcClient)===null||H===void 0?void 0:H.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return Ce.sent(),[4,this.setSelfIMCallStatus(M.CALL_STATUS.CONNECTED)];case 5:return Ce.sent(),this.changeCallStatus(M.CALL_STATUS.CONNECTED),this.getCallRecordReport().setBodyStatus(M.CALL_STATUS.CONNECTED),E.default.log("joinInGroupCall roomID:"+de+",type:"+Te+",userID:"+this.getUserId()),$={eventType:O.NAME.JOIN_IN_GROUP_CALL,callType:O.NAME.GROUP,mediaType:this._callType},this._callRecordUpload($),this._callRecordReport.startHeartbeat(),[3,8];case 6:return Q=Ce.sent(),this._logger.error("joinInGroupCall.fail",{text:{error:Q},type:"api"}),[4,this._resetTUICallEngine()];case 7:throw Ce.sent(),new Error("joinInGroupCall failed error: "+Q);case 8:return[2]}})})},V.prototype.inviteUser=function(S){return u(this,void 0,void 0,function(){var x,H,z,de,he,Te,Oe,$,Q,Ce,Ie,_e=this;return f(this,function(K){switch(K.label){case 0:if(this._logger.info("inviteUser.start",{text:{data:S},type:"api"}),!this.isGroupCall())throw this._logger.error("inviteUser.fail",{text:{error:"inv
5iteUser failed",data:S},type:"api"}),E.default.error("inviteUser failed - groupID:"+this.getGroupId()+", roomID:"+this.getRoomId()+", type:"+this._callType),new Error("inviteUser failed - groupID:"+this.getGroupId()+", roomID:"+this.getRoomId()+", type:"+this._callType);if(!this.isInviter()&&this._callStatus!==M.CALL_STATUS.CONNECTED)throw this._logger.error("inviteUser.fail",{text:{error:"current status:"+this._callStatus+" not support"},type:"api"}),E.default.error("inviteUser failed - current status:"+this._callStatus+" not support"),new Error("inviteUser failed - current status:"+this._callStatus+" not support");if(x=S.userIDList,H=x===void 0?[]:x,z=S.offlinePushInfo,H.length===0)throw this._logger.error("inviteUser.fail",{text:{error:"userIDList is empty"},type:"api"}),E.default.error("inviteUser failed - userIDList is empty"),new Error("inviteUser failed - userIDList is empty");if(de=this.getHandledInviteeList(),he=this.getUnHandledInviteeList(),Te=d(de,he),(Oe=H.filter(function(ce){return Te.indexOf(ce)===-1})).length===0)return this._logger.error("inviteUser.fail",{text:{error:"userIDList in call list",data:{userIDList:H,totalUserList:Te}},type:"api"}),E.default.error("inviteUser failed - userIDList in call list. userIDList:"+JSON.stringify(H)+", call list:"+JSON.stringify(Te)),[2,Promise.reject("inviteUser failed - userIDList in call list. userIDList:"+JSON.stringify(H)+", call list:"+JSON.stringify(Te))];H=Oe,K.label=1;case 1:return K.trys.push([1,3,,4]),$=this._handledInviteeList.filter(function(ce){return ce!==_e._userID}),[4,this._tsignalingClient.inviteInGroup({groupID:this.getGroupId(),userIDList:H,type:this._callType,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,inCallUserIDs:d(this._unHandledInviteeList,$),offlinePushInfo:z,initialCallId:this.getInitialCallId()})];case 2:return Q=K.sent(),E.default.log("inviteUser res",Q),Q.code===0?(this.addUnHandledInviteeList(H),this.addInviterInviteId(Q.inviteID,d([this._userID],H)),Ce={eventType:O.NAME.INVITE_USER,callType:O.NAME.GROUP,mediaType:this._callType,inviteeList:H},this._callRecordUpload(Ce)):this._logger.error("inviteUser.fail",{type:"api"}),[2,Q];case 3:throw Ie=K.sent(),new Error("inviteUser failed, userId:"+this.getUserId()+", inviteeIdList:"+H+", error: "+Ie);case 4:return[2]}})})},V.prototype.accept=function(){var S,x;return u(this,void 0,void 0,function(){var H,z,de,he,Te,Oe,$,Q,Ce;return f(this,function(Ie){switch(Ie.label){case 0:return this._logger.info("accept.start",{text:{data:{callStatus:this.getCallStatus(),inviteData:this._tsignalingClient.getInviteData()},type:"api"}}),E.default.debug("accept"),this.getCallStatus()===M.CALL_STATUS.CONNECTED?(this._logger.error("accept.fail",{text:{error:"already connected, avoid repeat accept"},type:"api"}),E.default.warn("accept - already connected, avoid repeat accept"),[2]):this._tsignalingClient.getInviteData()?(this._callDataReport.setCallAcceptTime(new Date().getTime()),[4,(S=this._trtcClient)===null||S===void 0?void 0:S.getMediaDevicesAuth({audio:!0})]):(this._logger.error("accept.fail",{text:{error:"there are no calls to accept"},type:"api"}),E.default.warn("accept - there are no calls to accept"),[2]);case 1:return Ie.sent().audio?[3,3]:[4,this._resetTUICallEngine()];case 2:Ie.sent(),Ie.label=3;case 3:H=this._tsignalingClient.getInviteData(),z=H.inviteID,de=H.inviteData,he=de.roomID,Te=de.callType,E.default.debug("accept - params","inviteID: "+z+",callType: "+Te+",roomID: "+he+"."),this._callType=Te,this._callStatus=M.CALL_STATUS.CALLING,Oe={},Ie.label=4;case 4:return Ie.trys.push([4,6,,8]),this._callDataReport.setEnterRoomTime(new Date().getTime()),[4,(x=this._trtcClient)===null||x===void 0?void 0:x.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 5:return Ie.sent(),this.addHandledInviteeList([this.getUserId()]),this.deleteUnHandledInviteeList([this.getUserId()]),this.addAcceptedUserList(z,[this.getUserId()]),this._tsignalingClient.setInviteData(null),this.changeCallStatus(M.CALL_STATUS.CONNECTED),this.getCallRecordReport().setBodyStatus(M.CALL_STATUS.CONNECTED),[3,8];case 6:return $=Ie.sent(),this.isGroupCall()||($.getCode?this._callDataReport.setCodeAndMessage($.getCode(),$.message):this._callDataReport.setCodeAndMessage(k.default.UNKNOWN,JSON.stringify($)),this._callDataReport.uploadToKibana()),this._logger.error("accept.join.fail",{text:{error:$},type:"api"}),[4,this._resetTUICallEngine()];case 7:throw Ie.sent(),new Error("accept failed, error: "+$);case 8:Oe={roomID:he,callType:Te},Ie.label=9;case 9:return Ie.trys.push([9,13,,15]),[4,this.modifyInvitation(z)];case 10:return Ie.sent(),[4,this._tsignalingClient.accept({inviteID:z,callType:Te})];case 11:return Q=Ie.sent(),[4,this.setSelfIMCallStatus(M.CALL_STATUS.CONNECTED)];case 12:return Ie.sent(),this._callRecordUpload({eventType:O.NAME.ACCEPT_CALL}),[3,15];case 13:return Ce=Ie.sent(),this._logger.error("accept.fail",{text:{error:Ce},type:"api"}),E.default.error(Ce),[4,this._resetTUICallEngine()];case 14:throw Ie.sent(),this.isGroupCall()||(this._callDataReport.setCodeAndMessage(k.default.UNKNOWN,JSON.stringify(Ce)),this._callDataReport.uploadToKibana()),new b.default({message:"<accept>: failed "+Ce.message,code:Ce.code});case 15:return[2,a(a({},Oe),Q)]}})})},V.prototype.reject=function(){return u(this,void 0,void 0,function(){var S,x,H,z,de,he,Te,Oe;return f(this,function($){switch($.label){case 0:if(this._logger.info("reject.start",{text:{data:{inviteData:this._tsignalingClient.getInviteData(),callStatus:this._callStatus},type:"api"}}),!this._tsignalingClient.getInviteData())return E.default.warn("reject - there are no calls to reject"),[2];S=this._callStatus===M.CALL_STATUS.CONNECTED,x=this._tsignalingClient.getInviteData(),H=x.inviteID,z=x.inviteData,de=z.callType,E.default.warn("reject - params","inviteID: "+H+",callType: "+de+",isBusy: "+S+"."),$.label=1;case 1:return $.trys.push([1,5,,6]),[4,this._tsignalingClient.reject({inviteID:H,callType:de,isBusy:S})];case 2:return he=$.sent(),this._callRecordUpload({eventType:O.NAME.REJECT_CALL}),S?[3,4]:(Te=this.generateEventData(),[4,this._resetTUICallEngine()]);case 3:$.sent(),this._delegate.onCallingCancel(a(a({userID:this._userID},Te),{reason:O.NAME.REJECT})),$.label=4;case 4:return[2,he];
5case 5:throw Oe=$.sent(),this._logger.error("reject.fail",{text:{error:Oe},type:"api"}),new b.default({message:"<reject>: failed "+Oe.message,code:Oe.code});case 6:return[2]}})})},V.prototype.hangup=function(){var S;return u(this,void 0,void 0,function(){var x,H,z,de,he,Te,Oe,$,Q,Ce,Ie,_e,K,ce,Le,Ue,St,te,De,ut;return f(this,function(Ke){switch(Ke.label){case 0:if(this._logger.info("hangup.start",{text:{data:{inviteData:this._tsignalingClient.getInviteData(),callStatus:this._callStatus,inviterInviteID:this._acceptedUserObject,inviteIdList:this.getInviterInviteIdList(),isInviter:this.isInviter(),isGroupCall:this.isGroupCall(),callType:this.getCallType(),currentUserID:this.getUserId()}},type:"api"}),E.default.warn(" - callStatus:"+this._callStatus+" _inviterInviteID:"+JSON.stringify(this._acceptedUserObject)),this._callStatus===M.CALL_STATUS.IDLE)throw this._logger.error("hangup.fail",{text:{error:"current status:"+this._callStatus,type:"api"}}),new Error("hangup failed. current status:"+this._callStatus);if(this._callStatus===M.CALL_STATUS.CALLING&&this.getInviterInviteIdList().length===0)throw this._logger.error("hangup.fail",{text:{error:"call/groupCall incomplete。please wait cancel"},type:"api"}),new Error("call/groupCall incomplete。please wait cancel");if(x=this.isGroupCall(),H=this.isInviter(),z=this.getUserId(),de=this.generateCallTotalTime(),he=this.getCallType(),Oe=this.getInviterInviteIdList(),this._callStatus!==M.CALL_STATUS.CONNECTED)return[3,7];Ke.label=1;case 1:return Ke.trys.push([1,5,,7]),[4,(S=this._trtcClient)===null||S===void 0?void 0:S.exitRoom()];case 2:return Ke.sent(),Oe.length!==0?[3,4]:(_e=this.generateCallEndData({callMediaType:he,totalTime:de}),this._delegate.onCallEnd(_e),[4,this._resetTUICallEngine()]);case 3:Ke.sent(),Ke.label=4;case 4:return[3,7];case 5:return $=Ke.sent(),this._logger.error("hangup.fail",{text:{error:$},type:"api"}),[4,this._resetTUICallEngine()];case 6:throw Ke.sent(),new Error($);case 7:Q=this.getHandledInviteeList(),Ce=this.getUnHandledInviteeList(),Ie=this.generateEventData(),Ke.label=8;case 8:return Ke.trys.push([8,30,,31]),x?[3,15]:(_e=this.generateCallEndData(),H?Ce.length!==1?[3,10]:[4,this._cancel()]:[3,12]);case 9:return Te=Ke.sent(),this._delegate.onCallingCancel(a(a({userID:z},Ie),{reason:O.NAME.NORMAL})),[3,11];case 10:this._delegate.onCallEnd(_e),Ke.label=11;case 11:return[3,13];case 12:this._delegate.onCallEnd(_e),Ke.label=13;case 13:return[4,this._resetTUICallEngine()];case 14:return Ke.sent(),[3,29];case 15:return K=this.getCallStatus(),ce={callType:he,userIDList:d(Q.filter(function(un){return un!==z}),Ce),callEnd:de},H?K!==M.CALL_STATUS.CALLING?[3,18]:[4,this._cancel(this.getInviterInviteIdList())]:[3,23];case 16:return Te=Ke.sent(),[4,this._resetTUICallEngine()];case 17:Ke.sent(),this._delegate.onCallingCancel(a(a({userID:z},Ie),{reason:O.NAME.NORMAL})),Ke.label=18;case 18:if(K!==M.CALL_STATUS.CONNECTED)return[3,22];Le=function(un){var jt,dn,kn,Nn,$n,xn;return f(this,function(rn){switch(rn.label){case 0:return jt=Oe[un],dn=Ue.getInviterInviteIdUserList(jt),(kn=Ue.getAcceptedUserList(jt)).length>0?(Nn=kn.filter(function(wt){return Q.indexOf(wt)!==-1}),$n=dn.filter(function(wt){return Ce.indexOf(wt)!==-1}),ce.userIDList=d(Nn,$n).filter(function(wt){return wt!==z}),E.default.warn("inviter emit hangup signal, notify userIDList:"+JSON.stringify(ce.userIDList)),ce.userIDList.length===0?[3,2]:[4,Ue._tsignalingClient.hangup(ce)]):[3,5];case 1:return Te=rn.sent(),[3,4];case 2:return Q.length>1?(ce.userIDList=Q.filter(function(wt){return wt!==z}),[4,Ue._tsignalingClient.hangup(ce)]):[3,4];case 3:Te=rn.sent(),rn.label=4;case 4:return[3,7];case 5:return xn=Ue.getUnHandledInviteeList(),dn.filter(function(wt){return xn.indexOf(wt)!==-1}).length>0?(E.default.warn("inviter emit cancel signal, userIdList:"+dn),[4,Ue._cancel([jt])]):[3,7];case 6:Te=rn.sent(),rn.label=7;case 7:return[2]}})},Ue=this,De=0,Ke.label=19;case 19:return De<Oe.length?[5,Le(De)]:[3,22];case 20:Ke.sent(),Ke.label=21;case 21:return De++,[3,19];case 22:return[3,27];case 23:St=function(un){var jt,dn,kn,Nn,$n,xn,rn;return f(this,function(wt){switch(wt.label){case 0:return jt=Oe[un],dn=te.getInviterInviteIdUserList(jt),(kn=te.getAcceptedUserList(jt)).length>0?(Nn=kn.filter(function(en){return Q.indexOf(en)!==-1}),$n=dn.filter(function(en){return Ce.indexOf(en)!==-1}),ce.userIDList=d(Nn,$n).filter(function(en){return en!==z}
5),E.default.warn("invitee emit hangup signal, notify userIDList:"+JSON.stringify(ce.userIDList)),ce.userIDList.length!==0?[3,1]:(xn=te.generateCallEndData({callMediaType:he,totalTime:de}),te._delegate.onCallEnd(xn),[3,3])):[3,4];case 1:return Q.length>1&&(ce.userIDList=Q.filter(function(en){return en!==z})),[4,te._tsignalingClient.hangup(ce)];case 2:Te=wt.sent(),wt.label=3;case 3:return[3,6];case 4:return rn=te.getUnHandledInviteeList(),dn.filter(function(en){return rn.indexOf(en)!==-1}).length>0?(E.default.warn("invitee emit cancel signal, inviteID:"+jt),[4,te._cancel([jt])]):[3,6];case 5:Te=wt.sent(),wt.label=6;case 6:return[2]}})},te=this,De=0,Ke.label=24;case 24:return De<Oe.length?[5,St(De)]:[3,27];case 25:Ke.sent(),Ke.label=26;case 26:return De++,[3,24];case 27:return[4,this._resetTUICallEngine()];case 28:Ke.sent(),Ke.label=29;case 29:return[2,Te];case 30:throw ut=Ke.sent(),this._logger.error("hangup.fail",{text:{error:ut},type:"api"}),E.default.warn("hangup failed, error: "+ut),new Error("hangup failed, error: "+ut);case 31:return[2]}})})},V.prototype._cancel=function(S){return u(this,void 0,void 0,function(){var x,H,z,de,he,Te;return f(this,function(Oe){switch(Oe.label){case 0:this._logger.info("_cancel.start",{text:{data:{inviteIDList:S,inviterInviteID:this._inviterInviteID},type:"api"}}),E.default.info("_cancel _inviterInviteID",this._inviterInviteID),x=[],Oe.label=1;case 1:return Oe.trys.push([1,7,,8]),(S||[]).length===0&&(S=this.getInviterInviteIdList().slice(0,1)),[4,this.modifyInvitation(S[0])];case 2:Oe.sent(),H=0,Oe.label=3;case 3:return H<S.length?(z=S[H],[4,this._tsignalingClient.cancel({inviteID:z})]):[3,6];case 4:de=Oe.sent(),x.push(de),Oe.label=5;case 5:return H++,[3,3];case 6:return[3,8];case 7:throw he=Oe.sent(),this._logger.error("_cancel.fail",{text:{error:he},type:"api"}),new b.default({message:"<_cancel>: failed "+he.message,code:he.code});case 8:return Te="cancel "+JSON.stringify(x)+" succeeded",E.default.log("_cancel "+Te),[2,x]}})})},V.prototype.startRemoteView=function(S){var x;return u(this,void 0,void 0,function(){var H,z,de,he;return f(this,function(Te){return this._logger.info("startRemoteView.start",{text:{data:S},type:"api"}),E.default.info("startRemoteView - params:",S),H=S.userID,z=S.videoViewDomID,(de=S.options)&&(he=h.analyzeVideoRenderParams(de),this.setRemotePlayOptions(he)),[2,(x=this._trtcClient)===null||x===void 0?void 0:x.startRemoteView({userId:H,videoViewDomId:z,options:de})]})})},V.prototype.stopRemoteView=function(S){var x;return u(this,void 0,void 0,function(){return f(this,function(H){return this._logger.info("stopRemoteView.start",{text:{data:S},type:"api"}),E.default.debug("stopRemoteView - params:",S),[2,(x=this._trtcClient)===null||x===void 0?void 0:x.stopRemoteView({userId:S.userID})]})})},V.prototype.startLocalView=function(S){return u(this,void 0,void 0,function(){return f(this,function(x){return E.default.warn("startLocalView interface is deprecated after v3.0.0"),[2]})})},V.prototype.stopLocalView=function(S){return u(this,void 0,void 0,function(){return f(this,function(x){return E.default.warn("stopLocalView interface is deprecated after v3.0.0"),[2]})})},V.prototype.openCamera=function(S,x){var H,z;return u(this,void 0,void 0,function(){var de;return f(this,function(he){switch(he.label){case 0:return he.trys.push([0,3,,4]),this._logger.info("openCamera.start",{text:{data:{videoViewDomID:S,isFrontCamera:x}},type:"api"}),[4,(H=this._trtcClient)===null||H===void 0?void 0:H.getMediaDevicesAuth({video:!0})];case 1:return he.sent(),[4,(z=this._trtcClient)===null||z===void 0?void 0:z.startLocalPreview(S,x)];case 2:return he.sent(),[3,4];case 3:throw de=he.sent(),this._logger.error("openCamera.fail",{text:{error:de},type:"api"}),E.default.error("openCamera failed. error: "+de),new Error("openCamera failed. error: "+de);case 4:return[2]}})})},V.prototype.closeCamera=function(){var S;return u(this,void 0,void 0,function(){return f(this,function(x){try{return this._logger.info("closeCamera.start",{type:"api"}),[2,(S=this._trtcClient)===null||S===void 0?void 0:S.stopLocalPreview()]}catch(H){throw new Error("closeCamera failed. error: "+H)}return[2]})})},V.prototype.openMicrophone=function(){var S;return u(this,void 0,void 0,function(){return f(this,function(x){switch(x.label){case 0:return this._logger.info("openMicrophone.start",{type:"api"}),[4,(S=this._trtcClient)===null||S===void 0?void 0:S.unMuteLocalAudio()];case 1:return x.sent(),[2]}})})},V.prototype.closeMicrophone=function(){var S;return u(this,void 0,void 0,function(){return f(this,function(x){switch(x.label){case 0:return this._logger.info("closeMicrophone.start",{type:"api"}),[4,(S=this._trtcClient)===null||S===void 0?void 0:S.muteLocalAudio()];case 1:return x.sent(),[2]}})})},V.prototype.setVideoQuality=function(S){var x;return u(this,void 0,void 0,function(){return f(this,function(H){switch(H.label){case 0:return this._logger.info("setVideoQuality.start",{text:{data:{profile:S,currentProfile:this.getVideoQuality(),hasTrtcClient:!!this._trtcClient}},type:"api"}),E.default.debug("setVideoQuality - quality:"+JSON.stringify(S)),S===this.getVideoQuality()?(E.default.warn("setVideoQuality failed - profile not change"),[2]):(this._quality=S,[4,(x=this._trtcClient)===null||x===void 0?void 0:x.setVideoEncoderParam(S)]);case 1:return H.sent(),[2]}})})},V.prototype.getVideoQuality=function(){return this._quality},V.prototype.setVideoRenderParams=function(S){var x;return u(this,void 0,void 0,function(){var H;return f(this,function(z){switch(z.label){case 0:return this._logger.info("setVideoRenderParams.start",{text:{data:{params:S,hasTRTCClient:!!this._trtcClient}},type:"api"}),H=h.analyzeVideoRenderParams(S),S.userID===this.getUserId()?(this.setLocalPlayOptions(H),H=this.getLocalPlayOptions()):(this.setRemotePlayOptions(H),H=this.getRemotePlayOptions()),[4,(x=this._trtcClient)===null||x===void 0?void 0:x.setVideoRenderParams(a({userId:S.userID},H))];case 1:return z.sent(),[2]}})})},V.prototype.switchCallMediaType=function(S){return u(this,void 0,void 0,function(){var x,H;return f(this,function(z){switch(z.label){case 0:if(this._logger.info("switchCallMediaType.start",{text:{data:{newMediaType:S,currentCallType:this._callType}},type:"api"}),this._callType===S)throw this._logger.error("switchCallMediaType.fail",{text:{error:U.ERROR_MESSAGE.ERROR_REQUEST_REPEATE
5D_SWITCH},type:"api"}),new b.default({message:"<switchCallMediaType>: "+U.ERROR_MESSAGE.ERROR_REQUEST_REPEATED_SWITCH,code:k.default.ERROR_REQUEST_REPEATED});if(!this._switchCallModeStatus)throw this._logger.error("switchCallMediaType.fail",{text:{error:"audio and video call switching"},type:"api"}),new Error("audio and video call switching.");E.default.info("switchCallMediaType",this._inviterID,this._inviteeID),z.label=1;case 1:return z.trys.push([1,3,,4]),[4,this._tsignalingClient.switchCallMode({userID:this._isInviter?this._inviteeID:this._inviterID,callType:this._callType,roomID:this.getRoomId(),timeout:this._callTimeout,mode:S===M.CALL_TYPE.AUDIO_CALL?M.MODE_TYPE.AUDIO:M.MODE_TYPE.VIDEO})];case 2:return x=z.sent(),this.setSwitchCallModeStatus(!1),[2,x];case 3:throw H=z.sent(),this._logger.error("switchCallMediaType.fail",{text:{error:H},type:"api"}),new Error("switchCallMediaType failed, error: "+H);case 4:return[2]}})})},V.prototype.setSwitchCallModeStatus=function(S){this._switchCallModeStatus=S},V.prototype.getSwitchCallModeStatus=function(){return this._switchCallModeStatus},V.prototype.getDeviceList=function(S){return u(this,void 0,void 0,function(){return f(this,function(x){switch(x.label){case 0:return this._logger.info("getDeviceList.start",{text:{data:{deviceType:S}},type:"api"}),(S=S===B.DEVICE_TYPE.MICROPHONES?B.DEVICE_TYPE.MICROPHONE:S)!==B.DEVICE_TYPE.MICROPHONE&&S!==B.DEVICE_TYPE.SPEAKER?[3,2]:[4,this._trtcClient.getMediaDevicesAuth({audio:!0})];case 1:x.sent(),x.label=2;case 2:return S!==B.DEVICE_TYPE.CAMERA?[3,4]:[4,this._trtcClient.getMediaDevicesAuth({video:!0,isThrowVideoError:!0})];case 3:x.sent(),x.label=4;case 4:return[4,this._trtcClient.getDeviceList(S)];case 5:return[2,x.sent()]}})})},V.prototype.getCurrentDevice=function(S){return this._trtcClient.getCurrentDevice(S)},V.prototype.switchCamera=function(S){return u(this,void 0,void 0,function(){return f(this,function(x){switch(x.label){case 0:this._logger.info("switchCamera.start",{text:{data:{cameraPosition:S}},type:"api"}),x.label=1;case 1:return x.trys.push([1,3,,4]),[4,this._trtcClient.switchCamera(S)];case 2:return x.sent(),[3,4];case 3:throw x.sent();case 4:return[2]}})})},V.prototype.switchDevice=function(S){var x;return u(this,void 0,void 0,function(){var H,z;return f(this,function(de){switch(de.label){case 0:return this._logger.info("switchDevice.start",{text:{data:{params:S}},type:"api"}),H=S.deviceType,z=S.deviceId,H===B.DEVICE_TYPE.VIDEO&&(H=B.DEVICE_TYPE.CAMERA),H!==B.DEVICE_TYPE.AUDIO&&H!==B.DEVICE_TYPE.MICROPHONES||(H=B.DEVICE_TYPE.MICROPHONE),E.default.debug("switchDevice - params: deviceType:"+H+",deviceID:"+z),[4,(x=this._trtcClient)===null||x===void 0?void 0:x.switchDevice(H,z)];case 1:return[2,de.sent()]}})})},V.prototype.setSelfInfo=function(S){return u(this,void 0,void 0,function(){var x,H,z;return f(this,function(de){return this._logger.info("setSelfInfo.start",{text:{data:{params:S}},type:"api"}),x=S.nickName,H=S.avatar,z={nick:x,avatar:H},!x&&delete z.nick,!H&&delete z.avatar,E.default.info("setSelfInfo -params: nickName:"+z.nick+",avatar:"+z.avatar),[2,this.tim.updateMyProfile(z)]})})},V.prototype.generateCallEndData=function(S){var x=S||{},H=x.roomId,z=x.callMediaType,de=x.callRole,he=x.totalTime,Te=x.userId;return H=H||this.getRoomId(),z=z||this.getCallType(),de||(de=this.isInviter()?M.CALL_ROLE.INVITER:M.CALL_ROLE.INVITEE),he=h.isUndefined(he)?this.generateCallTotalTime():he,Te=Te||this.getUserId(),{callID:this.getInitialCallId()||this.getInviterInviteIdList()[0],roomID:H,strRoomID:this.getStrRoomId(),callMediaType:z,callRole:de,totalTime:he,userID:Te}},V.prototype.generateEventData=function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomId(),strRoomID:this.getStrRoomId(),callRole:this._isInviter?O.NAME.INVITER:O.NAME.INVITEE,callMediaType:this._callType}},V.prototype.enableMultiDeviceAbility=function(S){this._logger.info("enableMultiDeviceAbility.start",{text:{data:{enable:S}},type:"api"}),this.setIsEnableMultiDeviceAbility(S)},V.prototype.enableAIVoice=function(S){var x;return u(this,void 0,void 0,function(){return f(this,function(H){switch(H.label){case 0:return this._logger.info("enableAIVoice.start",{text:{data:{enable:S}},type:"api"}),this._trtcClient?[4,(x=this._trtcClient)===null||x===void 0?void 0:x.enableAIVoice(S)]:[3,2];case 1:H.sent(),H.label=2;case 2:return[2]}})})}
5,V.prototype.setBlurBackground=function(S){var x;return u(this,void 0,void 0,function(){var H;return f(this,function(z){switch(z.label){case 0:return z.trys.push([0,2,,3]),this._logger.info("setBlurBackground.start",{type:"api",text:{data:{blurLevel:S}}}),[4,(x=this._trtcClient)===null||x===void 0?void 0:x.setVirtualBackground({enable:S!==0,type:O.NAME.BLUR,blurLevel:S})];case 1:return z.sent(),[3,3];case 2:throw H=z.sent(),this._logger.error("setBlurBackground.fail",{text:{error:H},type:"api"}),H;case 3:return[2]}})})},V.prototype.setVirtualBackground=function(S){var x;return u(this,void 0,void 0,function(){var H;return f(this,function(z){switch(z.label){case 0:return z.trys.push([0,2,,3]),this._logger.info("setVirtualBackground.start",{type:"api",text:{data:{imagePath:S}}}),[4,(x=this._trtcClient)===null||x===void 0?void 0:x.setVirtualBackground({enable:!!S,type:O.NAME.IMAGE,imagePath:S})];case 1:return z.sent(),[3,3];case 2:throw H=z.sent(),this._logger.error("setVirtualBackground.fail",{text:{error:H},type:"api"}),H;case 3:return[2]}})})},V.prototype.getTRTCCloudInstance=function(){var S;return(S=this._trtcClient)===null||S===void 0?void 0:S.getTRTCCloud()},V.prototype._resetTUICallEngine=function(){var S;return u(this,void 0,void 0,function(){var x;return f(this,function(H){switch(H.label){case 0:return this.getCallStatus()===M.CALL_STATUS.IDLE?[3,2]:(this._callStatus=M.CALL_STATUS.IDLE,this.getIsLogin()?[4,this.setSelfIMCallStatus(M.CALL_STATUS.IDLE)]:[3,2]);case 1:H.sent(),H.label=2;case 2:return E.default.debug("_resetTUICallEngine"),this._roomID=0,this._strRoomId="",this._isInviter=!1,this._isGroupCall=!1,this.setSwitchCallModeStatus(!0),this._groupID="",this._inviteeList=[],this._unHandledInviteeList=[],this._handledInviteeList=[],this._inviterInviteID={},this._initialInviteData={},this._audioVideoSwitchIdList=[],this._acceptedUserObject={},this._connectStartTime=0,this._switchCallModeStatus=!0,this._initialCallId="",this._callTimeout=30,this.setIsEnableMultiDeviceAbility(!1),[4,(S=this._trtcClient)===null||S===void 0?void 0:S.resetTRTCClient()];case 3:return H.sent(),this._tsignalingClient.setInviteData(null),this._tsignalingClient.resetJoined(),(x=document.getElementById("_trtc_calling_layer"))&&(x.innerHTML=""),[2]}})})},V.prototype.getCallStatus=function(){return this._callStatus},V.prototype.changeCallStatus=function(S){this._callStatus!==S&&(this._logger.info("changeCallStatus.start",{text:{data:{newCallStatus:S,currentStatus:this._callStatus}},type:"api"}),E.default.debug("changeCallStatus from "+this._callStatus+" to "+S),this._callStatus=S)},V.prototype.setInitialInviteData=function(S){this._initialInviteData=S},V.prototype.modifyInvitation=function(S){return u(this,void 0,void 0,function(){var x,H;return f(this,function(z){switch(z.label){case 0:if(this.isGroupCall())return[2];x=a(a({},this._initialInviteData.data),{consumed:!0}),z.label=1;case 1:return z.trys.push([1,3,,4]),[4,this.tim.modifyInvitation({inviteID:S,data:JSON.stringify(a(a({},this._initialInviteData),{data:x}))})];case 2:return z.sent(),[3,4];case 3:return H=z.sent(),E.default.error("modifyInvitation fail "+H),[3,4];case 4:return[2]}})})},V.prototype._callRecordUpload=function(S){var x=a(a({},S),{callRole:this.isInviter()?O.NAME.INVITER:O.NAME.INVITEE,userID:this.getUserId(),roomID:this.getRoomId(),inviteID:this.getInitialCallId(),strRoomId:this.getStrRoomId(),groupId:this.getGroupId()});this._callRecordReport.eventUpload(x)},V.prototype.extractCallingInfoFromMessage=function(S){if(!S||S.type!=="TIMCustomElem")return"";var x=JSON.parse(S.payload.data);if(E.default.debug("extractCallingInfoFromMessage - signalingData:",S.payload.data),x.businessID!==M.BUSINESS_ID.SIGNAL)return"";switch(x.actionType){case M.ACTION_TYPE.INVITE:var H=JSON.parse(x.data);return H.call_end>0?"结束通话,通话时长:"+h.formatDuration(H.call_end):H.call_end!==0&&H.room_id?"发起通话":"结束群聊";case M.ACTION_TYPE.CANCEL_INVITE:return"取消通话";case M.ACTION_TYPE.ACCEPT_INVITE:return"已接听";case M.ACTION_TYPE.REJECT_INVITE:return"拒绝通话";case M.ACTION_TYPE.INVITE_TIMEOUT:return"无应答";default:return""}},V.prototype.setInitialCallId=function(S){this._initialCallId=S},V.prototype.getInitialCallId=function(){return this._initialCallId},V.prototype.setIsEnableMultiDeviceAbility=function(S){this._isEnableMultiDeviceAbility=!!S},V.prototype.getIsEnableMultiDeviceAbility=function(){return this._isEnableMultiDeviceAbility},V.prototype.generateCallTotalTime=function(){return this.getConnectStartTime()===0?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)},V.prototype.setSelfIMCallStatus=function(S){var x;return u(this,void 0,void 0,function(){var H,z;return f(this,function(de){switch(de.label){case 0:if(this._logger.info("setSelfIMCallStatus.start",{text:{data:{callStatus:S,isEnableMultiDeviceAbility:this.getIsEnableMultiDeviceAbility()}},type:"api"}),!this.getIsEnableMultiDeviceAbility())return[2];if(!this.tim||!S||!this.getIsLogin())return[2];H=M.USER_CUSTOM_STATUS.NULL,de.label=1;case 1:switch(de.trys.push([1,3,,4]),S){case M.CALL_STATUS.CALLING:H=M.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_WAIT;break;case M.CALL_STATUS.CONNECTED:H=M.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT}return[4,(x=this.tim)===null||x===void 0?void 0:x.setSelfStatus({customStatus:H})];case 2:return de.sent(),[3,4];case 3:return z=de.sent(),this._logger.error("setSelfIMCallStatus.fail",{text:{error:z},type:"api"}),[3,4];case 4:return[2]}})})},V.prototype.getSelfIMCallStatus=function(S){var x;return S===void 0&&(S=[]),u(this,void 0,void 0,function(){var H,z,de,he;return f(this,function(Te){switch(Te.label){case 0:if(H=M.CALL_STATUS.IDLE,!this.getIsEnableMultiDeviceAbility())return[2,H];Te.label=1;case 1:return Te.trys.push([1,3,,4]),this._logger.info("getSelfIMCallStatus.start",{text:{data:S},type:"api"}),this.tim&&S.length!==0&&this.getIsLogin()?[4,(x=this.tim)===null||x===void 0?void 0:x.getUserStatus({userIDList:S})]:[2,H];case 2:if((z=Te.sent()).code===0)switch(de=(z.data||{}).successUserList,((de===void 0?[]:de)[0]||{}).customStatus){case M.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_WAIT:H=M.CALL_STATUS.CALLING;break;case M.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT:H=M.CALL_STATUS.CONNECTED}return[3,4];case 3:return he=Te.sent(),this._logger.error("getSelfIMCallStatus.fail",{text:{error:he},type:"api"}),[3,4];case 4:return[2,H]}})})},V.prototype.setSdkAppId=function(S){this._sdkAppID=S},V.prototype.getSdkAppId=function(){return this._sdkAppID},V.prototype.setUserId=function(S){this._userID=S},V.prototype.getUserId=function(){return this._userID},V.prototype.setRoomId=function(S){this._roomID=S},V.prototype.getRoomId=function(){return this._roomID},V.prototype.setStrRoomId=function(S){this._strRoomId=S},V.prototype.getStrRoomId=function(){return this._strRoomId}
5,V.prototype.analyzeAndSetRoomId=function(S,x){var H=h.analyzeRoomId(S,x);h.isNumber(H)&&this.setRoomId(H),x&&this.setStrRoomId(x)},V.prototype.setUserSig=function(S){this._userSig=S},V.prototype.getUserSig=function(){return this._userSig},V.prototype.getLanguage=function(){return this._language},V.prototype.setComponent=function(S){this._component=S},V.prototype.getComponent=function(){return this._component},V.prototype.getDevicePermission=function(){var S;!((S=this._trtcClient)===null||S===void 0)&&S._getDevicePermission&&this._trtcClient._getDevicePermission()},V.prototype.callExperimentalAPI=function(S){return u(this,void 0,void 0,function(){var x,H,z,de,he,Te;return f(this,function(Oe){if(this._logger.info("callExperimentalAPI",{text:{data:S},type:"api"}),(x=h.safelyParse(S))===S)return[2];if(H=x.api,z=x.params,de=z===void 0?{}:z,!H||!de)return[2];try{switch(H){case"setExcludeFromHistoryMessage":he=de.excludeFromHistoryMessage,Te=he!==void 0&&he,this._excludeFromHistoryMessage=Te}}catch($){throw $}return[2]})})},V.prototype.getGroupMemberProfile=function(S){var x,H;return u(this,void 0,void 0,function(){var z,de;return f(this,function(he){switch(he.label){case 0:this._logger.info("getGroupMemberProfile.start",{text:{data:S},type:"api"}),he.label=1;case 1:return he.trys.push([1,3,,4]),[4,this.tim.getGroupMemberProfile(S)];case 2:return(z=he.sent()).code===0?[2,Array.isArray((x=z==null?void 0:z.data)===null||x===void 0?void 0:x.memberList)?(H=z==null?void 0:z.data)===null||H===void 0?void 0:H.memberList:[]]:[3,4];case 3:return de=he.sent(),this._logger.error("getGroupMemberProfile.fail",{text:{error:de},type:"api"}),[3,4];case 4:return[2,[]]}})})},V.CALL_TYPE=M.CALL_TYPE,l([D.paramValidate(D.VALIDATE_PARAMS.login),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"init",null),l([D.paramValidate(D.VALIDATE_PARAMS.login),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"login",null),l([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.call),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.IDLE]}),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.BASE),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"call",null),l([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.groupCall),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.IDLE]}),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.PRO),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"groupCall",null),l([D.paramValidate(D.VALIDATE_PARAMS.joinInGroupCall),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.IDLE]}),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.PRO),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"joinInGroupCall",null),l([D.paramValidate(D.VALIDATE_PARAMS.inviteUser),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.PRO),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"inviteUser",null),l([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING]}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",Promise)],V.prototype,"accept",null),l([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING]}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",Promise)],V.prototype,"reject",null),l([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",Promise)],V.prototype,"hangup",null),l([D.paramValidate(D.VALIDATE_PARAMS.startRemoteView),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"startRemoteView",null),l([D.paramValidate(D.VALIDATE_PARAMS.stopRemoteView),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"stopRemoteView",null),l([D.paramValidate(D.VALIDATE_PARAMS.startLocalView),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),D.apiCallQueue(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"startLocalView",null),l([D.paramValidate(D.VALIDATE_PARAMS.stopLocalView),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),D.apiCallQueue(),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"stopLocalView",null),l([D.paramValidate(D.VALIDATE_PARAMS.openCamera),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[String,Boolean]),c("design:returntype",Promise)],V.prototype,"openCamera",null),l([D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",Promise)],V.prototype,"closeCamera",null),l([D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",Promise)],V.prototype,"openMicrophone",null),l([D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",Promise)],V.prototype,"closeMicrophone",null),l([D.paramValidate(D.VALIDATE_PARAMS.setVideoQuality),c("design:type",Function),c("design:paramtypes",[String]),c("design:returntype",Promise)],V.prototype,"setVideoQuality",null),l([D.paramValidate(D.VALIDATE_PARAMS.setVideoRenderParams),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"setVideoRenderParams",null),l([D.paramValidate(D.VALIDATE_PARAMS.switchCallMediaType),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CONNECTED,M.CALL_STATUS.CALLING],scene:!0}),c("design:type",Function),c("design:paramtypes",[Number]),c("design:returntype",Promise)],V.prototype,"switchCallMediaType",null),l([D.paramValidate(D.VALIDATE_PARAMS.getDeviceList),D.statusValidate({init:!0}),c("design:type",Function),c("design:paramtypes",[String]),c("design:returntype",Promise)],V.prototype,"getDeviceList",null),l([D.paramValidate(D.VALIDATE_PARAMS.getCurrentDevice),D.statusValidate({init:!0}),c("design:type",Function),c("design:paramtypes",[String]),c("design:returntype",void 0)],V.prototype,"getCurrentDevice",null),l([D.paramValidate(D.VALIDATE_PARAMS.switchCamera),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[Number]),c("design:returntype",Promise)],V.prototype,"switchCamera",null),l([D.paramValidate(D.VALIDATE_PARAMS.switchDevice),D.statusValidate({init:!0,callStatus:[M.CALL_STATUS.CALLING,M.CALL_STATUS.CONNECTED]}),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"switchDevice",null),l([D.paramValidate(D.VALIDATE_PARAMS.setSelfInfo),D.statusValidate({init:!0}),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",Promise)],V.prototype,"setSelfInfo",null),l([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.enableMultiDeviceAbility),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.PRO),c("design:type",Function),c("design:paramtypes",[Boolean]),c("design:returntype",void 0)],V.prototype,"enableMultiDeviceAbility",null),l([D.statusValidate({init:!0}),c("design:type",Function),c("design:paramtypes",[Boolean]),c("design:returntype",Promise)],V.prototype,"enableAIVoice",null),l([D.statusValidate({init:!0}),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.ULTIMATE),c("design:type",Function),c("design:paramtypes",[Number]),c("design:returntype",Promise)],V.prototype,"setBlurBackgroun
5d",null),l([D.statusValidate({init:!0}),D.businessValidate(M.CALL_EXPERMENTEL_API_TYPE.ULTIMATE),c("design:type",Function),c("design:paramtypes",[String]),c("design:returntype",Promise)],V.prototype,"setVirtualBackground",null),l([D.paramValidate(D.VALIDATE_PARAMS.createInstance),c("design:type",Function),c("design:paramtypes",[Object]),c("design:returntype",void 0)],V,"createInstance",null),V}();r.default=W},function(s,r,o){o.r(r),o.d(r,"default",function(){return u});const a=Function.prototype.apply,l=new WeakMap;function c(f){return l.has(f)||l.set(f,{}),l.get(f)}class u{constructor(d=null,p=console){const g=c(this);return g._events=new Set,g._callbacks={},g._console=p,g._maxListeners=d===null?null:parseInt(d,10),this}_addCallback(d,p,g,h){return this._getCallbacks(d).push({callback:p,context:g,weight:h}),this._getCallbacks(d).sort((m,y)=>m.weight>y.weight),this}_getCallbacks(d){return c(this)._callbacks[d]}_getCallbackIndex(d,p){return this._has(d)?this._getCallbacks(d).findIndex(g=>g.callback===p):null}_achieveMaxListener(d){return c(this)._maxListeners!==null&&c(this)._maxListeners<=this.listenersNumber(d)}_callbackIsExists(d,p,g){const h=this._getCallbackIndex(d,p),m=h!==-1?this._getCallbacks(d)[h]:void 0;return h!==-1&&m&&m.context===g}_has(d){return c(this)._events.has(d)}on(d,p,g=null,h=1){const m=c(this);if(typeof p!="function")throw new TypeError(p+" is not a function");return this._has(d)?(this._achieveMaxListener(d)&&m._console.warn(`Max listeners (${m._maxListeners}) for event "${d}" is reached!`),this._callbackIsExists(...arguments)&&m._console.warn(`Event "${d}" already has the callback ${p}.`)):(m._events.add(d),m._callbacks[d]=[]),this._addCallback(...arguments),this}once(d,p,g=null,h=1){const m=(...y)=>(this.off(d,m),a.call(p,g,y));return this.on(d,m,g,h)}off(d,p=null){const g=c(this);let h;return this._has(d)&&(p===null?(g._events.delete(d),g._callbacks[d]=null):(h=this._getCallbackIndex(d,p),h!==-1&&(g._callbacks[d].splice(h,1),this.off(...arguments)))),this}emit(d,...p){return this._has(d)&&this._getCallbacks(d).forEach(g=>a.call(g.callback,g.context,p)),this}clear(){const d=c(this);return d._events.clear(),d._callbacks={},this}listenersNumber(d){return this._has(d)?this._getCallbacks(d).length:null}}},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(B){for(var b,k=1,U=arguments.length;k<U;k++)for(var O in b=arguments[k])Object.prototype.hasOwnProperty.call(b,O)&&(B[O]=b[O]);return B}).apply(this,arguments)},l=this&&this.__awaiter||function(B,b,k,U){return new(k||(k=Promise))(function(O,D){function J(ue){try{se(U.next(ue))}catch(oe){D(oe)}}function ee(ue){try{se(U.throw(ue))}catch(oe){D(oe)}}function se(ue){var oe;ue.done?O(ue.value):(oe=ue.value,oe instanceof k?oe:new k(function(W){W(oe)})).then(J,ee)}se((U=U.apply(B,b||[])).next())})},c=this&&this.__generator||function(B,b){var k,U,O,D,J={label:0,sent:function(){if(1&O[0])throw O[1];return O[1]},trys:[],ops:[]};return D={next:ee(0),throw:ee(1),return:ee(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function ee(se){return function(ue){return function(oe){if(k)throw new TypeError("Generator is already executing.");for(;J;)try{if(k=1,U&&(O=2&oe[0]?U.return:oe[0]?U.throw||((O=U.return)&&O.call(U),0):U.next)&&!(O=O.call(U,oe[1])).done)return O;switch(U=0,O&&(oe=[2&oe[0],O.value]),oe[0]){case 0:case 1:O=oe;break;case 4:return J.label++,{value:oe[1],done:!1};case 5:J.label++,U=oe[1],oe=[0];continue;case 7:oe=J.ops.pop(),J.trys.pop();continue;default:if(O=J.trys,!((O=O.length>0&&O[O.length-1])||oe[0]!==6&&oe[0]!==2)){J=0;continue}if(oe[0]===3&&(!O||oe[1]>O[0]&&oe[1]<O[3])){J.label=oe[1];break}if(oe[0]===6&&J.label<O[1]){J.label=O[1],O=oe;break}if(O&&J.label<O[2]){J.label=O[2],J.ops.push(oe);break}O[2]&&J.ops.pop(),J.trys.pop();continue}oe=b.call(B,J)}catch(W){oe=[6,W],U=0}finally{k=O=0}if(5&oe[0])throw oe[1];return{value:oe[0]?oe[1]:void 0,done:!0}}([se,ue])}}},u=this&&this.__spreadArrays||function(){for(var B=0,b=0,k=arguments.length;b<k;b++)B+=arguments[b].length;var U=Array(B),O=0;for(b=0;b<k;b++)for(var D=arguments[b],J=0,ee=D.length;J<ee;J++,O++)U[O]=D[J];return U};
5Object.defineProperty(r,"__esModule",{value:!0});var f=o(14),d=o(8),p=o(2),g=o(37),h=o(1),m=o(10),y=o(7),R=o(11),I=o(6),T=o(9),C=o(0),_=o(5),A=o(12),L=o(15),E="TRTCClient",M=function(){function B(b){var k;this._trtcCloud=null,this._tuiCallEngine=null,this._isVideoPublish=!1,this._isAudioPublish=!1,this._isEnterRoom=!1,this._videoStreamType=f.TRTCVideoStreamType.TRTCVideoStreamTypeBig,this._frameWorkType=30,this._permission={audio:!1,video:!1},this._devices={microphone:[],camera:[],speaker:[]},this._currentDevices={microphone:null,camera:null,speaker:null},this._isRegisterVirtualBackgroundModelFile=!1,this._tuiCallEngine=b.tuiCallEngine,this._component=this._tuiCallEngine.getComponent(),(!((k=window==null?void 0:window.localStorage)===null||k===void 0)&&k.getItem("_isTIMCallKit")||window!=null&&window._isTIMCallKit)&&(this._component=15),this._trtcCloud=f.default.getTRTCShareInstance({frameWorkType:this._frameWorkType,component:this._component,language:this._tuiCallEngine.getLanguage()}),h.isUndefined(b.logLevel)||this.setLogLevel(b.logLevel),this._addTRTCEvents(),this._logger=d.default(),g.isHttpProtocols()&&(this._logger.error(E+".constructor.error",{text:{data:{code:y.default.ERROR_HTTP,msg:R.ERROR_MESSAGE.ERROR_HTTP}},type:"api"}),p.default.error("code: "+y.default.ERROR_HTTP+", "+R.ERROR_MESSAGE.ERROR_HTTP+", "+R.ERROR_CN_MESSAGE.ERROR_HTTP))}return B.prototype.enterRoom=function(b){var k,U;return l(this,void 0,void 0,function(){var O,D;return c(this,function(J){switch(J.label){case 0:return J.trys.push([0,2,,3]),this._logger.info(E+".enterRoom.start",{text:{data:b},type:"api"}),this.getIsEnterRoom()?[2]:(O=a(a({sdkAppId:(k=this._tuiCallEngine)===null||k===void 0?void 0:k.getSdkAppId(),userId:this._tuiCallEngine.getUserId(),userSig:this._tuiCallEngine.getUserSig()},b),{role:f.TRTCRoleType.TRTCRoleAnchor}),[4,(U=this._trtcCloud)===null||U===void 0?void 0:U.enterRoom(O)]);case 1:return J.sent(),this.setIsEnterRoom(!0),[3,3];case 2:throw D=J.sent(),this._logger.error(E+".enterRoom.fail",{text:{error:D},type:"api"}),p.default.error(E+".enterRoom failed error = "+D),new Error(E+".enterRoom failed! "+D);case 3:return[2]}})})},B.prototype.exitRoom=function(){var b;return l(this,void 0,void 0,function(){var k;return c(this,function(U){switch(U.label){case 0:return this._logger.info(E+".exitRoom.start",{text:{data:{isJoined:this.getIsEnterRoom()}},type:"api"}),p.default.info(E+".exitRoom isEnterRoom = "+this.getIsEnterRoom()),this.getIsEnterRoom()?(this._closeAudioVolumeEvaluation(),this.getIsRegisterVirtualBackgroundModelFile()?[4,this.setVirtualBackground({enable:!1})]:[3,2]):[2];case 1:U.sent(),U.label=2;case 2:return[4,this.stopLocalPreview()];case 3:return U.sent(),[4,this._trtcCloud.stopLocalAudio()];case 4:return U.sent(),[4,(b=this._trtcCloud)===null||b===void 0?void 0:b.exitRoom()];case 5:return U.sent(),this.setIsEnterRoom(!1),this.resetTRTCClient(),k=new Date().getTime(),this._tuiCallEngine.getCallDataReport().setExitRoomTime(k),[2]}})})},B.prototype.startLocalPreview=function(b,k){var U,O;return l(this,void 0,void 0,function(){var D,J;return c(this,function(ee){switch(ee.label){case 0:return ee.trys.push([0,8,,9]),D=k,_.isMobile()&&h.isUndefined(k)&&(D=!0),[4,(U=this._trtcCloud)===null||U===void 0?void 0:U.startLocalPreview(D,b)];case 1:return ee.sent(),[4,this.setVideoEncoderParam()];case 2:return ee.sent(),[4,(O=this._trtcCloud)===null||O===void 0?void 0:O.setLocalRenderParams(this._tuiCallEngine.getLocalPlayOptions())];case 3:return ee.sent(),this._tuiCallEngine.isInviter()&&this._tuiCallEngine.getCallStatus()===I.CALL_STATUS.CALLING?[4,this.muteLocalVideo(!0)]:[3,5];case 4:ee.sent(),ee.label=5;case 5:return this._tuiCallEngine.isInviter()?[3,7]:[4,this.muteLocalVideo(!1)];case 6:ee.sent(),ee.label=7;case 7:return[3,9];case 8:throw J=ee.sent(),this._logger.error(E+".startLocalPreview.fail",{text:{error:J},type:"api"}),new Error(E+".startLocalPreview failed, error:"+J);case 9:return[2]}})})},B.prototype.stopLocalPreview=function(){var b;return l(this,void 0,void 0,function(){var k;
5return c(this,function(U){switch(U.label){case 0:return U.trys.push([0,2,,3]),this._logger.info(E+".stopLocalPreview.start",{text:{},type:"api"}),[4,(b=this._trtcCloud)===null||b===void 0?void 0:b.stopLocalPreview()];case 1:return U.sent(),this.setIsVideoPublish(!1),[3,3];case 2:throw k=U.sent(),this._logger.error(E+".stopLocalPreview.fail",{text:{error:k},type:"api"}),p.default.error(E+".stopLocalPreview failed to play local video "+k),new Error(E+".stopLocalPreview failed to play local video "+k);case 3:return[2]}})})},B.prototype.startRemoteView=function(b){var k,U;return l(this,void 0,void 0,function(){var O,D,J,ee,se;return c(this,function(ue){switch(ue.label){case 0:p.default.info(E+".startRemoteView params = "+b),O=b.videoViewDomId,D=b.userId,ue.label=1;case 1:return ue.trys.push([1,4,,5]),J=this._tuiCallEngine.getRemotePlayOptions(),ee=this.getVideoStreamType(),[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.startRemoteView(D,O,ee)];case 2:return ue.sent(),[4,(U=this._trtcCloud)===null||U===void 0?void 0:U.setRemoteRenderParams(D,ee,J)];case 3:return ue.sent(),[3,5];case 4:throw se=ue.sent(),this._logger.error(E+".startRemoteView.fail",{text:{error:se},type:"api"}),p.default.error(E+".startRemoteView failed error "+se),new Error(E+".startRemoteView failed error "+se);case 5:return[2]}})})},B.prototype.stopRemoteView=function(b){var k;return l(this,void 0,void 0,function(){var U,O;return c(this,function(D){switch(D.label){case 0:p.default.debug(E+".stopRemoteView params = "+b),D.label=1;case 1:return D.trys.push([1,3,,4]),U=this.getVideoStreamType(),[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.stopRemoteView(b.userId,U)];case 2:return D.sent(),[3,4];case 3:throw O=D.sent(),this._logger.error(E+".stopRemoteView.fail",{text:{error:O},type:"api"}),p.default.error(E+".stopRemoteView failed error "+O),new Error(E+".stopRemoteView failed error "+O);case 4:return[2]}})})},B.prototype.muteLocalAudio=function(){var b;return l(this,void 0,void 0,function(){return c(this,function(k){switch(k.label){case 0:return[4,(b=this._trtcCloud)===null||b===void 0?void 0:b.muteLocalAudio(!0)];case 1:return k.sent(),this.setIsAudioPublish(!1),[2]}})})},B.prototype.unMuteLocalAudio=function(){var b;return l(this,void 0,void 0,function(){return c(this,function(k){switch(k.label){case 0:return[4,(b=this._trtcCloud)===null||b===void 0?void 0:b.muteLocalAudio(!1)];case 1:return k.sent(),this.setIsAudioPublish(!0),[2]}})})},B.prototype.muteLocalVideo=function(b){var k;return l(this,void 0,void 0,function(){return c(this,function(U){switch(U.label){case 0:return[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.muteLocalVideo(b)];case 1:return U.sent(),this.setIsVideoPublish(!b),[2]}})})},B.prototype.setVideoEncoderParam=function(b){var k;return l(this,void 0,void 0,function(){var U;return c(this,function(O){switch(O.label){case 0:return O.trys.push([0,3,,4]),this._logger.info(E+".setVideoEncoderParam.start",{type:"api",text:{data:b}}),b=b||this._tuiCallEngine.getVideoQuality(),C.VIDEO_ENCODER_MAP[b]?[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.setVideoEncoderParam(C.VIDEO_ENCODER_MAP[b])]:[3,2];case 1:O.sent(),O.label=2;case 2:return[3,4];case 3:return U=O.sent(),this._logger.error(E+".setVideoEncoderParam.fail",{text:{error:U},type:"api"}),p.default.error(E+".setVideoEncoderParam.failed, error: "+U),[3,4];case 4:return[2]}})})},B.prototype.setVideoRenderParams=function(b){var k,U;return l(this,void 0,void 0,function(){var O,D;return c(this,function(J){switch(J.label){case 0:return J.trys.push([0,5,,6]),b.userId!==this._tuiCallEngine.getUserId()?[3,2]:[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.setLocalRenderParams(b)];case 1:return J.sent(),[3,4];case 2:return O=this.getVideoStreamType(),[4,(U=this._trtcCloud)===null||U===void 0?void 0:U.setRemoteRenderParams(b.userId,O,b)];case 3:J.sent(),J.label=4;case 4:return[3,6];case 5:return D=J.sent(),this._logger.error(E+".setVideoRenderParams.fail",{text:{error:D},type:"api"}),p.default.warn(E+"._setVideoRenderParams failed error = "+D),[3,6];case 6:return[2]}})})},B.prototype.switchCallMode=function(b){return l(this,void 0,void 0,function(){var k;return c(this,function(U){switch(U.label){case 0:if(p.default.info(E+".switchCallMode - type",b),b!==I.CALL_TYPE.VIDEO_CALL)return[2];
5k=I.CALL_TYPE.AUDIO_CALL,U.label=1;case 1:return U.trys.push([1,3,,4]),[4,this.stopLocalPreview()];case 2:return U.sent(),this._tuiCallEngine.setCallType(k),this._tuiCallEngine.setSwitchCallModeStatus(!0),this._tuiCallEngine._delegate.onCallTypeChanged(b,k),[3,4];case 3:return U.sent(),b===I.CALL_TYPE.VIDEO_CALL&&this._tuiCallEngine._delegate.onError(y.default.FAILURE_SWITCH_TO_AUDIO,L.getErrorMessage({code:y.default.FAILURE_SWITCH_TO_AUDIO})),[3,4];case 4:return[2]}})})},B.prototype.resetTRTCClient=function(){return l(this,void 0,void 0,function(){return c(this,function(b){switch(b.label){case 0:return this.getIsEnterRoom()?[4,this.exitRoom()]:[3,2];case 1:b.sent(),b.label=2;case 2:return this.setIsEnterRoom(!1),this.setIsVideoPublish(!1),this.setIsAudioPublish(!1),[2]}})})},B.prototype.getMediaDevicesAuth=function(b){return b===void 0&&(b={}),l(this,void 0,void 0,function(){var k,U,O,D;return c(this,function(J){switch(J.label){case 0:if(this._logger.info(E+".getMediaDevicesAuth.start",{text:{data:{params:b}},type:"api"}),g.isHttpProtocols())throw this._logger.error(E+".getMediaDevicesAuth.fail",{text:{error:R.ERROR_MESSAGE.ERROR_HTTP},type:"api"}),new m.default({code:y.default.ERROR_HTTP});if(k=this._getDevicePermission(),!b.audio)return[3,4];if(_.IS_IOS&&k.audio)return[2,k];J.label=1;case 1:return J.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0})];case 2:return O=J.sent(),this._releaseStream(O),this._setDevicePermission(C.NAME.AUDIO,!0),[3,4];case 3:return U=J.sent(),this._logger.error(E+".getMediaDevicesAuth.fail",{text:{error:U},type:"api"}),this._setDevicePermission(C.NAME.AUDIO,!1),this._handleMediaError(U,"getMediaDevicesAuth",C.NAME.AUDIO),[3,4];case 4:if(!b.video)return[3,8];if(_.IS_IOS&&k.video)return[2,k];J.label=5;case 5:return J.trys.push([5,7,,8]),[4,navigator.mediaDevices.getUserMedia({video:!0})];case 6:return O=J.sent(),this._releaseStream(O),this._setDevicePermission(C.NAME.VIDEO,!0),[3,8];case 7:return D=J.sent(),this._logger.error(E+".getMediaDevicesAuth.fail",{text:{error:D},type:"api"}),this._setDevicePermission(C.NAME.VIDEO,!1),b.isThrowVideoError&&this._handleMediaError(D,"getMediaDevicesAuth",C.NAME.VIDEO),[3,8];case 8:return[2,this._getDevicePermission()]}})})},B.prototype.switchDevice=function(b,k){return l(this,void 0,void 0,function(){var U;return c(this,function(O){switch(O.label){case 0:return this._logger.info(E+".getMediaDevicesAuth.start",{text:{data:{deviceType:b,deviceId:k}},type:"api"}),U=!1,b!==T.DEVICE_TYPE.CAMERA?[3,2]:[4,this._trtcCloud.setCurrentCameraDevice(k)];case 1:U=O.sent(),O.label=2;case 2:return b!==T.DEVICE_TYPE.MICROPHONE?[3,4]:[4,this._trtcCloud.setCurrentMicDevice(k)];case 3:U=O.sent(),O.label=4;case 4:return b!==T.DEVICE_TYPE.SPEAKER?[3,6]:[4,this._trtcCloud.setCurrentSpeakerDevice(k)];case 5:U=O.sent(),O.label=6;case 6:return this._updateCurrentDevice(),this._tuiCallEngine._delegate.onDeviceUpdated(this._devices,this._currentDevices),[2,U]}})})},B.prototype.switchCamera=function(b){var k;return l(this,void 0,void 0,function(){var U,O;return c(this,function(D){switch(D.label){case 0:this._logger.info(E+".switchCamera.start",{text:{data:{cameraType:b}},type:"api"}),D.label=1;case 1:return D.trys.push([1,3,,4]),U=b===A.TUICallCameraPosition.FRONT,[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.switchCamera(U)];case 2:return D.sent(),[3,4];case 3:throw O=D.sent(),this._logger.error(E+".switchCamera.fail",{text:{error:O},type:"api"}),O;case 4:return[2]}})})},B.prototype.getDeviceList=function(b){return l(this,void 0,void 0,function(){var k,U;return c(this,function(O){switch(O.label){case 0:this._logger.info(E+".getDeviceList.start",{text:{data:{deviceType:b}},type:"api"}),O.label=1;case 1:switch(O.trys.push([1,12,,13]),k=[],b){case T.DEVICE_TYPE.CAMERA:return[3,2];case T.DEVICE_TYPE.MICROPHONE:return[3,5];case T.DEVICE_TYPE.SPEAKER:return[3,8]}return[3,11];case 2:return this._getDevicePermission().video?[4,this._trtcCloud.getCameraDevicesList()]:[3,4];case 3:k=O.sent(),O.label=4;case 4:return[3,11];case 5:return this._getDevicePermission().audio?[4,this._trtcCloud.getMicDevicesList()]:[3,7];case 6:k=O.sent(),O.label=7;case 7:return[3,11];case 8:return this._getDevicePermission().audio?[4,this._trtcCloud.get
5SpeakerDevicesList()]:[3,10];case 9:k=O.sent(),O.label=10;case 10:return[3,11];case 11:return this._setDevice(b,k),[2,k];case 12:throw U=O.sent(),this._logger.error(E+".getDeviceList.fail",{text:{error:U},type:"api"}),U;case 13:return[2]}})})},B.prototype.getCurrentDevice=function(b){return this._updateCurrentDevice(),this._currentDevices[b]},B.prototype.setLogLevel=function(b){!(f.default===null||f.default===void 0)&&f.default.setLogLevel&&f.default.setLogLevel(b+1)},B.prototype.setVirtualBackground=function(b){var k;return l(this,void 0,void 0,function(){var U,O,D;return c(this,function(J){switch(J.label){case 0:return J.trys.push([0,4,,5]),U=b.enable,this.getIsRegisterVirtualBackgroundModelFile()||!U?[3,2]:[4,this._trtcCloud.useVirtualBackground()];case 1:J.sent(),this.setIsRegisterVirtualBackgroundModelFile(!0),J.label=2;case 2:return O={api:C.NAME.ENABLE_VIRTUAL_BACKGROUND,params:a({sdkAppId:this._tuiCallEngine.getSdkAppId(),userId:this._tuiCallEngine.getUserId(),userSig:this._tuiCallEngine.getUserSig()},b)},this._logger.info(E+".setVirtualBackground.start",{type:"api",text:{data:O}}),[4,(k=this._trtcCloud)===null||k===void 0?void 0:k.callExperimentalAPI(JSON.stringify(O))];case 3:return J.sent(),[3,5];case 4:throw D=J.sent(),p.default.error(E+".setVirtualBackground.fail, "+D),this._logger.error(E+".setVirtualBackground.fail",{text:{error:D},type:"api"}),D;case 5:return[2]}})})},B.prototype._openAudioVolumeEvaluation=function(b){var k;b===void 0&&(b=1e3),(k=this._trtcCloud)===null||k===void 0||k.enableAudioVolumeEvaluation(b)},B.prototype._closeAudioVolumeEvaluation=function(){var b;(b=this._trtcCloud)===null||b===void 0||b.enableAudioVolumeEvaluation(-1)},B.prototype._releaseStream=function(b){for(var k=b.getTracks(),U=0;U<k.length;U++)k[U].stop()},B.prototype._handleMediaError=function(b,k,U){var O=y.default.UNKNOWN,D=C.NAME.UNKNOWN;switch(b==null?void 0:b.name){case"NotFoundError":U===T.DEVICE_TYPE.AUDIO&&(O=y.default.NOT_MICROPHONE_LIST),U===T.DEVICE_TYPE.VIDEO&&(O=y.default.NOT_CAMERA_LIST);break;case"NotAllowedError":O=y.default.ERROR_PERMISSION_DENIED}throw D=L.getErrorMessage({code:O,params:{error:b,fnName:k}}),this._tuiCallEngine._delegate.onError(O,JSON.stringify(D)),new m.default({code:O,message:D})},B.prototype._updateCurrentDevice=function(){this._currentDevices[C.NAME.CAMERA]=this._trtcCloud.getCurrentCameraDevice(),this._currentDevices[C.NAME.MICROPHONE]=this._trtcCloud.getCurrentMicDevice(),this._currentDevices[C.NAME.SPEAKER]=this._trtcCloud.getCurrentSpeakerDevice(),this._logger.info(E+"._getCurrentDevice.start",{text:{data:a({},this._currentDevices)},type:"api"})},B.prototype._addTRTCEvents=function(){var b,k,U,O,D,J,ee,se,ue,oe,W,V=this;(b=this._trtcCloud)===null||b===void 0||b.on("onEnterRoom",function(S){return l(V,void 0,void 0,function(){var x;return c(this,function(H){switch(H.label){case 0:return this._logger.info(E+".enterRoom.success",{type:"api",text:{cost:S}}),S>0?[4,this._trtcCloud.startLocalAudio()]:[3,5];case 1:return H.sent(),this._tuiCallEngine.isInviter()?[4,this._tuiCallEngine.setSelfIMCallStatus(I.CALL_STATUS.CALLING)]:[3,4];case 2:return H.sent(),[4,this.muteLocalAudio()];case 3:return H.sent(),[3,5];case 4:this.setIsVideoPublish(!0),this.setIsAudioPublish(!0),x=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(x),H.label=5;case 5:return[2]}})})}),(k=this._trtcCloud)===null||k===void 0||k.on("onExitRoom",function(S){return l(V,void 0,void 0,function(){var x,H;return c(this,function(z){switch(z.label){case 0:return p.default.warn("退房, reason = "+S),S===0?[3,4]:(p.default.warn("leave room, reason: "+S),this._tuiCallEngine.getCallStatus()===I.CALL_STATUS.CONNECTED&&(x=this._tuiCallEngine.generateCallEndData(),this._tuiCallEngine._delegate.onCallEnd(x)),this._tuiCallEngine.getCallStatus()!==I.CALL_STATUS.CALLING?[3,2]:(H=a(a({},this._tuiCallEngine.generateEventData()),{reason:S}),this._tuiCallEngine._delegate.onCallingCancel(a({userID:this._tuiCallEngine.getUserId()},H)),[4,this._tuiCallEngine._cancel()]));case 1:z.sent(),z.label=2;case 2:return[4,this._tuiCallEngine._resetTUICallEngine()];case 3:z.sent(),z.label=4;case 4:return[2]}})})}),(U=this._trtcCloud)===null||U===void 0||U.on("onRemoteUserEnterRoom",function(S){return l(V,void 0,void 0,function(){var x,H;return c(this,function(z){switch(z.label){case 0:return p.default.info(E+".onRemoteUserEnterRoom userId = "+S),S?[4,this._isUserInCall(S)]:[2];case 1:return z.sent()?(this._tuiCallEngine.getConnectStartTime()||(this._tuiCallEngine.setConnectStartTime(Date.now()),this._openAudioVolumeEvaluation()),this._tuiCallEngine._delegate.onUserEnter(S),this._tuiCallEngine.addHandledInviteeList([S]),this._tuiCallEngine.deleteUnHandledInviteeList([S]),this._tuiCallEngine.addAcceptedUserList(null,[S]),this._tuiCallEngine.getCallStatus()!==I.CALL_STATUS.CALLING?[3,7]:(this._tuiCallEngine.changeCallStatus(I.CALL_STATUS.CONNECTED),this._tuiCallEngine.isInviter()?(x=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(x),this.getIsVideoPublish()?[3,3]:[4,this.muteLocalVideo(!1)]):[3,7])):[2];case 2:z.sent(),z.label=3;case 3:return this.getIsAudioPublish()?[3,5]:[4,this.unMuteLocalAudio()];case 4:z.sent(),z.label=5;case 5:return[4,this._tuiCallEngine.setSelfIMCallStatus(I.CALL_STATUS.CONNECTED)];case 6:z.sent(),z.label=7;case 7:return this._tuiCallEngine.isGroupCall()&&(H=this._tuiCallEngine.getHandledInviteeList(
5),this._tuiCallEngine._delegate.onGroupCallInviteeListUpdate(H)),[2]}})})}),(O=this._trtcCloud)===null||O===void 0||O.on("onRemoteUserLeaveRoom",function(S,x){return l(V,void 0,void 0,function(){var H,z,de,he,Te,Oe;return c(this,function($){switch($.label){case 0:return p.default.info(E+".onRemoteUserLeaveRoom userId = "+S+", reason = "+x),S?[4,this._isUserInCall(S)]:[2];case 1:return $.sent()?this._tuiCallEngine.getCallStatus()===I.CALL_STATUS.IDLE?[2]:(H=this._tuiCallEngine.isGroupCall(),this._tuiCallEngine.deleteHandledInviteeList([S]),this._tuiCallEngine._delegate.onUserLeave(S),z=this._tuiCallEngine.getHandledInviteeList(),H?(de=this._tuiCallEngine.getUnHandledInviteeList(),z.length!==0&&this._tuiCallEngine._delegate.onGroupCallInviteeListUpdate(z),he=this._tuiCallEngine.getUserId(),z.length!==1||z[0]!==he||de.length!==0?[3,3]:(Te=this._tuiCallEngine.generateCallEndData(),this._tuiCallEngine._delegate.onCallEnd(Te),[4,this._tuiCallEngine._resetTUICallEngine()])):[3,4]):[2];case 2:$.sent(),$.label=3;case 3:return[3,7];case 4:return Oe={callType:this._tuiCallEngine.getCallType(),userIDList:[S],callEnd:this._tuiCallEngine.generateCallTotalTime()},z.length!==1?[3,7]:[4,this._tuiCallEngine._tsignalingClient.hangup(Oe)];case 5:return $.sent(),[4,this._tuiCallEngine._resetTUICallEngine()];case 6:$.sent(),$.label=7;case 7:return[2]}})})}),(D=this._trtcCloud)===null||D===void 0||D.on("onUserVideoAvailable",function(S,x){V._tuiCallEngine._delegate.onUserVideoAvailable({userID:S,isVideoAvailable:x})}),(J=this._trtcCloud)===null||J===void 0||J.on("onUserAudioAvailable",function(S,x){V._tuiCallEngine._delegate.onUserAudioAvailable({userID:S,isAudioAvailable:x})}),(ee=this._trtcCloud)===null||ee===void 0||ee.on("onUserVoiceVolume",function(S){S=S.map(function(x){return{userId:x.userId===""?V._tuiCallEngine.getUserId():x.userId,audioVolume:x.volume}}),V._tuiCallEngine._delegate.onUserVoiceVolume(S)}),(se=this._trtcCloud)===null||se===void 0||se.on("onDeviceChange",function(S,x,H){return l(V,void 0,void 0,function(){var z,de;return c(this,function(he){switch(he.label){case 0:return(de={})[f.TRTCDeviceType.TRTCDeviceTypeMi]=T.DEVICE_TYPE.MICROPHONE,de[f.TRTCDeviceType.TRTCDeviceTypeSpeaker]=T.DEVICE_TYPE.SPEAKER,de[f.TRTCDeviceType.TRTCDeviceTypeCamera]=T.DEVICE_TYPE.CAMERA,z=de,[4,this.getDeviceList(z[x])];case 1:return he.sent(),this._updateCurrentDevice(),this._tuiCallEngine._delegate.onDeviceUpdated(this._devices,this._currentDevices),[2]}})})}),(ue=this._trtcCloud)===null||ue===void 0||ue.on("onNetworkQuality",function(S,x){return l(V,void 0,void 0,function(){var H;return c(this,function(z){return H=this._tuiCallEngine.getUserId(),this._tuiCallEngine._delegate.onUserNetworkQualityChanged(u([a(a({},S),{userId:H})],x)),[2]})})}),(oe=this._trtcCloud)===null||oe===void 0||oe.on("onError",function(S,x){p.default.error(E+".onError, code = "+S+", message = "+x),V._tuiCallEngine._delegate.onError(S,x)}),(W=this._trtcCloud)===null||W===void 0||W.on("onWarning",function(S){var x=S.code;if(x===10000003||x===10000006){var H="Insufficient device performance causes high latency, please turn off the virtual background";V._logger.info("setVirtualBackground.error",{text:{data:{code:x,message:H}},type:"api"}),V._tuiCallEngine._delegate.onError(x,H)}})},B.prototype.removeTRTCEvents=function(){var b;(b=this._trtcCloud)===null||b===void 0||b.removeAllListeners()},B.prototype.getTRTCCloud=function(){return this._trtcCloud},B.prototype.setIsVideoPublish=function(b){this._isVideoPublish=b},B.prototype.getIsVideoPublish=function(){return this._isVideoPublish},B.prototype.setIsAudioPublish=function(b){this._isAudioPublish=b},B.prototype.getIsAudioPublish=function(){return this._isAudioPublish},B.prototype.setIsEnterRoom=function(b){this._isEnterRoom=b},B.prototype.getIsEnterRoom=function(){return this._isEnterRoom},B.prototype.setVideoStreamType=function(b){this._videoStreamType=b||this._videoStreamType},B.prototype.getVideoStreamType=function(){return this._videoStreamType},B.prototype.enableAIVoice=function(b){},B.prototype._setDevice=function(b,k){this._devices[b]=k},B.prototype._getDevicePermission=function(){return this._permission},B.prototype._setDevicePermission=function(b,k){this._permission[b]=k}
5,B.prototype.setIsRegisterVirtualBackgroundModelFile=function(b){this._isRegisterVirtualBackgroundModelFile=b},B.prototype.getIsRegisterVirtualBackgroundModelFile=function(){return this._isRegisterVirtualBackgroundModelFile},B.prototype._isUserInCall=function(b){return l(this,void 0,void 0,function(){var k,U;return c(this,function(O){switch(O.label){case 0:return this._tuiCallEngine.getInviterInviteIdUserList().indexOf(b)!==-1?[3,2]:(k=this._tuiCallEngine.getGroupId())?[4,this._tuiCallEngine.getGroupMemberProfile({groupID:k,userIDList:[b]})]:[2,!1];case 1:if(((U=O.sent())==null?void 0:U.length)===0)return[2,!1];O.label=2;case 2:return[2,!0]}})})},B}();r.default=M},function(s,r){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(a){typeof window=="object"&&(o=window)}s.exports=o},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.isHttpProtocols=void 0,r.isHttpProtocols=function(){if(!window||!window.location)return!1;var a=window.location,l=a.protocol,c=a.hostname;return l==="http:"&&c!=="localhost"&&c!=="127.0.0.1"}},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(T){for(var C,_=1,A=arguments.length;_<A;_++)for(var L in C=arguments[_])Object.prototype.hasOwnProperty.call(C,L)&&(T[L]=C[L]);return T}).apply(this,arguments)},l=this&&this.__awaiter||function(T,C,_,A){return new(_||(_=Promise))(function(L,E){function M(k){try{b(A.next(k))}catch(U){E(U)}}function B(k){try{b(A.throw(k))}catch(U){E(U)}}function b(k){var U;k.done?L(k.value):(U=k.value,U instanceof _?U:new _(function(O){O(U)})).then(M,B)}b((A=A.apply(T,C||[])).next())})},c=this&&this.__generator||function(T,C){var _,A,L,E,M={label:0,sent:function(){if(1&L[0])throw L[1];return L[1]},trys:[],ops:[]};return E={next:B(0),throw:B(1),return:B(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function B(b){return function(k){return function(U){if(_)throw new TypeError("Generator is already executing.");for(;M;)try{if(_=1,A&&(L=2&U[0]?A.return:U[0]?A.throw||((L=A.return)&&L.call(A),0):A.next)&&!(L=L.call(A,U[1])).done)return L;switch(A=0,L&&(U=[2&U[0],L.value]),U[0]){case 0:case 1:L=U;break;case 4:return M.label++,{value:U[1],done:!1};case 5:M.label++,A=U[1],U=[0];continue;case 7:U=M.ops.pop(),M.trys.pop();continue;default:if(L=M.trys,!((L=L.length>0&&L[L.length-1])||U[0]!==6&&U[0]!==2)){M=0;continue}if(U[0]===3&&(!L||U[1]>L[0]&&U[1]<L[3])){M.label=U[1];break}if(U[0]===6&&M.label<L[1]){M.label=L[1],L=U;break}if(L&&M.label<L[2]){M.label=L[2],M.ops.push(U);break}L[2]&&M.ops.pop(),M.trys.pop();continue}U=C.call(T,M)}catch(O){U=[6,O],A=0}finally{_=L=0}if(5&U[0])throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}([b,k])}}},u=this&&this.__rest||function(T,C){var _={};for(var A in T)Object.prototype.hasOwnProperty.call(T,A)&&C.indexOf(A)<0&&(_[A]=T[A]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(A=Object.getOwnPropertySymbols(T);L<A.length;L++)C.indexOf(A[L])<0&&Object.prototype.propertyIsEnumerable.call(T,A[L])&&(_[A[L]]=T[A[L]])}return _},f=this&&this.__spreadArrays||function(){for(var T=0,C=0,_=arguments.length;C<_;C++)T+=arguments[C].length;var A=Array(T),L=0;for(C=0;C<_;C++)for(var E=arguments[C],M=0,B=E.length;M<B;M++,L++)A[L]=E[M];return A};Object.defineProperty(r,"__esModule",{value:!0});var d=o(20),p=o(8),g=o(2),h=o(6),m="TSignalClient",y=o(0),R=o(1),I=function(){function T(C,_){this._loginResolveList=[],this._tuiCallEngine=C,this._chat=_.tim,this._joined=!1,this._newInvitationData=null,this._logger=p.default(),this.addTSignalEvents()}return T.prototype.setTSignalingIsJoined=function(C){this._joined=C},T.prototype.getTSignalingIsJoined=function(){return this._joined},T.prototype.setLogLevel=function(C){this._chat.setLogLevel(C)},T.prototype.addTSignalEvents=function(){var C,_,A,L,E,M=d,B=M.EVENT,b=M.TSignaling;this._chat.on(B.SDK_READY,this.onSdkReady,this),this._chat.on(B.SDK_NOT_READY,this.onSdkNotReady,this),this._chat.on(B.KICKED_OUT,this.onKickedOut,this),this._chat.on(B.NET_STATE_CHANGE,this.onNetStateChange,this),this._chat.on(B.USER_
5STATUS_UPDATED,this.onUserStatusUpdated,this),(C=this._chat)===null||C===void 0||C.addSignalingListener(b.NEW_INVITATION_RECEIVED,this.onNewInvitationReceived,this),(_=this._chat)===null||_===void 0||_.addSignalingListener(b.INVITEE_ACCEPTED,this.onInviteeAccepted,this),(A=this._chat)===null||A===void 0||A.addSignalingListener(b.INVITEE_REJECTED,this.onInviteeRejected,this),(L=this._chat)===null||L===void 0||L.addSignalingListener(b.INVITATION_CANCELLED,this.onInvitationCancelled,this),(E=this._chat)===null||E===void 0||E.addSignalingListener(b.INVITATION_TIMEOUT,this.onInvitationTimeout,this)},T.prototype.removeTSignalEvents=function(){var C,_,A,L,E,M=d,B=M.EVENT,b=M.TSignaling;this._chat.off(B.SDK_READY,this.onSdkReady,this),this._chat.off(B.SDK_NOT_READY,this.onSdkNotReady,this),this._chat.off(B.KICKED_OUT,this.onKickedOut,this),this._chat.off(B.NET_STATE_CHANGE,this.onNetStateChange,this),this._chat.off(B.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),(C=this._chat)===null||C===void 0||C.removeSignalingListener(b.NEW_INVITATION_RECEIVED,this.onNewInvitationReceived,this),(_=this._chat)===null||_===void 0||_.removeSignalingListener(b.INVITEE_ACCEPTED,this.onInviteeAccepted,this),(A=this._chat)===null||A===void 0||A.removeSignalingListener(b.INVITEE_REJECTED,this.onInviteeRejected,this),(L=this._chat)===null||L===void 0||L.removeSignalingListener(b.INVITATION_CANCELLED,this.onInvitationCancelled,this),(E=this._chat)===null||E===void 0||E.removeSignalingListener(b.INVITATION_TIMEOUT,this.onInvitationTimeout,this)},T.prototype.onSdkReady=function(C){this._logger.info(m+".onSdkReady",{type:"event"}),this._tuiCallEngine._delegate.onSdkReady(C),this._loginResolveList.forEach(function(_){return _.resolve(_.value)}),this._loginResolveList=[]},T.prototype.onSdkNotReady=function(){this._logger.info(m+".onSdkNotReady",{type:"event"}),g.default.warn("onSdkNotReady")},T.prototype.onNewInvitationReceived=function(C){var _,A,L,E,M;return l(this,void 0,void 0,function(){var B,b,k,U,O,D,J,ee,se,ue,oe;return c(this,function(W){switch(W.label){case 0:return B=this._tuiCallEngine.getCallStatus(),this._logger.info(m+".onNewInvitationReceived",{type:"event",text:{data:{params:C,currentCallStatus:B}}}),g.default.info(m+".onNewInvitationReceived - params:",C,"currentCallStatus:"+B),b=C.data,k=b.inviter,U=b.inviteeList,O=b.data,D=b.inviteID,J=b.groupID,this._tuiCallEngine.setInitialInviteData(JSON.parse(O)),ee=JSON.parse(O),R.isCallSignaling(ee==null?void 0:ee.businessID)?(ee.room_id||(ee.room_id=(_=ee==null?void 0:ee.data)===null||_===void 0?void 0:_.room_id),se=((A=ee==null?void 0:ee.data)===null||A===void 0?void 0:A.initialCallId)||"",this._tuiCallEngine.getUserId()===k?[2]:(ue=!!J)||!(!((L=ee==null?void 0:ee.data)===null||L===void 0)&&L.consumed)&&!(ee!=null&&ee.consumed)?(oe={inviter:k,inviteeList:U,inviteID:D,isGroupCall:ue,inviteData:ee,groupID:J,initialCallId:se,currentCallStatus:B,inCallUserIDs:(ee==null?void 0:ee.inCallUserIDs)||[]},((E=ee==null?void 0:ee.data)===null||E===void 0?void 0:E.cmd)!==h.CMD_TYPE.HANG_UP?[3,2]:(g.default.info(m+".hangup - params:",k,ee,this._tuiCallEngine.getHandledInviteeList(),this._tuiCallEngine.getUnHandledInviteeList(),B,ue),B===h.CALL_STATUS.IDLE?[2]:[4,this.handleHangupSignal(oe)])):[2]):[2];case 1:return W.sent(),[2];case 2:return J||!this.judgeSwitchCallMode(ee)?[3,5]:B===h.CALL_STATUS.IDLE||this._tuiCallEngine.getRoomId()!==ee.room_id?[3,4]:[4,this.handleSwitchCallMode(D,ee)];case 3:W.sent(),this._tuiCallEngine.addAudioVideoSwitchIdList(D),W.label=4;case 4:return[2];case 5:return B===h.CALL_STATUS.IDLE?[3,7]:[4,this.reject({inviteID:D,callType:ee.call_type,isBusy:!0})];case 6:return W.sent(),this._tuiCallEngine.getCallRecordReport().eventUploadNotSave({inviteID:se||D,callRole:y.NAME.INVITEE,eventType:y.NAME.IGNORE_CALL,roomID:ee.room_id,mediaType:ee.call_type,callType:J?y.NAME.GROUP:y.NAME.SINGLE,groupId:J,strRoomId:(ee==null?void 0:ee.str_room_id)||((M=ee==null?void 0:ee.data)===null||M===void 0?void 0:M.str_room_id)||""}),[2];case 7:return this.handleInvitedSignal(oe),[2]}})})},T.prototype.handleHangupSignal=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M,B,b,k,U,O;return c(this,function(D){switch(D.label){case 0:if(this._logger.info(m+".handleHangupSignal",{text:{data:a(a({},C),{isInviter:this._tuiCallEngine.isInviter(),isGroupCall:this._tuiCallEngine.isGroupCall()})},type:"event"}),_=C.inviter,A=C.inviteData,L=C.currentCallStatus,E=C.inviteeList,M=this._tuiCallEngine.isGroupCall(),B=this._tuiCallEngine.isInviter(),L===h.CALL_STATUS.CALLING){if(k=this._tuiCallEngine.getHandledInviteeList(
5),(U=this._tuiCallEngine.getUnHandledInviteeList()).indexOf(_)!==-1&&this._tuiCallEngine.deleteUnHandledInviteeList([_]),k.indexOf(_)===-1)return[2]}else if(this._tuiCallEngine.deleteHandledInviteeList([_]),(k=this._tuiCallEngine.getHandledInviteeList()).indexOf(_)===-1&&k.length>1)return[2];return b=this._tuiCallEngine.generateCallEndData({totalTime:A.call_end||0}),M?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()];case 1:return D.sent(),this._tuiCallEngine._delegate.onCallEnd(b),[3,10];case 2:return this._tuiCallEngine.deleteHandledInviteeList([_]),k=this._tuiCallEngine.getHandledInviteeList(),U=this._tuiCallEngine.getUnHandledInviteeList(),B?k.length!==1||U.length!==0?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,5];case 3:D.sent(),this._tuiCallEngine._delegate.onCallEnd(b),D.label=4;case 4:return[3,10];case 5:return L!==h.CALL_STATUS.CALLING?[3,8]:(E.indexOf(this._tuiCallEngine.getUserId())!==-1&&this._tuiCallEngine._delegate.onUserLeave(_),k.length!==0||U.length!==1?[3,7]:(O=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]));case 6:D.sent(),this._tuiCallEngine._delegate.onCallingCancel(a(a({userID:_},O),{reason:y.NAME.NORMAL})),D.label=7;case 7:return[3,10];case 8:return k.length!==1||U.length!==0?[3,10]:[4,this._tuiCallEngine._resetTUICallEngine()];case 9:D.sent(),this._tuiCallEngine._delegate.onCallEnd(b),D.label=10;case 10:return[2]}})})},T.prototype.handleInvitedSignal=function(C){var _;return l(this,void 0,void 0,function(){var A,L,E,M,B,b,k,U,O,D,J,ee,se,ue,oe,W,V;return c(this,function(S){switch(S.label){case 0:this._logger.info(m+".handleInvitedSignal",{text:{data:a(a({},C),{isInviter:this._tuiCallEngine.isInviter(),isGroupCall:this._tuiCallEngine.isGroupCall()})},type:"event"}),A=C.inviter,L=C.inviteeList,E=C.isGroupCall,M=C.groupID,B=C.inviteID,b=C.inviteData,k=C.inCallUserIDs,U=k===void 0?[]:k,O=C.initialCallId,D=O===void 0?"":O,this._tuiCallEngine.changeCallStatus(h.CALL_STATUS.CALLING),this._tuiCallEngine.setInviterID(A),this._tuiCallEngine.setInviteeList(L),this._tuiCallEngine.setRoomId(b.room_id),this._tuiCallEngine.setStrRoomId((b==null?void 0:b.str_room_id)||((_=b==null?void 0:b.data)===null||_===void 0?void 0:_.str_room_id)||""),this._tuiCallEngine.setCallType(b.call_type),this._tuiCallEngine.addUnHandledInviteeList(f(L,U)),this._tuiCallEngine.addHandledInviteeList([A]),this._tuiCallEngine.addAcceptedUserList(B,[A]),this._tuiCallEngine.setInitialCallId(D),E&&(this._tuiCallEngine.setIsGroupCall(E),this._tuiCallEngine.setGroupId(M)),this._tuiCallEngine.addInviterInviteId(B,f([A],L)),J=U.filter(function(x){return L.indexOf(x)===-1}),this._newInvitationData={sponsor:A,userIDList:f(L,J),isFromGroup:E,inviteID:B,groupID:M,inviteData:{version:b.version,callType:b.call_type,roomID:b.room_id},userData:b.userData,calleeIdList:L},ee=this._tuiCallEngine.getCallDataReport().getCallData(),ee=a(a({},ee),{roomID:b.room_id,inviteID:B,callRole:h.CALL_ROLE.INVITEE,callType:b.call_type,inviteeList:L,callScene:M?y.NAME.GROUP_CALL:y.NAME.SINGLE_CALL}),se=this._tuiCallEngine.generateEventData()||{},this._tuiCallEngine.getCallDataReport().setCallData(ee),ue={eventType:y.NAME.RECEIVE_CALL,callType:M?y.NAME.GROUP:y.NAME.SINGLE,mediaType:b.call_type,callRole:y.NAME.INVITEE,userID:this._tuiCallEngine.getUserId(),roomID:b.room_id,inviteID:D||B,strRoomId:this._tuiCallEngine.getStrRoomId(),groupId:this._tuiCallEngine.getGroupId()},this._tuiCallEngine.getCallRecordReport().eventUpload(ue),this._tuiCallEngine._delegate.onInvited(a(a({},se),this._newInvitationData)),oe=new Date().getTime(),W=oe,S.label=1;case 1:return W-oe<100?[4,new Promise(function(x){return setTimeout(x,10)})]:[3,5];case 2:return S.sent(),this._tuiCallEngine.getInviterInviteIdList().indexOf(B)!==-1?[3,4]:(this._logger.warn(m+".onNewInvitationReceived border case",{text:{data:{handleParams:C}},type:"api"}),[4,this._tuiCallEngine._resetTUICallEngine()]);case 3:return S.sent(),[2];case 4:return W=new Date().getTime(),[3,1];case 5:return[4,this._tuiCallEngine.getSelfIMCallStatus([this._tuiCallEngine.getUserId()])];case 6:return(V=S.sent())!==h.CALL_STATUS.IDLE?(this._logger.error(m+".onNewInvitationReceived",{text:{data:{handleParams:C,customStatus:V}},type:"event"}),[2]):[4,this._tuiCallEngine.setSelfIMCallStatus(h.CALL_STATUS.CALLING)];case 7:return S.sent(),[2]}})})},T.prototype.getInviteData=function(){return this._newInvitationData},T.prototype.setInviteData=function(C){this._newInvitationData=C},T.prototype.handleSwitchCallMode=function(C,_){return l(this,void 0,void 0,function(){var A,L,E,M;return c(this,function(B){switch(B.label){case 0:return A={inviteID:C,callType:_.call_type,switch_to_audio_call:null},L={cmd:h.CMD_TYPE.SWITCH_TO_VIDEO},_.call_type===h.CALL_TYPE.VIDEO_CALL?(A.switch_to_audio_call=h.CMD_TYPE.SWITCH_TO_AU
5DIO_CALL,L.cmd=h.CMD_TYPE.SWITCH_TO_AUDIO):delete A.switch_to_audio_call,E=this._tuiCallEngine.getCallStatus(),this.accept(A,L),E!==h.CALL_STATUS.CALLING?[3,1]:(M=_.call_type===h.CALL_TYPE.VIDEO_CALL?h.CALL_TYPE.AUDIO_CALL:h.CALL_TYPE.VIDEO_CALL,this._tuiCallEngine._delegate.onCallTypeChanged(_.call_type,M),this._newInvitationData.inviteData.callType=M,this._tuiCallEngine.setSwitchCallModeStatus(!1),[3,3]);case 1:return E!==h.CALL_STATUS.CONNECTED?[3,3]:(this._tuiCallEngine.setSwitchCallModeStatus(!1),[4,this._tuiCallEngine._trtcClient.switchCallMode(this._tuiCallEngine.getCallType())]);case 2:B.sent(),B.label=3;case 3:return[2]}})})},T.prototype.judgeSwitchCallMode=function(C){var _=C.switch_to_audio_call&&C.switch_to_audio_call===h.CMD_TYPE.SWITCH_TO_AUDIO_CALL||C.data&&C.data.cmd===h.CMD_TYPE.SWITCH_TO_AUDIO||C.data&&C.data.cmd===h.CMD_TYPE.SWITCH_TO_VIDEO;return g.default.info(m+".switchCallMode:",C,"isSwitchCallMode-"+_),_},T.prototype.onInviteeAccepted=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M;return c(this,function(B){switch(B.label){case 0:return this._logger.info(m+".onInviteeAccepted",{text:{data:C},type:"event"}),g.default.info(m+".onInviteeAccepted - params:",C),_=JSON.parse(C.data.data),R.isCallSignaling(_==null?void 0:_.businessID)?(A=C.data.invitee,L=C.data.inviteID,this._tuiCallEngine.getTotalInviterInviteIdList().indexOf(L)===-1?[2]:this._tuiCallEngine.isGroupCall()||!this.judgeSwitchCallMode(_)||this._tuiCallEngine.getSwitchCallModeStatus()?[3,2]:[4,this._tuiCallEngine._trtcClient.switchCallMode(this._tuiCallEngine.getCallType())]):[2];case 1:return B.sent(),[2];case 2:return E=this._tuiCallEngine.getCallStatus(),A!==this._tuiCallEngine.getUserId()||E!==h.CALL_STATUS.CALLING?[3,4]:(M=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]);case 3:return B.sent(),this._tuiCallEngine._delegate.onCallingCancel(a({userID:A},M)),[2];case 4:return E===h.CALL_STATUS.CALLING&&this._tuiCallEngine.isInviter()?(M=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(M),this._tuiCallEngine._trtcClient.getIsVideoPublish()?[3,6]:[4,this._tuiCallEngine._trtcClient.muteLocalVideo(!1)]):[3,9];case 5:B.sent(),B.label=6;case 6:return this._tuiCallEngine._trtcClient.getIsAudioPublish()?[3,8]:[4,this._tuiCallEngine._trtcClient.unMuteLocalAudio()];case 7:B.sent(),B.label=8;case 8:B.label=9;case 9:return this._tuiCallEngine.isInviter()&&this._tuiCallEngine.changeCallStatus(h.CALL_STATUS.CONNECTED),this._tuiCallEngine._delegate.onUserAccept(A),this._tuiCallEngine.addHandledInviteeList([A]),this._tuiCallEngine.deleteUnHandledInviteeList([A]),this._tuiCallEngine.addAcceptedUserList(L,[A]),[2]}})})},T.prototype.onInviteeRejected=function(C){var _;return l(this,void 0,void 0,function(){var A,L,E,M,B,b,k,U,O,D,J,ee,se,ue,oe,W,V,S;return c(this,function(x){switch(x.label){case 0:return this._logger.info(m+".onInviteeRejected",{text:{data:a(a({},C),{currentUserID:this._tuiCallEngine.getUserId(),currentCallStatus:this._tuiCallEngine.getCallStatus(),inviteeList:this._tuiCallEngine.getInviterInviteIdList()})},type:"event"}),g.default.info(m+".onInviteeRejected - params:",C),A=C.data.inviteID,L=JSON.parse(C.data.data),R.isCallSignaling(L==null?void 0:L.businessID)?this._tuiCallEngine.isGroupCall()||this._tuiCallEngine.getSwitchCallModeStatus()||this._tuiCallEngine.getAudioVideoSwitchIdList().indexOf(A)===-1?(E=C.data.invitee,M=C.data.inviter,B=this._tuiCallEngine.getUserId(),(b=this._tuiCallEngine.getCallStatus())===h.CALL_STATUS.IDLE?[2]:this._tuiCallEngine.getInviterInviteIdList().indexOf(A)===-1?(this._tuiCallEngine.isInviter()&&this._tuiCallEngine.getInviterInviteIdUserList().indexOf(E)!==-1||this._tuiCallEngine.deleteUnHandledInviteeList([E]),[2]):(k=this._tuiCallEngine.generateEventData(),U=a({userID:E},k),B!==E||b!==h.CALL_STATUS.CALLING?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()])):(g.default.info(m+".onInviteeRejected - Audio and video switching is not available"),this._tuiCallEngine.setSwitchCallModeStatus(!0),[2]):[2];case 1:return x.sent(),this._tuiCallEngine._delegate.onCallingCancel(U),[2];case 2:return O=this._tuiCallEngine.isGroupCall(),D=this._tuiCallEngine.isInviter(),this._tuiCallEngine.deleteUnHandledInviteeList([E]),J=this._tuiCallEngine.getUnHandledInviteeList(
5),ee=this._tuiCallEngine.getHandledInviteeList(),b===h.CALL_STATUS.CONNECTED&&ee.indexOf(E)!==-1?[2]:L.line_busy==="line_busy"||L.line_busy===""||!((_=L==null?void 0:L.data)===null||_===void 0)&&_.message&&L.data.message==="lineBusy"?O?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,7];case 3:return x.sent(),D&&this._tuiCallEngine._delegate.onLineBusy(E),this._tuiCallEngine._delegate.onCallingCancel(a(a({},U),{reason:y.NAME.BUSYLINE})),[3,6];case 4:if(M===B)this._tuiCallEngine._delegate.onLineBusy(E);else{for(se=(se=this._tuiCallEngine.getInviterInviteIdList()||[]).filter(function(H){return H!==A}),ue=!0,oe=function(H){var z=W._tuiCallEngine.getInviterInviteIdUserList(se[H]);if([B,E].every(function(de){return z.indexOf(de)===-1}))return ue=!1,"break"},W=this,V=0;V<se.length&&oe(V)!=="break";V++);ue&&this._tuiCallEngine._delegate.onLineBusy(E)}return J.length!==0||ee.length!==1?[3,6]:[4,this._tuiCallEngine._resetTUICallEngine()];case 5:x.sent(),this._tuiCallEngine._delegate.onCallingCancel(a(a({},U),{reason:y.NAME.BUSYLINE})),x.label=6;case 6:return[3,17];case 7:return O?[3,9]:[4,this._tuiCallEngine._resetTUICallEngine()];case 8:return x.sent(),this._tuiCallEngine._delegate.onReject(E),this._tuiCallEngine._delegate.onCallingCancel(a(a({},U),{reason:y.NAME.REJECT})),[3,17];case 9:return this._tuiCallEngine._delegate.onReject(E),b!==h.CALL_STATUS.CALLING?[3,15]:D?J.length!==0||ee.length!==1?[3,11]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,12];case 10:x.sent(),this._tuiCallEngine._delegate.onCallingCancel(a(a({},U),{reason:y.NAME.REJECT})),x.label=11;case 11:return[3,14];case 12:return J.length!==1||ee.length!==0?[3,14]:[4,this._tuiCallEngine._resetTUICallEngine()];case 13:x.sent(),this._tuiCallEngine._delegate.onCallingCancel(a(a({},U),{reason:y.NAME.REJECT})),x.label=14;case 14:return[3,17];case 15:return J.length!==0||ee.length!==1?[3,17]:(S=this._tuiCallEngine.generateCallEndData({userId:E}),[4,this._tuiCallEngine._resetTUICallEngine()]);case 16:x.sent(),this._tuiCallEngine._delegate.onCallEnd(S),x.label=17;case 17:return[2]}})})},T.prototype.onInvitationCancelled=function(C){return l(this,void 0,void 0,function(){var _,A;return c(this,function(L){switch(L.label){case 0:return this._logger.info(m+".onInvitationCancelled",{text:{data:a(a({},C),{currentUserID:this._tuiCallEngine.getUserId(),currentCallStatus:this._tuiCallEngine.getCallStatus(),inviteeList:this._tuiCallEngine.getInviterInviteIdList()})},type:"event"}),g.default.info(m+".onInvitationCancelled - params:",C,this._tuiCallEngine.getCallStatus()),_=JSON.parse(C.data.data),R.isCallSignaling(_==null?void 0:_.businessID)?this._tuiCallEngine.getCallStatus()===h.CALL_STATUS.IDLE||this._tuiCallEngine.getInviterInviteIdList().indexOf(C.data.inviteID)===-1?[2]:(A=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]):[2];case 1:return L.sent(),this._tuiCallEngine._delegate.onCallingCancel(a(a({userID:this._tuiCallEngine.getUserId()},A),{reason:y.NAME.NORMAL})),[2]}})})},T.prototype.onInvitationTimeout=function(C){var _,A;return l(this,void 0,void 0,function(){var L,E,M,B,b,k,U,O,D,J,ee,se,ue,oe,W;return c(this,function(V){switch(V.label){case 0:return this._logger.info(m+".onInvitationTimeout",{text:{data:a(a({},C),{currentUserID:this._tuiCallEngine.getUserId(),isGroupCall:this._tuiCallEngine.isGroupCall(),currentCallStatus:this._tuiCallEngine.getCallStatus()})},type:"event"}),L=C.data,E=L.inviter,M=L.inviteeList,B=M===void 0?[]:M,b=L.inviteID,k=this._tuiCallEngine.getUserId(),U=this._tuiCallEngine.isGroupCall(),O=this._tuiCallEngine.isInviter(),D=this._tuiCallEngine.getCallStatus(),this._tuiCallEngine.deleteUnHandledInviteeList(B),g.default.info(m+".onInvitationTimeout - params:",C,"currentUserID:"+k+" isInviter:"+O+" isGroupCall:"+U+" currentCallStatus:"+D+" inviteID:"+((_=this==null?void 0:this._newInvitationData)===null||_===void 0?void 0:_.inviteID)),this._tuiCallEngine.getInviterInviteIdList().indexOf(b)===-1?[2]:D===h.CALL_STATUS.IDLE?[2]:D!==h.CALL_STATUS.CONNECTED||U?(J=this._tuiCallEngine.getHandledInviteeList(),ee=this._tuiCallEngine.getUnHandledInviteeList(
5),se=a(a({},this._tuiCallEngine.generateEventData()),{reason:y.NAME.TIMEOUT}),U?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()]):[2];case 1:return V.sent(),O?(this._tuiCallEngine._delegate.onCallingCancel(a({userID:B[0]},se)),this._tuiCallEngine._delegate.onNoResp(E,B)):(this._tuiCallEngine._delegate.onCallingCancel(a({userID:B[0]||""},se)),ue=this._tuiCallEngine.getCallRecordReport().getCallRecordData().head,this._tuiCallEngine.getCallRecordReport().eventUpload(a(a({},ue),{eventType:y.NAME.NOT_ANSWER_CALL,inviteID:this._tuiCallEngine.getInitialCallId()}))),!((A=C==null?void 0:C.data)===null||A===void 0)&&A.isSelfTimeout&&this._tuiCallEngine._delegate.onCallMessage(C),[3,12];case 2:return D!==h.CALL_STATUS.CALLING?[3,10]:O?ee.length!==0?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,5];case 3:V.sent(),this._tuiCallEngine._delegate.onCallingCancel(a({userID:B.join(",")},se)),V.label=4;case 4:return this._tuiCallEngine._delegate.onNoResp(E,B),[3,9];case 5:return B.indexOf(k)!==-1?[3,6]:(this._tuiCallEngine._delegate.onNoResp(E,B),[3,8]);case 6:return[4,this._tuiCallEngine._resetTUICallEngine()];case 7:V.sent(),this._tuiCallEngine._delegate.onCallingCancel(a({userID:k},se)),V.label=8;case 8:oe=this._tuiCallEngine.getCallRecordReport().getCallRecordData().head,this._tuiCallEngine.getCallRecordReport().eventUpload(a(a({},oe),{eventType:y.NAME.NOT_ANSWER_CALL,inviteID:this._tuiCallEngine.getInitialCallId()})),V.label=9;case 9:return[3,12];case 10:return this._tuiCallEngine._delegate.onNoResp(E,B),J.length!==1||ee.length!==0?[3,12]:(W=this._tuiCallEngine.generateCallEndData(),[4,this._tuiCallEngine._resetTUICallEngine()]);case 11:V.sent(),this._tuiCallEngine._delegate.onCallEnd(W),V.label=12;case 12:return[2]}})})},T.prototype.onKickedOut=function(){return l(this,void 0,void 0,function(){return c(this,function(C){switch(C.label){case 0:return this._logger.info(m+".onKickedOut",{text:{error:"onKickedOut"},type:"event"}),g.default.info(m+".onKickedOut"),this._tuiCallEngine.setIsLogin(!1),this._tuiCallEngine._trtcClient.removeTRTCEvents(),[4,this._tuiCallEngine._resetTUICallEngine()];case 1:return C.sent(),this._tuiCallEngine._delegate.onKickedOut(),[2]}})})},T.prototype.onNetStateChange=function(){g.default.debug(m+".onNetStateChange")},T.prototype.onUserStatusUpdated=function(C){return l(this,void 0,void 0,function(){var _,A,L,E=this;return c(this,function(M){switch(M.label){case 0:return this._logger.info(m+".onUserStatusUpdated",{text:{data:C},type:"event"}),(_=(C.data||[]).find(function(B){return B.userID===E._tuiCallEngine.getUserId()}))?(A=y.CUSTOM_STATUS_MAP[_.customStatus],(L=this._tuiCallEngine.getCallStatus())===h.CALL_STATUS.IDLE||A===L?[3,2]:[4,this._tuiCallEngine.setSelfIMCallStatus(L)]):[2];case 1:M.sent(),M.label=2;case 2:return[2]}})})},T.prototype.onMessageSentByMe=function(C){this._tuiCallEngine._delegate.onMessageSentByMe(C)},T.prototype.login=function(C){return l(this,void 0,void 0,function(){var _=this;return c(this,function(A){return this._logger.info(m+".login.start",{text:{data:C},type:"api"}),[2,new Promise(function(L,E){_._chat.login(C).then(function(M){var B;!((B=M.data)===null||B===void 0)&&B.repeatLogin&&(_._logger.info(m+".login.success",{text:{error:"The TIM login status has been inherited into Call"},type:"api"}),g.default.info(m+".login - success: The TIM login status has been inherited into Call. IM 登录状态已成功被 Call 继承。"),_._chat.isReady()&&_._tuiCallEngine._delegate.onSdkReady({name:"ts_im_ready"}),L()),_._loginResolveList.push({resolve:L,value:M})}).catch(function(M){var B=M||{},b=B.code,k=B.message;b===2024||b===2025?(_._logger.warn(m+".login.fail",{text:{error:b+", "+k},type:"api"}),g.default.warn(m+".login failed: "+b+", "+k+"."),_._loginResolveList.push({resolve:L,value:{code:0,message:"success"}})):(_._logger.error(m+".login.fail",{text:{error:b+", "+k},type:"api"}),E(M))})})]})})},T.prototype.logout=function(){return l(this,void 0,void 0,function(){return c(this,function(C){return this._joined=!1,this._loginResolveList=[],[2,this._chat.logout()]})})},T.prototype.invite=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M,B,b,k,U,O,D;return c(this,function(J){switch(J.label){case 0:return this._logger.info(m+".invite.start",{text:{data:C},type:"api"}),_=C.userID,A=C.type,L=C.roomId,E=C.strRoomId,M=C.timeout,B=C.offlinePushInfo,b=C.userIDList,k=C.userData,U=k===void 0?"":k,O=this.handleNewSignaling({version:0,call_type:A,room_id:L,str_room_id:E},{userIDs:b,excludeFromHistoryMessage:!0},U),[4,this._chat.invite({userID:_,data:JSON.stringify(O),timeout:M,offlinePushInfo:this._convertOfflinePushParams(B)})];case 1:return D=J.sent(),this._tuiCallEngine.setInitialInviteData(O),[2,a(a({},D),{roomID:L,strRoomID:E,userID:_})]}})})},T.prototype.inviteInGroup=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M,B,b,k,U,O,D,J,ee;return c(this,function(se){switch(se.label){case 0:return this._logger.info(m+".inviteInGroup.start",{text:{data:C},type:"api"}),_=C.groupID,A=C.userIDList,L=C.roomId,E=C.strRoomId,M=C.type,B=C.timeout,b=C.offlinePushInfo,k=C.inCallUserIDs,U=C.userData,O=U===void 0?"":U,D=C.initialCallId,J=D===void 0?"":D,[4,this._chat.inviteInGroup({groupID:_,inviteeList:A,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:M,room_id:L,str_room_id:E,inCallUserIDs:k},{initialCallId:J},O)),timeout:B,offlinePushInfo:this._convertOfflinePushParams(b)})];case 1:return ee=se.sent(),[2,a(a({},ee),{roomID:L,strRoomID:E,groupID:_})]}})})},T.prototype.hangup=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M,B,b,k,U;return c(this,function(O){switch(O.label){case 0:return this._logger.info(m+".hangup.start",{text:{data:C},type:"api"}),g.default.info(m+".hangup - params:",C),_=C.userIDList,A=C.callType,L=C.callEnd,M={version:0,call_type:A,call_end:E=L===void 0?0:L},B={cmd:h.CMD_TYPE.HANG_UP},b=JSON.stringify(this.handleNewSignaling(M,B)),k={},U=this._tuiCallEngine.generateCallEndData({callMediaType:A,totalTime:E}),this._tuiCallEngine._delegate.onCallEnd(U),this._tuiCallEngine.isGroupCall()&&this._tuiCallEngine.getGroupId()?[4,this._chat.inviteInGroup({inviteeList:_,groupID:this._tuiCallEngine.getGroupId(),data:b,timeout:0})]:[3,2];case 1:return k=O.sent(),[3,4];case 2:return[4,this._chat.invite({userID:_[0],data:b,timeout:0})];case 3:k=O.sent(),O.label=4;case 4:return this._tuiCallEngine._delegate.onCallMessage(k),this._joined=!1,[2]}})})},T.prototype.accept=function(C,_){return l(this,void 0,void 0,function(){var A,L,E;return c(this,function(M){switch(M.label){case 0:return this._logger.info(m+".accept.start",{text:{data:C},type:"api"}
5),A=C.inviteID,L=C.callType,E=u(C,["inviteID","callType"]),[4,this._chat.accept({inviteID:A,data:JSON.stringify(this.handleNewSignaling(a({version:0,call_type:L},E),a(a({},_),{excludeFromHistoryMessage:!0})))})];case 1:return[2,M.sent()]}})})},T.prototype.reject=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M;return c(this,function(B){switch(B.label){case 0:return this._logger.info(m+".reject.start",{text:{data:{params:C}},type:"api"}),_=C.inviteID,A=C.callType,L=C.isBusy,[4,this._tuiCallEngine.modifyInvitation(_)];case 1:return B.sent(),E={version:0,call_type:A},L&&(E.line_busy="line_busy"),[4,this._chat.reject({inviteID:_,data:JSON.stringify(this.handleNewSignaling(E,{message:L?"lineBusy":""}))})];case 2:return M=B.sent(),L&&this._tuiCallEngine._delegate.onCallMessage(M),[2,M]}})})},T.prototype.cancel=function(C){return l(this,void 0,void 0,function(){var _,A;return c(this,function(L){return this._logger.info(m+".cancel.start",{text:{data:C},type:"api"}),_=C.inviteID,A=JSON.stringify(this.handleNewSignaling({version:4,businessID:y.NAME.AV_CALL,call_type:this._tuiCallEngine.getCallType()})),[2,this._chat.cancel({inviteID:_,data:A})]})})},T.prototype.resetJoined=function(){this._joined=!1},T.prototype.switchCallMode=function(C){return l(this,void 0,void 0,function(){var _,A,L,E,M,B,b,k;return c(this,function(U){switch(U.label){case 0:return _=C.userID,A=C.callType,L=C.roomID,E=C.timeout,M=C.mode,B={version:0,call_type:A,room_id:L,switch_to_audio_call:null},b={cmd:h.CMD_TYPE.SWITCH_TO_VIDEO},M===h.MODE_TYPE.AUDIO?(B.switch_to_audio_call=h.CMD_TYPE.SWITCH_TO_AUDIO_CALL,b.cmd=h.CMD_TYPE.SWITCH_TO_AUDIO):delete B.switch_to_audio_call,[4,this._chat.invite({userID:_,data:JSON.stringify(this.handleNewSignaling(B,b)),timeout:E})];case 1:return(k=U.sent()).inviteID&&this._tuiCallEngine.addAudioVideoSwitchIdList(k.inviteID),[2]}})})},T.prototype.handleNewSignaling=function(C,_,A){var L=a(a({userData:A||""},C),{version:4,businessID:y.NAME.AV_CALL,platform:"Web",data:a({cmd:h.CMD_TYPE_LIST[C.call_type],room_id:C.room_id,str_room_id:C.str_room_id,inviter:this._tuiCallEngine.getInviterID(),message:""},_)});return this._tuiCallEngine.getExcludeFromHistoryMessage()!==void 0&&(this._tuiCallEngine.getExcludeFromHistoryMessage()?L.data.excludeFromHistoryMessage=!0:delete L.data.excludeFromHistoryMessage),delete L.str_room_id,L},T.prototype._convertOfflinePushParams=function(C){if(C===void 0&&(C={}),Object.keys(C).length===0)return{};var _=C.title,A=C.description,L=C.androidOPPOChannelID,E=C.extension,M=C.isDisablePush,B=C.iOSPushType,b=B===void 0?h.IOSOfflinePushType.APNs:B,k=C.ignoreIOSBadge,U=C.iOSSound,O=C.androidSound,D=C.androidVIVOClassification;return{title:_||"",description:A||"",extension:E||"",disablePush:M||!1,androidInfo:{sound:O,XiaoMiChannelID:C.androidXiaoMiChannelID,OPPOChannelID:L,FCMChannelID:C.androidFCMChannelID,VIVOClassification:D,HuaWeiCategory:C.androidHuaWeiCategory},apnsInfo:{sound:U,ignoreIOSBadge:k||!1,disableVoipPush:b!==1}}},T}();r.default=I},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(h){for(var m,y=1,R=arguments.length;y<R;y++)for(var I in m=arguments[y])Object.prototype.hasOwnProperty.call(m,I)&&(h[I]=m[I]);return h}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0});var l=o(8),c=o(16),u=o(2),f=o(13),d=o(18),p="TUICallObserver",g=function(){function h(m){this._eventEmitter=m,this._callEngineLogger=l.default(),this._eventStatController=new d.default,f.default.bindController(this._eventStatController)}return h.prototype.onError=function(m,y){this._callEngineLogger.error("onError",{type:"event",text:{error:{code:m,msg:y}}}),u.default.debug(p+".onError code:"+m+" msg:"+y),this._eventEmitter.emit(c.TUICallEvent.ERROR,{code:m,msg:y})},h.prototype.onSdkReady=function(m){this._callEngineLogger.info("TUICallEvent.SDK_READY",{type:"event",text:{data:{params:m}}}),u.default.debug(p+".onSdkReady params:"+m),this._eventEmitter.emit(c.TUICallEvent.SDK_READY,m)},h.prototype.onInvited=function(m){this._callEngineLogger.info("TUICallEvent.INVITED",{type:"event",text:{data:{params:m}}}
5),u.default.debug(p+".onInvited params:",m);var y=m.sponsor,R=m.userIDList,I=m.isFromGroup,T=m.inviteData,C=m.inviteID,_=m.userData,A=_===void 0?"":_,L=m.calleeIdList,E=m.callID,M=m.roomID,B=m.strRoomID,b=m.callMediaType,k=m.callRole,U={callerId:y,callID:E,calleeIdList:L,groupID:m.groupID,callMediaType:b,roomID:M,strRoomID:B,callRole:k,userData:A,userIDList:R},O=a({sponsor:y,userIDList:R,isFromGroup:I,inviteData:T,inviteID:C},U);this._eventEmitter.emit(c.TUICallEvent.INVITED,O),this._eventEmitter.emit(c.TUICallEvent.ON_CALL_RECEIVED,U)},h.prototype.onUserAccept=function(m){this._callEngineLogger.info("TUICallEvent.USER_ACCEPT",{type:"event",text:{data:{userID:m}}}),u.default.debug(p+".onUserAccept userID:"+m),this._eventEmitter.emit(c.TUICallEvent.USER_ACCEPT,{userID:m})},h.prototype.onCallBegin=function(m){this._callEngineLogger.info("TUICallEvent.ON_CALL_BEGIN",{type:"event",text:{data:{params:m}}}),u.default.debug(p+".onCallBegin params:"+JSON.stringify(m)),this._eventEmitter.emit(c.TUICallEvent.ON_CALL_BEGIN,m)},h.prototype.onUserEnter=function(m){this._callEngineLogger.info("TUICallEvent.USER_ENTER",{type:"event",text:{data:{userID:m}}}),u.default.debug(p+".onUserEnter userID:"+m),this._eventEmitter.emit(c.TUICallEvent.USER_ENTER,{userID:m})},h.prototype.onUserLeave=function(m){this._callEngineLogger.info("TUICallEvent.USER_LEAVE",{type:"event",text:{data:{userID:m}}}),u.default.debug(p+".onUserLeave userID:"+m),this._eventEmitter.emit(c.TUICallEvent.USER_LEAVE,{userID:m})},h.prototype.onReject=function(m){this._callEngineLogger.info("TUICallEvent.REJECT",{type:"event",text:{data:{userID:m}}}),u.default.debug(p+".onReject userID:"+m),this._eventEmitter.emit(c.TUICallEvent.REJECT,{userID:m})},h.prototype.onNoResp=function(m,y){this._callEngineLogger.info("TUICallEvent.NO_RESP",{type:"event",text:{data:{sponsor:m,userIDList:y}}}),u.default.debug(p+".onNoResp userIDList:",m,y),this._eventEmitter.emit(c.TUICallEvent.NO_RESP,{sponsor:m,userIDList:y})},h.prototype.onLineBusy=function(m){this._callEngineLogger.info("TUICallEvent.LINE_BUSY",{type:"event",text:{data:{userID:m}}}),u.default.debug(p+".onLineBusy userID:"+m),this._eventEmitter.emit(c.TUICallEvent.LINE_BUSY,{userID:m})},h.prototype.onCallingCancel=function(m,y){this._callEngineLogger.info("TUICallEvent.ON_CALL_CANCELED",{type:"event",text:{data:{params:m}}}),u.default.debug(p+".onCallingCancel ",m),this._eventEmitter.emit(c.TUICallEvent.CALLING_CANCEL,m),this._eventEmitter.emit(c.TUICallEvent.ON_CALL_CANCELED,m)},h.prototype.onKickedOut=function(){this._callEngineLogger.info("TUICallEvent.KICKED_OUT",{type:"event"}),u.default.debug(p+".onKickedOut"),this._eventEmitter.emit(c.TUICallEvent.KICKED_OUT,{})},h.prototype.onCallingTimeout=function(m,y){this._callEngineLogger.info("TUICallEvent.CALLING_TIMEOUT",{type:"event",text:{data:{sponsor:m,userIDList:y}}}),u.default.debug(p+".onCallingTimeout userIDList:",y),this._eventEmitter.emit(c.TUICallEvent.CALLING_TIMEOUT,{sponsor:m,userIDList:y})},h.prototype.onCallEnd=function(m){this._callEngineLogger.info("TUICallEvent.CALLING_END",{type:"event",text:{data:{params:m}}}),u.default.debug(p+".onCallEnd params:"+m),this._eventEmitter.emit(c.TUICallEvent.CALLING_END,a(a({},m),{callEnd:m.totalTime}))},h.prototype.onUserVideoAvailable=function(m){this._callEngineLogger.info("TUICallEvent.USER_VIDEO_AVAILABLE",{type:"event",text:{data:{params:m}}}),u.default.debug(p+".onUserVideoAvailable params:",m);var y=m.userID,R=m.isVideoAvailable;this._eventEmitter.emit(c.TUICallEvent.USER_VIDEO_AVAILABLE,{userID:y,isVideoAvailable:R})},h.prototype.onUserAudioAvailable=function(m){this._callEngineLogger.info("TUICallEvent.USER_AUDIO_AVAILABLE",{type:"event",text:{data:{params:m}}}),u.default.debug(p+".onUserAudioAvailable params:",m);var y=m.userID,R=m.isAudioAvailable;this._eventEmitter.emit(c.TUICallEvent.USER_AUDIO_AVAILABLE,{userID:y,isAudioAvailable:R})},h.prototype.onUserVoiceVolume=function(m){this._eventEmitter.emit(c.TUICallEvent.USER_VOICE_VOLUME,{volumeMap:m})},h.prototype.onGroupCallInviteeListUpdate=function(m){this._callEngineLogger.info("TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE",{type:"event",text:{data:{userIDList:m}}}),this._eventEmitter.emit(c.TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE,{userIDList:m})},h.prototype.onCallTypeChanged=function(m,y){this._callEngineLogger.info("TUICallEvent.CALL_TYPE_CHANGED",{type:"event",text:{data:{oldCallType:m,newCallType:y}}}),this._eventEmitter.emit(c.TUICallEvent.CALL_TYPE_CHANGED,{oldCallType:m,newCallType:y})},h.prototype.onDeviceUpdated=function(m,y){var R=m.microphone,I=m.speaker,T=m.camera,C=y.microphone,_=y.speaker,A=y.camera;this._callEngineLogger.info("TUICallEvent.DEVICED_UPDATED",{type:"event",text:{data:a(a({},m),y)}}),this._eventEmitter.emit(c.TUICallEvent.DEVICED_UPDATED,{microphoneList:R,cameraList:T,speakerList:I,currentMicrophone:C,currentCamera:A,currentSpeaker:_})},h.prototype.onUserNetworkQualityChanged=function(m){this._eventEmitter.emit(c.TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED,{networkQualityList:m})},h.prototype.onMessageSentByMe=function(m){this._eventEmitter.emit(c.TUICallEvent.MESSAGE_SENT_BY_ME,m)},h.prototype.onCallMessage=function(m){var y;this._callEngineLogger.info("TUICallEvent.CALL_MESSAGE",{type:"event",text:{data:m}}),this._eventEmitter.emit(c.TUICallEvent.CALL_MESSAGE,(y=m==null?void 0:m.data)===null||y===void 0?void 0:y.message)},h}();r.default=g},function(s,r,o){var a=o(3),l=o(21),c=o(41),u=o(27);function f(p){var g=new c(p),h=l(c.prototype.request,g);return a.extend(h,c.prototype,g),a.extend(h,g),h}var d=f(o(17));d.Axios=c,d.create=function(p){return f(u(d.defaults,p))},d.Cancel=o(28),d.CancelToken=o(56),d.isCancel=o(26),d.all=function(p){return Promise.all(p)},d.spread=o(57),d.isAxiosError=o(58),s.exports=d,s.exports.default=d},function(s,r,o){var a=o(3),l=o(22),c=o(42),u=o(43),f=o(27),d=o(54),p=d.validators;function g(h){this.defaults=h,this.interceptors={request:new c,response:new c}}g.prototype.request=function(h){typeof h=="string"?(h=arguments[1]||{}).url=arguments[0]:h=h||{},(h=f(this.defaults,h)).method?h.method=h.method.toLowerCase():this.defaults.method?h.method=this.defaults.method.toLowerCase():h.method="get";var m=h.transitional;m!==void 0&&d.assertOptions(m,{silentJSONParsing:p.transitional(p.boolean,"1.0.0"),forcedJSONParsing:p.transitional(p.boolean,"1.0.0"),clarifyTimeoutError:p.transitional(p.boolean,"1.0.0")},!1);var y=[],R=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(h)===!1||(R=R&&E.synchronous,y.unshift(E.fulfilled,E.rejected))});var I,T=[];
vendor: 6,344 bytes, lines 5-6
5if(this.interceptors.response.forEach(function(E){T.push(E.fulfilled,E.rejected)}),!R){var C=[u,void 0];for(Array.prototype.unshift.apply(C,y),C=C.concat(T),I=Promise.resolve(h);C.length;)I=I.then(C.shift(),C.shift());return I}for(var _=h;y.length;){var A=y.shift(),L=y.shift();try{_=A(_)}catch(E){L(E);break}}try{I=u(_)}catch(E){return Promise.reject(E)}for(;T.length;)I=I.then(T.shift(),T.shift());return I},g.prototype.getUri=function(h){return h=f(this.defaults,h),l(h.url,h.params,h.paramsSerializer).replace(/^\?/,"")},a.forEach(["delete","get","head","options"],function(h){g.prototype[h]=function(m,y){return this.request(f(y||{},{method:h,url:m,data:(y||{}).data}))}}),a.forEach(["post","put","patch"],function(h){g.prototype[h]=function(m,y,R){return this.request(f(R||{},{method:h,url:m,data:y}))}}),s.exports=g},function(s,r,o){var a=o(3);function l(){this.handlers=[]}l.prototype.use=function(c,u,f){return this.handlers.push({fulfilled:c,rejected:u,synchronous:!!f&&f.synchronous,runWhen:f?f.runWhen:null}),this.handlers.length-1},l.prototype.eject=function(c){this.handlers[c]&&(this.handlers[c]=null)},l.prototype.forEach=function(c){a.forEach(this.handlers,function(u){u!==null&&c(u)})},s.exports=l},function(s,r,o){var a=o(3),l=o(44),c=o(26),u=o(17);function f(d){d.cancelToken&&d.cancelToken.throwIfRequested()}s.exports=function(d){return f(d),d.headers=d.headers||{},d.data=l.call(d,d.data,d.headers,d.transformRequest),d.headers=a.merge(d.headers.common||{},d.headers[d.method]||{},d.headers),a.forEach(["delete","get","head","post","put","patch","common"],function(p){delete d.headers[p]}),(d.adapter||u.adapter)(d).then(function(p){return f(d),p.data=l.call(d,p.data,p.headers,d.transformResponse),p},function(p){return c(p)||(f(d),p&&p.response&&(p.response.data=l.call(d,p.response.data,p.response.headers,d.transformResponse))),Promise.reject(p)})}},function(s,r,o){var a=o(3),l=o(17);s.exports=function(c,u,f){var d=this||l;return a.forEach(f,function(p){c=p.call(d,c,u)}),c}},function(s,r){var o,a,l=s.exports={};function c(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function f(T){if(o===setTimeout)return setTimeout(T,0);if((o===c||!o)&&setTimeout)return o=setTimeout,setTimeout(T,0);try{return o(T,0)}catch(C){try{return o.call(null,T,0)}catch(_){return o.call(this,T,0)}}}(function(){try{o=typeof setTimeout=="function"?setTimeout:c}catch(T){o=c}try{a=typeof clearTimeout=="function"?clearTimeout:u}catch(T){a=u}})();var d,p=[],g=!1,h=-1;function m(){g&&d&&(g=!1,d.length?p=d.concat(p):h=-1,p.length&&y())}function y(){if(!g){var T=f(m);g=!0;for(var C=p.length;C;){for(d=p,p=[];++h<C;)d&&d[h].run();h=-1,C=p.length}d=null,g=!1,function(_){if(a===clearTimeout)return clearTimeout(_);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(_);try{a(_)}catch(A){try{return a.call(null,_)}catch(L){return a.call(this,_)}}}(T)}}function R(T,C){this.fun=T,this.array=C}function I(){}l.nextTick=function(T){var C=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)C[_-1]=arguments[_];p.push(new R(T,C)),p.length!==1||g||f(y)},R.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=I,l.addListener=I,l.once=I,l.off=I,l.removeListener=I,l.removeAllListeners=I,l.emit=I,l.prependListener=I,l.prependOnceListener=I,l.listeners=function(T){return[]},l.binding=function(T){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(T){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(s,r,o){var a=o(3);s.exports=function(l,c){a.forEach(l,function(u,f){f!==c&&f.toUpperCase()===c.toUpperCase()&&(l[c]=u,delete l[f])})}},function(s,r,o){var a=o(25);s.exports=function(l,c,u){var f=u.config.validateStatus;u.status&&f&&!f(u.status)?c(a("Request failed with status code "+u.status,u.config,null,u.request,u)):l(u)}},function(s,r,o){var a=o(3);s.exports=a.isStandardBrowserEnv()?{write:function(l,c,u,f,d,p){var g=[];g.push(l+"="+encodeURIComponent(c)),a.isNumber(u)&&g.push("expires="+new Date(u).toGMTString()),a.isString(f)&&g.push("path="+f),a.isString(d)&&g.push("domain="+d),p===!0&&g.push("secure"),document.cookie=g.join("; ")},read:function(l){var c=document.cookie.match(new RegExp("(^|;\\s*)("+l+")=([^;]*)"));return c?decodeURIComponent(c[3]):null},remove:function(l){this.write(l,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(s,r,o){var a=o(50),l=o(51);s.exports=function(c,u){return c&&!a(u)?l(c,u):u}},function(s,r,o){s.exports=function(a){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(a)}},function(s,r,o){s.exports=function(a,l){return l?a.replace(/\/+$/,"")+"/"+l.replace(/^\/+/,""):a}},function(s,r,o){var a=o(3),l=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];s.exports=function(c){var u,f,d,p={};return c&&a.forEach(c.split(`
6`),function(g){if(d=g.indexOf(":"),u=a.trim(g.substr(0,d)).toLowerCase(),f=a.trim(g.substr(d+1)),u){if(p[u]&&l.indexOf(u)>=0)return;p[u]=u==="set-cookie"?(p[u]?p[u]:[]).concat([f]):p[u]?p[u]+", "+f:f}}),p}},function(s,r,o){var a=o(3);s.exports=a.isStandardBrowserEnv()?function(){var l,c=/(msie|trident)/i.test(navigator.userAgent),u=document.createElement("a");function f(d){var p=d;return c&&(u.setAttribute("href",p),p=u.href),u.setAttribute("href",p),{href:u.href,protocol:u.protocol?u.protocol.replace(/:$/,""):"",host:u.host,search:u.search?u.search.replace(/^\?/,""):"",hash:u.hash?u.hash.replace(/^#/,""):"",hostname:u.hostname,port:u.port,pathname:u.pathname.charAt(0)==="/"?u.pathname:"/"+u.pathname}}return l=f(window.location.href),function(d){var p=a.isString(d)?f(d):d;return p.protocol===l.protocol&&p.host===l.host}}():function(){return!0}},function(s,r,o){var a=o(55),l={};["object","boolean","number","function","string","symbol"].forEach(function(d,p){l[d]=function(g){return typeof g===d||"a"+(p<1?"n ":" ")+d}});var c={},u=a.version.split(".");function f(d,p){for(var g=p?p.split("."):u,h=d.split("."),m=0;m<3;m++){if(g[m]>h[m])return!0;
6if(g[m]<h[m])return!1}return!1}l.transitional=function(d,p,g){var h=p&&f(p);function m(y,R){return"[Axios v"+a.version+"] Transitional option '"+y+"'"+R+(g?". "+g:"")}return function(y,R,I){if(d===!1)throw new Error(m(R," has been removed in "+p));return h&&!c[R]&&(c[R]=!0),!d||d(y,R,I)}},s.exports={isOlderVersion:f,assertOptions:function(d,p,g){if(typeof d!="object")throw new TypeError("options must be an object");for(var h=Object.keys(d),m=h.length;m-- >0;){var y=h[m],R=p[y];if(R){var I=d[y],T=I===void 0||R(I,y,d);if(T!==!0)throw new TypeError("option "+y+" must be "+T)}else if(g!==!0)throw Error("Unknown option "+y)}},validators:l}},function(s){s.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(s,r,o){var a=o(28);function l(c){if(typeof c!="function")throw new TypeError("executor must be a function.");var u;this.promise=new Promise(function(d){u=d});var f=this;c(function(d){f.reason||(f.reason=new a(d),u(f.reason))})}l.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},l.source=function(){var c;return{token:new l(function(u){c=u}),cancel:c}},s.exports=l},function(s,r,o){s.exports=function(a){return function(l){return a.apply(null,l)}}},function(s,r,o){s.exports=function(a){return typeof a=="object"&&a.isAxiosError===!0}},function(s,r,o){o.r(r);var a=o(2);const l="none",c="online",u=function(){let f=window.location.protocol;return["http:","https:"].indexOf(f)<0&&(f="http:"),f};r.default=class{constructor(){this._networkType="",this.maxWaitTime=3e3}start(){this._networkType=c}_onNetworkStatusChange(f){this._networkType=f.networkType,f.isConnected?a.default.info("NetMonitor networkType:"+f.networkType):a.default.warn("NetMonitor no network, please check!")}probe(){return new Promise(f=>{if(window&&window.fetch)fetch(`${u()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`).then(d=>{d.ok?f([!0,c]):f([!1,l])}).catch(()=>{f([!1,l])});else{const d=new XMLHttpRequest,p=setTimeout(()=>{a.default.warn("NetMonitor fetch timeout. Probably no network, please check!"),d.abort(),this._networkType=l,f([!1,l])},this.maxWaitTime);d.onreadystatechange=function(){d.readyState===4&&(clearTimeout(p),d.status===200||d.status===304?(this._networkType=c,f([!0,c])):(a.default.warn(`NetMonitor fetch status:${d.status}. Probably no network, please check!`),this._networkType=l,f([!1,l])))},d.open("GET",`${u()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`),d.send()}})}getNetworkType(){return this._networkType}reset(){this._networkType=""}}}
6,function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.apiCallQueue=r.avoidRepeatedCall=r.statusValidate=r.businessValidate=r.paramValidate=r.VALIDATE_PARAMS=void 0;var a=o(61);Object.defineProperty(r,"VALIDATE_PARAMS",{enumerable:!0,get:function(){return a.VALIDATE_PARAMS}});var l=o(62);Object.defineProperty(r,"paramValidate",{enumerable:!0,get:function(){return l.paramValidate}});var c=o(63);Object.defineProperty(r,"businessValidate",{enumerable:!0,get:function(){return c.businessValidate}});var u=o(64);Object.defineProperty(r,"statusValidate",{enumerable:!0,get:function(){return u.statusValidate}});var f=o(65);Object.defineProperty(r,"avoidRepeatedCall",{enumerable:!0,get:function(){return f.avoidRepeatedCall}});var d=o(66);Object.defineProperty(r,"apiCallQueue",{enumerable:!0,get:function(){return d.apiCallQueue}})},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.VALIDATE_PARAMS=void 0;var a=o(12),l=o(0);r.VALIDATE_PARAMS={createInstance:{SDKAppID:{required:!0,rules:[l.NAME.NUMBER],allowEmpty:!1},tim:{required:!1,rules:[l.NAME.OBJECT],allowEmpty:!0}},login:{userID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},userSig:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1}},call:{userID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},type:{required:!0,rules:[l.NAME.NUMBER],range:[1,2],allowEmpty:!1},roomID:{required:!1,rules:[l.NAME.NUMBER],range:"0~"+l.MAX_NUMBER_ROOM_ID,allowEmpty:!1},strRoomID:{required:!1,rules:[l.NAME.STRING],allowEmpty:!0},timeout:{required:!1,rules:[l.NAME.NUMBER],allowEmpty:!1}},groupCall:{userIDList:{required:!0,rules:[l.NAME.ARRAY],allowEmpty:!1},type:{required:!0,rules:[l.NAME.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},roomID:{required:!1,rules:[l.NAME.NUMBER],range:"0~"+l.MAX_NUMBER_ROOM_ID,allowEmpty:!1},strRoomID:{required:!1,rules:[l.NAME.STRING],allowEmpty:!0},timeout:{required:!1,rules:[l.NAME.NUMBER],allowEmpty:!1}},joinInGroupCall:{type:{required:!0,rules:[l.NAME.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},roomID:{required:!0,rules:[l.NAME.NUMBER],allowEmpty:!1},strRoomID:{required:!1,rules:[l.NAME.STRING],allowEmpty:!0}},inviteUser:{userIDList:{required:!0,rules:[l.NAME.ARRAY],allowEmpty:!1}},openCamera:[{key:"videoViewDomID",required:!0,rules:[l.NAME.STRING],allowEmpty:!1}],startRemoteView:{userID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},videoViewDomID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1}},stopRemoteView:{userID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1}},startLocalView:{userID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},videoViewDomID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1}},stopLocalView:{userID:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1}},switchCamera:[{key:"cameraPosition",required:!0,rules:[l.NAME.NUMBER],range:[a.TUICallCameraPosition.FRONT,a.TUICallCameraPosition.BACK],allowEmpty:!1}],switchDevice:{deviceType:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1},deviceId:{required:!0,rules:[l.NAME.STRING],allowEmpty:!1}},setVideoQuality:[{key:"profile",required:!0,rules:[l.NAME.STRING,l.NAME.OBJECT],range:Object.keys(a.TUICommonDefine.VideoEncoderParams),allowEmpty:!1}],switchCallMediaType:[{key:"newMediaType",required:!0,rules:[l.NAME.NUMBER],range:[1,2],allowEmpty:!1}],getDeviceList:[{key:"deviceType",required:!0,rules:[l.NAME.STRING],range:["camera","microphones","speaker","microphone"],allowEmpty:!1}],getCurrentDevice:[{key:"deviceType",required:!0,rules:[l.NAME.STRING],range:["camera","speaker","microphone"],allowEmpty:!1}],setSelfInfo:{nickName:{required:!1,rules:[l.NAME.STRING],allowEmpty:!1},avatar:{required:!1,rules:[l.NAME.STRING],allowEmpty:!1}},setVideoRenderParams:{objectFit:{require:!1,rules:[l.NAME.STRING],range:[l.NAME.CONTAIN,l.NAME.COVER,l.NAME.FILL],allowEmpty:!1},muted:{require:!1,rules:[l.NAME.BOOLEAN],allowEmpty:!1},mirror:{require:!1,rules:[l.NAME.BOOLEAN],allowEmpty:!1}},enableMultiDeviceAbility:[{key:"enable",required:!0,rules:[l.NAME.BOOLEAN],allowEmpty:!1}]}},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(h){for(var m,y=1,R=arguments.length;y<R;y++)for(var I in m=arguments[y])Object.prototype.hasOwnProperty.call(m,I)&&(h[I]=m[I]);return h}).apply(this,arguments)};
6Object.defineProperty(r,"__esModule",{value:!0}),r.paramValidate=void 0;var l=o(8),c=o(1),u=o(10),f=o(7),d=o(15);function p(h,m,y){var R=l.default();try{if(c.isArray(h))for(var I=0;I<h.length;I++)g.call(this,a(a({},h[I]),{value:m[I],name:y}));else for(var T in h)g.call(this,a(a({},h[T]),{value:m[0][T],name:y,key:T}))}catch(C){throw R.error("paramValidate.fail",{text:{error:C}}),C}}function g(h){var m=h.required,y=h.rules,R=h.range,I=h.value,T=h.allowEmpty,C=h.name,_=h.key;if(c.isUndefined(I)){if(m){var A=d.getErrorMessage({code:f.default.INVALID_PARAMETER_REQUIRED,params:{key:_,value:I,fnName:C}});throw new u.default({code:f.default.ERROR_PARAM_INVALID,message:A})}}else{var L="";if(!y.some(function(b){return b===c.getType(I)})){for(var E=0;E<y.length;E++){var M=y[E];L+=(M=M.replace(M[0],M[0].toUpperCase()))+"/"}throw L=L.substring(0,L.length-1),A=d.getErrorMessage({code:f.default.INVALID_PARAMETER_TYPE,params:{key:_,rule:{type:L},value:I,fnName:C}}),new u.default({code:f.default.ERROR_PARAM_INVALID,message:A})}if(T===!1){if(c.isArray(I)&&I.length===0)throw A=d.getErrorMessage({code:f.default.INVALID_PARAMETER_EMPTY,params:{key:_,fnName:C}}),new u.default({code:f.default.ERROR_PARAM_INVALID,message:A});if(c.isString(I)&&I.trim()==="")throw A=d.getErrorMessage({code:f.default.INVALID_PARAMETER_EMPTY,params:{key:_,value:I}}),new u.default({code:f.default.ERROR_PARAM_INVALID,message:A})}if(c.isArray(R)&&R&&R.indexOf(I)===-1)throw A=d.getErrorMessage({code:f.default.INVALID_PARAMETER_RANGE,params:{key:_,rule:{values:R},value:I,fnName:C}}),new u.default({code:f.default.ERROR_PARAM_INVALID,message:A});if(c.isString(R)&&R.indexOf("~")!==-1){var B=R.split("~");if(I<+B[0]||I>+B[1]||c.isNumber(I)&&Number.isNaN(I))throw A=d.getErrorMessage({code:f.default.INVALID_PARAMETER_RANGE,params:{key:_,rule:{values:R},value:I,fnName:C}}),new u.default({code:f.default.ERROR_PARAM_INVALID,message:A})}}}r.paramValidate=function(h){return function(m,y,R){var I=R.value;return R.value=function(){for(var T=[],C=0;C<arguments.length;C++)T[C]=arguments[C];return p.call(this,h,T,y),I.apply(this,T)},R}}},function(s,r,o){var a=this&&this.__awaiter||function(R,I,T,C){return new(T||(T=Promise))(function(_,A){function L(B){try{M(C.next(B))}catch(b){A(b)}}function E(B){try{M(C.throw(B))}catch(b){A(b)}}function M(B){var b;B.done?_(B.value):(b=B.value,b instanceof T?b:new T(function(k){k(b)})).then(L,E)}M((C=C.apply(R,I||[])).next())})},l=this&&this.__generator||function(R,I){var T,C,_,A,L={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return A={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function E(M){return function(B){return function(b){if(T)throw new TypeError("Generator is already executing.");for(;L;)try{if(T=1,C&&(_=2&b[0]?C.return:b[0]?C.throw||((_=C.return)&&_.call(C),0):C.next)&&!(_=_.call(C,b[1])).done)return _;switch(C=0,_&&(b=[2&b[0],_.value]),b[0]){case 0:case 1:_=b;break;case 4:return L.label++,{value:b[1],done:!1};case 5:L.label++,C=b[1],b=[0];continue;case 7:b=L.ops.pop(),L.trys.pop();continue;default:if(_=L.trys,!((_=_.length>0&&_[_.length-1])||b[0]!==6&&b[0]!==2)){L=0;continue}if(b[0]===3&&(!_||b[1]>_[0]&&b[1]<_[3])){L.label=b[1];break}if(b[0]===6&&L.label<_[1]){L.label=_[1],_=b;break}if(_&&L.label<_[2]){L.label=_[2],L.ops.push(b);break}_[2]&&L.ops.pop(),L.trys.pop();continue}b=I.call(R,L)}catch(k){b=[6,k],C=0}finally{T=_=0}if(5&b[0])throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}([M,B])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.validateBusiness=r.businessValidate=void 0;var c=o(8),u=o(10),f=o(7),d=o(11),p=o(6),g=o(1);function h(R){var I=g.isDomesticSDKAppID(R)?""+d.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_PURCHASED:""+d.ERROR_MESSAGE.ERROR_PACKAGE_NOT_PURCHASED;return I=I.replace("${purchaseAddress}",g.getPurchaseAddress(R))}function m(R,I,T){if(c.default().error("validateBusiness.fail",{text:{error:R}}),R.code===2905)throw new u.default({code:f.default.ERROR_TIM_VERSION_OUTDATED});var C=f.default.ERROR_PACKAGE_NOT_SUPPORTED,_="";throw I===p.CALL_EXPERMENTEL_API_TYPE.PRO?_=function(A){var L=g.isDomesticSDKAppID(A)?""+d.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED:""+d.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED;return L=L.replace("${purchaseAddress}",g.getPurchaseAddress(A))}(T)+" <ERROR_PACKAGE_NOT_SUPPORTED: "+f.default.ERROR_PACKAGE_NOT_SUPPORTED+">":(C=f.default.ERROR_PACKAGE_NOT_PURCHASED,_=h(T)+" <ERROR_PACKAGE_NOT_PURCHASED: "+f.default.ERROR_PACKAGE_NOT_PURCHASED+">"),new u.default({code:C,message:_})}function y(R,I,T){return a(this,void 0,void 0,function(){return l(this,function(C){switch(C.label){case 0:return C.trys.push([0,2,,3]),[4,this.tim.callExperimentalAPI("isCommercialAbilityEnabled",R)];case 1:if(C.sent().data.enabled)return[2,I.apply(this,T)];try{R===p.CALL_EXPERMENTEL_API_TYPE.BASE&&(this._callDataReport.setCodeAndMessage(f.default.ERROR_PACKAGE_NOT_SUPPORTED,d.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED),this._callDataReport.uploadToKibana())}catch(_){}throw new u.default({code:f.default.ERROR_PACKAGE_NOT_SUPPORTED});case 2:return m(C.sent(),R,this._sdkAppID),[3,3];case 3:return[2]}})})}r.businessValidate=function(R){return function(I,T,C){var _=C.value;return C.value=function(){for(var A=[],L=0;L<arguments.length;L++)A[L]=arguments[L];return a(this,void 0,void 0,function(){return l(this,function(E){switch(E.label){case 0:return E.trys.push([0,2,,3]),[4,y.call(this,R,_,A)];case 1:return[2,E.sent()];case 2:throw E.sent();case 3:return[2]}})})},C}},r.validateBusiness=function(R,I,T){return a(this,void 0,void 0,function(){var C,_;return l(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),[4,R.callExperimentalAPI("isCommercialAbilityEnabled",I)];case 1:if((C=A.sent()).data.enabled)return[2,Promise.resolve(C.data.enabled)];throw _=h(T)+" <ERROR_PACKAGE_NOT_PURCHASED: "+f.default.ERROR_PACKAGE_NOT_PURCHASED+">",new u.default({code:f.default.ERROR_PACKAGE_NOT_PURCHASED,message:_});case 2:return m(A.sent(),I,T),[3,3];case 3:return[2]}})})}}
6,function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.statusValidate=void 0;var a=o(8),l=o(10),c=o(7),u=o(15);function f(d,p,g){var h,m=a.default();if(d!=null&&d.init&&!this._isLogin){var y=u.getErrorMessage({code:c.default.ERROR_INIT_FAIL,params:{fnName:g},languageList:["en"]});throw m.error("statusValidate.fail",{text:{error:""+y}}),new l.default({code:c.default.ERROR_INIT_FAIL,fnName:g})}if(((h=d==null?void 0:d.callStatus)===null||h===void 0?void 0:h.indexOf(this._callStatus))===-1)throw y=u.getErrorMessage({code:c.default.INVALID_PARAMETER_RANGE,params:{key:"callStatus",rule:{values:d.callStatus},value:this._callStatus,fnName:g}}),m.error("statusValidate.fail",{text:{error:y}}),new l.default({code:c.default.ERROR_REQUEST_REFUSED,message:y});if(d!=null&&d.scene&&this._isGroupCall)throw y=u.getErrorMessage({code:c.default.ERROR_SCENE_NOT_SUPPORTED,params:{fnName:g},languageList:["en"]}),m.error("statusValidate.fail",{text:{error:""+y}}),new l.default({code:c.default.ERROR_SCENE_NOT_SUPPORTED,fnName:g})}r.statusValidate=function(d){return function(p,g,h){var m=h.value;return h.value=function(){for(var y=[],R=0;R<arguments.length;R++)y[R]=arguments[R];return f.call(this,d,y,g),m.apply(this,y)},h}}},function(s,r,o){var a=this&&this.__awaiter||function(d,p,g,h){return new(g||(g=Promise))(function(m,y){function R(C){try{T(h.next(C))}catch(_){y(_)}}function I(C){try{T(h.throw(C))}catch(_){y(_)}}function T(C){var _;C.done?m(C.value):(_=C.value,_ instanceof g?_:new g(function(A){A(_)})).then(R,I)}T((h=h.apply(d,p||[])).next())})},l=this&&this.__generator||function(d,p){var g,h,m,y,R={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return y={next:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function I(T){return function(C){return function(_){if(g)throw new TypeError("Generator is already executing.");for(;R;)try{if(g=1,h&&(m=2&_[0]?h.return:_[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,_[1])).done)return m;switch(h=0,m&&(_=[2&_[0],m.value]),_[0]){case 0:case 1:m=_;break;case 4:return R.label++,{value:_[1],done:!1};case 5:R.label++,h=_[1],_=[0];continue;case 7:_=R.ops.pop(),R.trys.pop();continue;default:if(m=R.trys,!((m=m.length>0&&m[m.length-1])||_[0]!==6&&_[0]!==2)){R=0;continue}if(_[0]===3&&(!m||_[1]>m[0]&&_[1]<m[3])){R.label=_[1];break}if(_[0]===6&&R.label<m[1]){R.label=m[1],m=_;break}if(m&&R.label<m[2]){R.label=m[2],R.ops.push(_);break}m[2]&&R.ops.pop(),R.trys.pop();continue}_=p.call(d,R)}catch(A){_=[6,A],h=0}finally{g=m=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([T,C])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.avoidRepeatedCall=void 0;var c=o(8),u=o(10),f=o(7);r.avoidRepeatedCall=function(){var d=c.default();return function(p,g,h){var m=h.value,y=new Set;return h.value=function(){for(var R=[],I=0;I<arguments.length;I++)R[I]=arguments[I];return a(this,void 0,void 0,function(){var T,C;return l(this,function(_){switch(_.label){case 0:if(y.has(this))throw d.error("avoidRepeatedCall.fail",{text:{error:"previous "+g+"() is ongoing, please avoid repeated calls"}}),new u.default({code:f.default.ERROR_REQUEST_REPEATED,fnName:g});_.label=1;case 1:return _.trys.push([1,3,,4]),y.add(this),[4,m.apply(this,R)];case 2:return T=_.sent(),y.delete(this),[2,T];case 3:throw C=_.sent(),d.error("avoidRepeatedCall.fail",{text:{error:C}}),y.delete(this),C;case 4:return[2]}})})},h}}},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(c){for(var u,f=1,d=arguments.length;f<d;f++)for(var p in u=arguments[f])Object.prototype.hasOwnProperty.call(u,p)&&(c[p]=u[p]);return c}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),r.apiCallQueue=void 0;var l=new WeakMap;r.apiCallQueue=function(){return function(c,u,f){var d=f.value,p=function(g){var h=g.fn,m=g.args,y=g.context,R=g.resolve,I=g.reject;h.apply(y,m).then(R,I).finally(function(){var T=l.get(y);T.shift(),T[0]&&p(a({},T[0]))})};return f.value=function(){for(var g=this,h=[],m=0;m<arguments.length;m++)h[m]=arguments[m];return new Promise(function(y,R){if(l.has(g)){var I=l.get(g),T=I.length;
6I.push({fn:d,args:h,context:g,resolve:y,reject:R}),T===0&&p({fn:d,args:h,context:g,resolve:y,reject:R})}else l.set(g,[{fn:d,args:h,context:g,resolve:y,reject:R}]),p({fn:d,args:h,context:g,resolve:y,reject:R})})},f}}},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.TUICallEngineObserver=r.CallDataReport=void 0;var a=o(6),l=o(16),c=o(13),u=o(29),f=o(18),d=o(0),p=o(68),g=o(1),h=o(30),m=function(){function R(I){this._eventStatController=new f.default,c.default.bindController(this._eventStatController),this.initializeCallData(I),this._ssoLog=new c.default(u.default.QUALITY_REPORT)}return R.prototype.setCallData=function(I){this._callData=I},R.prototype.getCallData=function(){return this._callData},R.prototype.setInviteID=function(I){this._callData.inviteID=I},R.prototype.setTotalTime=function(I){this._callData.totalTime=I},R.prototype.setAbilityBit=function(I){this._callData.abilityBit=!!I},R.prototype.setEnterRoomTime=function(I){this._callData.enterRoomTime=p.convertTimeStampToString(I)},R.prototype.setSendSignalingTime=function(I){this._callData.sendSignalingTime=p.convertTimeStampToString(I)},R.prototype.setCallAcceptTime=function(I){this._callData.callAcceptTime=p.convertTimeStampToString(I)},R.prototype.setExitRoomTime=function(I){this._callData.exitRoomTime=p.convertTimeStampToString(I)},R.prototype.setCallEndTime=function(I){this._callData.callEndTime=I},R.prototype.setCodeAndMessage=function(I,T){this._callData.code=I||0,this._callData.message=T||""},R.prototype.setCallScene=function(I){this._callData.callScene=I||""},R.prototype.getResult=function(){return this._callData.result},R.prototype.setResult=function(I){this._callData.result=I||""},R.prototype.setUserID=function(I){this._callData.userID=I||""},R.prototype.packageCallDataToKibana=function(){var I=h.callTypeMapping(this._callData.callType),T=h.callRoleMapping(this._callData.callRole);return"CallData{version='"+this._callData.version+", platform="+this._callData.platform+", framework="+this._callData.framework+", sdk_app_id="+this._callData.sdkAppId+", user_id="+this._callData.userID+", room_id="+this._callData.roomID+", invite_id="+this._callData.inviteID+", invitee_list="+this._callData.inviteeList+", media_type="+I+", role="+T+", call_scene="+this._callData.callScene+", result="+this._callData.result+", total_time="+this._callData.totalTime+", total_score="+this._callData.totalScore+", ability_bit="+this._callData.abilityBit+", enter_room="+this._callData.enterRoomTime+", send_signaling="+this._callData.sendSignalingTime+", call_accept="+this._callData.callAcceptTime+", exit_room="+this._callData.exitRoomTime+", call_end="+this._callData.callEndTime+", code="+this._callData.code+", message="+this._callData.message+", network="+this._callData.network+", audio="+this._callData.audio+", video="+this._callData.video+"}"},R.prototype.initializeCallData=function(I){var T=I||{},C=T.version,_=C===void 0?"":C,A=T.sdkAppId,L=A===void 0?0:A,E=T.userID,M=E===void 0?"":E,B=g.getHostType();this._callData={version:_,platform:B,framework:d.NAME.WEB,sdkAppId:L,userID:M,roomID:0,inviteID:"",callRole:a.CALL_ROLE.UNKNOWN,callScene:"",callType:a.CALL_TYPE.UNKNOWN,inviteeList:[],result:d.NAME.UNKNOWN,totalTime:0,totalScore:0,code:0,message:"",abilityBit:!1,enterRoomTime:"",sendSignalingTime:"",callAcceptTime:"",exitRoomTime:"",callEndTime:"",network:0,audio:0,video:0}},R.prototype.reset=function(){this.initializeCallData(),this._ssoLog=null},R.prototype.clearCallDataAfterUpload=function(){var I=this.getCallData(),T=I.version,C=I.sdkAppId,_=I.userID;this.initializeCallData({version:T,sdkAppId:C,userID:_})},R.prototype.uploadToKibana=function(){try{this._ssoLog.setText(this.packageCallDataToKibana()).setEnd(),this.clearCallDataAfterUpload()}catch(I){}},R}();r.CallDataReport=m;var y=function(){function R(I,T){this._eventEmitter=I,this._callDataReport=T,this.registerListener()}return R.prototype.registerListener=function(){this._eventEmitter.on(l.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.on(l.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(l.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(l.TUICallEvent.
6LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(l.TUICallEvent.REJECT,this.onReject.bind(this))},R.prototype.removeLister=function(){this._eventEmitter.off(l.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.off(l.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.off(l.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.off(l.TUICallEvent.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.off(l.TUICallEvent.REJECT,this.onReject.bind(this))},R.prototype.onCallEnd=function(I){var T=I.totalTime,C=T===void 0?0:T;this._callDataReport.setTotalTime(C),this._callDataReport.setResult(d.NAME.NORMAL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()},R.prototype.onCallingCancel=function(){this._callDataReport.getResult()||this._callDataReport.setResult(d.NAME.CANCEL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()},R.prototype.onNoResponse=function(){this._callDataReport.setResult(d.NAME.TIMEOUT)},R.prototype.onLineBusy=function(){this._callDataReport.setResult(d.NAME.BUSYLINE)},R.prototype.onReject=function(){this._callDataReport.setResult(d.NAME.REJECT)},R}();r.TUICallEngineObserver=y},function(s,r,o){o.r(r),o.d(r,"setBaseTime",function(){return u}),o.d(r,"getCurrentTime",function(){return f}),o.d(r,"getTimestamp",function(){return d}),o.d(r,"convertTimeStampToString",function(){return p});var a=o(2);let l=new Date().getTime(),c=0;const u=function(g){l=g,c=l-new Date().getTime();const h=new Date;h.setTime(g),a.default.info("baseTime from server: "+h+" offset: "+c)},f=function(){return new Date().getTime()+c},d=function(){const g=new Date;return g.setTime(f()),g.toLocaleString()},p=g=>g<=0?"":function(h){const m=new Date(h);return`${m.getFullYear()}-${(m.getMonth()+1).toString().padStart(2,"0")}-${m.getDate().toString().padStart(2,"0")} ${m.getHours().toString().padStart(2,"0")}:${m.getMinutes().toString().padStart(2,"0")}:${m.getSeconds().toString().padStart(2,"0")}`}(g)},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(C){for(var _,A=1,L=arguments.length;A<L;A++)for(var E in _=arguments[A])Object.prototype.hasOwnProperty.call(_,E)&&(C[E]=_[E]);return C}).apply(this,arguments)},l=this&&this.__awaiter||function(C,_,A,L){return new(A||(A=Promise))(function(E,M){function B(U){try{k(L.next(U))}catch(O){M(O)}}function b(U){try{k(L.throw(U))}catch(O){M(O)}}function k(U){var O;U.done?E(U.value):(O=U.value,O instanceof A?O:new A(function(D){D(O)})).then(B,b)}k((L=L.apply(C,_||[])).next())})},c=this&&this.__generator||function(C,_){var A,L,E,M,B={label:0,sent:function(){if(1&E[0])throw E[1];return E[1]},trys:[],ops:[]};return M={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function b(k){return function(U){return function(O){if(A)throw new TypeError("Generator is already executing.");for(;B;)try{if(A=1,L&&(E=2&O[0]?L.return:O[0]?L.throw||((E=L.return)&&E.call(L),0):L.next)&&!(E=E.call(L,O[1])).done)return E;switch(L=0,E&&(O=[2&O[0],E.value]),O[0]){case 0:case 1:E=O;break;case 4:return B.label++,{value:O[1],done:!1};case 5:B.label++,L=O[1],O=[0];continue;case 7:O=B.ops.pop(),B.trys.pop();continue;default:if(E=B.trys,!((E=E.length>0&&E[E.length-1])||O[0]!==6&&O[0]!==2)){B=0;continue}if(O[0]===3&&(!E||O[1]>E[0]&&O[1]<E[3])){B.label=O[1];break}if(O[0]===6&&B.label<E[1]){B.label=E[1],E=O;break}if(E&&B.label<E[2]){B.label=E[2],B.ops.push(O);break}E[2]&&B.ops.pop(),B.trys.pop();continue}O=_.call(C,B)}catch(D){O=[6,D],L=0}finally{A=E=0}if(5&O[0])throw O[1];return{value:O[0]?O[1]:void 0,done:!0}}([k,U])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.TUICallEngineRecordObserver=r.CallRecordReport=void 0;var u=o(6),f=o(16),d=o(0),p=o(1),g=o(2),h=o(70),m=o(5),y=o(30),R={serviceCommand:d.NAME.CALLKIT_RECORDS_SVR+".*"},I=function(){function C(_){this._tim=_.tim,this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=d.NAME.WAITING,this.initializeCallData(_)}return C.prototype.getCallRecordData=function(){return this._callRecordData},C.prototype.initializeCallData=function(_){var A=_||{},L=A.version,E=L===void 0?"":L,M=A.userID,B=M===void 0?"":M,b=m.getOsInfo().name,k={version:1,
6command:d.NAME.EVENT_REPORT,sdk_version:E,seq:0,os_name:d.NAME.WEB,os_version:"0.0",device_name:b,framework:d.NAME.WEB,call_type:"",media_type:"",client_ts:0,role:u.CALL_ROLE.UNKNOWN,user_id:B,room_id:"",call_id:"",group_id:"",room_id_type:1};this._callRecordData={head:k,body:{event_type:"",code:0,message:"",invitee_list:[]}}},C.prototype.reset=function(){this.initializeCallData()},C.prototype._setCallType=function(_){_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{call_type:_}))},C.prototype._setMediaType=function(_){_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{media_type:y.callTypeMapping(_)}))},C.prototype._setCallRole=function(_){_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{role:_}))},C.prototype._setUserID=function(_){_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{user_id:_}))},C.prototype._setRoomID=function(_){_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{room_id:""+_}))},C.prototype._setInviteID=function(_){_===void 0&&(_=""),_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{call_id:_}))},C.prototype._setGroupId=function(_){p.isUndefined(_)||(this._callRecordData.head=a(a({},this._callRecordData.head),{group_id:_}))},C.prototype._getGroupId=function(){return this._callRecordData.head.group_id},C.prototype._setRoomIdType=function(_){_&&(this._callRecordData.head=a(a({},this._callRecordData.head),{room_id_type:_}))},C.prototype._setEventType=function(_){_&&(this._callRecordData.body=a(a({},this._callRecordData.body),{event_type:_}))},C.prototype._setInviteeList=function(_){_===void 0&&(_=[]),this._callRecordData.body=a(a({},this._callRecordData.body),{invitee_list:_})},C.prototype._setSeq=function(){var _=this.getCallRecordData().head.seq;this._callRecordData.head=a(a({},this._callRecordData.head),{seq:_+1})},C.prototype.setBodyStatus=function(_){if(_){var A=d.NAME.WAITING;switch(_){case u.CALL_STATUS.CALLING:A=d.NAME.WAITING;break;case u.CALL_STATUS.CONNECTED:A=d.NAME.CALLING}this._bodyStatus=A}},C.prototype.eventUpload=function(_){var A;return l(this,void 0,void 0,function(){var L,E,M,B,b,k,U,O,D,J,ee,se,ue,oe,W,V,S,x;return c(this,function(H){switch(H.label){case 0:return H.trys.push([0,2,,3]),L=_.eventType,E=_.callType,M=_.mediaType,B=_.callRole,b=_.userID,k=_.roomID,U=_.inviteID,O=_.groupId,D=_.strRoomId,J=D===void 0?"":D,ee=_.inviteeList,se=ee===void 0?[]:ee,L?(this._callRecordData.head=a(a({},this._callRecordData.head),{command:d.NAME.EVENT_REPORT,client_ts:Math.floor(Date.now()/1e3)}),this._setCallType(E),this._setMediaType(M),this._setCallRole(B),this._setUserID(b),this._setInviteID(U),this._setGroupId(O),k>0?(this._setRoomID(""+k),this._setRoomIdType(1)):k===0&&p.isString(J)&&J.length>0&&(this._setRoomID(J),this._setRoomIdType(2)),this._setEventType(L),this._setInviteeList(se),this._setSeq(),ue=this.getCallRecordData(),oe=ue.head,W=ue.body,V={head:a(a({},oe),{role:y.callRoleMapping(oe.role)}),body:W},S=a(a({},R),{data:JSON.stringify(V)}),[4,(A=this==null?void 0:this._tim)===null||A===void 0?void 0:A.callExperimentalAPI("sendTRTCCustomData",S)]):[2];case 1:return H.sent(),[3,3];case 2:return x=H.sent(),[3,3];case 3:return[2]}})})},C.prototype.eventUploadNotSave=function(_){var A;return l(this,void 0,void 0,function(){var L,E,M,B,b,k,U,O,D,J,ee,se,ue,oe,W,V;return c(this,function(S){switch(S.label){case 0:return S.trys.push([0,2,,3]),L=_.eventType,E=_.callType,M=_.mediaType,B=_.callRole,b=_.roomID,k=_.groupId,U=_.strRoomId,O=U===void 0?"":U,D=_.inviteID,this._setSeq(),J=this.getCallRecordData(),ee=J.head,se=J.body,ue=ee.room_id_type,b>0&&(ue=1),b===0&&O&&(ue=2),oe={head:a(a({},ee),{role:y.callRoleMapping(B),call_id:D,call_type:E,media_type:y.callTypeMapping(M),room_id:ue===1?""+b:O,client_ts:Math.floor(Date.now()/1e3),group_id:k||this._getGroupId(),room_id_type:ue}),body:a(a({},se),{event_type:L})},W=a(a({},R),{data:JSON.stringify(oe)}),[4,(A=this==null?void 0:this._tim)===null||A===void 0?void 0:A.callExperimentalAPI("sendTRTCCustomData",W)];case 1:return S.sent(),[3,3];case 2:return V=S.sent(),[3,3];case 3:return[2]}})})},C.prototype.heartBeatUpload=function(){var _;return l(this,void 0,void 0,function(){var A,L,E,M;return c(this,function(B){switch(B.label){case 0:return B.trys.push([0,2,,3]),this._setSeq(),A=this._callRecordData.head,L={head:a(a({},A),{role:y.callRoleMapping(A.role),clientTs:Date.now(),command:d.NAME.HEART_BEAT}),body:{status:this._bodyStatus}},E=a(a({},R),{data:L}),[4,(_=this==null?void 0:this._tim)===null||_===void 0?void 0:_.callExperimentalAPI("sendTRTCCustomData",E)];case 1:return B.sent(),[3,3];case 2:return M=B.sent(),[3,3];case 3:return[2]}})})},C.prototype.startHeartbeat=function(){this._heartbeat===-1&&(g.default.info("start heart beat..."),this.heartBeatUpload(),this._heartbeat=h.default.run(d.NAME.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))},C.prototype.stopHeartbeat=function(){this._heartbeat!==-1&&(g.default.info("stop heart beat"),h.default.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=d.NAME.WAITING)},C.prototype.doHeartbeat=function(){return l(this,void 0,void 0,function(){var _;return c(this,function(A){return this.heartBeatUpload(),_=Date.now(),this._lastHeartBeatTime>0&&_-this._lastHeartBeatTime>1e4&&g.default.warn("heartbeat took "+(_-this._lastHeartBeatTime)),this._lastHeartBeatTime=_,[2]})})},C}();r.CallRecordReport=I;var T=function(){function C(_,A){this._eventEmitter=_,this._callRecordDataReport=A,this._isCallAccepted=!1,this.registerListener()}return C.prototype.registerListener=function(){this._eventEmitter.on(f.TUICallEvent.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(f.TUICallEvent.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(f.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.on(f.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(f.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(f.TUICallEvent.
6LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(f.TUICallEvent.REJECT,this.onReject.bind(this))},C.prototype.removeLister=function(){this._eventEmitter.off(f.TUICallEvent.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(f.TUICallEvent.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(f.TUICallEvent.CALLING_END,this.onCallEnd),this._eventEmitter.off(f.TUICallEvent.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(f.TUICallEvent.NO_RESP,this.onNoResponse),this._eventEmitter.off(f.TUICallEvent.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(f.TUICallEvent.REJECT,this.onReject)},C.prototype.onCallReceived=function(){this._callRecordDataReport.startHeartbeat()},C.prototype.onCallAccepted=function(){var _=this._callRecordDataReport.getCallRecordData().head;if((_==null?void 0:_.role)===d.NAME.INVITER){if(this._isCallAccepted&&_.call_type===d.NAME.GROUP)return;this._isCallAccepted=!0;var A={eventType:d.NAME.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(A),this._callRecordDataReport.setBodyStatus(u.CALL_STATUS.CONNECTED)}},C.prototype.onCallEnd=function(){var _={eventType:d.NAME.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(_),this._callRecordDataReport.stopHeartbeat()},C.prototype.onCallingCancel=function(_){var A=this._callRecordDataReport.getCallRecordData().head,L=A.role===d.NAME.INVITER?d.NAME.CANCEL_CALL:d.NAME.CALL_CANCELED;this._isCallAccepted=!1;var E=(_||{}).reason;((E===void 0?"":E)===d.NAME.NORMAL||A.role===d.NAME.INVITER&&A.call_type===d.NAME.GROUP)&&this._callRecordDataReport.eventUpload({eventType:L}),this._callRecordDataReport.stopHeartbeat()},C.prototype.onNoResponse=function(){this._uploadInC2C(d.NAME.TIMEOUT)},C.prototype.onLineBusy=function(){this._uploadInC2C(d.NAME.BUSYLINE)},C.prototype.onReject=function(){this._uploadInC2C(d.NAME.REJECT)},C.prototype._uploadInC2C=function(_){var A=this._callRecordDataReport.getCallRecordData().head;if((A==null?void 0:A.call_type)===d.NAME.SINGLE){var L="";switch(_){case d.NAME.TIMEOUT:L=A.role===d.NAME.INVITER?d.NAME.CALL_MISSED:d.NAME.NOT_ANSWER_CALL;break;case d.NAME.REJECT:L=A.role===d.NAME.INVITER&&d.NAME.CALL_REJECTED;break;case d.NAME.BUSYLINE:L=A.role===d.NAME.INVITER?d.NAME.CALL_BUSY:d.NAME.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:L})}},C}();r.TUICallEngineRecordObserver=T},function(s,r,o){var a=this&&this.__assign||function(){return(a=Object.assign||function(d){for(var p,g=1,h=arguments.length;g<h;g++)for(var m in p=arguments[g])Object.prototype.hasOwnProperty.call(p,m)&&(d[m]=p[m]);return d}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0});var l=o(1),c=o(0),u=window==null?void 0:window.cancelAnimationFrame,f=function(){function d(){}return d.generateTaskID=function(){return this.currentTaskID++},d.run=function(p,g,h){p===void 0&&(p=c.NAME.TIMEOUT),h=p===c.NAME.INTERVAL?a({delay:2e3,count:0,backgroundTask:!0},h):p===c.NAME.RAF?a({fps:60,delay:16.6,count:0,backgroundTask:!0},h):a({delay:2e3,count:0,backgroundTask:!0},h),l.isObject(g)&&(h=a(a({},h),g)),l.isFunction(p)&&(g=p,p=c.NAME.TIMEOUT);var m=a({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,taskName:p,callback:g},h);return this.taskMap.set(m.taskID,m),this[p](m),m.taskID},d.interval=function(p){var g=this;return p.intervalID=setInterval(function(){p.callback(),p.loopCount+=1,g.isBreakLoop(p)},p.delay)},d.timeout=function(p){var g=this,h=function(){if(p.callback(),p.loopCount+=1,!g.isBreakLoop(p))return p.timeoutID=setTimeout(h,p.delay)};return p.timeoutID=setTimeout(h,p.delay)},d.raf=function(p){var g=this;p.delay=(1e3/p.fps).toFixed(2);var h,m=l.performanceNow(),y=function(){if(document.hidden&&p.backgroundTask)return h=l.performanceNow()-m,m=l.performanceNow(),p.callback(),p.loopCount+=1,g.isBreakLoop(p)?void 0:p.timeoutID=setTimeout(y,p.delay-Math.floor(h%p.delay));if((h=l.performanceNow()-m)>=p.delay&&(m=l.performanceNow()-Math.floor(h%p.delay),p.callback(),p.loopCount+=1),!g.isBreakLoop(p))return p.rafID=requestAnimationFrame(y)};if(p.rafID=requestAnimationFrame(y),p.backgroundTask){var R=function(){if(document.hidden){var I=l.performanceNow()-m;I>=p.delay?y():p.timeoutID=setTimeout(y,p.delay-I)}};document.addEventListener("visibilitychange",R),p.onVisibilitychange=R,document.hidden&&R()}return p.taskID}
6,d.hasTask=function(p){return this.taskMap.has(p)},d.clearTask=function(p){if(!this.taskMap.has(p))return!0;var g=this.taskMap.get(p),h=g.intervalID,m=g.timeoutID,y=g.rafID,R=g.onVisibilitychange;return h&&clearInterval(h),m&&clearTimeout(m),y&&u(y),R&&document.removeEventListener("visibilitychange",R),this.taskMap.delete(p),!0},d.isBreakLoop=function(p){return!this.taskMap.has(p.taskID)||p.count!==0&&p.loopCount>=p.count&&(this.clearTask(p.taskID),!0)},d.taskMap=new Map,d.currentTaskID=1,d}();r.default=f},function(s,r,o){Object.defineProperty(r,"__esModule",{value:!0}),r.ES_TABLE=r.ES_URL=r.CLS_TOPIC_ID=r.CLS_ENDPOINT=void 0,r.CLS_ENDPOINT="https://ap-nanjing.cls.tencentcs.com",r.CLS_TOPIC_ID="a1310e66-a3f5-4572-a1c3-7a327a27496d",r.ES_URL="https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report",r.ES_TABLE="timweb-trtccalling"}]).default})})(Zu);var Pe=Zu.exports;function op(i){return ye(this,null,function*(){if(!i)return!1;try{const e=yield new Promise((t,n)=>{const s=new XMLHttpRequest;s.open("HEAD",i,!0),s.onload=()=>t(s),s.onerror=()=>n(s),s.send()});return e.status===200&&e.getResponseHeader("Content-Type")==="audio/mpeg"}catch(e){return!1}})}function Kr(i){if(typeof i!="object"||i===null)return i;let e=Array.isArray(i)?[]:{};for(let t in i)i.hasOwnProperty(t)&&(e[t]=Kr(i[t]));return e}const ap={hangup:"Hang up",reject:"Decline",accept:"Accept",camera:"Camera",microphone:"Microphone",speaker:"speaker","open camera":"Open Camera","close camera":"Close Camera","open microphone":"Open Microphone","close microphone":"Close Microphone","video-to-audio":"Switch to audio","virtual-background":"Blur Background","other side reject call":"other side reject call","reject call":"Reject Call",cancel:"Cancel Call","other side line busy":"other side line busy","in busy":"in busy","call timeout":"call timeout","no response from the other side":"no response from the other side","end call":"end call","caller calling message":"Awaiting response","callee calling video message":"invites you to a video call","callee calling audio message":"invites you to a voice call","no microphone access":"no microphone access","no camera access":"no camera access","invite member":"Invite Member","Invited group call":"invites you to a group call",waiting:"Calling...",me:"(me)","browser-authorization":"Browser authorization","mac-privacy":"System Preferences -> Security and Privacy -> Privacy","win-privacy":"Setting -> Privacy and Security -> App permissions","mac-preferences":"Open System Preferences","win-preferences":"Open Setting","Please enter userID":"Please enter userID","View more":"View more","people selected":"people selected","Select all":"Select all",Cancel:"Cancel",Done:"Done","exist group call":"A group call already exists in the current group","camera enabled":"Camera On","camera disabled":"Camera Off","microphone enabled":"Unmuted","microphone disabled":"Muted","speaker enabled":"Speaker On","speaker disabled":"Speaker Off","open speaker":"Turn on speaker","close speaker":"Turn off speaker","wait to be called":"Waiting",answered:"Connected","people in the call":" other(s) in the call","failed to obtain speakers":"failed to obtain speakers","you have a new call":"You have a new call","switch camera":"Switch",join:"Join","people on the call":"people on the call","Supports a maximum of 9 people for simultaneous calls":"Supports a maximum of 9 people for simultaneous calls",you:"(you)","The network is poor during your current call":"The network is poor during your current call","The other user network is poor during the current call":"The other party's network is poor during the current call","TUICallKit init is not complete":"TUICallKit init is not complete. You need to use this API after the init API is finished.","Video call":"Video call","Voice call":"Voice call","Call End":"Call End","Switch voice call":"Switch voice call","Switch video call":"Switch video call","Call duration":"Duration","Call Cancel":"Canceled","Other Side Cancel":"Call canceled by caller",Decline:"Declined","Other Side Decline":"Call declined by user","No answer":"Call not answered","Other Side No Answer":"Call wasn't answered",Answered:"Answered","Other Side Line Busy":"Line busy","Line Busy":"Line busy. Call not received.","Those involved":"Those involved in the call are",call:"call","video-call":"video call","audio-call":"audio call",search:"search","search-result":"search result","no-user":"user not found","member-not-added":"member not added","input-phone-userID":"phone number or userID","not-login":"not logged in","login-status-expire":"login status is invali
6d, please refresh the page and try again","experience-multi-call":"experience multi-person calls, please download the full-featured demo: ","not-support-multi-call":"multi-person call interface is not open",userID:"userID","already-enter":"entered the call","camera-opened":"Camera on","camera-closed":"Camera off","microphone-opened":"Mic on","microphone-closed":"Mic off",timeout:"timeout","kick out":"kick out","image-resolution":"Resolution","default-image-resolution":"Default","invited-person":"Invite","be-rejected":"Call declined, ","be-no-response":"No response, ","be-line-busy":"Line busy, ","be-canceled":"The call is canceled, ","voice-call-end":"Voice call ended","video-call-end":"Video call ended","method-call-failed":"Failed to sync the operation","failed-to-obtain-permission":"Failed to obtain permissions","environment-detection-failed":"Failed to check the environment","switchToAudioCall-call-failed":"switch to audio call method failed","switchToVideoCall-call-failed":"switch to video call method failed","microphone-unavailable":"No mic foun
6d","camera-unavailable":"No camera found","ban-device":"Device access denied","not-supported-webrtc":"Your current environment does not support WebRTC","blacklist-user-tips":"The identifier is in blacklist. Failed to send this message!","is-already-calling":"TUICallKit is already on a call","need-init":"Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ","can't call yourself":"Can't call yourself","Use-phone-and-computer":"Use your mobile phone and computer to experience video calls","Wechat scan right QR code":"Wechat scan right QR code","Scan the QR code above":"Scan the QR code above","accept-error":"Accept failed","accept-device-error":"Accept failed, unable to auth calling device","call-error":"Start call failed"},lp={hangup:"挂断",reject:"拒绝",accept:"接受",camera:"摄像头",microphone:"麦克风",speaker:"扬声器","open camera":"打开摄像头","close camera":"关闭摄像头","open microphone":"打开麦克风","close microphone":"关闭麦克风","video-to-audio":"转语音通话","virtual-background":"模糊背景","other side reject call":"对方已拒绝","reject call":"拒绝通话",cancel:"取消通话","other side line busy":"对方忙线","in busy":"正在忙","call timeout":"呼叫超时","end call":"结束通话","caller calling message":"等待对方接受邀请","callee calling video message":"邀请你视频通话","callee calling audio message":"邀请你语音通话","no microphone access":"没有麦克风权限","no camera access":"没有摄像头权限","invite member":"邀请成员","Invited group call":"邀请你加入多人通话","Those involved":"参与通话的有:",waiting:"等待接听...",me:"(我)","browser-authorization":"浏览器授权","mac-privacy":"系统偏好设置 -> 安全与隐私 -> 隐私","win-privacy":"设置 -> 隐私和安全性 -> 应用权限","mac-preferences":"打开系统偏好设置","win-preferences":"打开系统设置","Please enter userID":"请输入 userID","View more":"查看更多","people selected":"人已选中","Select all":"全选",Cancel:"取消",Done:"完成","exist group call":"当前群组中已经存在群组通话","camera enabled":"摄像头已开","camera disabled":"摄像头已关","microphone enabled":"麦克风已开","microphone disabled":"麦克风已关","speaker enabled":"扬声器已开","speaker disabled":"扬声器已关","open speaker":"开启扬声器","close speaker":"关闭扬声器","wait to be called":"等待接听",answered:"已接通","people in the call":"人参与通话","failed to obtain speakers":"无法获取扬声器","you have a new call":"您有一个新的通话","switch camera":"翻转",join:"加入","people on the call":"人正在通话","Supports a maximum of 9 people for simultaneous calls":"最多支持9人同时通话",you:"(ä½ )","The network is poor during your current call":"当前通话你的网络不佳","The other user network is poor during the current call":"当前通话对方网络不佳","TUICallKit init is not complete":"TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API","Video call":"发起视频通话","Voice call":"发起语音通话","Call End":"通话结束","Switch voice call":"切换语音通话","Switch video call":"切换视频通话","Call duration":"通话时长","Call Cancel":"已取消","Other Side Cancel":"对方已取消",Decline:"已拒绝","Other Side Decline":"对方已拒绝","No answer":"超时无应答","Other Side No Answer":"对方无应答",Answered:"已接听","Other Side Line Busy":"对方忙线中","Line Busy":"忙线无应答",timeout:"超时","kick out":"被踢",call:"通话","video-call":"视频通话","audio-call":"音频通话",search:"搜索","search-result":"搜索结果","Wechat scan right QR code":"微信扫右二维码","Use-phone-and-computer":"用手机与电脑互打体验视频通话","Scan the QR code above":"扫描上方二维码","no-user":"未搜索到用户","member-not-added":"未添加成员","not-login":"未登录","login-status-expire":"登录状态已失效,请刷新网页重试","experience-multi-call":"体验多人通话请下载全功能demo:","not-support-multi-call":"多人通话接口未开放","input-phone-userID":"请输入手机号/用户ID",userID:"用户ID","already-enter":"已经进入当前通话","image-resolution":"分辨率","default-image-resolution":"默认分辨率","invited-person":"添加成员","be-rejected":"对方已拒绝,","be-no-response":"对方无应答,","be-line-busy":"对方忙线中,","be-canceled":"对方已取消","voice-call-end":"语音通话结束","video-call-end":"视频通话结束","method-call-failed":"同步操作失败","failed-to-obtain-permission":"权限获取失败","environment-detection-failed":"环境检测失败","switchToAudioCall-call-failed":"切语音调用失败","switchToVideoCall-call-failed":"切视频调用失败","microphone-unavailable":"没有可用的麦克风设备","camera-unavailable":"没有可用的摄像头设备","ban-device":"用户禁止使用设备","not-supported-webrtc":"当前环境不支持 WebRTC","blacklist-user-tips":"发起通话失败,被对方拉入黑名单ï¼
6Œç¦æ­¢å‘起!","is-already-calling":"TUICallKit 已在通话状态","need-init":"TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功","can't call yourself":"不能呼叫自己","accept-error":"接通失败","accept-device-error":"接通失败,通话设备获取失败","call-error":"发起通话失败"},cp={hangup:"通話終了",reject:"拒否",accept:"応答",camera:"カメラ",microphone:"マイク",speaker:"スピーカー","virtual-background":"ボケ背景","other side reject call":"通話が拒否されました","reject call":"通話拒否",cancel:"通話をキャンセル","other side line busy":"相手が通話中です","in busy":"通話中","call timeout":"呼び出しタイムアウト","end call":"通話終了","caller calling message":"応答を待っています","callee calling video message":"ビデオ通話に招待されました","callee calling audio message":"音声通話に招待されました","no microphone access":"マイクにアクセスできません","no camera access":"カメラにアクセスできません","invite member":"メンバーを招待する","browser-authorization":"ブラウザ認証","mac-privacy":"システム環境設定 -> セキュリティとプライバシー ->プライバシー","win-privacy":"設定 -> セキュリティとプライバシー ->アプリのアクセス許可","mac-preferences":"システム環境設定を開く","win-preferences":"システム設定を開く","Please enter userID":"ユーザーIDを入力してください","View more":"もっと見る","people selected":"人が選択されました","Select all":"すべて選択",Cancel:"キャンセル",Done:"完了","exist group call":"現在のグループには既にグループ通話が存在しています","Video call":"ビデオ通話を開始","Voice call":"音声通話を開始","Call End":"通話終了","Switch audio call":"音声通話に切り替える","Switch video call":"ビデオ通話に切り替える","Call duration":"通話時間","Call Cancel":"通話をキャンセルする","Other Side Cancel":"相手がキャンセルしました",Decline:"通話を拒否する","Other Side Decline":"相手が拒否しました","No answer":"無応答","Other Side No Answer":"相手からの返答はありません",Answered:"応答しました","Other Side Line Busy":"相手は現在忙しくて対応できません","Line Busy":"忙しいので応答できません","open camera":"オープンカメラ","close camera":"カメラを閉じる","open microphone":"オープンマイク","close microphone":"マイクを閉じる","camera enabled":"カメラオン","camera disabled":"カメラオフ","microphone enabled":"マイクオン","microphone disabled":"マイクオフ","speaker enabled":"スピーカーオン","speaker disabled":"スピーカーオフ","open speaker":"スピーカーをオンにする","close speaker":"スピーカーの電源を切ります","wait to be called":"待機中",answered:"接続済み","people in the call":"通話に参加している人たち","failed to obtain speakers":"スピーカーが見つかりません","you have a new call":"新しい通話があります","switch camera":"切り替え",
6join:"参加する","people on the call":"人が通話中です","Supports a maximum of 9 people for simultaneous calls":"最大で9人まで同時通話が可能です",you:"(あなた)","The network is poor during your current call":"現在の通話で、あなたのネットワークは不良です","The other user network is poor during the current call":"現在の通話で、相手側のネットワークが不良です","TUICallKit init is not complete":"TUICallKitの初期化ログインが完了していません。init が完了した後にこのAPIを使用する必要があります。",timeout:"タイムアウト","kick out":"キックアウトされました","Invited group call":"グループ通話に招待されました。","Those involved":"参加者:",call:"通話","video-call":"ビデオ通話","audio-call":"音声通話",search:"検索","search-result":"検索結果","Wechat scan right QR code":"WeChatで右側にあるQRコードを読み取ります。","Use-phone-and-computer":"携帯電話とコンピュータを使用してビデオ通話を体験してください","Scan the QR code above":"上のQRコードを読み取ります。","no-user":"ユーザーが見つかりませんでした","member-not-added":"メンバーが追加されていません","not-login":"ログインしていません","login-status-expire":"ログインの有効期限が過ぎています。ページを更新してもう一度お試しください","experience-multi-call":"複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください","not-support-multi-call":"グループ通話インターフェイスが開いていません","input-phone-userID":"携帯電話番号/ユーザーIDを入力してください",userID:"ユーザーID","already-enter":"すでに通話に参加しています",waiting:"応答を待っています...","camera-opened":"カメラがオンになっています","camera-closed":"カメラがオフになっています","microphone-opened":"マイクがオンになっています","microphone-closed":"マイクがオフになっています","image-resolution":"解像度","default-image-resolution":"デフォルト解像度","invited-person":"メンバーを招待","video-to-audio":"音声通話に切り替えます",me:"(自分)","be-rejected":"通話が拒否されました, ","be-no-response":"応答なし, ","be-line-busy":"相手が通話中です, ","be-canceled":"相手が通話をキャンセルしました","voice-call-end":"音声通話が終了しました","video-call-end":"ビデオ通話が終了しました","method-call-failed":"操作の同期に失敗しました","failed-to-obtain-permission":"権限の取得に失敗しました","environment-detection-failed":"環境の検出に失敗しました","switchToAudioCall-call-failed":"音声通話に切り替えることはできません","switchToVideoCall-call-failed":"ビデオ通話に切り替えることはできません","microphone-unavailable":"使用できるマイクがありません","camera-unavailable":"使用できるカメラがありません","ban-device":"デバイスへのアクセスが拒否されました","not-supported-webrtc":"現在の環境はWebRTCをサポートしていません","blacklist-user-tips":"ユーザーはブラックリストに登録され、通話が開始できませんでした","is-already-calling":"TUICallKit はすでに通話中です","need-init":"TUICallKitで通話を開始する前に、TUICallKitServer.init() メソッドが正常に実行されたことを確認してください。","can't call yourself":"自分に電話をかけることができません","accept-error":"接続できませんでした","accept-device-error":"接続できませんでした。発信側デバイスを認証できません","call-error":"通話が開始できませんでした"},hn={OTHER_SIDE_REJECT_CALL:"other side reject call",REJECT_CALL:"reject call",OTHER_SIDE_LINE_BUSY:"other side line busy",IN_BUSY:"in busy",END_CALL:"end call",KICK_OUT:"kick out",CALLER_CALLING_MSG:"caller calling message",CALLER_GROUP_CALLING_MSG:"wait to be called",CALLEE_CALLING_VIDEO_MSG:"callee calling video message",CALLEE_CALLING_AUDIO_MSG:"callee calling audio message",NO_MICROPHONE_DEVICE_PERMISSION:"no microphone access",NO_CAMERA_DEVICE_PERMISSION:"no camera access",LOCAL_NETWORK_IS_POOR:"The network is poor during your current call"},Ql={en:ap,"zh-cn":lp,ja_JP:cp};function Ge(i){var n;const e=le.getData(j.CALL,N.LANGUAGE);for(const s in Ql)if(s===e){const r=Ql[s];
6for(const o in r)if(o===i)return r[o]}return(n=i.en)==null?void 0:n.key}const Yr=typeof wx!="undefined"&&typeof wx.getSystemInfoSync=="function"&&!!wx.getSystemInfoSync().fontSizeSetting,Xu=typeof uni!="undefined"&&typeof uni=="undefined",Zl=Yr||Xu,ed=typeof uni!="undefined",ul=function(){return(typeof uni!="undefined"||typeof window!="undefined")&&!Zl}(),up=function(){return Yr?wx:ed?uni:window}(),Ri=ul&&window&&window.navigator&&window.navigator.userAgent||"",dp=/Android/i.test(Ri),fp=/(?:Windows Phone)/.test(Ri),hp=/(?:SymbianOS)/.test(Ri),pp=/iPad/i.test(Ri)||/iPhone/i.test(Ri)||/iPod/i.test(Ri),td=dp||fp||hp||pp||ul,dl=ul&&!td,gp=dl&&Ri.includes("Windows NT"),mp=dl&&Ri.includes("Mac");var ni;let nd=(ni=class{constructor(){xe(this,"global",up);xe(this,"isPC",!1);xe(this,"isH5",!1);xe(this,"isWeChat",!1);xe(this,"isApp",!1);xe(this,"isUniPlatform",!1);xe(this,"isOfficial",!1);xe(this,"isWIN",!1);xe(this,"isMAC",!1);this.initEnv()}static getInstance(){return ni.instance||(ni.instance=new ni),ni.instance}initEnv(){this.isPC=dl,this.isH5=td,this.isWeChat=Yr,this.isApp=Xu&&!Yr,this.isUniPlatform=ed,this.isWIN=gp,this.isMAC=mp}initOfficial(e){this.isOfficial=e===1400187352||e===1400188366}},xe(ni,"instance"),ni);const _o=function(i){return typeof i===N.UNDEFINED},id=function(i){if(typeof i!==N.OBJECT||i===null)return!1;const e=Object.getPrototypeOf(i);if(e===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t},sd=function(i){return typeof Array.isArray===N.FUNCTION?Array.isArray(i):Object.prototype.toString.call(i).match(/^\[object (.*)\]$/)[1].toLowerCase()===N.ARRAY},Sa=function(i){return typeof i===N.STRING},vp=function(i){return typeof i===N.BOOLEAN},rd=function(i){return i!==null&&(typeof i===N.NUMBER&&!isNaN(i-0)||typeof i===N.OBJECT&&i.constructor===Number)};function od(i){const e=Math.floor(i/3600),t=Math.floor(i%3600/60),n=Math.floor(i%60);let s=e>9?`${e}`:`0${e}`;return s+=t>9?`:${t}`:`:0${t}`,s+=n>9?`:${n}`:`:0${n}`,s}function Cp(i){if(typeof i===N.STRING)try{return!!JSON.parse(i)}catch(e){return!1}return!1}const Ar=function(i){return!i||!Cp(i)?i:JSON.parse(i)};function Xl(i){return(i==null?void 0:i.message.indexOf("is ongoing, please avoid repeated calls"))!==-1}function _p(i){const{message:e}=i;return e.indexOf("NotAllowedError: Permission denied")!==-1}function Fo(){return Date.now()}const Fr=function(i){return typeof i===N.FUNCTION},yp=()=>{if(nd.getInstance().isWeChat)return"zh-cn";const i=((navigator==null?void 0:navigator.language)||(navigator==null?void 0:navigator.userLanguage)||"").substr(0,2);let e="en";switch(i){case"zh":e="zh-cn";break;case"ja":e="ja_JP";break;default:e="en"}return e},Ip=function(i){return Object.prototype.toString.call(i).match(/^\[object (.*)\]$/)[1].toLowerCase()};function Ep(i,e,t){if(!i.hasOwnProperty(e))return i;const n={};
6return Object.keys(i).forEach(s=>{s===e?n[t]=i[s]:n[s]=i[s]}),n}const Sp="/assets/phone_dialing-DXAN2A8Z.mp3",ec="/assets/phone_ringing-BGAsybda.mp3";class Tp{constructor(){xe(this,"_bellContext",null);xe(this,"_isMuteBell",!1);xe(this,"_calleeBellFilePath",ec);xe(this,"_callRole",Dt.UNKNOWN);xe(this,"_callStatus",Be.IDLE);this._bellContext=new Audio,this._bellContext.loop=!0}setBellSrc(){try{let e=Sp;this._callRole===Dt.CALLEE&&(e=this._calleeBellFilePath||ec),this._bellContext.src=e}catch(e){}}setBellProperties(e){this._callRole=e.callRole||this._callRole,this._callStatus=e.callStatus||this._callStatus,this._calleeBellFilePath=e.calleeBellFilePath||this._calleeBellFilePath,this._isMuteBell=_o(e.isMuteBell)?this._isMuteBell:e.isMuteBell}play(){return ye(this,null,function*(){try{if(this._callStatus!==Be.CALLING)return;this.setBellSrc(),this._callRole===Dt.CALLEE&&!this._isMuteBell&&(yield this._bellContext.play()),this._callRole===Dt.CALLER&&(yield this._bellContext.play())}catch(e){}})}stop(){return ye(this,null,function*(){try{yield this._bellContext.pause()}catch(e){}})}setBellMute(e){return ye(this,null,function*(){this._callStatus!==Be.CALLING&&this._callRole!==Dt.CALLEE||(e?yield this.stop():yield this.play())})}destroy(){try{this._isMuteBell=!1,this._calleeBellFilePath="",this._callRole=Dt.UNKNOWN,this._callStatus=Be.IDLE,this._bellContext.pause(),this._bellContext=null}catch(e){}}}function kt(){return function(i,e,t){const n=t.value,s=new Set;return t.value=function(...r){return ye(this,null,function*(){var o,a;if(s.has(this)){(a=(o=this==null?void 0:this.getTUICallEngineInstance())==null?void 0:o.reportLog)==null||a.call(o,{name:"TUICallKit.avoidRepeatedCall.fail",data:{name:e},error:`previous ${e}() is ongoing`});return}try{s.add(this);const l=yield n.apply(this,r);return s.delete(this),l}catch(l){throw s.delete(this),l}})},t}}const Bs=N.PREFIX+"API";function In(i){return function(e,t,n){let s=n.value;return n.value=function(...r){return Lp.call(this,i,r,t),s.apply(this,r)},n}}function Lp(i,e,t){try{if(e[0].SDKAppID||(i=Ep(i,"SDKAppID","sdkAppID")),sd(i))for(let n=0;n<i.length;n++)tc.call(this,Z(F({},i[n]),{value:e[n],name:t}));else for(const n in i)i.hasOwnProperty(n)&&tc.call(this,Z(F({},i[n]),{value:e[0][n],name:t,key:n}))}catch(n){throw n}}function tc({required:i,rules:e,range:t,value:n,allowEmpty:s,name:r,key:o}){if(_o(n)){if(i)throw new Error(`${Bs}<${r}>: ${o} is required.`);return}const a=e.some(c=>c===Ip(n));let l="";if(!a){for(let c=0;c<e.length;c++){let u=e[c];u=u.replace(u[0],u[0].toUpperCase()),l+=`${u}/`}throw l=l.substring(0,l.length-1),new Error(`${Bs}<${r}>: ${o} must be ${l}, current ${o} is ${typeof n}.`)}if(s===!1&&Sa(n)&&n.trim()==="")throw new Error(`${Bs}<${r}>: ${o} is blank.`);if(sd(t)&&t&&t.indexOf(n)===-1)throw new Error(`${Bs}<${r}>: ${o} error, only be ${t}, current ${o} is ${n}.`);if(Sa(t)&&t.indexOf("~")!==-1){const c=t.split("~");if(n<+c[0]||n>+c[1]||rd(n)&&Number.isNaN(n))throw new Error(`${Bs}<${r}>: ${o} error, only be ${t}, current ${o} is ${n}.`)}}const En={init:{SDKAppID:{required:!0,rules:[N.NUMBER],allowEmpty:!1},userID:{required:!0,rules:[N.STRING],allowEmpty:!1},userSig:{required:!0,rules:[N.STRING],allowEmpty:!1},tim:{required:!1,rules:[N.OBJECT]}},call:{userID:{required:!0,rules:[N.STRING],allowEmpty:!1},type:{required:!0,rules:[N.NUMBER],range:[1,2],allowEmpty:!1},roomID:{required:!1,rules:[N.NUMBER],range:`0~${Jl}`,allowEmpty:!1},strRoomID:{required:!1,rules:[N.STRING],allowEmpty:!0},userData:{required:!1,rules:[N.STRING],allowEmpty:!1},timeout:{required:!1,rules:[N.NUMBER],allowEmpty:!1}},groupCall:{userIDList:{required:!0,rules:[N.ARRAY],allowEmpty:!1},type:{required:!0,rules:[N.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[N.STRING],allowEmpty:!1},roomID:{required:!1,rules:[N.NUMBER],range:`0~${Jl}`,allowEmpty:!1},strRoomID:{required:!1,rules:[N.STRING],allowEmpty:!0},timeout:{required:!1,rules:[N.NUMBER],allowEmpty:!1},userData:{required:!1,rules:[N.STRING],allowEmpty:!1},offlinePushInfo:{required:!1,rules:[N.OBJECT],allowEmpty:!1}},joinInGroupCall:{type:{required:!0,rules:[N.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[N.STRING],allowEmpty:!1},roomID:{required:!0,rules:[N.NUMBER],allowEmpty:!1},strRoomID:{required:!1,rules:[N.STRING],allowEmpty:!0}},inviteUser:{userIDList:{required:!0,rules:[N.ARRAY],allowEmpty:!1}},setSelfInfo:{nickName:{required:!1,rules:[N.STRING],allowEmpty:!1},avatar:{required:!1,rules:[N.STRING],allowEmpty:!1}},enableFloatWindow:[{key:"enable",required:!1,rules:[N.BOOLEAN],allowEmpty:!1}],enableAIVoice:[{key:"enable",required:!0,rules:[N.BOOLEAN],allowEmpty:!1}],enableMuteMode:[{key:"enable",required:!0,rules:[N.BOOLEAN],allowEmpty:!1}],setCallingBell:[{key:"filePath",required:!1,rules:[N.STRING],allowEmpty:!0}],setLanguage:[{key:"language",required:!0,rules:[N.STRING],allowEmpty:!1}],setVideoDisplayMode:[{key:"displayMode",required:!0,rules:[N.STRING],range:[Qs.CONTAIN,Qs.COVER,Qs.FILL],allowEmpty:!1}],setVideoResolution:[{key:"resolution",required:!0,rules:[N.STRING],range:[Zs.RESOLUTION_1080P,Zs.RESOLUTION_480P,Zs.RESOLUTION_720P],allowEmpty:!1}]};function yo(i){return function(e,t,n){let s=n.value;return n.value=function(...r){return wp.call(this,i,r,t),s.apply(this,r)},n}}function wp(i){if(i!=null&&i.engineInstance&&!this._tuiCallEngine)throw`${N.PREFIX} ${Ge("TUICallKit init is not complete")}`}class Ap{constructor(){xe(this,"defaultStore",{callStatus:Be.IDLE,callRole:Dt.UNKNOWN,callMediaType:rt.UNKNOWN,localUserInfo:{userId:""},localUserInfoExcludeVolume:{userId:""},remoteUserInfoList:[],remoteUserInfoExcludeVolumeList:[],callerUserInfo:{userId:""},isGroup:!1,callDuration:"00:00:00",callTips:"",toastInfo:{text:""},isMinimized:!1,enableFloatWindow:!1,bigScreenUserId:"",language:yp(),isClickable:!1,deviceList:{cameraList:[],microphoneList:[],currentCamera:{},currentMicrophone:{}},showPermissionTip:!1,netWorkQualityList:[],isMuteSpeaker:!1,groupID:"",roomID:0,roomIdType:0,cameraPosition:Xs.FRONT,groupCallMembers:[],displayMode:Qs.COVER,videoRes
6olution:Zs.RESOLUTION_480P,showSelectUser:!1,pusher:{},player:[],isEarPhone:!1,pusherId:N.INITIAL_PUSHER,isShowEnableVirtualBackground:!1,enableVirtualBackground:!1,customUIConfig:{button:{},viewBackground:{},layoutMode:zr.RemoteInLargeView}});xe(this,"store",Kr(this.defaultStore));xe(this,"prevStore",Kr(this.defaultStore))}update(e,t){switch(e){case N.CALL_TIPS:const n=this.getData(e);this.prevStore[e]=n;default:this.store[e]=t}}getPrevData(e){return e?this.prevStore[e]:this.prevStore}getData(e){return e?this.store[e]:this.store}reset(e=[]){e.length===0&&(e=Object.keys(this.store));const t=e.reduce((n,s)=>Z(F({},n),{[s]:this.defaultStore[s]}),{});this.store=F(F(F({},this.defaultStore),this.store),t)}}var ii;let Io=(ii=class{constructor(){xe(this,"task");xe(this,"storeMap");xe(this,"timerId",-1);this.storeMap={[j.CALL]:new Ap},this.task={}}static getInstance(){return ii.instance||(ii.instance=new ii),ii.instance}watch(e,t,n){this.task[e]||(this.task[e]={});const s=this.task[e];Object.keys(t).forEach(r=>{const o=t[r];s[r]||(s[r]=new Map),s[r].set(o,1);const{notifyRangeWhenWatch:a}=n||{};if(a===N.ALL&&this.notify(e,r),a===N.MYSELF){const l=this.getData(e,r);o.call(this,l)}})}unwatch(e,t){if(!this.task[e])return;const n=this.task[e];Object.keys(t).forEach(s=>{n[s].delete(t[s])})}update(e,t,n){var s;(Sa(n)||rd(n)||vp(n))&&this.storeMap[e].store[t]===n||((s=this.storeMap[e])==null||s.update(t,n),this.notify(e,t))}getPrevData(e,t){var n;return(n=this.storeMap[e])==null?void 0:n.getPrevData(t)}getData(e,t){var n;return(n=this.storeMap[e])==null?void 0:n.getData(t)}notify(e,t){if(!this.task[e])return;const n=this.task[e];if(n[t]){const s=n[t],r=this.getData(e,t);for(const[o]of s.entries())o.call(this,r)}}reset(e,t=[],n=!1){if(e in this.storeMap){const s=this.storeMap[e];t.length===0&&(t=Object.keys(s==null?void 0:s.store)),s.reset(t),n&&t.forEach(r=>{this.notify(e,r)})}}updateStore(e,t){const n=t||j.CALL;Object.keys(e).forEach(s=>{this.update(n,s,e[s])})}},xe(ii,"instance"),ii);const gt=Io.getInstance();function Ta(i,e){const t={userId:i,nick:"",avatar:"",remark:"",displayUserInfo:"",isAudioAvailable:!1,isVideoAvailable:!1,isEnter:!1,domId:e||i};return e?t:Z(F({},t),{isEnter:!1})}function bp(i,e){return ye(this,null,function*(){var n,s,r,o,a;let t=Ta(i,N.LOCAL_VIDEO);try{if(!e)return t;const l=yield e.getMyProfile(),c=gt==null?void 0:gt.getData(j.CALL,N.LOCAL_USER_INFO);return(l==null?void 0:l.code)===0&&(t=Z(F(F({},t),c),{userId:(n=l==null?void 0:l.data)==null?void 0:n.userID,nick:(s=l==null?void 0:l.data)==null?void 0:s.nick,avatar:(r=l==null?void 0:l.data)==null?void 0:r.avatar,displayUserInfo:((o=l==null?void 0:l.data)==null?void 0:o.nick)||((a=l==null?void 0:l.data)==null?void 0:a.userID)})),t}catch(l){return t}})}function lr(i,e){return ye(this,null,function*(){let t=i.map(n=>Ta(n));try{if(!e)return t;const n=yield e.getFriendProfile({userIDList:i});if(n.code===0){const{friendList:s=[],failureUserIDList:r=[]}=n.data;let o=r.map(u=>u.userID);if(r.length>0){const u=yield e.getUserProfile({userIDList:r.map(f=>f.userID)});(u==null?void 0:u.code)===0&&(o=(u==null?void 0:u.data)||[])}const a=gt==null?void 0:gt.getData(j.CALL,N.REMOTE_USER_INFO_LIST),l=s.map(u=>u.userID),c=o.map(u=>u.userID);t=i.map(u=>{var I,T,C,_,A,L,E;const f=Ta(u),d=l.indexOf(u),p=c.indexOf(u);let g="",h="",m="",y="";d!==-1&&(g=((I=s[d])==null?void 0:I.remark)||"",h=((C=(T=s[d])==null?void 0:T.profile)==null?void 0:C.nick)||"",m=g||h||f.userId||"",y=((A=(_=s[d])==null?void 0:_.profile)==null?void 0:A.avatar)||""),p!==-1&&(h=((L=o[p])==null?void 0:L.nick)||"",m=h||f.userId||"",y=((E=o[p])==null?void 0:E.avatar)||"");const R=a.find(M=>M.userId===u)||{};return Z(F(F({},f),R),{remark:g,nick:h,displayUserInfo:m,avatar:y})})}return t}catch(n){return t}})}function Ts(i,e,t){const n=gt.getData(j.CALL,N.IS_GROUP);let s=`${Ge(i)}`;return n&&(s=e?`${e} ${s}`:s,s=s),s}function br(){const i=gt.getData(j.CALL,N.CALL_STATUS);if(i===Be.IDLE)return Yt.IDLE;const e=gt.getData(j.CALL,N.IS_GROUP);if(i===Be.CALLING)return e?Yt.DIALING_GROUP:Yt.DIALING_C2C;
6const t=gt.getData(j.CALL,N.CALL_MEDIA_TYPE);return e?t===rt.AUDIO?Yt.CALLING_GROUP_AUDIO:Yt.CALLING_GROUP_VIDEO:t===rt.AUDIO?Yt.CALLING_C2C_AUDIO:Yt.CALLING_C2C_VIDEO}function Rp(i,e,t,n){return ye(this,null,function*(){let s=[];try{const r=yield e.getGroupMemberList({groupID:i,count:t,offset:n});if(r.code===0)return r.data.memberList||s}catch(r){return s}})}function Op(i,e){return ye(this,null,function*(){let t={};try{return(yield e.getGroupProfile({groupID:i})).data.group||t}catch(n){return t}})}function ad(i,e){i===0&&e?(gt.update(j.CALL,N.ROOM_ID,e),gt.update(j.CALL,N.ROOM_ID_TYPE,Ea.STRING_ROOM_ID)):(gt.update(j.CALL,N.ROOM_ID,i),gt.update(j.CALL,N.ROOM_ID_TYPE,Ea.NUMBER_ROOM_ID))}function Un(i){return i||{}}function Go(i){if(i.length===0)return;let e=gt.getData(j.CALL,N.REMOTE_USER_INFO_LIST);i.forEach(t=>{e=e.filter(n=>n.userId!==t)}),gt.update(j.CALL,N.REMOTE_USER_INFO_LIST,e),gt.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,e)}function Ho(i){i==null||i.getDeviceList("speaker").then(t=>{const n=gt.getData(j.CALL,N.DEVICE_LIST),s=(t==null?void 0:t[0])||{};gt.update(j.CALL,N.DEVICE_LIST,Z(F({},n),{speakerList:t,currentSpeaker:s}))}).catch(t=>{}),gt.getData(j.CALL,N.CALL_MEDIA_TYPE)===rt.VIDEO&&(i==null||i.getDeviceList("camera").then(t=>{const n=gt.getData(j.CALL,N.DEVICE_LIST),s=(t==null?void 0:t[0])||{};gt.update(j.CALL,N.DEVICE_LIST,Z(F({},n),{cameraList:t,currentCamera:s}))}).catch(t=>{})),i==null||i.getDeviceList("microphones").then(t=>{const n=gt.getData(j.CALL,N.DEVICE_LIST),s=(t==null?void 0:t[0])||{};gt.update(j.CALL,N.DEVICE_LIST,Z(F({},n),{microphoneList:t,currentMicrophone:s}))}).catch(t=>{})}function $o(i,e,t){if(_p(i)){let n="";e===rt.AUDIO&&(n=Ts(hn.NO_MICROPHONE_DEVICE_PERMISSION)),e===rt.VIDEO&&(n=Ts(hn.NO_CAMERA_DEVICE_PERMISSION));const s=t==null?void 0:t.getDevicePermission();s!=null&&s.audio||gt.update(j.CALL,N.SHOW_PERMISSION_TIP,!0),n&&gt.update(j.CALL,N.TOAST_INFO,{text:n,type:N.ERROR})}}function Fi(i,e){let t=gt.getData(j.CALL,N.LOCAL_USER_INFO);e===N.AUDIO&&(t=Z(F({},t),{isAudioAvailable:i})),e===N.VIDEO&&(t=Z(F({},t),{isVideoAvailable:i})),gt.update(j.CALL,N.LOCAL_USER_INFO,t),gt.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,t)}class qr{static generateTaskID(){return this.currentTaskID++}static run(e=N.TIMEOUT,t,n){e===N.INTERVAL?n=F({delay:2e3,count:0,backgroundTask:!0},n):n=F({delay:2e3,count:0,backgroundTask:!0},n),id(t)&&(n=F(F({},n),t)),Fr(e)&&(t=e,e=N.TIMEOUT);const s=F({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,taskName:e,callback:t},n);return this.taskMap.set(s.taskID,s),e===N.INTERNAL?this.interval(s):this.timeout(s),s.taskID}static interval(e){const t=()=>{e.callback(),e.loopCount+=1,this.isBreakLoop(e)};return e.intervalID=setInterval(t,e.delay)}static timeout(e){const t=()=>{if(e.callback(),e.loopCount+=1,!this.isBreakLoop(e))return e.timeoutID=setTimeout(t,e.delay)};return e.timeoutID=setTimeout(t,e.delay)}static hasTask(e){return this.taskMap.has(e)}static clearTask(e){if(!this.taskMap.has(e))return!0;const{intervalID:t,timeoutID:n,onVisibilitychange:s}=this.taskMap.get(e);return t&&clearInterval(t),n&&clearTimeout(n),s&&document.removeEventListener("visibilitychange",s),this.taskMap.delete(e),!0}static isBreakLoop(e){return this.taskMap.has(e.taskID)?e.count!==0&&e.loopCount>=e.count?(this.clearTask(e.taskID),!0):!1:!0}}xe(qr,"taskMap",new Map),xe(qr,"currentTaskID",1);const Dp=function(i){if(i===null||typeof i=="undefined")return!0;if(typeof i=="boolean")return!1;if(typeof i=="number")return i===0;if(typeof i=="string"||typeof i=="function"||Array.isArray(i))return i.length===0;if(i instanceof Error)return i.message==="";if(id(i)){for(const e in i)if(Object.prototype.hasOwnProperty.call(i,e))return!1;return!0}return!1},jo="_local_user_id",Wi=class Wi{constructor(){xe(this,"_viewConfig",{viewBackground:{local:{},remote:{}}});
6xe(this,"_isSetViewBackgroundConfig",{remote:!1,local:!1});xe(this,"_tuiCallEngine",null);xe(this,"_tuiStore",null)}static getInstance(){return Wi.instance||(Wi.instance=new Wi),Wi.instance}_updateViewBackground(){var n,s,r;const e=(n=this._tuiStore)==null?void 0:n.getData(j.CALL,N.CUSTOM_UI_CONFIG),{userId:t}=(s=this._tuiStore)==null?void 0:s.getData(j.CALL,N.LOCAL_USER_INFO);Object.keys(this._viewConfig.viewBackground.remote).includes(t)&&delete this._viewConfig.viewBackground.remote[t],(r=this._tuiStore)==null||r.update(j.CALL,N.CUSTOM_UI_CONFIG,Z(F({},e),{viewBackground:F(F({},this._viewConfig.viewBackground.remote),this._viewConfig.viewBackground.local)}))}setEngineInstance(e){this._tuiCallEngine=e}setTUIStore(e){this._tuiStore=e}updateViewBackgroundUserId(e){var t,n;if(e==="local"){const{userId:s}=(t=this._tuiStore)==null?void 0:t.getData(j.CALL,N.LOCAL_USER_INFO);if(Object.keys(this._viewConfig.viewBackground.remote).includes(s)&&(delete this._viewConfig.viewBackground.remote[s],this._updateViewBackground()),!this._isSetViewBackgroundConfig.local)return;const r=this._viewConfig.viewBackground.local,o=r[s]||r[jo];r[s]=r[jo],this._viewConfig.viewBackground.local={[s]:o},this._updateViewBackground()}else{let s=this._viewConfig.viewBackground.remote;this._isSetViewBackgroundConfig.remote&&Object.keys(s).includes("*")&&(((n=this._tuiStore)==null?void 0:n.getData(j.CALL,N.REMOTE_USER_INFO_LIST)).map(a=>a.userId).forEach(a=>{Object.keys(s).includes(a)||(s[a]=s["*"])}),this._viewConfig.viewBackground.remote=s,this._updateViewBackground())}}hideFeatureButton(e){var n,s,r,o,a;(s=(n=this._tuiCallEngine)==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.hideFeatureButton.start",data:{buttonName:e}});const t=(r=this._tuiStore)==null?void 0:r.getData(j.CALL,N.CUSTOM_UI_CONFIG);(a=this._tuiStore)==null||a.update(j.CALL,N.CUSTOM_UI_CONFIG,Z(F({},t),{button:Z(F({},t.button),{[e]:Z(F({},((o=t.button)==null?void 0:o[e])||{}),{show:!1})})}))}setLocalViewBackgroundImage(e){var n,s,r;(s=(n=this._tuiCallEngine)==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.setLocalViewBackgroundImage.start",data:{url:e}}),this._isSetViewBackgroundConfig.local=!0;let{userId:t}=(r=this._tuiStore)==null?void 0:r.getData(j.CALL,N.LOCAL_USER_INFO);Dp(t)&&(t=jo),this._viewConfig.viewBackground.local={[t]:e},this._updateViewBackground()}setRemoteViewBackgroundImage(e,t){var n,s;(s=(n=this._tuiCallEngine)==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.setRemoteViewBackgroundImage.start",data:{userId:e,url:t}}),this._isSetViewBackgroundConfig.remote=!0,e==="*"&&(this._viewConfig.viewBackground.remote={}),this._viewConfig.viewBackground.remote[e]=t,this._updateViewBackground()}setLayoutMode(e){var n,s;(s=(n=this._tuiCallEngine)==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.setLayoutMode.start",data:{layoutMode:e}});const t=this._tuiStore.getData(j.CALL,N.CUSTOM_UI_CONFIG);this._tuiStore.update(j.CALL,N.CUSTOM_UI_CONFIG,Z(F({},t),{layoutMode:e}))}setCameraDefaultState(e){var n,s;(s=(n=this._tuiCallEngine)==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.setCameraDefaultState.start",data:{isOpen:e}});const t=Kr(this._tuiStore.getData(j.CALL,N.CUSTOM_UI_CONFIG));Object.keys(t.button).includes(oi.Camera)||(t.button[oi.Camera]={}),t.button[oi.Camera].state=e?As.Open:As.Close,this._tuiStore.update(j.CALL,N.CUSTOM_UI_CONFIG,t)}};xe(Wi,"instance");let Jr=Wi;const Rr=Io.getInstance(),Pn={audioCall:()=>Ge("Voice call"),videoCall:()=>Ge("Video call"),switchToAudio:()=>Ge("Switch audio call"),switchToVideo:()=>Ge("Switch video call"),hangup:({callDuration:i})=>`${Ge("Call duration")}:${i}`},zi=class zi{constructor(e){xe(this,"_callService");var t,n,s;this._callService=e.callService,Fn.registerEvent(ct.TUILogin.EVENT.LOGIN_STATE_CHANGED,ct.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS,this),(t=ct.TUIChat)!=null&&t.EVENT&&Fn.registerEvent((n=ct.TUIChat.EVENT)==null?void 0:n.CHAT_STATE_CHANGED,(s=ct.TUIChat.EVENT_SUB_KEY)==null?void 0:s.CHAT_OPENED,this),Fn.registerService(ct.TUICalling.SERVICE.NAME,this),Fn.registerExtension(ct.TUIChat.EXTENSION.INPUT_MORE.EXT_ID,this)}static getInstance(e){return zi.instance||(zi.instance=new zi(e)),zi.instance}callTUIService(e){const{message:t}=e||{};Fn.callService({serviceName:ct.TUIChat.SERVICE.NAME,method:ct.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST,params:{message:t}})}onGetExtension(e,t){var n,s;
6if(e===ct.TUIChat.EXTENSION.INPUT_MORE.EXT_ID){if((s=(n=this._callService.getTUICallEngineInstance())==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.onGetExtension",data:{extensionID:e,params:t}}),_o(t))return[];if([ct.TUIChat.TYPE.ROOM,ct.TUIChat.TYPE.CUSTOMER_SERVICE].includes(t.chatType))return[];let r=[];const o={weight:1e3,text:"语音通话",icon:np,data:{name:"voiceCall"},listener:{onClicked:l=>ye(this,null,function*(){return yield this._handleTUICoreOnClick(l,l.type||rt.AUDIO)})}},a={weight:900,text:"视频通话",icon:ip,data:{name:"videoCall"},listener:{onClicked:l=>ye(this,null,function*(){return yield this._handleTUICoreOnClick(l,l.type||rt.VIDEO)})}};return t!=null&&t.chatType?r=[o,a]:(!(t!=null&&t.filterVoice)&&r.push(o),!(t!=null&&t.filterVideo)&&r.push(a)),r}}onCall(e,t){return ye(this,null,function*(){e===ct.TUICalling.SERVICE.METHOD.START_CALL&&(yield this._handleTUICoreOnClick(t,t.type))})}onNotifyEvent(e,t,n){return ye(this,null,function*(){var s,r,o,a,l,c,u,f;try{if(e===ct.TUILogin.EVENT.LOGIN_STATE_CHANGED)if(t===ct.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS){const{chat:d,userID:p,userSig:g,SDKAppID:h}=Th.getContext();yield(s=this._callService)==null?void 0:s.init({tim:d,userID:p,userSig:g,sdkAppID:h,isFromChat:!0,component:cl.TIM_CALL_KIT}),(r=this._callService)==null||r.setIsFromChat(!0),(o=this._callService)==null||o.setLogLevel(Qu.NORMAL),this._addListenChatEvent()}else t===ct.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS&&(this._removeListenChatEvent(),yield(a=this._callService)==null?void 0:a.destroyed());if((l=ct.TUIChat)!=null&&l.EVENT&&e===ct.TUIChat.EVENT.CHAT_STATE_CHANGED&&t===ct.TUIChat.EVENT_SUB_KEY.CHAT_OPENED){if((c=this._callService)==null||c.setCurrentGroupId((n==null?void 0:n.groupID)||""),Rr.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE)return;const d=(u=this._callService)==null?void 0:u.getCurrentGroupId(),p=d?yield this.getGroupAttributes((f=this._callService)==null?void 0:f.getTim(),d):{};yield this.updateStoreBasedOnGroupAttributes(p)}}catch(d){}})}updateStoreBasedOnGroupAttributes(e){return ye(this,null,function*(){var t,n,s,r;(s=(n=(t=this._callService)==null?void 0:t.getTUICallEngineInstance())==null?void 0:n.reportLog)==null||s.call(n,{name:"TUICallKit.getJoinGroupCallInfo.success",data:{groupAttributes:e}});try{const{group_id:o="",room_id:a=0,room_id_type:l=0,call_media_type:c=N.UNKNOWN,user_list:u}=e[N.INNER_ATTR_KIT_INFO]?JSON.parse(e[N.INNER_ATTR_KIT_INFO]):{};let f=(u||[]).map(p=>p.userid);f=f.length&&(yield lr(f,(r=this._callService)==null?void 0:r.getTim()));const d={[N.GROUP_ID]:o,[N.GROUP_CALL_MEMBERS]:f,[N.ROOM_ID]:a,[N.CALL_MEDIA_TYPE]:Ju[c],[N.ROOM_ID_TYPE]:l};Rr.updateStore(d,j.CALL)}catch(o){}})}getGroupAttributes(e,t){return ye(this,null,function*(){if(!t)return{};try{const{data:n}=yield e.getGroupAttributes({groupID:t,keyList:[]});return(n==null?void 0:n.groupAttributes)||{}}catch(n){return{}}})}isLineBusy(e){var s;const t=Ar(e.payload.data),n=Ar(t==null?void 0:t.data);return(n==null?void 0:n.line_busy)==="line_busy"||(n==null?void 0:n.line_busy)===""||((s=n==null?void 0:n.data)==null?void 0:s.message)==="lineBusy"}getCallKitMessage(e,t){return ye(this,null,function*(){var d,p,g,h;const n=Ar(e.payload.data);if((n==null?void 0:n.businessID)!==1)return{};let s="";const r=Ar(n==null?void 0:n.data),o=r.call_type,a=n.inviteeList,l=(d=r==null?void 0:r.data)==null?void 0:d.inviter,c=Rr.getData(j.CALL,N.LOCAL_USER_INFO).userId,u=l===c,f=(p=r==null?void 0:r.data)==null?void 0:p.cmd;switch(n==null?void 0:n.actionType){case ys.INVITE:{s=Pn[f]({callDuration:od(r==null?void 0:r.call_end)});break}case ys.CANCEL_INVITE:s=Ge(u?"Call Cancel":"Other Side Cancel");break;case ys.ACCEPT_INVITE:["switchToAudio","switchToVideo"].includes(f)?s=(g=Pn==null?void 0:Pn[f])==null?void 0:g.call(Pn):s=Ge("Answered");break;case ys.REJECT_INVITE:this.isLineBusy(e)?s=Ge(u?"Line Busy":"Other Side Line Busy"):s=Ge(u?"Other Side Decline":"Decline");break;case ys.INVITE_TIMEOUT:["switchToAudio","switchToVideo"].includes(f)?s=(h=Pn==null?void 0:Pn[f])==null?void 0:h.call(Pn):s=Ge(u?"Other Side No Answer":"No answer");break}return{messageCardContent:s,callMediaType:o,inviteeList:a}})}_addListenChatEvent(){var e,t;(e=this._callService)!=null&&e.getTim()&&((t=this._callService)==null||t.getTim().on(Js.EVENT.GROUP_ATTRIBUTES_UPDATED,this._handleGroupAttributesUpdated,this))}_removeListenChatEvent(){var e,t;(e=this._callService)!=null&&e.getTim()&&((t=this._callService)==null||t.getTim().off(Js.EVENT.GROUP_ATTRIBUTES_UPDATED,this._handleGroupAttributesUpdated,this))}_handleTUICoreOnClick(e,t){return ye(this,null,function*(){var s,r;try{const n=e,{groupID:o,userIDList:a=[]}=n,l=$l(n,["groupID","userIDList"]);o?yield(s=this._callService)==null?void 0:s.groupCall(F({groupID:o,userIDList:a,type:t},l)):a.length===1&&(yield(r=this._callService)==null?void 0:r.call(F({userID:a[0],type:t},l)))}catch(o){}})}_handleGroupAttributesUpdated(e){return ye(this,null,function*(){var r;if(Rr.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE)return;const t=(e==null?void 0:e.data)||{},{groupID:n="",groupAttributes:s={}}=t;n===((r=this._callService)==null?void 0:r.getCurrentGroupId())&&(yield this.updateStoreBasedOnGroupAttributes(s))})}};xe(zi,"instance");let La=zi;const Mp=0,kp=1,nc=2;function Np({retryFunction:i,settings:e,onError:t,onRetrying:n,onRetryFailed:s,context:r}){return function(...o){const a=e.retries||5;let l=0,c=-1,u=Mp;const f=(d,p)=>ye(this,null,function*(){const g=this;try{const h=yield i.apply(g,o);l=0,d(h)}catch(h){const m=()=>{clearTimeout(c),l=0,u=nc,p(h)},y=()=>{u!==nc&&l<a?(l++,u=kp,Fr(n)&&n.call(g,l,m),c=setTimeout(()=>{c=-1,f(d,p)}
6,_o(e.timeout)?1e3:e.timeout)):(m(),Fr(s)&&s.call(g,h))};Fr(t)?t.call(g,h,y,p,o):y()}});return new Promise(f)}}function xp(i){return function(e,t,n){const{retries:s=5,timeout:r=2e3,onError:o,onRetrying:a,onRetryFailed:l}=i,c=Np({retryFunction:n.value,settings:{retries:s,timeout:r},onError:o,onRetrying:a,onRetryFailed:l,context:null});return n.value=function(...u){return c.apply(this,u)},n}}var Up=Object.defineProperty,Pp=Object.getOwnPropertyDescriptor,Vp=(i,e,t,n)=>{for(var s=Pp(e,t),r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Up(e,t,s),s};const tt=Io.getInstance(),Bp=Jr.getInstance();var si;const ld=(si=class{constructor(e){xe(this,"_callService");this._callService=e.callService}static getInstance(e){return si.instance||(si.instance=new si(e)),si.instance}addListenTuiCallEngineEvent(){var t;const e=(t=this._callService)==null?void 0:t.getTUICallEngineInstance();e&&(e.on(Pe.TUICallEvent.ERROR,this._handleError,this),e.on(Pe.TUICallEvent.INVITED,this._handleNewInvitationReceived,this),e.on(Pe.TUICallEvent.USER_ACCEPT,this._handleUserAccept,this),e.on(Pe.TUICallEvent.USER_ENTER,this._handleUserEnter,this),e.on(Pe.TUICallEvent.USER_LEAVE,this._handleUserLeave,this),e.on(Pe.TUICallEvent.REJECT,this._handleInviteeReject,this),e.on(Pe.TUICallEvent.NO_RESP,this._handleNoResponse,this),e.on(Pe.TUICallEvent.LINE_BUSY,this._handleLineBusy,this),e.on(Pe.TUICallEvent.CALLING_CANCEL,this._handleCallingCancel,this),e.on(Pe.TUICallEvent.SDK_READY,this._handleSDKReady,this),e.on(Pe.TUICallEvent.KICKED_OUT,this._handleKickedOut,this),e.on(Pe.TUICallEvent.MESSAGE_SENT_BY_ME,this._messageSentByMe,this),Pe.TUICallEvent.CALL_MESSAGE&&e.on(Pe.TUICallEvent.CALL_MESSAGE,this._handleCallMessage,this),Pe.TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED&&e.on(Pe.TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED,this._handleNetworkQuality,this),e.on(Pe.TUICallEvent.CALLING_END,this._handleCallingEnd,this),e.on(Pe.TUICallEvent.CALL_TYPE_CHANGED,this._handleCallTypeChange,this),e.on(Pe.TUICallEvent.USER_VIDEO_AVAILABLE,this._handleUserVideoAvailable,this),e.on(Pe.TUICallEvent.USER_AUDIO_AVAILABLE,this._handleUserAudioAvailable,this),e.on(Pe.TUICallEvent.USER_VOICE_VOLUME,this._handleUserVoiceVolume,this),e.on(Pe.TUICallEvent.DEVICED_UPDATED,this._handleDeviceUpdate,this))}removeListenTuiCallEngineEvent(){var t;const e=(t=this._callService)==null?void 0:t.getTUICallEngineInstance();e.off(Pe.TUICallEvent.ERROR,this._handleError,this),e.off(Pe.TUICallEvent.INVITED,this._handleNewInvitationReceived,this),e.off(Pe.TUICallEvent.USER_ACCEPT,this._handleUserAccept,this),e.off(Pe.TUICallEvent.USER_ENTER,this._handleUserEnter,this),e.off(Pe.TUICallEvent.USER_LEAVE,this._handleUserLeave,this),e.off(Pe.TUICallEvent.REJECT,this._handleInviteeReject,this),e.off(Pe.TUICallEvent.NO_RESP,this._handleNoResponse,this),e.off(Pe.TUICallEvent.LINE_BUSY,this._handleLineBusy,this),e.off(Pe.TUICallEvent.CALLING_CANCEL,this._handleCallingCancel,this),e.off(Pe.TUICallEvent.SDK_READY,this._handleSDKReady,this),e.off(Pe.TUICallEvent.KICKED_OUT,this._handleKickedOut,this),e.off(Pe.TUICallEvent.MESSAGE_SENT_BY_ME,this._messageSentByMe,this),Pe.TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED&&e.off(Pe.TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED,this._handleNetworkQuality,this),e.off(Pe.TUICallEvent.CALLING_END,this._handleCallingEnd,this),e.off(Pe.TUICallEvent.CALL_TYPE_CHANGED,this._handleCallTypeChange,this),e.off(Pe.TUICallEvent.USER_VIDEO_AVAILABLE,this._handleUserVideoAvailable,this),e.off(Pe.TUICallEvent.USER_AUDIO_AVAILABLE,this._handleUserAudioAvailable,this),e.off(Pe.TUICallEvent.USER_VOICE_VOLUME,this._handleUserVoiceVolume,this),e.off(Pe.TUICallEvent.DEVICED_UPDATED,this._handleDeviceUpdate,this)}_callerChangeToConnected(){var n;const e=tt.getData(j.CALL,N.CALL_ROLE);tt.getData(j.CALL,N.CALL_STATUS)===Be.CALLING&&e===Dt.CALLER&&(tt.update(j.CALL,N.CALL_STATUS,Be.CONNECTED),(n=this._callService)==null||n.startTimer())}_unNormalEventsManager(e,t){var r;const n=tt.getData(j.CALL,N.IS_GROUP),s=tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST);
6switch(t){case Pe.TUICallEvent.REJECT:case Pe.TUICallEvent.LINE_BUSY:{const{userID:o}=Un(e);let a=t===Pe.TUICallEvent.REJECT?hn.OTHER_SIDE_REJECT_CALL:hn.OTHER_SIDE_LINE_BUSY,l=Ts(a);if(n){const c=(s.find(u=>u.userId===o)||{}).displayUserInfo||o;a=t===Pe.TUICallEvent.REJECT?hn.REJECT_CALL:hn.IN_BUSY,l=Ts(a,c)}tt.update(j.CALL,N.TOAST_INFO,{text:l}),o&&Go([o]);break}case Pe.TUICallEvent.NO_RESP:{const{userIDList:o=[]}=Un(e);o.map(a=>(s.find(c=>c.userId===a)||{}).displayUserInfo||a),o.length>0&&Go(o);break}case Pe.TUICallEvent.CALLING_CANCEL:{(r=this._callService)==null||r._resetCallStore();break}}}_handleError(e){var o;const{code:t,message:n}=e||{},s=Object.values(ql).indexOf(t);let r="";if(s!==-1){const a=Object.keys(ql)[s];r=Ge(Xh[a]),r&&tt.update(j.CALL,N.TOAST_INFO,{text:r,type:N.ERROR})}(o=this._callService)==null||o.executeExternalAfterCalling()}_handleNewInvitationReceived(e){return ye(this,null,function*(){var y,R,I,T;const{sponsor:t="",isFromGroup:n,callMediaType:s,inviteData:r={},calleeIdList:o=[],groupID:a="",roomID:l,strRoomID:c}=Un(e),u=tt.getData(j.CALL,N.LOCAL_USER_INFO),f=[t,...o.filter(C=>C!==u.userId)],d=s||r.callType,p=d===rt.AUDIO?hn.CALLEE_CALLING_AUDIO_MSG:hn.CALLEE_CALLING_VIDEO_MSG;let g={[N.CALL_ROLE]:Dt.CALLEE,[N.IS_GROUP]:n,[N.CALL_STATUS]:Be.CALLING,[N.CALL_MEDIA_TYPE]:d,[N.CALL_TIPS]:Ge(p),[N.CALLER_USER_INFO]:{userId:t},[N.GROUP_ID]:a};ad(l,c),tt.updateStore(g,j.CALL),(y=this._callService)==null||y.executeExternalBeforeCalling(),(R=this._callService)!=null&&R.statusChanged&&((I=this._callService)==null||I.statusChanged({oldStatus:Yt.IDLE,newStatus:Yt.BE_INVITED}));const h=yield lr(f,(T=this._callService)==null?void 0:T.getTim()),[m]=h.filter(C=>C.userId===t);h.length>0&&tt.updateStore({[N.REMOTE_USER_INFO_LIST]:h,[N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]:h,[N.CALLER_USER_INFO]:{userId:t,nick:(m==null?void 0:m.nick)||"",avatar:(m==null?void 0:m.avatar)||"",displayUserInfo:(m==null?void 0:m.remark)||(m==null?void 0:m.nick)||t}},j.CALL)})}_handleUserAccept(e){this._callerChangeToConnected(),tt.update(j.CALL,N.TOAST_INFO,Ge("answered"))}_handleUserEnter(e){return ye(this,null,function*(){var o;this._callerChangeToConnected();const{userID:t,data:n}=Un(e);let s=tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST);if(!s.find(a=>(a==null?void 0:a.userId)===t)){s.push({userId:t}),s.length>0&&(tt.update(j.CALL,N.REMOTE_USER_INFO_LIST,s),tt.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,s));const[a]=yield lr([t],(o=this._callService)==null?void 0:o.getTim());s=tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST),s.forEach(l=>{(l==null?void 0:l.userId)===t&&(l=Object.assign(l,a))})}s=s.map(a=>(a.userId===t&&(a.isEnter=!0),a)),s.length>0&&(tt.update(j.CALL,N.REMOTE_USER_INFO_LIST,s),tt.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,s),Bp.updateViewBackgroundUserId("remote"))})}_handleUserLeave(e){const{data:t,userID:n}=Un(e);if(tt.getData(j.CALL,N.IS_GROUP)){const r=(tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST).find(a=>a.userId===n)||{}).displayUserInfo||n,o=Ts(hn.END_CALL,r);tt.update(j.CALL,N.TOAST_INFO,{text:o})}n&&Go([n])}_handleInviteeReject(e){this._unNormalEventsManager(e,Pe.TUICallEvent.REJECT)}_handleNoResponse(e){this._unNormalEventsManager(e,Pe.TUICallEvent.NO_RESP)}_handleLineBusy(e){this._unNormalEventsManager(e,Pe.TUICallEvent.LINE_BUSY)}_handleCallingCancel(e){var t;(t=this._callService)==null||t.executeExternalAfterCalling(),this._unNormalEventsManager(e,Pe.TUICallEvent.CALLING_CANCEL)}_handleCallingEnd(e){var t,n;(t=this._callService)==null||t.executeExternalAfterCalling(),(n=this._callService)==null||n._resetCallStore()}_handleSDKReady(e){return ye(this,null,function*(){var n,s,r;let t=tt.getData(j.CALL,N.LOCAL_USER_INFO);t=yield bp(t.userId,(n=this._callService)==null?void 0:n.getTim()),(r=this._callService)==null||r.setDefaultOfflinePushInfo(Z(F({},(s=this._callService)==null?void 0:s.getDefaultOfflinePushInfo()),{title:t==null?void 0:t.displayUserInfo})),tt.update(j.CALL,N.LOCAL_USER_INFO,t),tt.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,t)})}_handleKickedOut(e){var t,n,s;(t=this._callService)!=null&&t.kickedOut&&((n=this._callService)==null||n.kickedOut(e)),tt.update(j.CALL,N.CALL_TIPS,Ts(hn.KICK_O
6UT)),(s=this._callService)==null||s._resetCallStore()}_messageSentByMe(e){var n,s;const t=e==null?void 0:e.data;(n=this._callService)!=null&&n.onMessageSentByMe&&((s=this._callService)==null||s.onMessageSentByMe(t))}_handleCallMessage(e){const t=Un(e);this._callService._chatCombine.callTUIService({message:t})}_handleCallTypeChange(e){const{newCallType:t,type:n}=Un(e);tt.update(j.CALL,N.CALL_MEDIA_TYPE,t||n)}_handleNetworkQuality(e){const{networkQualityList:t=[]}=Un(e);tt.update(j.CALL,N.NETWORK_STATUS,t);const n=tt.getData(j.CALL,N.IS_GROUP),s=tt.getData(j.CALL,N.LOCAL_USER_INFO);if(tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST),!n&&t.find(o=>(s==null?void 0:s.userId)===(o==null?void 0:o.userId)&&(o==null?void 0:o.quality)>=rp)){tt.update(j.CALL,N.CALL_TIPS,Ge(hn.LOCAL_NETWORK_IS_POOR));return}}_startRemoteView(e){return ye(this,null,function*(){var t;if(e){if(!document.getElementById(e))return Promise.reject();try{const n=tt.getData(j.CALL,N.DISPLAY_MODE);yield(t=this._callService)==null?void 0:t.getTUICallEngineInstance().startRemoteView({userID:e,videoViewDomID:e,options:{objectFit:n}})}catch(n){return Promise.reject(n)}}})}_setRemoteUserInfoAudioVideoAvailable(e,t,n){let s=tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST);s=s.map(r=>{if(r.userId===n){if(t===N.AUDIO)return Z(F({},r),{isAudioAvailable:e});if(t===N.VIDEO)return Z(F({},r),{isVideoAvailable:e})}return r}),s.length>0&&(tt.update(j.CALL,N.REMOTE_USER_INFO_LIST,s),tt.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,s))}_handleUserVideoAvailable(e){return ye(this,null,function*(){const{userID:t,isVideoAvailable:n}=Un(e);try{n&&(yield this._startRemoteView(t))}catch(s){}this._setRemoteUserInfoAudioVideoAvailable(n,N.VIDEO,t)})}_handleUserAudioAvailable(e){const{userID:t,isAudioAvailable:n}=Un(e);this._setRemoteUserInfoAudioVideoAvailable(n,N.AUDIO,t)}_handleUserVoiceVolume(e){try{const{volumeMap:t}=Un(e);if((t||[]).length===0)return;const n=tt.getData(j.CALL,N.LOCAL_USER_INFO);let s=tt.getData(j.CALL,N.REMOTE_USER_INFO_LIST);const[r]=t.filter(l=>l.userId===n.userId),o=t.reduce((l,c)=>c.userId!==n.userId?Z(F({},l),{[c.userId]:c.audioVolume}):l,{});n.volume=r.audioVolume,s=s.map(l=>Z(F({},l),{volume:o[l.userId]}));const a={[N.LOCAL_USER_INFO]:n,[N.REMOTE_USER_INFO_LIST]:s};tt.updateStore(a,j.CALL)}catch(t){}}_handleDeviceUpdate(e){const{cameraList:t,microphoneList:n,speakerList:s,currentCamera:r,currentMicrophone:o,currentSpeaker:a}=e;tt.update(j.CALL,N.DEVICE_LIST,{cameraList:t,microphoneList:n,speakerList:s,currentCamera:r,currentMicrophone:o,currentSpeaker:a})}},xe(si,"instance"),si);Vp([xp({retries:5,timeout:200,onRetrying(i){}})],ld.prototype,"_startRemoteView");let Fp=ld;var Gp=Object.defineProperty,Hp=Object.getOwnPropertyDescriptor,Ct=(i,e,t,n)=>{for(var s=Hp(e,t),r=i.length-1,o;r>=0;r--)(o=i[r])&&(s=o(e,t,s)||s);return s&&Gp(e,t,s),s};const it=nd.getInstance(),le=Io.getInstance(),gi=Jr.getInstance();gi.setTUIStore(le);const $p="3.3.7",jp="vue3";var ri;const mt=(ri=class{constructor(){xe(this,"_tuiCallEngine");xe(this,"_tim",null);xe(this,"_TUICore",null);xe(this,"_timerId",-1);xe(this,"_startTimeStamp",Fo());xe(this,"_bellContext",null);xe(this,"_isFromChat",!1);xe(this,"_currentGroupId","");xe(this,"_defaultOfflinePushInfo",{title:"",description:Ge("you have a new call")});xe(this,"_permissionCheckTimer",null);xe(this,"_chatCombine",null);xe(this,"_engineEventHandler",null);xe(this,"beforeCalling");xe(this,"afterCalling");xe(this,"onMinimized");xe(this,"onMessageSentByMe");xe(this,"kickedOut");xe(this,"statusChanged");xe(this,"_handleCallStatusChange",e=>ye(this,null,function*(){var t,n,s,r;try{const o={callRole:le.getData(j.CALL,N.CALL_ROLE),callStatus:le.getData(j.CALL,N.CALL_STATUS)};if(this._bellContext.setBellProperties(o),e===Be.CALLING)yield(t=this==null?void 0:this._bellContext)==null?void 0:t.play();else{if(e===Be.CONNECTED){const a=le.getData(j.CALL,N.IS_GROUP),l=le.getData(j.CALL,N.CALL_MEDIA_TYPE),c=le.getData(j.CALL,N.REMOTE_USER_INFO_LIST),u=a?Yt.DIALING_GROUP:Yt.DIALING_C2C;le.update(j.CALL,N.CALL_TIPS,""),this.statusChanged&&this.statusChanged({oldStatus:u,newStatus:br()}),!a&&l===rt.VIDEO&&this.switchScreen(c[0].domId)}if(e===Be.IDLE&&this._isFromChat){const a=this._currentGroupId?yield(n=this._chatCombine)==null?void 0:n.getGroupAttributes(this._tim,this._currentGroupId):{};yield(s=this._chatCombine)==null?void 0:s.updateStoreBasedOnGroupAttributes(a,le,this)}yield(r=this==null?void 0:this._bellContext)==null?void 0:r.stop()}}catch(o){}}));this._watchTUIStore(),this._engineEventHandler=Fp.getInstance({callService:this}),this._chatCombine=La.getInstance({callService:this})}static getInstance(){return ri.instance||(ri.instance=new ri),ri.instance}init(e){return ye(this,null,function*(){var t,n;try{if(this._tuiCallEngine)return;let{userID:s,tim:r,userSig:o,sdkAppID:a,SDKAppID:l,isFromChat:c,component:u=cl.TUI_CALL_KIT}=e;this._TUICore&&(a=this._TUICore.SDKAppID,r=this._TUICore.tim),this._tim=r,this._tuiCallEngine=Pe.TUICallEngine.createInstance({tim:r,SDKAppID:a||l,frameWork:jp,language:6,callkitVersion:$p,chat:c||!1,component:u}),gi.setEngineInstance(this._tuiCallEngine),this._addListenTuiCallEngineEvent(),this._bellContext=new Tp,le.update(j.CALL,N.LOCAL_USER_INFO,{userId:s}),le.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,{userId:s}
6),gi.updateViewBackgroundUserId("local"),yield this._tuiCallEngine.login({userID:s,userSig:o,assetsPath:""});const f=le.getData(j.CALL,N.CUSTOM_UI_CONFIG);(n=(t=this._tuiCallEngine)==null?void 0:t.reportLog)==null||n.call(t,{name:"TUICallkit.init",data:{uiConfig:f}})}catch(s){throw s}})}destroyed(){return ye(this,null,function*(){var e;try{const t=le.getData(j.CALL,N.CALL_STATUS);if(t!==Be.IDLE)throw new Error(`please destroyed when status is idle, current status: ${t}`);this._tuiCallEngine&&(this._removeListenTuiCallEngineEvent(),yield this._tuiCallEngine.destroyInstance(),this._tuiCallEngine=null),(e=this._bellContext)==null||e.destroy(),this._bellContext=null}catch(t){throw t}})}call(e){return ye(this,null,function*(){if(le.getData(j.CALL,N.CALL_STATUS)===Be.IDLE)try{const{type:t,userID:n,offlinePushInfo:s}=e;if(le.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE)return;yield this._updateCallStoreBeforeCall(t,[{userId:n}]),this.executeExternalBeforeCalling(),e.offlinePushInfo=F(F({},this._defaultOfflinePushInfo),s);const r=yield this._tuiCallEngine.call(e);yield this._updateCallStoreAfterCall([n],r)}catch(t){this._handleCallError(t,"call")}})}groupCall(e){return ye(this,null,function*(){if(le.getData(j.CALL,N.CALL_STATUS)===Be.IDLE)try{const{userIDList:t,type:n,groupID:s,offlinePushInfo:r}=e;if(le.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE)return;const o=t.map(l=>({userId:l}));yield this._updateCallStoreBeforeCall(n,o,s),this.executeExternalBeforeCalling(),e.offlinePushInfo=F(F({},this._defaultOfflinePushInfo),r);const a=yield this._tuiCallEngine.groupCall(e);yield this._updateCallStoreAfterCall(t,a)}catch(t){this._handleCallError(t,"groupCall")}})}inviteUser(e){return ye(this,null,function*(){if(le.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE)try{const{userIDList:t}=e;let n=yield lr(t,this.getTim());const s=le.getData(j.CALL,N.REMOTE_USER_INFO_LIST);le.update(j.CALL,N.REMOTE_USER_INFO_LIST,[...s,...n]),le.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,[...s,...n]),this._tuiCallEngine&&(yield this._tuiCallEngine.inviteUser(e))}catch(t){throw this._resetCallStore(),t}})}joinInGroupCall(e){return ye(this,null,function*(){if(le.getData(j.CALL,N.CALL_STATUS)!==Be.CONNECTED)try{const t={[N.CALL_ROLE]:Dt.CALLEE,[N.IS_GROUP]:!0,[N.CALL_STATUS]:Be.CONNECTED,[N.CALL_MEDIA_TYPE]:e.type,[N.GROUP_ID]:e.groupID,[N.ROOM_ID]:e.roomID};le.updateStore(t,j.CALL);const n=yield this._tuiCallEngine.joinInGroupCall(e),s=this._getFeatureButtonDefaultState(oi.Camera)===As.Close;e.type===rt.VIDEO&&!s&&(yield this.openCamera(N.LOCAL_VIDEO)),le.update(j.CALL,N.IS_CLICKABLE,!0),this.startTimer(),Ho(this._tuiCallEngine),yield this._tuiCallEngine.setVideoQuality(le.getData(j.CALL,N.VIDEO_RESOLUTION));const r=le.getData(j.CALL,N.LOCAL_USER_INFO);le.update(j.CALL,N.LOCAL_USER_INFO,Z(F({},r),{isEnter:!0})),le.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,Z(F({},r),{isEnter:!0})),Fi(!0,N.AUDIO)}catch(t){this._handleCallError(t,"joinInGroupCall")}})}getTUICallEngineInstance(){return(this==null?void 0:this._tuiCallEngine)||null}setLogLevel(e){var t;(t=this==null?void 0:this._tuiCallEngine)==null||t.setLogLevel(e)}setLanguage(e){e&&Object.values(qu).includes(e)&&le.update(j.CALL,N.LANGUAGE,e)}enableFloatWindow(e){le.update(j.CALL,N.ENABLE_FLOAT_WINDOW,e)}setSelfInfo(e){return ye(this,null,function*(){const{nickName:t,avatar:n}=e;try{yield this._tuiCallEngine.setSelfInfo({nickName:t,avatar:n})}catch(s){}})}enableVirtualBackground(e){return ye(this,null,function*(){le.update(j.CALL,N.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND,e)})}enableAIVoice(e){return ye(this,null,function*(){try{yield this._tuiCallEngine.enableAIVoice(e)}catch(t){throw t}})}setCallingBell(e){return ye(this,null,function*(){let t=!0;if(t=yield op(e),!t)return;const n={calleeBellFilePath:e};this._bellContext.setBellProperties(n)})}enableMuteMode(e){return ye(this,null,function*(){try{const t={isMuteBell:e};this._bellContext.setBellProperties(t),yield this._bellContext.setBellMute(e)}catch(t){}})}hideFeatureButton(e){gi.hideFeatureButton(e)}setLocalViewBackgroundImage(e){gi.setLocalViewBackgroundImage(e)}
6setRemoteViewBackgroundImage(e,t){gi.setRemoteViewBackgroundImage(e,t)}setLayoutMode(e){gi.setLayoutMode(e)}setCameraDefaultState(e){gi.setCameraDefaultState(e)}accept(){return ye(this,null,function*(){var t,n,s,r,o,a;const e=le.getData(j.CALL,N.CALL_STATUS);if((n=(t=this._tuiCallEngine)==null?void 0:t.reportLog)==null||n.call(t,{name:"TUICallKit.accept.start",data:{callStatus:e}}),e!==Be.CONNECTED)try{le.update(j.CALL,N.CALL_STATUS,Be.CONNECTED),Ho(this._tuiCallEngine);const l=yield this._tuiCallEngine.accept();if(l){(r=this._chatCombine)==null||r.callTUIService({message:(s=l==null?void 0:l.data)==null?void 0:s.message}),le.update(j.CALL,N.IS_CLICKABLE,!0),this.startTimer();const c=le.getData(j.CALL,N.CALL_MEDIA_TYPE),u=this._getFeatureButtonDefaultState(oi.Camera)===As.Close;c===rt.VIDEO&&!u&&(yield this.openCamera(N.LOCAL_VIDEO)),yield this._tuiCallEngine.setVideoQuality(le.getData(j.CALL,N.VIDEO_RESOLUTION));const f=le.getData(j.CALL,N.LOCAL_USER_INFO);le.update(j.CALL,N.LOCAL_USER_INFO,Z(F({},f),{isEnter:!0})),le.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,Z(F({},f),{isEnter:!0})),Fi(!0,N.AUDIO)}}catch(l){if((a=(o=this._tuiCallEngine)==null?void 0:o.reportLog)==null||a.call(o,{name:"TUICallKit.accept.fail",level:"error",error:l}),Xl(l))return;$o(l,rt.AUDIO,this._tuiCallEngine),this._resetCallStore()}})}hangup(){return ye(this,null,function*(){if(le.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE){try{const e=yield this._tuiCallEngine.hangup();e==null||e.forEach(t=>{var n,s;(t==null?void 0:t.code)===0&&((s=this._chatCombine)==null||s.callTUIService({message:(n=t==null?void 0:t.data)==null?void 0:n.message}))})}catch(e){}this._resetCallStore()}})}reject(){return ye(this,null,function*(){var e,t;if(le.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE){try{const n=yield this._tuiCallEngine.reject();(n==null?void 0:n.code)===0&&((t=this._chatCombine)==null||t.callTUIService({message:(e=n==null?void 0:n.data)==null?void 0:e.message}))}catch(n){}this._resetCallStore()}})}openCamera(e){return ye(this,null,function*(){try{yield this._tuiCallEngine.openCamera(e),Fi(!0,N.VIDEO)}catch(t){$o(t,rt.VIDEO,this._tuiCallEngine)}})}closeCamera(){return ye(this,null,function*(){try{yield this._tuiCallEngine.closeCamera(),Fi(!1,N.VIDEO)}catch(e){}})}openMicrophone(){return ye(this,null,function*(){try{yield this._tuiCallEngine.openMicrophone(),Fi(!0,N.AUDIO)}catch(e){}})}closeMicrophone(){return ye(this,null,function*(){try{yield this._tuiCallEngine.closeMicrophone(),Fi(!1,N.AUDIO)}catch(e){}})}unMuteSpeaker(){var e,t;try{const n=(t=(e=this._tuiCallEngine)==null?void 0:e.getTRTCCloudInstance)==null?void 0:t.call(e);n&&(n.muteAllRemoteAudio(!1),le.update(j.CALL,N.IS_MUTE_SPEAKER,!1))}catch(n){}}muteSpeaker(){var e,t;try{const n=(t=(e=this._tuiCallEngine)==null?void 0:e.getTRTCCloudInstance)==null?void 0:t.call(e);n&&(n.muteAllRemoteAudio(!0),le.update(j.CALL,N.IS_MUTE_SPEAKER,!0))}catch(n){}}switchScreen(e){e&&le.update(j.CALL,N.BIG_SCREEN_USER_ID,e)}switchCallMediaType(){return ye(this,null,function*(){var e,t;try{if(le.getData(j.CALL,N.CALL_MEDIA_TYPE)===rt.AUDIO)return;const s=yield this._tuiCallEngine.switchCallMediaType(rt.AUDIO);(s==null?void 0:s.code)===0&&((t=this._chatCombine)==null||t.callTUIService({message:(e=s==null?void 0:s.data)==null?void 0:e.message})),le.update(j.CALL,N.CALL_MEDIA_TYPE,rt.AUDIO);const o=le.getData(j.CALL,N.IS_GROUP)?Yt.CALLING_GROUP_VIDEO:Yt.CALLING_C2C_VIDEO,a=br();this.statusChanged&&this.statusChanged({oldStatus:o,newStatus:a})}catch(n){}})}switchCamera(){return ye(this,null,function*(){const t=le.getData(j.CALL,N.CAMERA_POSITION)===Xs.BACK?Xs.FRONT:Xs.BACK;try{yield this._tuiCallEngine.switchCamera(t),le.update(j.CALL,N.CAMERA_POSITION,t)}catch(n){}})}setBlurBackground(e){return ye(this,null,function*(){try{yield this._tuiCallEngine.setBlurBackground(e?sp:0),le.update(j.CALL,N.ENABLE_VIRTUAL_BACKGROUND,e)}catch(t){}})}switchDevice(e){return ye(this,null,function*(){try{yield this._tuiCallEngine.switchDevice(e)}catch(t){}})}getDeviceList(e){return ye(this,null,function*(){try{return yield this._tuiCallEngine.getDeviceList(e)}catch(t){this._handleCallError(t,"call")}})}_addListenTuiCallEngineEvent(){this._engineEventHandler.addListenTuiCallEngineEvent()}_removeListenTuiCallEngineEvent(){this._engineEventHandler.removeListenTuiCallEngineEvent()}setCallback(e){const{beforeCalling:t,afterCalling:n,onMinimized:s,onMessageSentByMe:r,kickedOut:o,statusChanged:a}=e;t&&(this.beforeCalling=t),n&&(this.afterCalling=n),s&&(this.onMinimized=s),r&&(this.onMessageSentByMe=r),o&&(this.kickedOut=o),a&&(this.statusChanged=a)}toggleMinimize(){const e=le.getData(j.CALL,N.IS_MINIMIZED);le.update(j.CALL,N.IS_MINIMIZED,!e),this.onMinimized&&this.onMinimized(e,!e)}executeExternalBeforeCalling(){this.beforeCalling&&this.beforeCalling()}executeExternalAfterCalling(){this.afterCalling&&this.afterCalling()}setVideoDisplayMode(e){le.update(j.CALL,N.DISPLAY_MODE,e)}setVideoResolution(e){return ye(this,null,function*(){var t;try{if(!e)return;le.update(j.CALL,N.VIDEO_RESOLUTION,e),yield(t=this._tuiCallEngine)==null?void 0:t.setVideoQuality(e)}catch(n){}})}startTimer(){this._timerId===-1&&(this._startTimeStamp=Fo(),this._timerId=qr.run(N.TIMEOUT,this._updateCallDuration.bind(this),{delay:1e3}))}_handleCallError(e,t){if(this._permissionCheckTimer&&clearInterval(this._permissionCheckTimer),!Xl(e))throw $o(e,rt.AUDIO,this._tuiCallEngine),this._resetCallStore(),e}_updateCallStoreBeforeCall(e,t,n){return ye(this,null,function*(){const s=n||le.getData(j.CALL,N.IS_MINIMIZED)?hn.CALLER_GROUP_CALLING_MSG:hn.CALLER_CALLING_MSG;let r={[N.CALL_MEDIA_TYPE]:e,[N.CALL_ROLE]:Dt.CALLER,[N.REMOTE_USER_INFO_LIST]:t,[N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]:t,[N.IS_GROUP]:!!n,[N.CALL_TIPS]:Ge(s),[N.GROUP_ID]:n};le.updateStore(Z(F({},r),{[N.CALL_STATUS]:Be.CALLING}),j.CALL),this.statusChanged&&this.statusChanged({oldStatus:Yt.IDLE,newStatus:n?Yt.DIALING_GROUP:Yt.DIALING_C2C}),Ho(this._tuiCallEngine);const o=yield lr(t.map(a=>a.userId),this.getTim());o.length>0&&(le.update(j.CALL,N.REMOTE_USER_INFO_LIST,o),le.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,o))})}_updateCallStoreAfterCall(e,t){return ye(this,null,function*(){var n,s;if(t){le.update(j.CALL,N.IS_CLICKABLE,!0),ad(t==null?void 0:t.roomID,t==null?void 0:t.strRoomID);
6const r=le.getData(j.CALL,N.CALL_MEDIA_TYPE);if(t.code===0){(s=this._chatCombine)==null||s.callTUIService({message:(n=t==null?void 0:t.data)==null?void 0:n.message});try{yield this._tuiCallEngine.setVideoQuality(le.getData(j.CALL,N.VIDEO_RESOLUTION))}catch(l){}}else{this._resetCallStore();return}const o=this._getFeatureButtonDefaultState(oi.Camera)===As.Close;r===rt.VIDEO&&!o&&(yield this.openCamera(N.LOCAL_VIDEO));const a=le.getData(j.CALL,N.LOCAL_USER_INFO);le.update(j.CALL,N.LOCAL_USER_INFO,Z(F({},a),{isEnter:!0})),le.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,Z(F({},a),{isEnter:!0})),Fi(!0,N.AUDIO)}else this._permissionCheckTimer&&clearInterval(this._permissionCheckTimer),this._permissionCheckTimer=null,this._resetCallStore()})}_getFeatureButtonDefaultState(e){var n;const{button:t}=le.getData(j.CALL,N.CUSTOM_UI_CONFIG);return(n=t==null?void 0:t[e])==null?void 0:n.state}_updateCallDuration(){const e=Math.round((Fo()-this._startTimeStamp)/1e3),t=od(e);le.update(j.CALL,N.CALL_DURATION,t)}_stopTimer(){this._timerId!==-1&&(qr.clearTask(this._timerId),this._timerId=-1)}_resetCallStore(){const e=br();this._stopTimer();let t=Object.keys(Br).filter(r=>{switch(Br[r]){case N.CALL_STATUS:case N.LANGUAGE:case N.IS_GROUP:case N.DISPLAY_MODE:case N.VIDEO_RESOLUTION:case N.ENABLE_FLOAT_WINDOW:case N.LOCAL_USER_INFO:case N.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND:case N.LOCAL_USER_INFO_EXCLUDE_VOLUMN:return!1;default:return!0}});t=t.map(r=>Br[r]),le.reset(j.CALL,t),le.getData(j.CALL,N.CALL_STATUS)!==Be.IDLE&&le.reset(j.CALL,[N.CALL_STATUS],!0),le.reset(j.CALL,[N.IS_MINIMIZED],!0),le.reset(j.CALL,[N.IS_EAR_PHONE],!0),le.reset(j.CALL,[N.ENABLE_VIRTUAL_BACKGROUND],!0),le.reset(j.CALL,[N.IS_MUTE_SPEAKER],!0),le.update(j.CALL,N.LOCAL_USER_INFO,Z(F({},le.getData(j.CALL,N.LOCAL_USER_INFO)),{isVideoAvailable:!1,isAudioAvailable:!1})),le.update(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN,Z(F({},le.getData(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN)),{isVideoAvailable:!1,isAudioAvailable:!1})),le.update(j.CALL,N.REMOTE_USER_INFO_LIST,[]),le.update(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST,[]);const s=br();e!==s&&this.statusChanged&&this.statusChanged({oldStatus:e,newStatus:s})}getGroupMemberList(e,t){return ye(this,null,function*(){const n=le.getData(j.CALL,N.GROUP_ID);return yield Rp(n,this.getTim(),e,t)})}getGroupProfile(){return ye(this,null,function*(){const e=le.getData(j.CALL,N.GROUP_ID);return yield Op(e,this.getTim())})}_watchTUIStore(){le==null||le.watch(j.CALL,{[N.CALL_STATUS]:this._handleCallStatusChange})}_unwatchTUIStore(){le==null||le.unwatch(j.CALL,{[N.CALL_STATUS]:this._handleCallStatusChange})}bindTUICore(e){this._TUICore=e}getTim(){var e,t;return this._tim?this._tim:this._tuiCallEngine?((e=this._tuiCallEngine)==null?void 0:e.tim)||((t=this._tuiCallEngine)==null?void 0:t.getTim()):null}setIsFromChat(e){this._isFromChat=e}setCurrentGroupId(e){this._currentGroupId=e}getCurrentGroupId(){return this._currentGroupId}setDefaultOfflinePushInfo(e){this._defaultOfflinePushInfo=e}getDefaultOfflinePushInfo(){return this._defaultOfflinePushInfo}getCallMessage(e){return ye(this,null,function*(){return yield this._chatCombine.getCallKitMessage(e,this.getTim())})}},xe(ri,"instance"),ri);Ct([kt(),In(En.init)],mt.prototype,"init");Ct([kt(),In(En.call),yo({engineInstance:!0})],mt.prototype,"call");Ct([kt(),In(En.groupCall),yo({engineInstance:!0})],mt.prototype,"groupCall");Ct([kt(),In(En.inviteUser),yo({engineInstance:!0})],mt.prototype,"inviteUser");Ct([kt(),In(En.joinInGroupCall),yo({engineInstance:!0})],mt.prototype,"joinInGroupCall");Ct([In(En.setLanguage)],mt.prototype,"setLanguage");Ct([In(En.enableFloatWindow)],mt.prototype,"enableFloatWindow");Ct([In(En.setSelfInfo)],mt.prototype,"setSelfInfo");Ct([In(En.enableAIVoice)],mt.prototype,"enableAIVoice");Ct([In(En.setCallingBell)],mt.prototype,"setCallingBell");Ct([In(En.enableMuteMode)],mt.prototype,"enableMuteMode");Ct([kt()],mt.prototype,"accept");Ct([kt()],mt.prototype,"hangup");Ct([kt()],mt.prototype,"reject");Ct([kt()],mt.prototype,"openCamera");Ct([kt()],mt.prototype,"closeCamera");Ct([kt()],mt.prototype,"openMicrophone");Ct([kt()],mt.prototype,"closeMicrophone");Ct([kt()],mt.prototype,"unMuteSpeaker");Ct([kt()],mt.prototype,"muteSpeaker");Ct([kt()],mt.prototype,"switchScreen");Ct([kt()],mt.prototype,"switchCallMediaType");Ct([kt()],mt.prototype,"switchCamera");
6Ct([kt()],mt.prototype,"setBlurBackground");Ct([kt()],mt.prototype,"switchDevice");Ct([In(En.setVideoDisplayMode)],mt.prototype,"setVideoDisplayMode");Ct([In(En.setVideoResolution)],mt.prototype,"setVideoResolution");let Wp=mt;const We=Wp.getInstance(),cd="CallInfoContextKey",ud="CallerUserInfoContextKey",dd="UserInfoExcludeVolumeContextKey",fd="FocusContextKey",hd="ButtonPanelContextKey",pd="FloatWindowContextKey",gd="IsClickableContextKey",md="PopoverContextKey",vd="CustomUIConfigContextKey";function zp(){return Dn(ud)}function Lt(){return Dn(cd)}function Eo(i){const e=P([]),t=P(""),n=r=>{var o,a,l;switch(i){case qt.CAMERA:e.value=(r==null?void 0:r.cameraList)||[],t.value=((o=r==null?void 0:r.currentCamera)==null?void 0:o.deviceId)||"";break;case qt.MICROPHONE:e.value=(r==null?void 0:r.microphoneList)||[],t.value=((a=r==null?void 0:r.currentMicrophone)==null?void 0:a.deviceId)||"";break;case qt.SPEAKER:e.value=(r==null?void 0:r.speakerList)||[],t.value=((l=r==null?void 0:r.currentSpeaker)==null?void 0:l.deviceId)||"";break}},s=r=>{t.value=r};return et(()=>{le.watch(j.CALL,{[N.DEVICE_LIST]:n},{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,{[N.DEVICE_LIST]:n})}),[{deviceList:e,currentDeviceId:t},{updateCurrentDeviceId:s}]}const ic=i=>typeof i=="object"&&i!==null,Cd=(i,e)=>{if(!ic(i)||!ic(e))return i===e;if(i===e)return!0;const t=Object.keys(i),n=Object.keys(e);if(t.length!==n.length)return!1;for(let s in i)if(!Cd(i[s],e[s]))return!1;return!0};function Kp(i){const e=document.getElementById(i);!document.fullscreenElement&&e?e.requestFullscreen().catch(t=>{}):document.exitFullscreen()}function So(i){if(typeof i!="object"||i===null)return i;let e=Array.isArray(i)?[]:{};for(let t in i)i.hasOwnProperty(t)&&(e[t]=So(i[t]));return e}const Yp=500;function fl(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const t=function(...n){const s=e?e.apply(this,n):n[0],r=t.cache;if(r.has(s))return r.get(s);const o=i.apply(this,n);return t.cache=r.set(s,o)||r,o};return t.cache=new(fl.Cache||Map),t}fl.Cache=Map;function qp(i){const e=fl(i,t=>{const{cache:n}=e;return n.size===Yp&&n.clear(),t});return e}const Jp=46,Qp=/\\(\\)?/g,Zp=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),_d=qp(i=>{const e=[];return i.charCodeAt(0)===Jp&&e.push(""),i.replace(Zp,(t,n,s,r)=>{let o=t;s?o=r.replace(Qp,"$1"):n&&(o=n.trim()),e.push(o)}),e});function Gi(i,e,t){if(typeof i!="object"||!e)return;const n=_d(e);let s=i;for(let r=0;r<n.length;r++){if(s==null)return;const o=n[r];r!==n.length-1?s=s==null?void 0:s[o]:Object.assign(s,{[o]:t})}}function Fs(i,e,t){if(typeof i!="object")return;const n=_d(e);let s=i;for(let r=0;r<n.length;r++){if(s==null)return;const o=n[r];r!==n.length-1?s=s==null?void 0:s[o]:Array.isArray(s)&&s.splice(o,0,t)}}function Xp(i){return i==null||typeof i=="string"&&i.trim().length===0?!0:Array.isArray(i)||typeof i=="object"?Object.keys(i).length===0:!1}
6function wa(i,e,t,n,s){Object.keys(i).forEach(r=>{const o=i[r],a=Xp(t)?r:`${t}.${r}`;if(typeof o=="object")if(Array.isArray(o))for(let l=0;l<o.length;l++){const c=`${a}.${l}`;wa(o[l],e,c,n,s)}else wa(o,e,a,n,s);else if(e(o)){const l=typeof s=="function"?s({key:o,value:a}):a;n.push(l)}})}function yd(){const i=P(),e=P(le.getData(j.CALL,N.REMOTE_USER_INFO_LIST)),t=r=>{(it.isWeChat?r.enableMic:r.isAudioAvailable)&&(i.value=Z(F({},i.value),{localVideo:r.volume}))},n=r=>{const o={};(r.length!==e.value.length||!Cd(r,e.value))&&(e.value=r,e.value.forEach(a=>{if(it.isWeChat?a.hasAudio:a.isAudioAvailable){const c=it.isWeChat?a.userID:a.domId;o[c]=a.volume}}),i.value=F(F({},i.value),o))};let s={[N.LOCAL_USER_INFO]:t,[N.REMOTE_USER_INFO_LIST]:n};return it.isUniPlatform&&(s={[N.PUSHER]:t,[N.PLAYER]:n}),et(()=>{le.watch(j.CALL,s,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,s)}),i}function e2(){const i=P(""),e=P(!0),t=P(0),n=r=>{t.value=0,i.value=r},s=r=>{let o=r;typeof o=="object"&&(o=r==null?void 0:r.text),o&&(t.value=2e3,i.value=o)};return et(()=>{le.watch(j.CALL,{[N.CALL_TIPS]:n},{notifyRangeWhenWatch:N.MYSELF}),le.watch(j.CALL,{[N.TOAST_INFO]:s})}),st(()=>{le.unwatch(j.CALL,{[N.CALL_TIPS]:n,[N.TOAST_INFO]:s})}),{tip:i,show:e,duration:t}}function t2(){const i=P(le.getData(j.CALL,N.NETWORK_STATUS)),e=t=>{i.value=t};return et(()=>{le.watch(j.CALL,{[N.NETWORK_STATUS]:e},{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,{[N.NETWORK_STATUS]:e})}),{netWorkQualityList:i}}function Id(){const i=P(le.getData(j.CALL,N.PLAYER)),e=n=>{i.value=n==null?void 0:n.map(s=>{const{userID:r,hasVideo:o,hasAudio:a}=s;return{userID:r,hasVideo:o,hasAudio:a}})},t={[N.PLAYER]:e};return et(()=>{le.watch(j.CALL,t,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,t)}),i}function Sn(){return Dn(dd)}function hl(){const i=P(le.getData(j.CALL,N.CALL_DURATION)),e=t=>{i.value=t};return et(()=>{le.watch(j.CALL,{[N.CALL_DURATION]:e},{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,{[N.CALL_DURATION]:e})}),{callDuration:i}}function Cr(){return Dn(hd,{status:P("open")})}function Ed(){return Dn(fd,P("open"))}function Hn(){return Dn(pd)}function n2(){return Dn(gd)}function To(){return Dn(md)}const i2=(i,e)=>{const t=[{i:0,x:0,y:0,w:e,h:e}];for(let n=1;n<i;n++){const s=t[n-1].x+e===12;t[n]={i:n,x:t[n-1].x+e===12?0:t[n-1].x+e,y:t[n-1].y+(s?e:0),w:e,h:e}}return i===3&&(t[i-1].x+=3),i>3&&it.isPC&&i%3===2&&(t[i-1].x+=2,t[i-2].x+=2),t};function s2(i,e){const{isFloatWindow:t}=$e(Hn()),n=P();return Ye([i,e,t],()=>{if(t.value){const c=[];for(let u=0;u<e.value;u++)c[u]={i:u,x:0,y:0,w:12,h:12};n.value=c;return}const s=Object.keys(Array.from({length:e.value})),r=e.value<=4?6:4,o=i2(e.value,r);n.value=o;let a,l;if(i.value!==null){if(s.length<5){const c=s.concat();c.splice(i.value,1),c.unshift(i.value)}else l=i.value%3,a=Math.floor(i.value/3);if(s.length<5){const c=o.findIndex(u=>u.i===i.value);if(c!==-1){const u=o[0];o[0]=o[c],o[c]=u;for(let f=0;f<o.length;f++){const d=o[f];f===0?(d.w+=6,d.h+=6,d.x=0,d.y=0):(d.x=(f-1)*4,d.y=12,d.w=4,d.h=4)}}}else{let c;l===0?(o[i.value+1]&&(o[i.value+1].x+=4),o[i.value+2]&&(o[i.value+2].y+=4),c={i:i.value,x:0,y:a*4,w:8,h:8}):l===2?(c={i:i.value,x:4,y:a*4,w:8,h:8},o[i.value-1].x=0,o[i.value-1].y+=4):l===1&&(c={i:i.value,x:4,y:a*4,w:8,h:8},o[i.value+1]&&(o[i.value+1].x=0,o[i.value+1].y+=4));const u=3-l;for(let f=i.value+u;f<o.length;f++){const d=o[f];d.y+=4}o[i.value]=c}n.value=o}},{immediate:!0}),n}function _r(){return Dn(vd)}const r2={calling:[[{name:"switchCamera",customStyle:{justifyContent:"flex-start"},props:{}},{name:"virtualBackground"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{},{name:"hangup",customStyle:{paddingTop:"6vh"}},{}]],accept:[[{name:"switchCamera",customStyle:{justifyContent:"flex-start"},props:{}},{name:"virtualBackground"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{name:"reject",customStyle:{paddingTop:"6vh",justifyContent:"center"}},{},{name:"accept",customStyle:{paddingTop:"6vh",justifyContent:"center"}}]],connected:[[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"speaker"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}
6],[{name:"virtualBackground",customStyle:{justifyContent:"center",paddingTop:"6vh"},props:{}},{name:"hangup",customStyle:{paddingTop:"6vh"}},{name:"switchCamera",customStyle:{justifyContent:"center",paddingTop:"6vh"},props:{}}]]},o2={singleCall:{video:{calling:[[],[{},{name:"hangup"},{}]],accept:[[],[{name:"reject",customStyle:{justifyContent:"flex-end"}},{},{name:"accept",customStyle:{justifyContent:"flex-start"}}]],connected:[[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"speaker"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{},{name:"hangup",customStyle:{paddingTop:"6vh"}},{name:"switchCamera",customStyle:{justifyContent:"center",paddingTop:"6vh"},props:{}}]]},audio:{calling:[[],[{},{name:"hangup"},{}]],accept:[[],[{name:"reject",customStyle:{justifyContent:"flex-end"}},{},{name:"accept",customStyle:{justifyContent:"flex-start"}}]],connected:[[],[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"hangup"},{name:"speaker",customStyle:{justifyContent:"flex-end"}}]]}},groupCall:{video:{calling:[[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"speaker"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{},{name:"hangup",customStyle:{paddingTop:"6vh"}},{}]],accept:[[],[{name:"reject"},{name:"accept"}]],connected:[[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"speaker"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{},{name:"hangup",customStyle:{paddingTop:"6vh"}},{}]],close_calling:[[{name:"microphone",props:{}},{name:"speaker"},{name:"camera",props:{}},{name:"hangup"}]],close_connected:[[{name:"microphone",props:{}},{name:"speaker"},{name:"camera",props:{}},{name:"hangup"}]]},audio:{calling:[[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"speaker"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{},{name:"hangup",customStyle:{paddingTop:"6vh"}},{}]],accept:[[],[{name:"reject"},{name:"accept"}]],connected:[[{name:"microphone",customStyle:{justifyContent:"flex-start"},props:{}},{name:"speaker"},{name:"camera",customStyle:{justifyContent:"flex-end"},props:{}}],[{},{name:"hangup",customStyle:{paddingTop:"6vh"}},{}]],close_calling:[[{name:"microphone",props:{}},{name:"speaker"},{name:"camera",props:{}},{name:"hangup"}]],close_connected:[[{name:"microphone",props:{}},{name:"speaker"},{name:"camera",props:{}},{name:"hangup"}]]}}},a2={singleCall:{video:{calling:[[{name:"camera",props:{}},{name:"microphone",props:{}},{name:"hangup"}]],accept:[[{name:"camera",props:{}},{name:"reject"},{name:"accept"}]],connected:[[{name:"camera",props:{}},{name:"microphone",props:{}},{name:"speaker"},{name:"hangup"}]]},audio:{calling:[[{name:"microphone",props:{}},{name:"hangup"}]],accept:[[{name:"reject"},{name:"accept"}]],connected:[[{name:"microphone",props:{}},{name:"speaker"},{name:"hangup"}]]}},groupCall:{video:{calling:[[{name:"camera",props:{}},{name:"microphone",props:{}},{name:"inviteUser",props:{}},{name:"hangup"}]],accept:[[{name:"reject"},{name:"accept"}]],connected:[[{name:"camera",props:{}},{name:"microphone",props:{}},{name:"speaker"},{name:"inviteUser",props:{}},{name:"hangup"}]]},audio:{calling:[[{name:"microphone",props:{}},{name:"hangup"}]],accept:[[{name:"reject"},{name:"accept"}]],connected:[[{name:"microphone",props:{}},{name:"speaker"},{name:"inviteUser",props:{}},{name:"hangup"}]]}}},sc={pc:a2,mobile:o2};function Sd(i){const e=So(i);return Gi(e,"mobile.singleCall.video",r2),Fs(e,"pc.singleCall.video.calling[0][2]",{name:"virtualBackground",props:{}}),Fs(e,"pc.singleCall.video.accept[0][1]",{name:"virtualBackground",props:{}}),Fs(e,"pc.singleCall.video.connected[0][3]",{name:"virtualBackground",props:{}}),Fs(e,"pc.groupCall.video.calling[0][3]",{name:"virtualBackground",props:{}}),Fs(e,"pc.groupCall.video.connected[0][4]",{name:"virtualBackground",props:{}}),e}function l2(i,e,t){let n=So(i);return e?(Gi(n,"mobile.singleCall.video.connected[1][2].props.show",!0),t&&Sd(n)):(Gi(n,"mobile.singleCall.video.connected[1][2].props.show",!1),t&&(Gi(n,"mobile.singleCall.video.connected[1][0].props.show",!1),Gi(n,"pc.singleCall.video.connected[0][3].props.show",!1),Gi(n,"pc.groupCall.video.connected[0][4].props.show",!1))),n}
6function c2(){const{isShowEnableVirtualBackground:i,callStatus:e}=$e(Lt()),t=_r(),{localUserInfoExcludeVolume:n}=$e(Sn()),s=ie(()=>(n==null?void 0:n.value.isVideoAvailable)||!1),r=ie(()=>i.value&&!it.isH5),o=P([]);return Ye([t,i,s],()=>{let a=So(sc);r.value&&(a=Sd(sc)),e.value===Be.CONNECTED&&(a=l2(a,s.value,r.value));const{button:l}=t.value,c=[];function u(d){return Object.keys(l).includes(d)}function f({key:d,value:p}){var R;const g=p.split(".");let h=g.slice(0,g.length-1);const m=g.slice(0,g.length-2);if(m[m.length-1]==="0")for(let I=0;I<3;I++){let T=m.slice();T.push(I),T.push("customStyle"),T.push("justifyContent"),T=T.join("."),c.push({path:T,value:"center"})}return h.push("props"),h.push("show"),h=h.join("."),{path:h,value:(R=l==null?void 0:l[d])==null?void 0:R.show}}wa(a,u,"",c,f),c==null||c.forEach(d=>{Gi(a,d.path,d.value)}),o.value=a},{immediate:!0}),o}function Td(){const i=_r(),e=P(i.value.viewBackground);return Ye(i,()=>{e.value=i.value.viewBackground}),e}function u2(){const i=P(le.getData(j.CALL,N.ROOM_ID)),e=P(le.getData(j.CALL,N.ROOM_ID_TYPE)),t=P(le.getData(j.CALL,N.GROUP_ID)),n=P(le.getData(j.CALL,N.CALL_MEDIA_TYPE)),s=P(le.getData(j.CALL,N.GROUP_CALL_MEMBERS)),r=P(le.getData(j.CALL,N.CALL_STATUS)),o=p=>{i.value=p},a=p=>{t.value=p},l=p=>{n.value=p},c=p=>{s.value=p},u=p=>{r.value=p},f=p=>{e.value=p},d={[N.ROOM_ID]:o,[N.GROUP_ID]:a,[N.CALL_MEDIA_TYPE]:l,[N.GROUP_CALL_MEMBERS]:c,[N.CALL_STATUS]:u,[N.ROOM_ID_TYPE]:f};return et(()=>{le.watch(j.CALL,d,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,d)}),{roomId:i,roomIdType:e,groupId:t,callMediaType:n,groupCallMembers:s,callStatus:r}}const d2={customStyle:{type:Object},customClass:{type:String}},f2=["start","center","end","space-around","space-between","space-evenly"],h2=["top","middle","bottom"],p2={gutter:{type:Number,default:0},justify:{type:String,values:f2,default:"start"},align:{type:String,values:h2,default:"top"},customStyle:{type:Object,default:()=>{}}};function Et(...i){const e=[],t={}.hasOwnProperty;for(let n=0;n<i.length;n++){const s=i[n];if(!s)continue;const r=typeof s;if(r==="string"||r==="number")e.push(s);else if(Array.isArray(s)){if(s.length){const o=Et.apply(null,s);o&&e.push(o)}}else if(r==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(const o in s)t.call(s,o)&&s[o]&&e.push(o)}}return e.join(" ")}const is=typeof wx!="undefined"&&typeof wx.getSystemInfoSync=="function"&&!!wx.getSystemInfoSync().fontSizeSetting,g2=typeof uni!="undefined"&&typeof uni=="undefined",rc=is||g2,m2=typeof uni!="undefined",Ld=function(){return(typeof uni!="undefined"||typeof window!="undefined")&&!rc}();(function(){return is?wx:m2?uni:window})();const Oi=Ld&&window&&window.navigator&&window.navigator.userAgent||"",v2=/Android/i.test(Oi),C2=/(?:Windows Phone)/.test(Oi),_2=/(?:SymbianOS)/.test(Oi),y2=/iPad/i.test(Oi)||/iPhone/i.test(Oi)||/iPod/i.test(Oi),wd=v2||C2||_2||y2,us=Ld&&!wd;us&&Oi.includes("Windows NT");us&&Oi.includes("Mac");function Qr(i){const e={};for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&i[t]!==void 0&&(e[t]=i[t]);return e}function I2(){let i="unknow";return i=jl.split(".")[0],{version:jl,majorVersion:i}}function oc(i,e){const{key:t,value:n}=e;return i.find(s=>s[t]===n)}const Ad="RowContextKey",Qe="tk",js={SUCCESS:"success",INFO:"info",WARNING:"warning",ERROR:"error"},E2={options:{virtualHost:!0}},S2=ge(Z(F({},E2),{__name:"Row",props:p2,setup(i){const e=i,t=ie(()=>e.gutter);An(Ad,{gutter:t});const n=Et([`${Qe}-row`,`${Qe}-justify-${e.justify}`,`${Qe}-align-${e.align}`]);return(s,r)=>(w(),G("div",{class:fe(v(n)),style:Ze([s.customStyle])},[Ve(s.$slots,"default",{},void 0,!0)],6))}})),Hi=ve(S2,[["__scopeId","data-v-74356dcf"]]),T2=["start","center","end","space-around","space-between","space-evenly"],L2=["top","middle","bottom"],w2={span:{type:Number,default:24},justify:{type:String,values:T2,default:"start"},align:{type:String,values:L2,default:"middle"},offset:{type:Number,default:0}},A2={options:{virtualHost:!0}},b2=ge(Z(F({},A2),{__name:"Col",props:w2,setup(i){const e=i,{gutter:t}=Dn(Ad,{gutter:ie(()=>0)}),n=Et([`${Qe}-col`,`${Qe}-justify-${e.justify}`,`${Qe}-align-${e.align}`]),s=ie(()=>`${e.span/24*100}%`),r=ie(()=>`${e.offset/24*100}%`),o=ie(()=>`${t.value/2}px`),a=o;return(l,c)=>(w(),G("div",{class:fe(v(n)),style:Ze({width:v(s),marginLeft:v(r),paddingLeft:v(o),paddingRight:v(a)})},[Ve(l.$slots,"default",{},void 0,!0)],6))}})),Ft=ve(b2,[["__scopeId","data-v-fec787bc"]]),R2={width:{type:String,default:"40px"},height:{type:String,default:"40px"},color:{type:String}},O2={options:{virtualHost:!0}},D2=ge(Z(F({},O2),{__name:"Dot",props:R2,setup(i){const e=i,t=`${Qe}-loading_dot-container`,n=`${Qe}-loading_dot`,s=ie(()=>({width:e.width,height:e.height})),r=ie(()=>{const o={};return e.color&&(o.backgroundColor=e.color),o});return(o,a)=>(w(),G("div",{class:fe(t),style:Ze([v(s)])},[q("div",{class:fe(n),style:Ze([v(r)])},null,4),q("div",{class:fe(n),style:Ze([v(r)])},null,4),q("div",{class:fe(n),style:Ze([v(r)])},null,4)],4))}})),M2=ve(D2,[["__scopeId","data-v-0d2f3d1e"]]),k2={width:{type:String,default:"40px"},height:{type:String,default:"40px"},color:{type:String}},N2={options:{virtualHost:!0}},x2=ge(Z(F({},N2),{__name:"Circle",props:k2,setup(i){const e=i,t=ie(()=>{const s={width:e.width,height:e.height};return e.color&&(s["--tk-loading-primary-color"]=e.color),s}),n=`${Qe}-loading_circle-container`;return(s,r)=>(w(),G("div",{class:fe(n),style:Ze([v(t)])},null,4))}})),U2=ve(x2,[["__scopeId","data-v-f8413ab7"]]),P2=["circle","dot"],V2=["row","column"],B2={mode:{type:String,values:P2,default:"circle"},loadingWidth:{type:String,default:"40px"},loadingHeight:{type:String,default:"40px"},color:{type:String},text:{type:String},layout:{type:String,values:V2,default:"column"}},F2={options:{virtualHost:!0}},G2=ge(Z(F({},F2),{__name:"Loading",props:B2,setup(i){const e=i,t=`${Qe}-loading ${Qe}-loading--${e.mode}`,n=`${Qe}-loading_text`,s=ie(()=>({flexDirection:e.layout}));return(r,o)=>(w(),G("div",{class:fe(t),style:Ze([v(s)])},[r.mode==="dot"?(w(),ne(M2,{key:0,width:r.loadingWidth,height:r.loadingHeight,color:r.color},null,8,["width","height","color"])):(w(),ne(U2,{key:1,width:r.loadingWidth,height:r.loadingHeight,color:r.color},null,8,["width","height","color"])),r.text?(w(),G("div",{key:2,class:fe(n)},ae(r.text),1)):X("",!0)],4))}}
6)),pl=ve(G2,[["__scopeId","data-v-56520be8"]]),H2={src:{type:String},size:{type:Number,default:20}},$2=["fill","contain","cover"],ac={fill:"scaleToFill",contain:"aspectFit",cover:"aspectFill"},j2={width:{type:String,default:"320px"},height:{type:String,default:"240px"},src:{type:String},fit:{type:String,values:$2,default:"fill"},customStyle:{type:Object},defaultSrc:{type:String}},W2={error:i=>i},z2={options:{virtualHost:!0}},K2=ge(Z(F({},z2),{__name:"TKImage",props:j2,emits:W2,setup(i,{emit:e}){const t=i,n=e,s=P(!1),r=P(t.src);Ye(()=>t.src,()=>{s.value=!1,r.value=t.src});const o=ie(()=>Et([`${Qe}-image`])),a=ie(()=>F({width:t.width,height:t.height},t.customStyle)),l=ie(()=>Et([`${Qe}-image_inner`])),c=ie(()=>is?ac[t.fit]||ac.cover:t.fit);function u(f){s.value=!0,r.value=t.defaultSrc,n("error",f)}return(f,d)=>{const p=vr;return w(),G("div",{class:fe(v(o)),style:Ze([v(a)])},[v(s)&&!f.defaultSrc?Ve(f.$slots,"error",{key:0},void 0,!0):(w(),G(ze,{key:1},[v(is)?X("",!0):(w(),G("img",{key:0,class:fe(v(l)),src:v(r),style:Ze({objectFit:v(c)}),onError:u},null,46,["src"])),v(is)?(w(),ne(p,{key:1,class:fe(v(l)),src:v(r),alt:"Image","lazy-load":"",mode:v(c),onError:u},null,8,["class","src","mode"])):X("",!0)],64))],6)}}})),Qt=ve(K2,[["__scopeId","data-v-c594f989"]]),Y2={options:{virtualHost:!0}},Ds=ge(Z(F({},Y2),{__name:"Icon",props:H2,setup(i){const e=i,t=ie(()=>`${e.size}px`),n=ie(()=>`${e.size}px`);return(s,r)=>(w(),ne(Qt,{src:s.src,width:v(t),height:v(n)},null,8,["src","width","height"]))}})),q2=["small","middle","large"],J2=["row","column"],Q2=["circle","round"],Z2={iconSrc:{type:String},iconSize:{type:Number},text:{type:String},loading:{type:Boolean,default:!1},loadingColor:{type:String,default:"#fff"},loadingWidth:{type:String,default:"40px"},loadingHeight:{type:String,default:"40px"},size:{type:String,values:q2,default:"middle"},width:{type:String},height:{type:String},color:{type:String},direction:{type:String,values:J2,default:"row"},shape:{type:String,values:Q2},buttonStyle:{type:Object},buttonTextStyle:{type:Object}},X2={options:{virtualHost:!0}},e1=ge(Z(F({},X2),{__name:"Button",props:Z2,emits:["click"],setup(i,{emit:e}){const t=i,n=`${Qe}-button--content`,s=ie(()=>F({width:t.width,height:t.height,backgroundColor:t.color,flexDirection:t.direction,cursor:us?"pointer":"auto"},t.buttonStyle)),r=Et([`${Qe}-button`,{[`${Qe}-${t.shape}`]:t.shape},`${Qe}-button--${t.size}`]),o=e,a=l=>{!t.loading&&o("click",l)};return(l,c)=>(w(),G("div",{style:Ze([v(s)]),class:fe(v(r)),onClick:a},[l.loading?(w(),ne(pl,{key:0,loadingWidth:l.loadingWidth,loadingHeight:l.loadingHeight,color:l.loadingColor},null,8,["loadingWidth","loadingHeight","color"])):X("",!0),l.iconSrc&&!l.loading?(w(),ne(Ds,{key:1,size:l.iconSize,src:l.iconSrc},null,8,["size","src"])):X("",!0),l.text?(w(),G("div",{key:2,style:Ze([l.buttonTextStyle]),class:fe(n)},ae(l.text),5)):X("",!0)],6))}})),cn=ve(e1,[["__scopeId","data-v-f551904c"]]),Aa="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M30%2016.0509C30%2013.8146%2028.7722%2011.7194%2026.6855%2010.915C23.0591%209.51726%2019.119%208.75098%2015%208.75098C10.8809%208.75098%206.94086%209.51726%203.31453%2010.915C1.22784%2011.7194%200%2013.8146%200%2016.0509V19.6476C0%2020.5153%200.734003%2021.202%201.59978%2021.1443L7.97478%2020.7193C8.76272%2020.6668%209.375%2020.0123%209.375%2019.2226V16.209C9.375%2015.8564%209.62034%2015.5503%209.96644%2015.4831C11.5955%2015.1667%2013.2784%2015.001%2015%2015.001C16.7216%2015.001%2018.4045%2015.1667%2020.0336%2015.4831C20.3797%2015.5503%2020.625%2015.8564%2020.625%2016.209V19.2226C20.625%2020.0123%2021.2373%2020.6668%2022.0252%2020.7193L28.4002%2021.1443C29.266%2021.202%2030%2020.5153%2030%2019.6476V16.0509Z'%20fill='white'/%3e%3c/svg%3e",bd="data:image/svg+xml,%3csvg%20width='26'%20height='20'%20viewBox='0%200%2026%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.9165%208.19978H9.7665V7.34978V5.64978V4.79978H8.9165H4.83317H3.98317V5.64978V7.34978V8.19978H4.83317H8.9165ZM1.0165%201.66662C1.0165%201.58378%201.08366%201.51663%201.1665%201.51663H17.8332C17.916%201.51663%2017.9832%201.58378%2017.9832%201.66663V18.3333C17.9832%2018.4161%2017.916%2018.4833%2017.8332%2018.4833H1.1665C1.08366%2018.4833%201.0165%2018.4161%201.0165%2018.3333V1.66662ZM21.2143%205.02224C21.2143%204.96396%2021.248%204.91096%2021.3008%204.88631L24.7696%203.26756C24.869%203.22115%2024.983%203.29375%2024.983%203.40349L24.983%2016.5964C24.983%2016.7062%2024.869%2016.7788%2024.7696%2016.7324L21.3008%2015.1136C21.248%2015.089%2021.2143%2015.036%2021.2143%2014.9777L21.2143%205.02224Z'%20fill='%2322262E'%20stroke='%2322262E'%20stroke-width='1.7'%20stroke-linecap='round'/%3e%3c/svg%3e",Rd="/assets/camera-close-dQetL_xG.svg",Od="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2015.625V13.75H6V15.625C6%2020.5956%2010.0294%2024.625%2015%2024.625C19.9706%2024.625%2024%2020.5956%2024%2015.625V13.75H26V15.625C26%2021.363%2021.6065%2026.0749%2016%2026.5802V30H14V26.5802C8.3935%2026.0749%204%2021.363%204%2015.625Z'%20fill='%2322262E'/%3e%3crect%20x='8.75'%20y='1.25'%2
60width='12.5'%20height='20.625'%20rx='6.25'%20fill='%2322262E'/%3e%3c/svg%3e",Dd="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.75%207.5C8.75%204.04822%2011.5482%201.25%2015%201.25C16.9758%201.25%2018.7376%202.16686%2019.8829%203.59834L8.87248%2016.8624C8.79215%2016.4624%208.75%2016.0486%208.75%2015.625V7.5ZM6.80567%2019.3523C6.28825%2018.2166%206%2016.9544%206%2015.625V13.75H4V15.625C4%2017.5882%204.51431%2019.4313%205.41555%2021.0269L6.80567%2019.3523ZM9.21177%2024.9807L10.5044%2023.4235C11.8272%2024.1877%2013.3625%2024.625%2015%2024.625C19.9706%2024.625%2024%2020.5956%2024%2015.625V13.75H26V15.625C26%2021.363%2021.6065%2026.0749%2016%2026.5802V30H14V26.5802C12.2543%2026.4228%2010.6262%2025.8577%209.21177%2024.9807ZM12.2983%2021.2625L21.25%2010.4784V15.625C21.25%2019.0768%2018.4518%2021.875%2015%2021.875C14.0323%2021.875%2013.116%2021.6551%2012.2983%2021.2625Z'%20fill='white'%20style='fill:white;fill:white;fill-opacity:1;'/%3e%3cpath%20d='M6.41895%2024.084L22.0939%205.20938'%20stroke='white'%20style='stroke:white;stroke:white;stroke-opacity:1;'%20stroke-width='2'%20stroke-linecap='square'%20stroke-linejoin='round'/%3e%3c/svg%3e",Md="data:image/svg+xml,%3csvg%20width='28'%20height='26'%20viewBox='0%200%2028%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.1351%200.372864L21.0007%200.87359C25.1827%203.29275%2028%207.81679%2028%2013C28%2018.1833%2025.1827%2022.7073%2021.0007%2025.1265L20.1351%2025.6272L19.1336%2023.896L19.9992%2023.3953C23.5887%2021.3189%2026%2017.4405%2026%2013C26%208.55959%2023.5887%204.68117%2019.9992%202.6048L19.1336%202.10408L20.1351%200.372864ZM13.6448%201.38893C14.3517%200.86327%2015.3556%201.36779%2015.3556%202.24869V23.7514C15.3556%2024.6323%2014.3517%2025.1368%2013.6448%2024.6111L6.9957%2019.6665C6.81087%2019.529%206.58667%2019.4548%206.35634%2019.4548H1.2516C0.659871%2019.4548%200.180176%2018.9751%200.180176%2018.3834V7.63411C0.180176%207.04371%200.65779%206.56457%201.24819%206.56269L6.35824%206.54639C6.5874%206.54566%206.81029%206.47147%206.99418%206.33472L13.6448%201.38893ZM19.5553%206.1684L18.7237%205.61304L17.613%207.27626L18.4446%207.83162C19.9368%208.82815%2021%2010.7411%2021%2013C21%2015.2589%2019.9368%2017.1719%2018.4446%2018.1684L17.613%2018.7238L18.7237%2020.387L19.5553%2019.8316C21.6499%2018.4328%2023%2015.8688%2023%2013C23%2010.1312%2021.6499%207.56717%2019.5553%206.1684Z'%20fill='%232E333D'/%3e%3c/svg%3e",kd="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.3602%2022.8416L14.5947%2026.4025C15.2916%2026.9886%2016.3557%2026.4931%2016.3557%2025.5825V15.619L10.3602%2022.8416ZM23.7162%206.75187L25.0014%205.20364C27.4741%207.72791%2029%2011.1855%2029%2015C29%2020.1833%2026.1827%2024.7073%2022.0007%2027.1265L21.1351%2027.6272L20.1337%2025.896L20.9993%2025.3953C24.5887%2023.3189%2027%2019.4405%2027%2015C27%2011.806%2025.7524%208.90282%2023.7162%206.75187ZM20.4377%2010.7014L21.7262%209.14917C23.1393%2010.6132%2024%2012.7094%2024%2015C24%2017.8689%2022.65%2020.4329%2020.5554%2021.8316L19.7238%2022.387L18.6131%2020.7238L19.4447%2020.1684C20.9369%2019.1719%2022%2017.2589%2022%2015C22%2013.2842%2021.3866%2011.768%2020.4377%2010.7014ZM16.3557%206.48288L3.92759%2021.4548H2.25167C1.65993%2021.4548%201.18024%2020.9751%201.18024%2020.3834V9.63459C1.18024%209.04401%201.65813%208.56479%202.2487%208.56316L8.32218%208.54636C8.57345%208.54567%208.81649%208.45668%209.0088%208.29496L14.5947%203.59761C15.2916%203.01151%2016.3557%203.50699%2016.3557%204.41763V6.48288Z'%20fill='white'/%3e%3cpath%20d='M4.56372%2025.2683L22.1407%204.08365'%20stroke='white'%20stroke-width='2'%20stroke-linecap='square'%20stroke-linejoin='round'/%3e%3c/svg%3e",t1="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20opacity='0.5'%20cx='15'%20cy='15'%20r='15'%20fill='%2322262E'%20style='fill:%2322262E;fill:color(display-p3%200.1333%200.1490%200.1804);fill-opacity:1;'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.516%2017.4516C20.6682%2017.6118%2020.6617%2017.865%2020.5015%2018.0171L19.6315%2018.8436C19.4713%2018.9958%2019.2182%2018.9893%2019.066%2018.8291L14.9999%2014.549L10.9339%2018.8291C10.7818%2018.9893%2010.5286%2018.9958%2010.3684%2018.8436L9.49842%2018.0172C9.33826%2017.865%209.33176%2017.6118%209.48391%2017.4517L14.5165%2012.1539C14.7793%2011.8773%2015.2203%2011.8772%2015.4832%2012.1539L20.516%2017.4516Z'%20fill='white'%20style='fill:white;fill:white;fill-opacity:1;'/%3e%3c/svg%3e",n1="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_22_1697)'%3e%3cpath%20d='M4.16182%205.67699C2.58049%207.25832%201.96718%209.60805%202.87395%2011.6523C4.44977%2015.2049%206.69399%2018.5328%209.6066%2021.4454C12.5192%2024.358%2015.8471%2026.6022%2019.3997%2028.1781C21.444%2029.0848%2023.7937%2028.4715%2025.375%2026.8902L27.9183%2024.3469C28.5319%2023.7333%2028.4984%2022.7288%2027.8454%2022.1574L23.0371%2017.9501C22.4428%2017.4301%2021.5471%2017.4599%2
6020.9887%2018.0183L18.8577%2020.1493C18.6084%2020.3986%2018.2184%2020.4415%2017.9262%2020.2443C16.5505%2019.3161%2015.2434%2018.2433%2014.026%2017.026C12.8087%2015.8086%2011.7359%2014.5015%2010.8077%2013.1258C10.6105%2012.8336%2010.6534%2012.4436%2010.9027%2012.1943L13.0337%2010.0633C13.5921%209.50494%2013.6219%208.60923%2013.1019%208.01493L8.89464%203.2066C8.32325%202.55359%207.31867%202.52014%206.70511%203.1337L4.16182%205.67699Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_22_1697'%3e%3crect%20width='30'%20height='30'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ii="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1%202C1%201.44772%201.44772%201%202%201H26C26.5523%201%2027%201.44772%2027%202V26C27%2026.5523%2026.5523%2027%2026%2027H2C1.44772%2027%201%2026.5523%201%2026V2ZM15.6528%2016.8013C17.1385%2016.1608%2018.1786%2014.683%2018.1786%2012.9624C18.1786%2010.6546%2016.3078%208.7838%2014%208.7838C11.6922%208.7838%209.82143%2010.6546%209.82143%2012.9624C9.82143%2014.683%2010.8615%2016.1608%2012.3472%2016.8013H12.1429C9.06584%2016.8013%206.57143%2019.2957%206.57143%2022.3728V24.6228C6.57143%2025.175%207.01914%2025.6228%207.57143%2025.6228H20.4286C20.9809%2025.6228%2021.4286%2025.175%2021.4286%2024.6228V22.3728C21.4286%2019.2957%2018.9342%2016.8013%2015.8571%2016.8013H15.6528ZM2.39286%207.62094L7.62094%202.39286H9.85337L2.39286%209.85337V7.62094ZM2.39286%2015.751V13.5185L13.5185%202.39286H15.751L2.39286%2015.751ZM2.39286%2021.6486V19.4161L7.85185%2013.9571C7.91394%2014.583%208.0694%2015.1811%208.30396%2015.7375L2.39286%2021.6486ZM16.3978%207.64363C15.8412%207.40904%2015.243%207.25365%2014.6174%207.19157L19.4161%202.39286H21.6486L16.3978%207.64363ZM2.83951%2024.8671L4.57139%2023.1352V25.0001C4.57139%2025.1176%204.57815%2025.2336%204.59131%2025.3477L4.33274%2025.6063C3.73014%2025.5885%203.19445%2025.3041%202.83951%2024.8671ZM18.5485%209.15806C18.9099%209.55094%2019.221%209.99075%2019.4717%2010.4673L25.6063%204.33274C25.5885%203.73014%2025.3041%203.19445%2024.8671%202.83951L18.5485%209.15806ZM19.5184%2016.1212C19.5606%2016.1445%2019.6025%2016.1682%2019.6442%2016.1924L25.6071%2010.2294V7.997L20.1779%2013.4262C20.1646%2014.3952%2019.9283%2015.3097%2019.5184%2016.1212ZM21.6396%2017.8621C21.9852%2018.2706%2022.2883%2018.7162%2022.5421%2019.192L25.6071%2016.127V13.8946L21.6396%2017.8621ZM23.4285%2022.7501V24.2032L25.6071%2022.0246V19.7922L23.3925%2022.0068C23.4163%2022.2513%2023.4285%2022.4993%2023.4285%2022.7501Z'%20fill='white'/%3e%3c/svg%3e",ba="data:image/svg+xml,%3csvg%20width='26'%20height='26'%20viewBox='0%200%2026%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0%201C0%200.447716%200.447715%200%201%200H25C25.5523%200%2026%200.447715%2026%201V25C26%2025.5523%2025.5523%2026%2025%2026H1C0.447716%2026%200%2025.5523%200%2025V1ZM13%2014C15.3078%2014%2017.1786%2012.1292%2017.1786%209.82143C17.1786%207.51367%2015.3078%205.64286%2013%205.64286C10.6922%205.64286%208.82143%207.51367%208.82143%209.82143C8.82143%2012.1292%2010.6922%2014%2013%2014ZM11.1429%2015.3459C8.06584%2015.3459%205.57143%2017.8403%205.57143%2020.9174V23.1674C5.57143%2023.7196%206.01914%2024.1674%206.57143%2024.1674H19.4286C19.9809%2024.1674%2020.4286%2023.7196%2020.4286%2023.1674V20.9174C20.4286%2017.8403%2017.9342%2015.3459%2014.8571%2015.3459L13%2018.0193L11.1429%2015.3459ZM1.39286%208.03553L8.03553%201.39286H10.268L1.39286%2010.268V8.03553ZM1.39286%2020.268V18.0355L8.03466%2011.3937L9.15088%2012.5099L1.39286%2020.268ZM24.6071%2014.8212V17.0537L22.134%2019.5269L21.0177%2018.4106L24.6071%2014.8212ZM24.6071%204.82129V7.05373L17.5149%2014.146L16.3987%2013.0298L24.6071%204.82129ZM20.268%201.39286L16.3726%205.28821L15.2564%204.17199L18.0355%201.39286H20.268Z'%20fill='black'%20style='fill:black;fill-opacity:1;'/%3e%3c/svg%3e",i1="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.66683%209.33337H3.3335V4.00004C3.3335%203.63185%203.63197%203.33337%204.00016%203.33337L9.3335%203.33337V4.66671H5.60963L9.8049%208.86199L8.86209%209.8048L4.66683%205.60952V9.33337ZM15.3333%2010.6667H16.6667V16C16.6667%2016.3682%2016.3682%2016.6667%2016%2016.6667L10.6667%2016.6667L10.6667%2015.3333H14.3905L10.1953%2011.138L11.1381%2010.1952L15.3333%2014.3905V10.6667Z'%20fill='white'/%3e%3cpath%20d='M0.666667%201.33333C0.666667%200.965144%200.965144%200.666667%201.33333%200.666667H18.6667C19.0349%200.666667%2019.3333%200.965144%2019.3333%201.33333V18.6667C19.3333%2019.0349%2019.0349%2019.3333%2018.6667%2019.3333H1.33333C0.965143%2019.3333%200.666667%2019.0349%200.666667%2018.6667V1.33333Z'%20stroke='white'%20stroke-width='1.33333'/%3e%3c/svg%3e",s1="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.769231'%20y='0.769231'%20width='18.4615'%20height='18.4615'%20rx='0.769231'%20stroke='white'%20stroke-width='1.53846'/%3e%3cpath%20d='M11.5385%2012.3077C11.5385%2011.8829%2011.8829%2011.5385%2012.3077%2011.5385H19.2308V18.4615C19.2308%2018.8864%2018.8864%2019.2308%2018.4616%2019.2308H11.5385V12.3077Z'%20stroke='white'%20stroke-width='1.53846'/%3e%3cpath%20d='M0.769287%200.769226L8.9723%208.92412'%20stroke='white'%20stroke-width='1.53846'/%3e%3cpath%20d='M9.4967%204.71716V9.4486H4.74146'%20stroke='white'%20stroke-width='1.53846'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",r1="data:image/svg+xml,%3csvg%20t='1708400849531'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8267'%20width='200'%20height='200'%3e%3cpath%20d='M121.51%20460.15h779.64v100.6H121.51z'%20p-id='8268'%20fill='%23ffffff'%3e%3c/path%3e%3cpath%20d='M461.035%20900.271v-779.64h100.6v779.64z'%20p-id='8269'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",o1="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.49991%204H2.99991C2.44762%2
604%201.99991%204.44772%201.99991%205V17C1.99991%2017.5523%202.44762%2018%202.99991%2018H14.9999C15.5522%2018%2015.9999%2017.5523%2015.9999%2017V11.5'%20stroke='%23D5E0F2'%20stroke-width='1.5'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.4999%203.5V8.5H16.4999V3.5H11.4999ZM10.9999%202C10.4476%202%209.99991%202.44772%209.99991%203V9C9.99991%209.55228%2010.4476%2010%2010.9999%2010H16.9999C17.5522%2010%2017.9999%209.55228%2017.9999%209V3C17.9999%202.44772%2017.5522%202%2016.9999%202H10.9999Z'%20fill='%23D5E0F2'/%3e%3c/svg%3e",Ci="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M25.0184%205.76336C26.1229%205.76336%2027.0184%206.65879%2027.0184%207.76336V23.2909C27.0184%2024.3955%2026.1229%2025.2909%2025.0184%2025.2909H2.98163C1.87706%2025.2909%200.981628%2024.3955%200.981628%2023.2909V7.76336C0.981628%206.65879%201.87706%205.76336%202.98163%205.76336H7.2436C7.81488%205.76336%208.35888%205.51907%208.73842%205.09209L10.1487%203.5055C10.5283%203.07852%2011.0723%202.83423%2011.6435%202.83423H14H16.3565C16.9277%202.83423%2017.4717%203.07852%2017.8513%203.5055L19.2616%205.09209C19.6411%205.51907%2020.1851%205.76336%2020.7564%205.76336H25.0184ZM11.7229%209.58495C12.3994%209.31602%2013.1377%209.16846%2013.9091%209.16846C15.6277%209.16846%2017.1788%209.90132%2018.25%2011.071V9.91846H19.75V14.9138L19.75%2014.9185H18.25L18.25%2014.9144C18.2478%2012.5817%2016.3179%2010.6685%2013.9091%2010.6685C13.3302%2010.6685%2012.7797%2010.779%2012.2771%2010.9788L11.7229%209.58495ZM8.25%2019.9185V14.9185H9.75C9.75%2017.253%2011.6807%2019.1685%2014.0909%2019.1685C14.6698%2019.1685%2015.2203%2019.0579%2015.7229%2018.8581L16.2771%2020.252C15.6006%2020.5209%2014.8623%2020.6685%2014.0909%2020.6685C12.3723%2020.6685%2010.8212%2019.9356%209.75%2018.766V19.9185H8.25Z'%20fill='white'/%3e%3c/svg%3e",a1="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_b_2584_236)'%3e%3cmask%20id='path-1-inside-1_2584_236'%20fill='white'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.5%2011.0505C12.9853%2011.0505%2015%209.03582%2015%206.55054C15%204.06526%2012.9853%202.05054%2010.5%202.05054C8.01472%202.05054%206%204.06526%206%206.55054C6%209.03582%208.01472%2011.0505%2010.5%2011.0505ZM8.5%2012.5001C5.18629%2012.5001%202.5%2015.1864%202.5%2018.5001V21.0001C2.5%2021.5523%202.94772%2022.0001%203.5%2022.0001H17.5C18.0523%2022.0001%2018.5%2021.5523%2018.5%2021.0001V18.5001C18.5%2015.1864%2015.8137%2012.5001%2012.5%2012.5001L10.5%2015.3791L8.5%2012.5001Z'/%3e%3c/mask%3e%3cpath%20d='M8.5%2012.5001L9.89617%2011.5302L9.38899%2010.8001H8.5V12.5001ZM12.5%2012.5001V10.8001H11.611L11.1038%2011.5302L12.5%2012.5001ZM10.5%2015.3791L9.10383%2016.349L10.5%2018.3588L11.8962%2016.349L10.5%2015.3791ZM13.3%206.55054C13.3%208.09693%2012.0464%209.35054%2010.5%209.35054V12.7505C13.9242%2012.7505%2016.7%209.9747%2016.7%206.55054H13.3ZM10.5%203.75054C12.0464%203.75054%2013.3%205.00414%2013.3%206.55054H16.7C16.7%203.12637%2013.9242%200.350537%2010.5%200.350537V3.75054ZM7.7%206.55054C7.7%205.00414%208.9536%203.75054%2010.5%203.75054V0.350537C7.07583%200.350537%204.3%203.12637%204.3%206.55054H7.7ZM10.5%209.35054C8.9536%209.35054%207.7%208.09693%207.7%206.55054H4.3C4.3%209.9747%207.07583%2012.7505%2010.5%2012.7505V9.35054ZM4.2%2018.5001C4.2%2016.1252%206.12518%2014.2001%208.5%2014.2001V10.8001C4.24741%2010.8001%200.8%2014.2475%200.8%2018.5001H4.2ZM4.2%2021.0001V18.5001H0.8V21.0001H4.2ZM3.5%2020.3001C3.8866%2020.3001%204.2%2020.6135%204.2%2021.0001H0.8C0.8%2022.4912%202.00883%2023.7001%203.5%2023.7001V20.3001ZM17.5%2020.3001H3.5V23.7001H17.5V20.3001ZM16.8%2021.0001C16.8%2020.6135%2017.1134%2020.3001%2017.5%2020.3001V23.7001C18.9912%2023.7001%2020.2%2022.4912%2020.2%2021.0001H16.8ZM16.8%2018.5001V21.0001H20.2V18.5001H16.8ZM12.5%2014.2001C14.8748%2014.2001%2016.8%2016.1252%2016.8%2018.5001H20.2C20.2%2014.2475%2016.7526%2010.8001%2012.5%2010.8001V14.2001ZM11.8962%2016.349L13.8962%2013.47L11.1038%2011.5302L9.10383%2014.4092L11.8962%2016.349ZM7.10383%2013.47L9.10383%2016.349L11.8962%2014.4092L9.89617%2011.5302L7.10383%2013.47Z'%20fill='%23D5E0F2'%20mask='url(%23path-1-inside-1_2584_236)'/%3e%3c/g%3e%3cpath%20d='M16%2011H23M19.5%207.5V14.5'%20stroke='%23D5E0F2'%20stroke-width='1.7'/%3e%3cdefs%3e%3cfilter%20id='filter0_b_2584_236'%20x='-5.5'%20y='-5.94946'%20width='32'%20height='35.9495'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='Backgroun
6dImageFix'/%3e%3cfeGaussianBlur%20in='BackgroundImageFix'%20stdDeviation='4'/%3e%3cfeComposite%20in2='SourceAlpha'%20operator='in'%20result='effect1_backgroundBlur_2584_236'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_backgroundBlur_2584_236'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",l1="data:image/svg+xml,%3csvg%20width='30'%20height='30'%20viewBox='0%200%2030%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20opacity='0.5'%20cx='15'%20cy='15'%20r='15'%20fill='%2322262E'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.48375%2014.3133C9.3316%2014.1531%209.33809%2013.8999%209.49825%2013.7478L10.3683%2012.9213C10.5284%2012.7691%2010.7816%2012.7756%2010.9338%2012.9358L14.9999%2017.2159L19.0658%2012.9358C19.218%2012.7756%2019.4711%2012.7691%2019.6313%2012.9213L20.5013%2013.7477C20.6615%2013.8999%2020.668%2014.1531%2020.5158%2014.3132L15.4833%2019.611C15.2204%2019.8876%2014.7794%2019.8876%2014.5166%2019.611L9.48375%2014.3133Z'%20fill='white'/%3e%3c/svg%3e",Nt=!it.isPC;let Nd=o1,xd=a1;Nt||(Nd=s1,xd=r1);const ft={width:Nt?"60px":"40px",height:Nt?"60px":"40px",shape:"circle",iconSize:Nt?30:20,showText:!0,textColor:"#D5E0F2",textSize:"12px",textStyle:{marginTop:"5px"}},Ne={accept:{basicConfig:Z(F({},ft),{color:"#51C271",iconSrc:n1}),loadingConfig:Z(F({},ft),{color:"#51C271",loadingWidth:Nt?"30px":"20px",loadingHeight:Nt?"30px":"20px"})},hangup:{basicConfig:Z(F({},ft),{color:"#ED4651",iconSrc:Aa}),loadingConfig:Z(F({},ft),{color:"#ED4651",loadingWidth:Nt?"30px":"20px",loadingHeight:Nt?"30px":"20px"})},reject:{basicConfig:Z(F({},ft),{color:"#ED4651",iconSrc:Aa})},camera:{basicConfig:Z(F({},ft),{color:"#FFFFFF",iconSrc:bd,shape:"circle"}),closedConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Rd}),loadingConfig:Z(F({},ft),{color:"#6b758a4d",loadingWidth:Nt?"30px":"20px",loadingHeight:Nt?"30px":"20px"})},microphone:{basicConfig:Z(F({},ft),{color:"#FFFFFF",iconSrc:Od}),closedConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Dd})},speaker:{basicConfig:Z(F({},ft),{color:"#FFFFFF",iconSrc:Md}),closedConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:kd})},fullScreen:{basicConfig:{iconSize:20,iconSrc:i1}},minimize:{basicConfig:{iconSize:Nt?24:20,iconSrc:Nd}},switchCamera:{basicConfig:Z(F({},ft),{color:"transparent",iconSrc:Ci,shape:"circle"})},inviteUser:{basicConfig:Z(F({},ft),{color:Nt?"":"#6b758a4d",width:Nt?"24px":"40px",height:Nt?"24px":"40px",shape:Nt?"":"circle",iconSize:Nt?24:20,iconSrc:xd})},toggleButtonPanel:{basicConfig:{color:"transparent",width:"40px",height:"40px",shape:"circle",iconSize:40,iconSrc:l1}},virtualBackground:{basicConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ii,shape:"circle"}),closedConfig:Z(F({},ft),{color:"#FFFFFF",iconSrc:ba}),loadingConfig:Z(F({},ft),{color:"#6b758a4d",loadingWidth:Nt?"30px":"20px",loadingHeight:Nt?"30px":"20px"}),disableConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ii,buttonStyle:{opacity:.6}})}},mi={singleCall:{video:{calling:Z(F({},Ne),{switchCamera:{basicConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ci,shape:"circle",showText:!0}),disableConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ci,shape:"circle",showText:!0,buttonStyle:{opacity:.6}})},hangup:{basicConfig:F({},Ne.hangup.basicConfig),loadingConfig:F({},Ne.hangup.loadingConfig)},reject:{basicConfig:Z(F({},Ne.reject.basicConfig),{showText:!1})}}),accept:Z(F({},Ne),{switchCamera:{basicConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ci,shape:"circle"}),disableConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ci,shape:"circle",showText:!0,buttonStyle:{opacity:.6}})},accept:{basicConfig:Z(F({},Ne.accept.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.accept.loadingConfig),{showText:!1})},reject:{basicConfig:Z(F({},Ne.reject.basicConfig),{showText:!1})}}),connected:Z(F({},Ne),{virtualBackground:{basicConfig:Z(F({},ft),{color:"transparent",iconSrc:Ii,shape:"circle",showText:!1}),closedConfig:Z(F({},ft),{color:"transparent",iconSrc:Ii,showText:!1}),disableConfig:Z(F({},ft),{color:"transparent",iconSrc:Ii,showText:!1,buttonStyle:{opacity:.6}})},hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})},switchCamera:{basicConfig:Z(F({},Ne.switchCamera.basicConfig),{showText:!1}),disableConfig:Z(F({},Ne.switchCamera.basicConfig),{showText:!1,buttonStyle:{opacity:.6}})}})},audio:{calling:Ne,accept:Ne,connected:Ne}},groupCall:{video:{calling:Z(F({},Ne),{switchCamera:{basicConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ci,shape:"circle"})},hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})},accept:{basicConfig:Z(F({},Ne.accept.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.accept.loadingConfig),{showText:!1})},reject:{basicConfig:Z(F({},Ne.reject.basicConfig),{showText:!1})}}),accept:Z(F({},Ne),{hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})},accept:{basicConfig:Z(F({},Ne.accept.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.accept.loadingConfig),{showText:!1})},reject:{basicConfig:Z(F({},Ne.reject.basicConfig),{showText:!1})}}),connected:Z(F({}
6,Ne),{virtualBackground:{basicConfig:Z(F({},ft),{color:"transparent",iconSrc:Ii,shape:"circle",showText:!1}),closedConfig:Z(F({},ft),{color:"transparent",iconSrc:ba,showText:!1})},hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})}})},audio:{calling:Z(F({},Ne),{switchCamera:{basicConfig:Z(F({},ft),{color:"#6b758a4d",iconSrc:Ci,shape:"circle"})},hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})},accept:{basicConfig:Z(F({},Ne.accept.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.accept.loadingConfig),{showText:!1})},reject:{basicConfig:Z(F({},Ne.reject.basicConfig),{showText:!1})}}),accept:Z(F({},Ne),{hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})},accept:{basicConfig:Z(F({},Ne.accept.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.accept.loadingConfig),{showText:!1})},reject:{basicConfig:Z(F({},Ne.reject.basicConfig),{showText:!1})}}),connected:Z(F({},Ne),{hangup:{basicConfig:Z(F({},Ne.hangup.basicConfig),{showText:!1}),loadingConfig:Z(F({},Ne.hangup.loadingConfig),{showText:!1})},virtualBackground:{basicConfig:Z(F({},ft),{color:"transparent",iconSrc:Ii,shape:"circle"}),closedConfig:Z(F({},ft),{color:"transparent",iconSrc:ba})}})}}},c1={singleCall:{video:{calling:Ne,accept:Ne,connected:Ne},audio:{calling:Ne,accept:Ne,connected:Ne}},groupCall:{video:{calling:Ne,accept:Ne,connected:Ne},audio:{calling:Ne,accept:Ne,connected:Ne}}},u1={pc:c1,mobile:mi},pi={width:"40px",height:"40px",shape:"circle",iconSize:20,textColor:"#D5E0F2"},Or={microphone:{basicConfig:Z(F({},pi),{color:"#FFFFFF",iconSrc:Od}),closedConfig:Z(F({},pi),{color:"#6b758a4d",iconSrc:Dd})},speaker:{basicConfig:Z(F({},pi),{color:"#FFFFFF",iconSrc:Md}),closedConfig:Z(F({},pi),{color:"#6b758a4d",iconSrc:kd})},camera:{basicConfig:Z(F({},pi),{color:"#FFFFFF",iconSrc:bd}),closedConfig:Z(F({},pi),{color:"#6b758a4d",iconSrc:Rd})},hangup:{basicConfig:Z(F({},pi),{color:"#ED4651",iconSrc:Aa}),loadingConfig:Z(F({},pi),{color:"#ED4651",loadingWidth:"20px",loadingHeight:"20px"})},toggleButtonPanel:{basicConfig:{color:"transparent",width:"40px",height:"40px",shape:"circle",iconSize:40,iconSrc:t1}}},d1={mobile:Z(F({},mi),{groupCall:{video:Z(F({},mi.groupCall.video),{calling:F(F({},mi.groupCall.video.calling),Or),connected:F(F({},mi.groupCall.video.connected),Or)}),audio:Z(F({},mi.groupCall.audio),{calling:F(F({},mi.groupCall.audio.calling),Or),connected:F(F({},mi.groupCall.audio.connected),Or)})}})},_n=(i,e)=>{var c;const t=it.isPC?"pc":"mobile",{status:n}=Cr(),{callStatus:s,callRole:r,isGroupCall:o,callType:a}=$e(Lt()),l=P((c=Ne==null?void 0:Ne[i])==null?void 0:c[e.value]);return Ye([e,n,s,o,a],()=>{var g,h,m,y,R;const u=o.value?"groupCall":"singleCall",f=a.value===rt.AUDIO?"audio":"video";let d="";s.value===Be.CALLING?d=r.value===Dt.CALLER?"calling":"accept":s.value===Be.CONNECTED&&(d="connected");let p=u1;n.value==="close"&&(p=d1),l.value=((R=(y=(m=(h=(g=p==null?void 0:p[t])==null?void 0:g[u])==null?void 0:h[f])==null?void 0:m[d])==null?void 0:y[i])==null?void 0:R[e.value])||{}},{immediate:!0}),l},f1={options:{virtualHost:!0}},h1=ge(Z(F({},f1),{__name:"Minimize",setup(i){const e=_n("minimize",P("basicConfig")),t=()=>ye(this,null,function*(){if(document!=null&&document.fullscreenElement)try{document==null||document.exitFullscreen()}catch(n){}yield We.toggleMinimize()});return(n,s)=>(w(),ne(cn,{iconSrc:v(e).iconSrc,iconSize:v(e).iconSize,onClick:t},null,8,["iconSrc","iconSize"]))}})),lc=ve(h1,[["__scopeId","data-v-944f59d1"]]),p1={options:{virtualHost:!0}},g1=ge(Z(F({},p1),{__name:"FullScreen",setup(i){const e=_n("fullScreen",P("basicConfig")),t=()=>ye(this,null,function*(){yield Kp("tuicallkit-id")});return(n,s)=>(w(),ne(cn,{iconSrc:v(e).iconSrc,iconSize:v(e).iconSize,onClick:t},null,8,["iconSrc","iconSize"]))}})),m1=ve(g1,[["__scopeId","data-v-d8d77e6d"]]),v1={width:{type:String},color:{type:String},size:{type:String},weight:{type:Number},truncated:{type:Boolean,default:!1},lineClamp:{type:Number},textStyle:{type:Object}},C1={options:{virtualHost:!0}},_1=ge(Z(F({},C1),{__name:"TKText",props:v1,emits:["click"],setup(i,{emit:e}){const t=i,n=e,s=Et([`${Qe}-text`,{[`${Qe}-text--line-clamp`]:t.lineClamp}
6]),r=ie(()=>Qr(F({maxWidth:t.width,fontSize:t.size,fontWeight:t.weight,color:t.color,textOverflow:t.truncated?"ellipsis":"auto","-webkit-line-clamp":t.lineClamp},t.textStyle))),o=()=>{n("click")};return(a,l)=>(w(),G("span",{class:fe(v(s)),style:Ze([v(r)]),onClick:o},[Ve(a.$slots,"default",{},void 0,!0)],6))}})),Mt=ve(_1,[["__scopeId","data-v-8080ee37"]]),hi={width:{type:String},height:{type:String},showText:{type:Boolean,default:!0},iconSize:{type:String}},y1={options:{virtualHost:!0}},I1=ge(Z(F({},y1),{__name:"InviteUser",props:hi,setup(i){const e=i,t=_n("inviteUser",P("basicConfig")),n=()=>ye(this,null,function*(){le.update(j.CALL,N.SHOW_SELECT_USER,!0)});return(s,r)=>(w(),G("div",{class:"btn-content"},[Y(cn,{iconSrc:v(t).iconSrc,color:v(t).color,iconSize:v(t).iconSize,width:e.width||v(t).width,height:e.height||v(t).height,shape:v(t).shape,onClick:n},null,8,["iconSrc","color","iconSize","width","height","shape"]),s.showText?(w(),ne(Mt,{key:0,textStyle:v(t).textStyle,color:v(t).textColor,size:v(t).textSize},{default:re(()=>[qe(ae(v(Ge)("invite member")),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Ud=ve(I1,[["__scopeId","data-v-22f19b7e"]]),E1={color:{type:String,default:"#FFF"},callDuration:{type:String,default:""},fontSize:{type:String,default:"16px"}},S1={options:{virtualHost:!0}},Zr=ge(Z(F({},S1),{__name:"Timer",props:E1,setup(i){const e=i,t=ie(()=>({color:e.color,fontSize:e.fontSize}));return(n,s)=>(w(),G("span",{style:Ze([v(t)])},ae(n.callDuration),5))}})),T1={options:{virtualHost:!0}},L1=ge(Z(F({},T1),{__name:"TopBar",props:d2,setup(i){const e=it.isPC,{callStatus:t,isGroupCall:n,callRole:s,allowedFullScreen:r}=$e(Lt()),{callDuration:o}=hl(),a=_r(),l=ie(()=>t.value===Be.CONNECTED),c=P(le.getData(j.CALL,N.ENABLE_FLOAT_WINDOW)),u=ie(()=>{var p,g;return!n.value||((g=(p=a.value.button)==null?void 0:p[oi.InviteUser])==null?void 0:g.show)===!1?!1:t.value===Be.CALLING?s.value===Dt.CALLER:!0});function f(p){c.value=p}const d={[N.ENABLE_FLOAT_WINDOW]:f};return et(()=>{le.watch(j.CALL,d,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,F({},d))}),(p,g)=>(w(),G("div",{style:Ze(p.customStyle),class:"top-bar-container"},[v(e)?(w(),ne(Hi,{key:0},{default:re(()=>[Y(Ft,{span:8}),Y(Ft,{span:8,justify:"center",align:"center"},{default:re(()=>[v(l)?(w(),ne(Zr,{key:0,"call-duration":v(o)},null,8,["call-duration"])):X("",!0)]),_:1}),Y(Ft,{span:8,justify:"end",align:"center"},{default:re(()=>[Y(Hi,null,{default:re(()=>[Y(Ft,{span:18}),Y(Ft,{span:3,justify:"center"},{default:re(()=>[v(c)?(w(),ne(lc,{key:0})):X("",!0)]),_:1}),Y(Ft,{span:3,justify:"center"},{default:re(()=>[v(r)?(w(),ne(m1,{key:0})):X("",!0)]),_:1})]),_:1})]),_:1})]),_:1})):X("",!0),v(e)?X("",!0):(w(),ne(Hi,{key:1},{default:re(()=>[Y(Ft,{span:8,align:"center"},{default:re(()=>[Y(Hi,null,{default:re(()=>[Y(Ft,{span:8,justify:"center"},{default:re(()=>[!v(e)&&v(c)?(w(),ne(lc,{key:0})):X("",!0)]),_:1}),Y(Ft,{span:16})]),_:1})]),_:1}),Y(Ft,{span:8,justify:"center",align:"center"},{default:re(()=>[v(l)?(w(),ne(Zr,{key:0,"call-duration":v(o)},null,8,["call-duration"])):X("",!0)]),_:1}),Y(Ft,{span:8,justify:"end",align:"center"},{default:re(()=>[Y(Hi,null,{default:re(()=>[Y(Ft,{span:16}),Y(Ft,{span:8,justify:"center"},{default:re(()=>[v(u)?(w(),ne(Ud,{key:0,"show-text":v(e)},null,8,["show-text"])):X("",!0)]),_:1})]),_:1})]),_:1})]),_:1}))],4))}})),Pd=ve(L1,[["__scopeId","data-v-37dfad97"]]),w1={show:{type:Boolean,default:!0},showMask:{type:Boolean,default:!0},showBackgroundImage:{type:Boolean,default:!0},blur:{type:Boolean,default:!0},bgColor:{type:String},bgImage:{type:String},zIndex:{type:Number,default:11e3},customClass:{type:String},customStyle:{type:Object},customMaskStyle:{type:Object},fit:{type:String,default:"cover"},defaultSrc:{type:String}},A1=["click","error"],b1={options:{virtualHost:!0}},R1=ge(Z(F({},b1),{__name:"Overlay",props:w1,emits:A1,setup(i,{emit:e}){const t=i,n=e,s=Et([`${Qe}-overlay`,t.customClass]),r=`${Qe}-overlay_mask-container`,o=ie(()=>Et([`${Qe}-overlay_mask`,{[`${Qe}-blur`]:t.blur}])),a=`${Qe}-overlay_slot`,l=ie(()=>F({zIndex:t.zIndex},t.customStyle)),c=ie(()=>F({backgroundColor:t.bgColor},t.customMaskStyle));function u(){n("click")}const f=d=>{n("error",d)};return(d,p)=>d.show?(w(),G("div",{key:0,class:fe(v(s)),style:Ze([v(l)]),onClick:u},[q("div",{class:fe(r)},[d.showMask?(w(),G("div",{key:0,class:fe(v(o)),style:Ze([v(c)])}
6,null,6)):X("",!0),d.showBackgroundImage?(w(),ne(Qt,{key:1,fit:d.fit,src:d.bgImage,width:"100%",height:"100%",defaultSrc:d.defaultSrc,onError:f},null,8,["fit","src","defaultSrc"])):X("",!0)]),q("div",{class:fe(a)},[Ve(d.$slots,"default",{},void 0,!0)])],6)):X("",!0)}})),Vd=ve(R1,[["__scopeId","data-v-e685984f"]]),O1=["fill","contain","cover"],D1=["circle","square"],M1={icon:{type:String},size:{type:[Number,String],default:100},shape:{type:String,values:D1,default:"square"},src:{type:String},defaultSrc:{type:String},text:{type:String},fit:{type:String,values:O1,default:"cover"},customClass:{type:String}},k1={options:{virtualHost:!0}},N1=ge(Z(F({},k1),{__name:"Avatar",props:M1,setup(i){const e=i,t=P("");Ye(()=>e.src,()=>{t.value=e.src},{immediate:!0});const n=ie(()=>Et([`${Qe}-avatar`,`${Qe}-avatar--${e.shape}`,`${Qe}-avatar--${e.size}`,e.customClass])),s=ie(()=>typeof e.size=="number"?`${e.size}px`:e.size),r=ie(()=>typeof e.size=="number"?`${e.size}px`:e.size),o=ie(()=>({width:s.value,height:r.value}));function a(l){e.defaultSrc&&(t.value=e.defaultSrc)}return(l,c)=>(w(),G("div",{class:fe(v(n)),style:Ze([v(o)])},[v(t)?(w(),ne(Qt,{key:0,fit:l.fit,width:v(s),height:v(r),src:v(t),onError:a},null,8,["fit","width","height","src"])):Ve(l.$slots,"default",{key:1},void 0,!0)],6))}})),Bd=ve(N1,[["__scopeId","data-v-d935787a"]]),x1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%3e%3crect%20x='11'%20y='20'%20width='2'%20height='4'%20fill='%23fff'%20/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.1499%2011V12.5C3.1499%2017.3877%207.11218%2021.35%2011.9999%2021.35C16.8876%2021.35%2020.8499%2017.3877%2020.8499%2012.5V11H19.1499V12.5C19.1499%2016.4488%2015.9487%2019.65%2011.9999%2019.65C8.05107%2019.65%204.8499%2016.4488%204.8499%2012.5V11H3.1499Z'%20fill='%23fff'/%3e%3crect%20x='7.85'%20y='1.85'%20width='8.3'%20height='14.8'%20rx='4.15'%20stroke='%23fff'%20stroke-width='1.7'/%3e%3c/svg%3e",U1="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.73708%2012.9963C8.71266%2012.8344%208.7%2012.6687%208.7%2012.5V6C8.7%204.17746%2010.1775%202.7%2012%202.7C13.5488%202.7%2014.8484%203.76695%2015.2038%205.20592L16.4458%203.70974C15.615%202.10033%2013.936%201%2012%201C9.23858%201%207%203.23858%207%206V12.5C7%2013.2333%207.15786%2013.9297%207.44145%2014.5572L8.73708%2012.9963ZM11.3385%2015.7337L10.1618%2017.1513C10.7308%2017.3763%2011.3509%2017.5%2012%2017.5C14.7614%2017.5%2017%2015.2614%2017%2012.5V8.9133L15.3%2010.9613V12.5C15.3%2014.3225%2013.8225%2015.8%2012%2015.8C11.7734%2015.8%2011.5522%2015.7772%2011.3385%2015.7337ZM5.96519%2016.3356C5.25933%2015.2273%204.85039%2013.9114%204.85039%2012.5V11H3.15039V12.5C3.15039%2014.4416%203.77562%2016.2371%204.83572%2017.6963L5.96519%2016.3356ZM7.63218%2020.1986L8.7394%2018.8647C9.71718%2019.3667%2010.8257%2019.65%2012.0004%2019.65C15.9492%2019.65%2019.1504%2016.4488%2019.1504%2012.5V11H20.8504V12.5C20.8504%2017.0498%2017.4171%2020.7976%2013%2021.2942V24H11V21.2941C9.78613%2021.1575%208.64658%2020.7754%207.63218%2020.1986Z'%20fill='%23fff'%20/%3e%3cpath%20d='M5.73682%2019.5513L18.2667%204.46371'%20stroke='%23ED414D'%20style='stroke:%23ED414D;stroke:color(display-p3%200.9292%200.2555%200.3004);stroke-opacity:1;'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",P1={isMuted:{type:Boolean,default:!1},volume:{type:Number,default:0}},V1={options:{virtualHost:!0}},B1=ge(Z(F({},V1),{__name:"MicrophoneVolume",props:P1,setup(i){const e=i,t=ie(()=>e.isMuted?U1:x1),n=ie(()=>e.isMuted||!e.volume?"":`height: ${e.volume*4}%`);return(s,r)=>(w(),G("div",{class:"mic-container"},[q("div",{class:"mic-level-container"},[q("div",{class:"mic-level",style:Ze(v(n))},null,4)]),Y(Ds,{src:v(t)},null,8,["src"])]))}})),Fd=ve(B1,[["__scopeId","data-v-0bac5dc4"]]),ai="data:image/svg+xml,%3csvg%20width='100'%20height='100'%20viewBox='0%200%20100%20100'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='-5'%20y='-5'%20width='110'%20height='110'%20fill='url(%23paint0_linear_2964_1758)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.9999%2071.5C24.9999%2061.2357%2032.9304%2
6052.8237%2042.9983%2052.057C43.4939%2052.0193%2043.9947%2052%2044.4999%2052H57.4999C58.0051%2052%2058.5059%2052.0193%2059.0014%2052.057C69.0694%2052.8237%2076.9999%2061.2357%2076.9999%2071.5V78.2826H24.9999L24.9999%2071.5Z'%20fill='%23D5E0F2'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M44.4999%2045.6048C44.4312%2045.5707%2044.3629%2045.536%2044.2948%2045.5008C39.5906%2043.0697%2036.3749%2038.1604%2036.3749%2032.5C36.3749%2024.4228%2042.9227%2017.875%2050.9999%2017.875C59.077%2017.875%2065.6249%2024.4228%2065.6249%2032.5C65.6249%2038.1604%2062.4092%2043.0697%2057.7049%2045.5008C57.6369%2045.536%2057.5686%2045.5707%2057.4999%2045.6048C55.5418%2046.5779%2053.3347%2047.125%2050.9999%2047.125C48.665%2047.125%2046.4579%2046.5779%2044.4999%2045.6048Z'%20fill='%23D5E0F2'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2964_1758'%20x1='73.5'%20y1='-5'%20x2='5'%20y2='98.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%237C859B'/%3e%3cstop%20offset='1'%20stop-color='%23747C90'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",F1={showOverlayStream:{type:Boolean,default:!0},customClass:{type:String},customStyle:{type:Object},isSmallWindow:{type:Boolean,default:!1},tip:{type:String,default:null},showOverlay:{type:Boolean,default:!0},showMask:{type:Boolean,default:!0},showBackgroundImage:{type:Boolean,default:!0},blur:{type:Boolean,default:!0},bgColor:{type:String},bgImage:{type:String,default:ai},overlayZIndex:{type:Number},customOverlayClass:{type:String},fit:{type:String},showLoading:{type:Boolean,default:!1},showAvatar:{type:Boolean,default:!0},avatar:{type:String,default:ai},showUserName:{type:Boolean,default:!0},username:{type:String},color:{type:String,default:"#FFF"},showMicVolume:{type:Boolean,default:!1},isMuted:{type:Boolean,default:!1},volume:{type:Number,default:0},showTip:{type:Boolean,default:!0}},G1=["error"],H1={options:{virtualHost:!0}},$1=ge(Z(F({},H1),{__name:"OverlayStream",props:F1,emits:G1,setup(i,{emit:e}){const t=e,n=i,s=P(100),{isFloatWindow:r}=$e(Hn()),o=it.isPC?"40px":"20px";Ye([()=>n.isSmallWindow,r],()=>{r.value?s.value=n.isSmallWindow?20:40:s.value=n.isSmallWindow?40:100},{immediate:!0});const a=ie(()=>Et(["overlay-stream-container",{pc:it.isPC,mobile:!it.isPC,float:r.value}])),l=c=>{t("error",c)};return(c,u)=>c.showOverlayStream?(w(),G("div",{key:0,class:fe(v(a)),style:Ze([c.customStyle])},[Y(Vd,{show:c.showOverlay,"show-background-image":c.showBackgroundImage,"show-mask":c.showMask,blur:c.blur,zIndex:c.overlayZIndex,bgColor:c.bgColor,bgImage:c.bgImage||v(ai),fit:c.fit,defaultSrc:v(ai),customStyle:{position:"absolute",width:"100%",height:"100%"},"custom-mask-style":{"backdrop-filter":"blur(12px)","-webkit-backdrop-filter":"blur(12px)"},customClass:c.customOverlayClass,onError:l},{default:re(()=>[q("div",{class:"overlay-stream-content-container"},[q("div",{class:"overlay-stream-content"},[c.showLoading?(w(),ne(pl,{key:0,mode:"dot"})):X("",!0),q("div",{class:"overlay-stream-avatar"},[c.showAvatar?(w(),ne(Bd,{key:0,src:c.avatar||v(ai),size:v(s)},null,8,["src","size"])):X("",!0)]),q("div",{class:"overlay-stream-info"},[c.showUserName?(w(),ne(Mt,{key:0,truncated:!0,size:v(o),color:c.color,width:"200px",weight:500},{default:re(()=>[qe(ae(c.username),1)]),_:1},8,["size","color"])):X("",!0),c.showMicVolume?(w(),ne(Fd,{key:1,isMuted:c.isMuted,volume:c.volume},null,8,["isMuted","volume"])):X("",!0)]),q("div",{class:"overlay-stream-tip"},[c.showTip&&c.tip?(w(),G("div",{key:0},ae(c.tip),1)):X("",!0)])]),Ve(c.$slots,"default",{},void 0,!0)])]),_:3},8,["show","show-background-image","show-mask","blur","zIndex","bgColor","bgImage","fit","defaultSrc","custom-mask-style","customClass"])],6)):X("",!0)}})),Gd=ve($1,[["__scopeId","data-v-8255571f"]]),j1=ge({__name:"Waiting",setup(i){const{localUserInfoExcludeVolume:e,remoteUserListExcludeVolume:t}=$e(Sn()),{callerUserInfo:n}=$e(zp()),{isGroupCall:s}=$e(Lt()),r=Td(),{isPC:o}=Us(),a=ie(()=>{var m,y;return s.value?n.value.displayUserInfo:(y=(m=t.value)==null?void 0:m[0])==null?void 0:y.displayUserInfo}),l=ie(()=>{var m,y;return s.value?n.value.avatar:(y=(m=t.value)==null?void 0:m[0])==null?void 0:y.avatar}),c=ie(()=>s.value?!0:!e.value.isVideoAvailable),u=ie(()=>s.value?Ge("Invited group call"):null),f=ie(()=>{var m,y;return s.value?r.value[n.value.userId]||l.value:r.value[(y=(m=t.value)==null?void 0:m[0])==null?void 0:y.userId]||l.value}),d=P(!1),p=P("fill");let g=P(!1);ln(()=>{var m,y,R,I;if(g.value){d.value=s.value?!0:!e.value.isVideoAvailable,p.value="cover";return}s.value?(d.value=!r.value[n.value.userId],p.value=r.value[n.value.userId]?"fill":"cover"):(d.value=!e.value.isVideoAvailable&&!r.value[(y=(m=t.value)==null?void 0:m[0])==null?void 0:y.userId],p.value=r.value[(I=(R=t.value)==null?void 0:R[0])==null?void 0:I.userId]?"fill":"cover")});const h=()=>{g.value=!0};return(m,y)=>(w(),G("div",{class:"waiting-container"},[Y(Gd,{username:v(a),avatar:v(l),"bg-image":v(f),"show-avatar":!v(o),"show-loading":!1,"bg-color":"#22262ed9","show-mask":v(d),"show-background-image":v(c),tip:v(u),fit:v(p),onError:h},{default:re(()=>[!v(o)&&v(s)?(w(),G("div",{key:0,class:"groupcall-info"},[q("div",{class:"tip"},[Y(Mt,{color:"#FFF"},{default:re(()=>[qe(ae(v(t).length)+ae(v(Ge)("people in the call")),1)]),_:1})]),q("div",{class:"avatar-group"},[(w(!0),G(ze,null,pt(v(t),R=>(w(),G("div",{class:"avatar-item"},[Y(Bd,{size:"100%",src:R.avatar||v(ai)},null,8,["src"])]))),256))])])):X("",!0)]),_:1}
6,8,["username","avatar","bg-image","show-avatar","show-mask","show-background-image","tip","fit"])]))}}),Hd=ve(j1,[["__scopeId","data-v-8044bf9b"]]),W1={bigWindow:{type:String},showSmallWindow:{type:Boolean,default:!0},smallWindowWidth:{type:String,default:"30%"},smallWindowHeight:{type:String,default:"30%"}},z1=["toggle"],$d="ToggleWindowContextKey",K1={options:{virtualHost:!0}},Y1=ge(Z(F({},K1),{__name:"ToggleWindow",props:W1,emits:z1,setup(i,{emit:e}){const t=i,n=e,s=P(t.bigWindow),r=`${Qe}-toggle-window`,o=a=>{s.value=a,n("toggle",a)};return Ye(()=>t.bigWindow,()=>{s.value=t.bigWindow}),An($d,{bigWindow:s,toggleWindow:o,smallWindowWidth:Bo(t,"smallWindowWidth"),smallWindowHeight:Bo(t,"smallWindowHeight"),showSmallWindow:Bo(t,"showSmallWindow")}),(a,l)=>(w(),G("div",{class:fe(r)},[Ve(a.$slots,"default",{},void 0,!0)]))}})),q1=ve(Y1,[["__scopeId","data-v-c842a129"]]),J1={disabled:{type:Boolean,default:!1},to:{type:String,default:"body"},source:{type:String,default:"body"}},Q1={name:"teleport",props:{to:{type:String,required:!0},source:{type:String,required:!0},disabled:{type:Boolean,required:!0}},mounted(){if(this.disabled)return;const i=document.querySelector(this.to);i&&i.appendChild(this.$el)},watch:{disabled:{immediate:!0,handler(){var i,e;this.disabled?(e=document.querySelector(this.source))==null||e.appendChild(this.$el):(i=document.querySelector(this.to))==null||i.appendChild(this.$el)}}},destroyed(){const i=document.querySelector(this.to);if(i)try{i.removeChild(this.$el)}catch(e){}}};function Z1(i,e,t,n,s,r){return w(),G("div",null,[Ve(i.$slots,"default")])}const X1=ve(Q1,[["render",Z1]]),eg={options:{virtualHost:!0}},tg=ge(Z(F({},eg),{__name:"Portal",props:["disabled","to"],setup(i){return(e,t)=>(w(),ne(ku,{disabled:i.disabled,to:i.to},[Ve(e.$slots,"default")],8,["disabled","to"]))}})),jd=ge({__name:"Portal",props:J1,setup(i){const{majorVersion:e}=I2(),t=ie(()=>e==="2");return(n,s)=>v(t)?(w(),ne(X1,{key:0,disabled:n.disabled,to:n.to,source:n.source},{default:re(()=>[Ve(n.$slots,"default")]),_:3},8,["disabled","to","source"])):(w(),ne(tg,{key:1,disabled:n.disabled,to:n.to,source:n.source},{default:re(()=>[Ve(n.$slots,"default")]),_:3},8,["disabled","to","source"]))}}),ng={value:{type:String}},ig={options:{virtualHost:!0}},sg=ge(Z(F({},ig),{__name:"ToggleWindowItem",props:ng,setup(i){const e=i,{bigWindow:t,toggleWindow:n,smallWindowWidth:s,smallWindowHeight:r,showSmallWindow:o}=Dn($d),a=ie(()=>Et([`${Qe}-toggle-window-item`,`${Qe}-toggle-window-item--${t.value===e.value?"big":"small"}`,{pc:us,mobile:!us}])),l=ie(()=>{let c={};return t.value!==e.value&&(c={width:s.value,height:r.value},o.value?c.visibility="":c.visibility="hidden"),c});return(c,u)=>(w(),G("div",{class:fe(v(a)),style:Ze([v(l)]),onClick:u[0]||(u[0]=()=>v(n)(c.value))},[Ve(c.$slots,"default",{},void 0,!0)],6))}})),cc=ve(sg,[["__scopeId","data-v-6482014d"]]),gl={nickName:{type:String,default:""},isSelf:{type:Boolean,default:!1},isMuted:{type:Boolean,default:!1},volume:{type:Number,default:0},showNickName:{type:Boolean,default:!1},showSwitchCameraButton:{type:Boolean,default:!1},showVirtualBackgroundButton:{type:Boolean,default:!1},showNetWorkStatus:{type:Boolean,default:!1}},Wd="/assets/networkStatus-Tc4f4Y5J.svg",rg={options:{virtualHost:!0}},og=ge(Z(F({},rg),{__name:"StreamInfoPC",props:gl,setup(i){return(e,t)=>(w(),ne(Hi,null,{default:re(()=>[Y(Ft,{span:12,justify:"start",align:"center"},{default:re(()=>[q("div",{class:"stream-userInfo"},[Y(Fd,{class:"mic-volume","is-muted":e.isMuted,volume:e.volume},null,8,["is-muted","volume"]),q("div",{class:"nickname"},[Y(Mt,{color:"#fff",truncated:!0,width:"80px",size:"14px"},{default:re(()=>[qe(ae(e.nickName),1)]),_:1}),_t(Y(Mt,{color:"#fff",size:"14px"},{default:re(()=>[qe(ae(v(Ge)("me")),1)]),_:1},512),[[yt,e.isSelf]])])])]),_:1}),Y(Ft,{span:12,justify:"center"},{default:re(()=>[e.showNetWorkStatus?(w(),G("div",{key:0},[Y(Qt,{width:"24px",height:"24px",src:v(Wd)},null,8,["src"])])):X("",!0)]),_:1})]),_:1}))}})),ag=ve(og,[["__scopeId","data-v-48012062"]]),lg="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_124_647)'%3e%3ccircle%20cx='14'%20cy='14'%20r='12'%20fill='white'/%3e%3c/g%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.8122%2022.5382C15.8122%2022.5382%2015.8123%2022.5381%2015.8123%2022.5381C20.5278%2017.8226%2020.5278%2010.1772%2015.8124%205.46167L14.0446%207.22944C17.7838%2010.9687%2017.7837%2017.0311%2014.0445%2020.7704C14.0445%2020.7704%2014.0445%2020.7704%2014.0445%2020.7704L15.8122%2022.5382Z'%20fill='%231C66E5'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.1879%2019.1356C12.1879%2019.1356%2012.1879%2019.1356%2012.188%2019.1355C15.0246%2016.2989%2015.0247%2011.6998%2012.1881%208.86304L10.4203%2010.6308C12.2806%2012.4912%2012.2805%2015.5074%2010.4202%2017.3678C10.4202%2017.3678%2010.4201%2017.3678%2010.4201%2017.3678L12.1879%2019.1356Z'%20fill='%231C66E5'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.12144%2016.0692C10.2644%2014.926%2010.2643%2013.0728%209.12128%2011.9298C9.12126%2011.9297%209.12124%2011.9297%209.12122%2011.9297L7.10298%2013.9479C7.103%2013.9479%207.10302%2013.948%207.10304%2013.948C7.13146%2013.9764%207.13151%2014.0224%207.1032%2014.0509L9.12144%2016.0692Z'%20fill='%231C66E5'/%3e%3cdefs%3e%3cfilter%20id='filter0_d_124_647'%20x='0'%20y='0'%20width='28'%20height='28'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='Backgroun
6dImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='1'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_124_647'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_124_647'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",cg="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_1741_10678)'%3e%3ccircle%20cx='14'%20cy='14'%20r='12'%20fill='white'/%3e%3c/g%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.6667%2010.0001C10.6667%208.15913%2012.159%206.66675%2014%206.66675C15.0538%206.66675%2015.9934%207.15574%2016.6042%207.9192L10.732%2014.9934C10.6891%2014.7801%2010.6667%2014.5594%2010.6667%2014.3334V10.0001ZM9.62975%2016.3212C9.35375%2015.7155%209.2%2015.0423%209.2%2014.3332V13.3332H8.13333V14.3332C8.13333%2015.3803%208.40766%2016.3634%208.88836%2017.2144L9.62975%2016.3212ZM10.913%2019.323L11.6025%2018.4925C12.3079%2018.9%2013.1267%2019.1332%2014%2019.1332C16.651%2019.1332%2018.8%2016.9842%2018.8%2014.3332V13.3332H19.8667V14.3332C19.8667%2017.3935%2017.5235%2019.9065%2014.5333%2020.176V22.0001H13.4667V20.176C12.5357%2020.0921%2011.6674%2019.7907%2010.913%2019.323ZM12.5591%2017.3401L17.3333%2011.5886V14.3334C17.3333%2016.1744%2015.8409%2017.6667%2014%2017.6667C13.4839%2017.6667%2012.9952%2017.5495%2012.5591%2017.3401Z'%20fill='%23E6395C'/%3e%3cpath%20d='M9.4234%2018.8447L17.7834%208.77827'%20stroke='%23E6395C'%20stroke-width='1.06667'%20stroke-linecap='square'%20stroke-linejoin='round'/%3e%3cdefs%3e%3cfilter%20id='filter0_d_1741_10678'%20x='0'%20y='0'%20width='28'%20height='28'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='1'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_1741_10678'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_1741_10678'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",ug={options:{virtualHost:!0}},dg=ge(Z(F({},ug),{__name:"StreamInfoMobile",props:gl,setup(i){const{enableVirtualBackground:e}=$e(Lt()),t=()=>ye(this,null,function*(){yield We.switchCamera()}),n=()=>ye(this,null,function*(){yield We.setBlurBackground(!e.value)});return(s,r)=>(w(),ne(Hi,{"custom-style":{padding:"2px 5px"}},{default:re(()=>[Y(Ft,{span:12,justify:"start",align:"center"},{default:re(()=>[s.showNickName?(w(),ne(Mt,{key:0,width:"100px",truncated:!0,color:"#FFF"},{default:re(()=>[qe(ae(s.nickName),1)]),_:1})):X("",!0),_t(q("div",null,[Y(Ds,{size:24,src:v(lg)},null,8,["src"])],512),[[yt,!s.isMuted&&s.volume]]),_t(q("div",null,[Y(Ds,{size:24,src:v(cg)},null,8,["src"])],512),[[yt,s.isMuted]])]),_:1}),Y(Ft,{span:12,justify:"end",align:"center"},{default:re(()=>[s.showNetWorkStatus?(w(),G("div",{key:0},[Y(Qt,{width:"24px",height:"24px",src:v(Wd)},null,8,["src"])])):X("",!0),s.showSwitchCameraButton?(w(),G("div",{key:1,class:"switch-camera stream-icon",onClick:It(t,["stop"])},[Y(Qt,{width:"15px",height:"15px",src:v(Ci)},null,8,["src"])])):X("",!0),s.showVirtualBackgroundButton?(w(),G("div",{key:2,class:"stream-icon",onClick:It(n,["stop"])},[Y(Qt,{width:"15px",height:"15px",src:v(Ii)},null,8,["src"])])):X("",!0)]),_:1})]),_:1}))}})),fg=ve(dg,[["__scopeId","data-v-f2dc457f"]]),hg={options:{virtualHost:!0}},Xr=ge(Z(F({},hg),{__name:"TKStreamInfo",props:gl,setup(i){const{isGroupCall:e}=Lt(),t=it.isPC;return(n,s)=>(w(),G("div",null,[v(t)?(w(),ne(ag,{key:0,nickName:n.nickName,isSelf:n.isSelf,isMuted:n.isMuted,volume:n.volume,showNetWorkStatus:n.showNetWorkStatus},null,8,["nickName","isSelf","isMuted","volume","showNetWorkStatus"])):X("",!0),v(e)&&!v(t)?(w(),ne(fg,{key:1,showSwitchCameraButton:n.showSwitchCameraButton,showVirtualBackgroun
6dButton:n.showVirtualBackgroundButton,showNetWorkStatus:n.showNetWorkStatus,nickName:n.nickName,showNickName:n.showNickName,isSelf:n.isSelf,isMuted:n.isMuted,volume:n.volume},null,8,["showSwitchCameraButton","showVirtualBackgroundButton","showNetWorkStatus","nickName","showNickName","isSelf","isMuted","volume"])):X("",!0)]))}})),pg={show:{type:Boolean,default:!0},domId:{type:String},loading:{type:Boolean},showStreamInfo:{type:Boolean},showAudioStream:{type:Boolean}},gg={options:{virtualHost:!0}},mg=ge(Z(F({},gg),{__name:"Pusher",props:pg,setup(i){const e=P(le.getData(j.CALL,N.PUSHER_ID)),t=Et(["stream-info-container",{mobile:!it.isPC}]),n=r=>{e.value=r},s={[N.PUSHER_ID]:n};return et(()=>{le.watch(j.CALL,s,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,s)}),(r,o)=>_t((w(),G("div",{id:r.domId,class:"pusher-container"},[_t(q("div",{class:"audio-stream-container"},[Ve(r.$slots,"audio-stream",{},void 0,!0)],512),[[yt,r.showAudioStream]]),Ve(r.$slots,"loading",{},void 0,!0),q("div",{class:fe(v(t))},[Ve(r.$slots,"stream-info",{},void 0,!0)],2)],8,["id"])),[[yt,r.show]])}})),zd=ve(mg,[["__scopeId","data-v-6582855d"]]),vg={options:{virtualHost:!0}},Cg=ge(Z(F({},vg),{__name:"weChatPlayer",props:{remoteClass:{type:String,required:!0},domId:{type:String}},setup(i){const e=P(le.getData(j.CALL,N.PLAYER)),t=P(le.getData(j.CALL,N.CALL_STATUS)),n=P(le.getData(j.CALL,N.IS_EAR_PHONE)?$s.EAR:$s.SPEAKER),s=i,r=g=>{e.value=JSON.parse(JSON.stringify(g))},o=ie(()=>{var g;return(g=e.value)==null?void 0:g.find(h=>(h==null?void 0:h.userID)===s.domId)}),a=g=>{t.value=g},l=g=>{n.value=g?$s.EAR:$s.SPEAKER},c={[N.PLAYER]:r,[N.CALL_STATUS]:a,[N.IS_EAR_PHONE]:l};et(()=>{le.watch(j.CALL,c,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,c)});function u(g){We._tuiCallEngine._playerStateChange(g)}function f(g){}function d(g){We._tuiCallEngine._playNetStatus(g)}function p(g){We._tuiCallEngine._playerAudioVolumeNotify(g)}return(g,h)=>{const m=dh;return w(),G("div",{class:fe(i.remoteClass)},[v(o)&&(v(o).hasAudio||v(o).hasVideo)?(w(),ne(m,{key:0,class:"stream",id:v(o).id,"data-userid":v(o).userID,"data-streamid":v(o).streamID,"data-streamtype":v(o).streamType,src:v(o).src,mode:"RTC",autoplay:v(o).autoplay,"mute-audio":v(o).muteAudio,"mute-video":v(o).muteVideo,orientation:v(o).orientation,"object-fit":v(o).objectFit,"background-mute":v(o).enableBackgroundMute,"min-cache":v(o).minCache,"max-cache":v(o).maxCache,"sound-mode":v(n),"enable-recv-message":v(o).enableRecvMessage,"auto-pause-if-navigate":v(o).autoPauseIfNavigate,"auto-pause-if-open-native":v(o).autoPauseIfOpenNative,onStatechange:u,onFullscreenchange:f,onNetstatus:d,onAudiovolumenotify:p},null,8,["id","data-userid","data-streamid","data-streamtype","src","autoplay","mute-audio","mute-video","orientation","object-fit","background-mute","min-cache","max-cache","sound-mode","enable-recv-message","auto-pause-if-navigate","auto-pause-if-open-native"])):X("",!0)],2)}}})),_g=ve(Cg,[["__scopeId","data-v-f1e7f026"]]),yg={show:{type:Boolean,default:!0},domId:{type:String},loading:{type:Boolean},showStreamInfo:{type:Boolean},showAudioStream:{type:Boolean}},Ig={options:{virtualHost:!0}},Eg=ge(Z(F({},Ig),{__name:"Player",props:yg,setup(i){const e=Et(["stream-info-container",{mobile:!it.isPC}]);return(t,n)=>_t((w(),G("div",{id:t.domId,class:"player-container"},[_t(q("div",{class:"audio-stream-container"},[Ve(t.$slots,"audio-stream",{},void 0,!0)],512),[[yt,t.showAudioStream]]),Ve(t.$slots,"loading",{},void 0,!0),q("div",{class:fe(v(e))},[Ve(t.$slots,"stream-info",{},void 0,!0)],2),v(it).isWeChat?(w(),ne(_g,{key:0,"dom-id":t.domId,remoteClass:"small-view"},null,8,["dom-id"])):X("",!0)],8,["id"])),[[yt,t.show]])}})),Kd=ve(Eg,[["__scopeId","data-v-886b29f9"]]),Sg={avatar:{type:String},username:{type:String},isVideoAvailable:{type:Boolean},showStreamInfo:{type:Boolean},isSmallWindow:{type:Boolean,default:!1},isMuted:{type:Boolean,default:!0},volume:{type:Number,default:0},userId:{type:String}},Tg={options:{virtualHost:!0}},eo=ge(Z(F({},Tg),{__name:"AudioStream",props:Sg,setup(i){const e=i,t=Td(),{callType:n,isGroupCall:s}=$e(Lt()),{isFloatWindow:r}=$e(Hn()),o=ie(()=>!s.value&&!it.isPC),a=ie(()=>s.value?it.isPC:n.value===rt.AUDIO),l=ie(()=>!s.value&&it.isPC&&n.value===rt.AUDIO),c=ie(()=>({zIndex:1})),u=ie(()=>t.value[e.userId]||e.avatar),f=P(!t.value[e.userId]),d=P(t.value[e.userId]?"fill":"cover");Ye([()=>e.userId,t],()=>{t.value[e.userId]?(d.value="fill",f.value=!1):(d.value="cover",f.value=!0)},{immediate:!0});const p=()=>{f.value=!0,d.value="cover"};return(g,h)=>(w(),ne(Gd,{avatar:g.avatar,"bg-image":v(u),"show-avatar":v(o),username:g.username,"show-user-name":v(a),"show-mask":!v(s)&&v(f),fit:v(d),blur:!v(s),"show-mic-volume":v(l),"show-tip":!v(s)&&!v(r),"custom-style":v(c),"is-small-window":g.isSmallWindow,"is-muted":g.isMuted,volume:g.volume,"bg-color":"rgba(0, 0, 0, 0.5)",onError:p},null,8,["avatar","bg-image","show-avatar","username","show-user-name","show-mask","fit","blur","show-mic-volume","show-tip","custom-style","
6is-small-window","is-muted","volume"]))}})),Lg="data:image/svg+xml,%3csvg%20width='26'%20height='26'%20viewBox='0%200%2026%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.4437%2012.449C18.4437%2014.1142%2018.2336%2015.3515%2021.5089%2015.7126C24.7875%2016.0737%2024.3666%2013.6794%2024.3662%2012.0669C24.3649%2010.2061%2020.0602%207.61895%2013.2726%207.6173C6.48662%207.61735%202.1789%2010.205%202.17888%2012.067C2.17887%2013.68%201.75621%2016.0726%205.03315%2015.7123C8.31009%2015.3537%208.10005%2014.1155%208.09837%2012.4495C8.10134%2011.2862%2010.7587%2011.0316%2013.2725%2011.0298C15.7863%2011.0281%2018.4454%2011.2844%2018.4437%2012.449Z'%20fill='%23FE3C44'/%3e%3c/svg%3e",wg="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.66666%204.16668C6.66666%202.32834%208.16166%200.833344%209.99999%200.833344C11.8383%200.833344%2013.3333%202.32834%2013.3333%204.16668V9.16668C13.3333%2011.005%2011.8383%2012.5%209.99999%2012.5C8.16166%2012.5%206.66666%2011.005%206.66666%209.16668V4.16668ZM6.66666%2018.3333C6.66666%2017.8725%207.03999%2017.5%207.49999%2017.5H12.5C12.9608%2017.5%2013.3333%2017.8725%2013.3333%2018.3333C13.3333%2018.7942%2012.9608%2019.1667%2012.5%2019.1667H7.49999C7.03999%2019.1667%206.66666%2018.7942%206.66666%2018.3333Z'%20fill='%23101419'/%3e%3cpath%20d='M15.8333%208.3512V9.50825C15.8333%2012.081%2013.2217%2015%209.99999%2015C6.77833%2015%204.16666%2012.081%204.16666%209.50825V8.33334'%20stroke='%23101419'%20stroke-width='1.66667'%20stroke-linecap='round'/%3e%3c/svg%3e",Ag="data:image/svg+xml,%3csvg%20width='15'%20height='21'%20viewBox='0%200%2015%202
61'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.6247%200.719168C14.1934%200.374158%2013.5641%200.44408%2013.2191%200.875342L10.8168%203.83203C10.1789%203.02455%209.15387%202.50004%208.00001%202.50004C6.06976%202.50004%204.50001%203.96785%204.50001%205.77276V10.6819C4.50001%2010.9563%204.5363%2011.2229%204.60463%2011.4778L3.388%2012.9752C2.98449%2012.3433%202.75001%2011.6522%202.75001%2010.9717V9.81819L2.74319%209.71556C2.6892%209.31213%202.32108%209.00001%201.87501%209.00001C1.39176%209.00001%201.00001%209.36632%201.00001%209.81819V10.9717L1.00466%2011.1761C1.05557%2012.2968%201.52161%2013.4016%202.26939%2014.3519L0.219137%2016.8753L0.146861%2016.9782C-0.112977%2017.4017%20-0.0227767%2017.9624%200.375311%2018.2809C0.806573%2018.6259%201.43587%2018.556%201.78088%2018.1247L3.71661%2015.7423C3.71849%2015.7437%203.72038%2015.745%203.72227%2015.7464L4.2997%2015.0246L8.28088%2010.1247L14.7809%202.12473L14.8532%202.02191C15.113%201.59834%2015.0228%201.03764%2014.6247%200.719168ZM7.72499%2013.9446L11.5%209.22582V10.6819C11.5%2012.4868%209.93026%2013.9546%208.00001%2013.9546C7.90746%2013.9546%207.81575%2013.9512%207.72499%2013.9446ZM6.60445%2015.3453L5.50798%2016.7159C6.29225%2017.0136%207.13532%2017.1818%208.00001%2017.1818C11.6976%2017.1818%2015%2014.1064%2015%2010.9717V9.83572L14.9932%209.73309C14.9392%209.32966%2014.5711%209.01754%2014.125%209.01754C13.6418%209.01754%2013.25%209.38385%2013.25%209.83572V10.9717L13.2445%2011.1527C13.1138%2013.3262%2010.6589%2015.5455%208.00001%2015.5455C7.52424%2015.5455%207.05501%2015.4744%206.60445%2015.3453ZM5.37501%2018.8637C4.89201%2018.8637%204.50001%2019.2294%204.50001%2019.6819C4.50001%2020.1343%204.89201%2020.5%205.37501%2020.5H10.625C11.1089%2020.5%2011.5%2020.1343%2011.5%2019.6819C11.5%2019.2294%2011.1089%2018.8637%2010.625%2018.8637H5.37501Z'%20fill='%23101419'/%3e%3c/svg%3e",bg="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.33337%209.33331H0.333374V0.99998C0.333374%200.63179%200.631851%200.333313%201.00004%200.333313L9.33338%200.333313V2.33331H3.74758L10.0405%208.62624L8.62627%2010.0404L2.33337%203.74753V9.33331ZM18.3331%2011.3333H20.3331V19.6666C20.3331%2020.0348%2020.0347%2020.3333%2019.6665%2020.3333L11.3331%2020.3333L11.3331%2018.3333H16.9189L10.626%2012.0403L12.0402%2010.6261L18.3331%2016.919V11.3333Z'%20fill='%23101419'/%3e%3c/svg%3e",Rg={options:{virtualHost:!0}}
6,Og=ge(Z(F({},Rg),{__name:"FloatWindow",setup(i){const{localUserInfoExcludeVolume:e}=$e(Sn()),{callRole:t,callStatus:n}=$e(Lt()),{isFloatWindow:s}=$e(Hn());function r(){We.toggleMinimize()}function o(){return ye(this,null,function*(){t.value===Dt.CALLEE&&n.value===Be.CALLING?yield We.reject():yield We.hangup()})}function a(){return ye(this,null,function*(){e.value.isAudioAvailable?yield We.closeMicrophone():yield We.openMicrophone()})}return(l,c)=>(w(),G("div",{class:"float-window-container"},[_t(q("div",{class:"float-control-panel"},[q("div",{class:"float-control-item-icon"},[q("div",{class:"float-control-item-icon-container",onClick:o},[q("img",{src:v(Lg)},null,8,["src"])])]),_t(q("div",{class:"float-control-item-icon"},[q("div",{class:"float-control-item-icon-container",onClick:a},[v(e).isAudioAvailable?(w(),G("img",{key:0,src:v(wg)},null,8,["src"])):(w(),G("img",{key:1,src:v(Ag)},null,8,["src"]))])],512),[[yt,v(s)]]),_t(q("div",{class:"float-control-item-icon"},[q("div",{class:"float-control-item-icon-container",onClick:r},[q("img",{src:v(bg)},null,8,["src"])])],512),[[yt,v(s)]])],512),[[yt,v(s)]]),_t(q("div",null,[Ve(l.$slots,"default",{},void 0,!0)],512),[[yt,!v(s)]])]))}})),Dg=ve(Og,[["__scopeId","data-v-4cbb0db0"]]),Yd="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.760961%209.33154C0.00123507%207.13371%200.962968%204.77323%202.83345%203.39097C4.25152%202.34304%205.67603%201.2847%206.48889%200.680124C6.87515%200.392837%207.41661%200.45568%207.72841%200.822397L12.158%206.03214C12.4476%206.37275%2012.4477%206.87295%2012.1583%207.21373L9.4422%2010.4119C9.19496%2010.7031%209.15378%2011.1183%209.34925%2011.4465C10.2293%2012.9238%2011.195%2014.1891%2012.5%2015.4938C13.8127%2016.806%2015.0778%2017.7529%2016.5635%2018.6308C16.8919%2018.8248%2017.3065%2018.7836%2017.5974%2018.5368L20.7826%2015.8351C21.1234%2015.5459%2021.6237%2015.5461%2021.9643%2015.8356L27.1783%2020.2662C27.5441%2020.577%2027.6066%2021.1179%2027.3213%2021.5038L24.5937%2025.1936C23.2225%2027.0486%2020.8804%2027.9919%2018.6987%2027.2413C14.6658%2025.8538%2010.8781%2023.5511%207.65922%2020.3331C4.44957%2017.1244%202.15015%2013.3503%200.760961%209.33154Z'%20fill='%2312B969'/%3e%3c/svg%3e",Mg={options:{virtualHost:!0}},kg=ge(Z(F({},Mg),{__name:"FloatWindowSingleCall",setup(i){const{callType:e,callStatus:t}=$e(Lt()),{isFloatWindow:n}=$e(Hn()),{callDuration:s}=hl(),r=ie(()=>Et(["float-window-container",{"singlecall-video-float":e.value===rt.VIDEO&&n.value,"singlecall-audio-float":e.value===rt.AUDIO&&n.value}]));function o(){n.value&&We.toggleMinimize()}return(a,l)=>(w(),G("div",{class:fe(v(r))},[_t(q("div",{class:"singlecall-video-float-content",onClick:o},[Ve(a.$slots,"default",{},void 0,!0),q("div",{class:"float-window-tip-container"},[v(t)===v(Be).CALLING&&v(n)?(w(),ne(Mt,{key:0,color:"#FFF",size:"12px"},{default:re(()=>[qe(ae(v(Ge)("wait to be called")),1)]),_:1})):X("",!0)])],512),[[yt,!(v(n)&&v(e)===v(rt).AUDIO)]]),_t(q("div",{class:"singlecall-audio-float-content",onClick:o},[Y(Qt,{width:"36px",height:"36px",src:v(Yd)},null,8,["src"]),v(t)===v(Be).CONNECTED?(w(),ne(Zr,{key:0,fontSize:"12px",callDuration:v(s),color:"#12b969"},null,8,["callDuration"])):X("",!0),v(t)===v(Be).CALLING&&v(n)?(w(),ne(Mt,{key:1,color:"#12b969",size:"12px"},{default:re(()=>[qe(ae(v(Ge)("wait to be called")),1)]),_:1})):X("",!0)],512),[[yt,v(n)&&v(e)===v(rt).AUDIO]])],2))}})),Ng=ve(kg,[["__scopeId","data-v-7f4dd49f"]]),xg="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.9165%207.56937V6.83887H3.4165V7.56937C3.4165%2010.1007%205.46853%2012.1527%207.99984%2012.1527C10.5311%2012.1527%2012.5832%2010.1007%2012.5832%207.56936V6.83887H14.0832V7.56936C14.0832%2010.6751%2011.7557%2013.2373%208.74988%2013.6069V14.9089H7.24988V13.6069C4.24398%2013.2374%201.9165%2010.6752%201.9165%207.56937Z'%20fill='%2312B969'/%3e%3crect%20x='4.66675'%20y='1.09082'%20width='6.66667'%20height='9.8969'%20rx='3.33333'%20fill='%2312B969'/%3e%3c/svg%3e",Ug="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.6716%206.11692C12.4687%206.21869%2012.3406%206.42625%2012.3406%206.65324V9.34648C12.3406%209.57348%2012.4687%209.78105%2012.6716%209.88281L15.4744%2011.2884C15.6074%2011.3551%2015.764%2011.2584%2015.764%2011.1096L15.764%204.88996C15.764%204.74117%2015.60
674%204.64448%2015.4744%204.71118L12.6716%206.11692Z'%20fill='%2312B969'/%3e%3cg%20filter='url(%23filter0_b_1977_11630)'%3e%3crect%20x='0.666748'%20y='2.89355'%20width='10.6667'%20height='10.2128'%20rx='1.5'%20fill='%2312B969'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_b_1977_11630'%20x='-7.33325'%20y='-5.10645'%20width='26.6666'%20height='26.2126'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeGaussianBlur%20in='BackgroundImageFix'%20stdDeviation='4'/%3e%3cfeComposite%20in2='SourceAlpha'%20operator='in'%20result='effect1_backgroundBlur_1977_11630'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_backgroundBlur_1977_11630'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",Pg="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.9165%207.56937V6.83887H3.4165V7.56937C3.4165%2010.1007%205.46853%2012.1527%207.99984%2012.1527C10.5311%2012.1527%2012.5832%2010.1007%2012.5832%207.56936V6.83887H14.0832V7.56936C14.0832%2010.6751%2011.7557%2013.2373%208.74988%2013.6069V14.9089H7.24988V13.6069C4.24398%2013.2374%201.9165%2010.6752%201.9165%207.56937Z'%20fill='%23ADADAD'/%3e%3crect%20x='4.66675'%20y='1.09082'%20width='6.66667'%20height='9.8969'%20rx='3.33333'%20fill='%23ADADAD'/%3e%3c/svg%3e",Vg="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.6716%205.77659C12.4687%205.87835%2012.3406%206.08591%2012.3406%206.31291V9.00614C12.3406%209.23315%2012.4687%209.44072%2012.6716%209.54248L15.4744%2010.948C15.6074%2011.0147%2015.764%2010.918%2015.764%2010.7693L15.764%204.54962C15.764%204.40084%2015.6074%204.30415%2015.4744%204.37085L12.6716%205.77659Z'%20fill='%23ADADAD'/%3e%3cg%20filter='url(%23filter0_b_131_1449)'%3e%3crect%20x='0.666748'%20y='2.55322'%20width='10.6667'%20height='10.2128'%20rx='1.5'%20fill='%23ADADAD'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_b_131_1449'%20x='-7.33325'%20y='-5.44678'%20width='26.6667'%20height='26.2126'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeGaussianBlur%20in='Backgroun
6dImageFix'%20stdDeviation='4'/%3e%3cfeComposite%20in2='SourceAlpha'%20operator='in'%20result='effect1_backgroundBlur_131_1449'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_backgroundBlur_131_1449'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",Bg={options:{virtualHost:!0}},Fg=ge(Z(F({},Bg),{__name:"FloatWindowGroupCall",setup(i){const{isFloatWindow:e}=$e(Hn()),{callDuration:t}=hl(),{localUserInfoExcludeVolume:n}=$e(Sn()),{callStatus:s}=$e(Lt()),r=ie(()=>n.value.isAudioAvailable?xg:Pg),o=ie(()=>n.value.isVideoAvailable?Ug:Vg),a=ie(()=>Et(["groupcall-video-float",{"not-float":!e.value,float:e.value}]));function l(){e.value&&We.toggleMinimize()}return(c,u)=>(w(),G("div",{class:fe(v(a))},[v(e)?(w(),G("div",{key:0,class:"click-container",onClickCapture:It(l,["stop"])},null,32)):X("",!0),q("div",{class:"stream-container"},[q("div",{class:"video"},[Ve(c.$slots,"default",{},void 0,!0)]),_t(q("div",{class:"audio"},[Y(Qt,{width:"36px",height:"36px",src:v(Yd)},null,8,["src"]),v(s)===v(Be).CONNECTED?(w(),ne(Zr,{key:0,fontSize:"12px",callDuration:v(t),color:"#12b969"},null,8,["callDuration"])):X("",!0),v(s)===v(Be).CALLING?(w(),ne(Mt,{key:1,size:"12px",color:"#12b969"},{default:re(()=>[qe(ae(v(Ge)("wait to be called")),1)]),_:1}
6)):X("",!0)],512),[[yt,v(e)]])]),_t(q("div",{class:"device-status"},[Y(Qt,{width:"16px",height:"16px",src:v(r)},null,8,["src"]),Y(Qt,{width:"16px",height:"16px",src:v(o)},null,8,["src"])],512),[[yt,v(e)]])],2))}})),Gg=ve(Fg,[["__scopeId","data-v-87e9ceb8"]]),Hg={options:{virtualHost:!0}},$g=ge(Z(F({},Hg),{__name:"FloatWindow",setup(i){const{isGroupCall:e}=$e(Lt());return(t,n)=>(w(),G("div",{id:"float-window-id"},[v(e)?(w(),ne(Gg,{key:1},{default:re(()=>[Ve(t.$slots,"default")]),_:3})):(w(),ne(Ng,{key:0},{default:re(()=>[Ve(t.$slots,"default")]),_:3}))]))}})),jg={options:{virtualHost:!0}},Wg=ge(Z(F({},jg),{__name:"FloatWindow",setup(i){const{isFloatWindow:e}=$e(Hn()),{isPC:t}=Us(),n=ie(()=>Et(["float-window-container",{float:e.value,"not-float":!e.value,pc:t.value,mobile:!t.value}]));return(s,r)=>(w(),G("div",{class:fe(v(n))},[v(t)?(w(),ne(Dg,{key:0},{default:re(()=>[Ve(s.$slots,"default",{},void 0,!0)]),_:3})):X("",!0),v(t)?X("",!0):(w(),ne($g,{key:1},{default:re(()=>[Ve(s.$slots,"default",{},void 0,!0)]),_:3}))],2))}})),qd=ve(Wg,[["__scopeId","data-v-2ed5bf04"]]);function zg(){const i=_r(),{callStatus:e}=$e(Lt()),t=P(Xn.LOCAL),{remoteUserListExcludeVolume:n}=$e(Sn());return Ye([n,i,e],()=>{var o,a,l,c;if(e.value===Be.CALLING)return;const s=[zr.RemoteInLargeView,zr.LocalInLargeView],r=(o=i.value)==null?void 0:o.layoutMode;if(s.includes(r)){t.value=(a=i.value)==null?void 0:a.layoutMode;return}(c=(l=n.value)==null?void 0:l[0])!=null&&c.isEnter&&(t.value=Xn.REMOTE)},{immediate:!0}),t}const Kg={options:{virtualHost:!0}},Yg=ge(Z(F({},Kg),{__name:"MediaContainer",setup(i){const e=zg(),t=P(!0),{isFloatWindow:n}=$e(Hn()),{localUserInfoExcludeVolume:s,remoteUserListExcludeVolume:r}=$e(Sn()),o=yd(),{callType:a,callStatus:l}=$e(Lt()),c=Id(),u=ie(()=>{var h,m,y,R;return it.isWeChat?(m=(h=c.value)==null?void 0:h.find(I=>{var T,C;return(I==null?void 0:I.userID)===((C=(T=r.value)==null?void 0:T[0])==null?void 0:C.userId)}))==null?void 0:m.hasVideo:(R=(y=r.value)==null?void 0:y[0])==null?void 0:R.isVideoAvailable}),f=ie(()=>{var h,m;return(m=(h=r.value)==null?void 0:h[0])==null?void 0:m.domId}),d=ie(()=>{var h,m,y;return(y=o.value)==null?void 0:y[(m=(h=r.value)==null?void 0:h[0])==null?void 0:m.domId]});Ye([a,l],()=>{a.value===rt.AUDIO||l.value===Be.CALLING?t.value=!1:t.value=!0},{immediate:!0});const p=ie(()=>Et(["singlecall-media-container",{mobile:!it.isPC,pc:it.isPC,float:n.value}]));function g(h){e.value=h}return(h,m)=>(w(),ne(jd,{id:"source",disabled:!v(n),source:"#source",to:"body"},{default:re(()=>[Y(qd,null,{default:re(()=>[q("div",{class:fe(v(p))},[Y(q1,{"big-window":v(e),"show-small-window":v(t),onToggle:g},{default:re(()=>[(w(),ne(cc,{value:v(Xn).LOCAL,key:v(Xn).LOCAL},{default:re(()=>[Y(zd,{domId:v(s).domId,"show-audio-stream":!v(s).isVideoAvailable},{"audio-stream":re(()=>[Y(eo,{userId:v(s).userId,username:v(s).displayUserInfo,avatar:v(s).avatar,"is-video-available":v(s).isVideoAvailable,"is-small-window":v(e)!==v(Xn).LOCAL,"is-muted":!v(s).isAudioAvailable,volume:v(o)&&v(o)[v(s).domId]},null,8,["userId","username","avatar","is-video-available","is-small-window","is-muted","volume"])]),"stream-info":re(()=>[v(a)===v(rt).VIDEO?(w(),ne(Xr,{key:0,"nick-name":v(s).displayUserInfo,"is-self":!0,"is-muted":!v(s).isAudioAvailable,volume:v(o)&&v(o)[v(s).domId]},null,8,["nick-name","is-muted","volume"])):X("",!0)]),_:1},8,["domId","show-audio-stream"])]),_:1},8,["value"])),(w(),ne(cc,{value:v(Xn).REMOTE,key:v(Xn).REMOTE},{default:re(()=>[Y(Kd,{"dom-id":v(f),"show-audio-stream":!v(u)},{"audio-stream":re(()=>[Y(eo,{userId:v(r)[0]&&v(r)[0].userId,username:v(r)[0]&&v(r)[0].displayUserInfo,avatar:v(r)[0]&&v(r)[0].avatar,"is-video-available":v(u),"is-small-window":v(e)!==v(Xn).REMOTE,"is-muted":v(r)[0]&&!v(r)[0].isAudioAvailable,volume:v(d)},null,8,["userId","username","avatar","is-video-available","is-small-window","is-muted","volume"])]),"stream-info":re(()=>[v(a)===v(rt).VIDEO?(w(),ne(Xr,{key:0,"nick-name":v(r)[0]&&v(r)[0].displayUserInfo,"is-muted":v(r)[0]&&!v(r)[0].isAudioAvailable,volume:v(d)},null,8,["nick-name","is-muted","volume"])):X("",!0)]),_:1},8,["dom-id","show-audio-stream"])]),_:1},8,["value"]))]),_:1}
6,8,["big-window","show-small-window"])],2)]),_:1})]),_:1},8,["disabled"]))}})),qg=ve(Yg,[["__scopeId","data-v-26e41aec"]]),Jg=[js.SUCCESS,js.INFO,js.WARNING,js.ERROR],Is={isShow:{type:Boolean,default:!1},message:{type:String,default:""},type:{type:String,values:Jg,default:js.INFO},duration:{type:Number,default:3e3},offset:{type:Number,default:16},showClose:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!0},customClass:{type:String},customStyle:{type:Object}},Qg={onClose:null};function Zg(i,e){const t=P((i==null?void 0:i.message)||Is.message.default),n=P((i==null?void 0:i.duration)||Is.duration.default),s=P((i==null?void 0:i.type)||Is.type.default),r=P((i==null?void 0:i.offset)||Is.offset.default),o=P((i==null?void 0:i.showClose)||Is.showClose.default),a=P(!1);let l=-1;const c=d=>{l>-1&&(clearTimeout(l),l=-1),a.value=!0,f(d||{}),n.value&&(l=setTimeout(()=>{u()},n.value))},u=()=>{a.value=!1,l>-1&&(clearTimeout(l),l=-1)},f=d=>{const{message:p=t.value,type:g=s.value,offset:h=r.value,duration:m=n.value,showClose:y=o.value}=d;n.value=(i==null?void 0:i.duration)===0?i==null?void 0:i.duration:m,t.value=p,s.value=g,r.value=h,o.value=y};return Ye(()=>i==null?void 0:i.isShow,d=>{d&&c()},{immediate:!0}),Ye(a,d=>{d||e("onClose")}),{messageContent:t,messageDuration:n,messageType:s,messageOffset:r,isShowCloseIcon:o,visible:a,show:c,close:u}}const Xg="data:image/svg+xml,%3csvg%20t='1700123349738'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6300'%20width='16'%20height='16'%3e%3cpath%20d='M512%2097.52381c228.912762%200%20414.47619%20185.563429%20414.47619%20414.47619s-185.563429%20414.47619-414.47619%20414.47619S97.52381%20740.912762%2097.52381%20512%20283.087238%2097.52381%20512%2097.52381z%20m129.29219%20233.447619l-129.267809%20129.29219-129.316571-129.29219-51.736381%2051.736381%20129.316571%20129.267809-129.316571%20129.316571%2051.736381%2051.736381L512%20563.687619l129.29219%20129.316571%2051.736381-51.73638L563.687619%20512l129.316571-129.29219-51.73638-51.736381z'%20p-id='6301'%20fill='%23d54941'%3e%3c/path%3e%3c/svg%3e",em="data:image/svg+xml,%3csvg%20t='1700121539788'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4018'%20width='16'%20height='16'%3e%3cpath%20d='M512%2097.52381c228.912762%200%20414.47619%20185.563429%20414.47619%20414.47619s-185.563429%20414.47619-414.47619%20414.47619S97.52381%20740.912762%2097.52381%20512%20283.087238%2097.52381%20512%2097.52381z%20m193.194667%20218.331428L447.21981%20581.315048l-103.936-107.812572-52.662858%2050.761143%20156.379429%20162.230857%20310.662095-319.683047-52.467809-50.956191z'%20p-id='4019'%20fill='%232ba471'%3e%3c/path%3e%3c/svg%3e",tm="data:image/svg+xml,%3csvg%20t='1700123274686'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5050'%20width='16'%20height='16'%3e%3cpath%20d='M512%2097.52381c228.912762%200%20414.47619%20185.563429%20414.47619%20414.47619s-185.563429%20414.47619-414.47619%20414.47619S97.52381%20740.912762%2097.52381%20512%20283.087238%2097.52381%20512%2097.52381z%20m36.571429%20341.333333h-73.142858v292.571428h73.142858V438.857143z%20m0-121.904762h-73.142858v73.142857h73.142858v-73.142857z'%20p-id='5051'%20fill='%23e37318'%3e%3c/path%3e%3c/svg%3e",nm="data:image/svg+xml,%3csvg%20t='1700123274686'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5050'%20width='16'%20height='16'%3e%3cpath%20d='M512%2097.52381c228.912762%200%20414.47619%20185.563429%20414.47619%20414.47619s-185.563429%20414.47619-414.47619%20414.47619S97.52381%20740.912762%2097.52381%20512%20283.087238%2097.52381%20512%2097.52381z%20m36.571429%20341.333333h-73.142858v292.571428h73.142858V438.857143z%20m0-121.904762h-73.142858v73.142857h73.142858v-73.142857z'%20p-id='5051'%20fill='%230052d9'%3e%3c/path%3e%3c/svg%3e",im="data:image/svg+xml,%3csvg%20t='1700123766247'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='6301'%20width='16'%20height='16'%3e%3cpath%20d='M557.2%20512l233.4-233.4c12.5-12.5%2012.5-32.8%200-45.2s-32.8-12.5-45.2%200L512%20466.8%20278.6%20233.4c-12.5-12.5-32.8-12.5-45.2%200s-12.5%2032.8%200%2045.2L466.8%20512%20233.4%20745.4c-12.5%2012.5-12.5%2032.8%200%2045.2%206.2%206.2%2014.4%209.4%2022.6%209.4s16.4-3.1%2022.6-9.4L512%20557.2l233.4%20233.4c6.2%206.2%2014.4%209.4%2022.6%209.4s16.4-3.1%2022.6-9.4c12.5-12.5%2012.5-32.8%200-45.2L557.2%20512z'%20p-id='6301'%20fill='%2373767a'%3e%3c/path%3e%3c/svg%3e",sm={options:{virtualHost:!0}},rm=ge(Z(F({},sm),{__name:"Message",props:Is,emits:Qg,setup(i,{expose:e,emit:t}
6){const n=i,s=t,{messageContent:r,messageType:o,messageOffset:a,isShowCloseIcon:l,visible:c,show:u,close:f}=Zg(n,s),d=ie(()=>Et([`${Qe}-message`,`${Qe}-message--${o.value}`,n.customClass])),p=ie(()=>Et([`${Qe}-message_icon`])),g=ie(()=>Et([`${Qe}-message_close`])),h=ie(()=>`${a.value}px`),m=ie(()=>F({top:h.value},n.customStyle)),y={info:nm,waring:tm,success:em,error:Xg};return e({show:u,close:f}),(R,I)=>v(c)?(w(),G("div",{key:0,class:fe(v(d)),style:Ze([v(m)])},[_t(q("div",{class:fe(v(p))},[Y(Ds,{src:y[v(o)]},null,8,["src"])],2),[[yt,R.showIcon]]),q("span",null,ae(v(r)),1),_t(q("div",{class:fe(v(g)),onClick:I[0]||(I[0]=(...T)=>v(f)&&v(f)(...T))},[Y(Ds,{src:v(im)},null,8,["src"])],2),[[yt,v(l)]])],6)):X("",!0)}})),Jd=ve(rm,[["__scopeId","data-v-17dbe23c"]]),om={customClass:{type:String}},am={options:{virtualHost:!0,styleIsolation:"shared"}},Qd=ge(Z(F({},am),{__name:"Tip",props:om,setup(i){const{isFloatWindow:e}=$e(Hn()),{tip:t,duration:n}=e2(),{isGroupCall:s}=$e(Lt()),r=P(null),o=i,a=it.isPC,l=ie(()=>[o.customClass]),c=ie(()=>Qr({color:"white",background:"none",position:"absolute","z-index":4,"align-items":"center",left:"50%",top:`${a?"60%":"70%"}`,transform:"translate(-50%, -50%)","font-size":e.value?"12px":void 0})),u=ie(()=>Qr({color:"white",background:"none",position:"static",transform:"none","font-size":e.value?"12px":void 0})),f=ie(()=>s.value?u.value:c.value);return Ye(t,()=>{var d;(d=r.value)==null||d.show({message:t.value,duration:n.value,offset:0})}),(d,p)=>(w(),G("div",null,[Y(Jd,{showIcon:!1,class:fe(v(l)),ref_key:"message",ref:r,customStyle:v(f)},null,8,["class","customStyle"])]))}})),lm=["%","vw"],cm={length:{type:Number,default:0},unit:{type:String,values:lm,default:"%"},enableFocus:{type:Boolean,default:!1},layout:{type:Array},focus:{type:[String,Number]}},um=["change","toggle"],Zd="GridContextKey",dm={options:{virtualHost:!0}},Xd=ge(Z(F({},dm),{__name:"Grid",props:cm,emits:um,setup(i,{emit:e}){const t=i,n=P(t.focus),s=P(t.layout),r=P(t.unit),o=e;function a(l){o("toggle",l)}return Ye(()=>t.focus,()=>n.value=t.focus),Ye(()=>t.layout,()=>s.value=t.layout),Ye(()=>t.unit,()=>r.value=t.unit),An(Zd,{layout:s,enableFocus:t.enableFocus,handleFocusChange:a,focus:n,unit:r}),(l,c)=>(w(),G("div",{style:{height:"100%"}},[Ve(l.$slots,"default")]))}})),fm={options:{virtualHost:!0}},hm=ge(Z(F({},fm),{__name:"GridItem",props:["index","height","customStyle"],setup(i){const e=i,{layout:t,enableFocus:n,handleFocusChange:s,focus:r,unit:o}=Dn(Zd),a=100/12,l=a,c=P({}),u=Et([`${Qe}-grid-item`,{pc:us,mobile:!us,h5:wd}]),f=()=>{const p=String(e.index)===String(r.value)?null:e.index;n&&s(p)},d=ie(()=>!!oc(t.value,{key:"i",value:e.index}));return ln(()=>{const p=oc(t.value,{key:"i",value:e.index});if(!p)return;const{x:g,y:h,w:m,h:y,customStyle:R,customProps:I}=p;
6c.value=F(F({width:m*a+o.value,height:e.height||y*l+o.value,left:g*a+o.value,top:h*l+o.value,position:"absolute",visibility:(I==null?void 0:I.show)===!1?"hidden":""},e.customStyle),R)}),st(()=>{String(e.index)===String(r.value)&&n&&s(null)}),(p,g)=>v(d)?(w(),G("div",{key:0,class:fe(v(u)),style:Ze([v(c)]),onClick:f},[Ve(p.$slots,"default",{},void 0,!0)],6)):X("",!0)}})),Vn=ve(hm,[["__scopeId","data-v-7b38d982"]]);function pm(){const i=P([]),e=P([]),{callStatus:t,isGroupCall:n,callType:s,callRole:r}=$e(Lt()),{status:o}=Cr()||{},a=c2();return Ye([t,n,s,r,o,a],()=>{var y,R,I;let l=a.value;const c=it.isPC?"pc":"mobile",u=n.value?"groupCall":"singleCall",f=s.value===rt.AUDIO?"audio":"video";let d=t.value===Be.CALLING?r.value===Dt.CALLER?"calling":"accept":t.value;n&&(o==null?void 0:o.value)==="close"&&(d="close_"+d);const p=((I=(R=(y=l==null?void 0:l[c])==null?void 0:y[u])==null?void 0:R[f])==null?void 0:I[d])||[];e.value=p;const g=[];let h=0;for(let T=0;T<p.length;T++){const C=T===0?p[T].filter(L=>{var E;return((E=L==null?void 0:L.props)==null?void 0:E.show)!==!1}):p[T];p[T]=C;const _=12/C.length,A=3;for(let L=0;L<C.length;L++)g[h++]={i:C[L].name,x:L*_,y:T*_,w:_,h:A,customStyle:C[L].customStyle,customProps:C[L].props}}h=0;let m=[];for(let T=0;T<p.flat().length;T++)m[T]=g[h++];m=m.filter(T=>T.i),i.value=m},{immediate:!0}),{layout:i,config:e}}function gm(...i){let e=window==null?void 0:window.document,t="",n=()=>{},s={};if(typeof i[0]=="string"?[t,n,s]=i:[e,t,n,s]=i,!!e)return e==null||e.addEventListener(t,n,s),()=>{e==null||e.removeEventListener(t,n,s)}}function mm(i,e){let t=()=>{};et(()=>{t=gm("click",s=>{const r=i.map(l=>v(l)),o=s.composedPath(),a=[];for(let l=0;l<r.length;l++)a[l]=o.includes(r[l]);a.every(l=>!l)&&e()},{passive:!0})}),st(()=>{t==null||t()})}const vm=(i,e,t,n,s)=>{const r=t.isShowArrow?t.arrowSize:0,o=`${i.width/2-e.width/2}px`,a=`${i.height/2-e.height/2}px`,l=`${r}px solid ${t.color}`,c=F({},n),u=F({},s);switch(t.placement){case"top":c.left=o,c.top=`-${e.height+r+t.arrowDistance}px`,u.borderTop=l,u.left=`${i.width/2-r/2}px`,u.top=`-${r+t.arrowDistance}px`;break;case"bottom":c.left=o,c.top=`${i.height+r+t.arrowDistance}px`,u.borderBottom=l,u.left=`${i.width/2-r/2}px`,u.top=`${i.height+t.arrowDistance-r}px`;break;case"left":c.left=`-${e.width+r+t.arrowDistance}px`,c.top=a,u.borderLeft=l,u.left=`-${r*2-t.arrowDistance}px`,u.top=`${i.height/2-r/2}px`;break;case"right":c.left=`${i.width+r+t.arrowDistance}px`,c.top=a,u.borderRight=l,u.left=`${i.width+r*2-t.arrowDistance}px`,u.top=`${i.height/2-r/2}px`;break}return{finalContentStyle:c,finalArrowStyle:u}},Cm=["click","hover"],_m=["top","bottom","left","right"],e0={trigger:{type:String,values:Cm,default:"click"},placement:{type:String,values:_m,default:"top"},color:{type:String},isShowArrow:{type:Boolean,default:!0},arrowSize:{type:Number,default:5},arrowDistance:{type:Number,default:5},show:{type:Boolean},autoClose:{type:Number,default:300}},ym={options:{virtualHost:!0}},Im=ge(Z(F({},ym),{__name:"PopoverWeb",props:e0,emits:["hover"],setup(i,{emit:e}){const t=i,n=`${Qe}-popover`,s=`${Qe}-popover_content`,r=`${Qe}-popover_arrow`,o=`${Qe}-popover_trigger`,a=P(),l=P(),c=P(),u=P(!1),f=P(null),d=ie(()=>u.value&&t.isShowArrow&&t.show),p=Qr({left:"0px",top:"0px",backgroundColor:t.color}),g=P(p),h=`${t.arrowSize}px solid transparent`,m={borderLeft:h,borderRight:h,borderTop:h,borderBottom:h,top:"0px",left:"0px"},y=P(m),R=e,I=()=>{ei(()=>{var b,k,U,O;if(!u.value||!t.show)return;const L=(k=(b=l.value).getBoundingClientRect)==null?void 0:k.call(b),E=(O=(U=c.value).getBoundingClientRect)==null?void 0:O.call(U),{finalContentStyle:M,finalArrowStyle:B}=vm(L,E,t,p,m);g.value=F(F({},p),M),y.value=F(F({},m),B)})},T=()=>{clearTimeout(f.value)},C=()=>{t.trigger==="click"&&(u.value=!u.value,I())},_=()=>{t.trigger==="hover"&&(R("hover"),T(),u.value=!0,I())},A=()=>{t.trigger==="hover"&&(f.value=setTimeout(()=>{u.value=!1,I()},1e3))};return mm([a],()=>{u.value=!1}),(L,E)=>(w(),G("div",{class:fe(n),ref_key:"popoverRef",ref:a},[v(u)&&L.show?(w(),G("div",{key:0,ref_key:"contentRef",ref:c,onMouseenter:T,onMouseleave:A,class:fe(s),style:Ze([v(g)])},[Ve(L.$slots,"content",{},void 0,!0)],36)):X("",!0),v(d)?(w(),G("div",{key:1,style:Ze([v(y)]),class:fe(r)},null,4)):X("",!0),q("div",{ref_key:"triggerRef",ref:l,class:fe(o),onClick:C,onMouseenter:_,onMouseleave:A},[Ve(L.$slots,"trigger",{},void 0,!0)],544)],512))}})),Em=ve(Im,[["__scopeId","data-v-624973d9"]]),Sm={options:{virtualHost:!0}};function Tm(i,e,t,n,s,r){return null}const Lm=ve(Sm,[["render",Tm],["__scopeId","data-v-0372ccf9"]]),wm={options:{virtualHost:!0}},ml=ge(Z(F({},wm),{__name:"Popover",props:e0,emits:["hover"],setup(i,{emit:e}){const t=e,n=()=>{t("hover")};return(s,r)=>(w(),G(ze,null,[v(is)?X("",!0):(w(),ne(Em,Wl({key:0,onHover:n},s.$props),{trigger:re(()=>[Ve(s.$slots,"trigger")]),content:re(()=>[Ve(s.$slots,"content")]),_:3},16)),v(is)?(w(),ne(Lm,bh(Wl({key:1},s.$props)),{trigger:re(()=>[Ve(s.$slots,"trigger")]),content:re(()=>[Ve(s.$slots,"content")]),_:3},16)):X("",!0)],64))}})),Am={deviceType:{type:String},isShowControlBtn:{type:Boolean,default:!1}},bm={options:{virtualHost:!0}},Rm=ge(Z(F({},bm),{__name:"DeviceSelect",props:Am,setup(i){const e=i,[{deviceList:t,currentDeviceId:n},{updateCurrentDeviceId:s}]=Eo(e.deviceType),{localUserInfoExcludeVolume:r}=$e(Sn()),{isMuteSpeaker:o}=$e(Lt()),a=To(),l=d=>ye(this,null,function*(){try{f(),yield We.switchDevice({deviceType:e.deviceType,deviceId:d}),s(d)}catch(p){}}),c=()=>ye(this,null,function*(){var d,p;f(),e.deviceType===qt.CAMERA&&((d=r.value)!=null&&d.isVideoAvailable?yield We.closeCamera():yield We.openCamera("localVideo")),e.deviceType===qt.MICROPHONE&&((p=r.value)!=null&&p.isAudioAvailable?yield We.closeMicrophone():yield We.openMicrophone()),e.deviceType===qt.SPEAKER&&(o.value?yield We.unMuteSpeaker():yield We.muteSpeaker())}),u=ie(()=>{var d;if(e.deviceType===qt.CAMERA)return r!=null&&r.value.isVideoAvailable?Ge("close camera"):Ge("open camera");if(e.deviceType===qt.MICROPHONE)return(d=r==null?void 0:r.value)!=null&&d.isAudioAvailable?Ge("close microphone"):Ge("open microphone");if(e.deviceType===qt.SPEAKER)return o.value?Ge("open speaker"):Ge("close speaker")}),f=()=>{a.value="close"};return(d,p)=>(w(),G("div",{class:"device-selector-container"},[q("div",{class:"scroll-container"},[q("div",{class:"scroll-content"},[(w(!0),G(ze,null,pt(v(t),g=>(w(),G("div",{key:g.deviceId},[Y(Mt,{width:"100%",color:"#ffff",truncated:!0,size:"14px",class:fe(["device-item",{select:v(n)===g.deviceId}]),onClick:()=>l(g.deviceId)},{default:re(()=>[qe(ae(g.label),1)]),_:2},1032,["class","onClick"])]))),128))])]),q("div",{class:"control-item"}),d.isShowControlBtn?(w(),ne(Mt,{key:0,width:"100%",color:"#ffff",truncated:!0,size:"14px",class:"device-item",onClick:c},{default:re(()=>[qe(ae(v(u)),1)]),_:1})):X("",!0)]))}})),vl=ve(Rm,[["__scopeId","data-v-cb0b5f52"]]),Om={options:{virtualHost:!0}},Dm=ge(Z(F({},Om),{__name:"Camera",props:hi,setup(i){const e=i,t=P(!0),n=it.isPC,{localUserInfoExcludeVolume:s}=$e(Sn()),r=P(s==null?void 0:s.value.isVideoAvailable),o=ie(()=>s==null?void 0:s.value.isVideoAvailable),a=To(),[{deviceList:l}]=Eo(qt.CAMERA),c=ie(()=>{var h;return((h=l.value)==null?void 0:h.length)>0&&a.value==="camera"}),u=ie(()=>t.value?o.value?"basicConfig":"closedConfig":"loadingConfig"),f=ie(()=>s!=null&&s.value.isVideoAvailable?Ge("camera enabled"):Ge("camera disabled")),d=_n("camera",u),p=()=>ye(this,null,function*(){t.value=!1,r.value=!o.value,o.value?yield We.closeCamera():yield We.openCamera("localVideo"),t.value=!0}),g=()=>{a.value="camera"};
6return(h,m)=>(w(),G("div",{class:"btn-content"},[v(n)?(w(),ne(ml,{key:0,color:"rgba(107, 117, 138, 0.5)",show:v(c),onHover:g,trigger:"hover"},{content:re(()=>[Y(vl,{isShowControlBtn:!0,deviceType:v(qt).CAMERA},null,8,["deviceType"])]),trigger:re(()=>[Y(cn,{loading:!v(t),iconSrc:v(d).iconSrc,color:v(d).color,iconSize:v(d).iconSize,width:e.width||v(d).width,height:e.height||v(d).height,loadingWidth:v(d).loadingWidth,loadingHeight:v(d).loadingHeight,shape:v(d).shape,onClick:p},null,8,["loading","iconSrc","color","iconSize","width","height","loadingWidth","loadingHeight","shape"])]),_:1},8,["show"])):X("",!0),v(n)?X("",!0):(w(),ne(cn,{key:1,loading:!v(t),iconSrc:v(d).iconSrc,color:v(d).color,iconSize:e.iconSize||v(d).iconSize,width:e.width||v(d).width,height:e.height||v(d).height,loadingWidth:v(d).loadingWidth,loadingHeight:v(d).loadingHeight,shape:"circle",onClick:p},null,8,["loading","iconSrc","color","iconSize","width","height","loadingWidth","loadingHeight"])),v(d).showText?(w(),ne(Mt,{key:2,textStyle:v(d).textStyle,color:v(d).textColor,size:v(d).textSize},{default:re(()=>[qe(ae(v(f)),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Mm=ve(Dm,[["__scopeId","data-v-1c7eb1af"]]),km={options:{virtualHost:!0}},Nm=ge(Z(F({},km),{__name:"Hangup",props:hi,setup(i){const e=i,t=n2(),n=ie(()=>t.value?"basicConfig":"loadingConfig"),s=_n("hangup",n),r=()=>ye(this,null,function*(){yield We.hangup()});return(o,a)=>(w(),G("div",{class:"btn-content"},[Y(cn,{loading:!v(t),loadingWidth:v(s).loadingWidth,loadingHeight:v(s).loadingHeight,iconSrc:v(s).iconSrc,color:v(s).color,iconSize:e.iconSize||v(s).iconSize,width:e.width||v(s).width,height:e.height||v(s).height,shape:v(s).shape,onClick:r},null,8,["loading","loadingWidth","loadingHeight","iconSrc","color","iconSize","width","height","shape"]),v(s).showText?(w(),ne(Mt,{key:0,textStyle:v(s).textStyle,color:v(s).textColor,size:v(s).textSize},{default:re(()=>[qe(ae(v(Ge)("hangup")),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),xm=ve(Nm,[["__scopeId","data-v-601b18cb"]]),Um={options:{virtualHost:!0}},Pm=ge(Z(F({},Um),{__name:"Accept",props:hi,setup(i){const e=P(!0),t=i,n=ie(()=>e.value?"basicConfig":"loadingConfig"),s=_n("accept",n),r=()=>ye(this,null,function*(){e.value=!1,yield We.accept(),e.value=!0});return(o,a)=>(w(),G("div",{class:"btn-content"},[Y(cn,{iconSrc:v(s).iconSrc,color:v(s).color,iconSize:t.iconSize||v(s).iconSize,width:t.width||v(s).width,height:t.height||v(s).height,shape:v(s).shape,loading:!v(e),loadingWidth:v(s).loadingWidth,loadingHeight:v(s).loadingHeight,onClick:r},null,8,["iconSrc","color","iconSize","width","height","shape","loading","loadingWidth","loadingHeight"]),v(s).showText?(w(),ne(Mt,{key:0,textStyle:v(s).textStyle,color:v(s).textColor,size:v(s).textSize},{default:re(()=>[qe(ae(v(Ge)("accept")),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Vm=ve(Pm,[["__scopeId","data-v-d245ba04"]]),Bm={options:{virtualHost:!0}},Fm=ge(Z(F({},Bm),{__name:"Microphone",props:hi,setup(i){const{t:e}=Qa(),t=it.isPC,n=P(!0),{localUserInfoExcludeVolume:s}=$e(Sn()),r=To(),[{deviceList:o}]=Eo(qt.MICROPHONE),a=ie(()=>{var p;return((p=o.value)==null?void 0:p.length)>0&&r.value==="microphone"}),l=ie(()=>n.value?s!=null&&s.value.isAudioAvailable?"basicConfig":"closedConfig":"loadingConfig"),c=_n("microphone",l),u=ie(()=>s!=null&&s.value.isAudioAvailable?e("call-uikit-vue.microphone_enabled"):e("call-uikit-vue.microphone_disabled")),f=()=>ye(this,null,function*(){s!=null&&s.value.isAudioAvailable?yield We.closeMicrophone():yield We.openMicrophone()}),d=()=>{r.value="microphone"};return(p,g)=>(w(),G("div",{class:"btn-content"},[v(t)?(w(),ne(ml,{key:0,color:"rgba(107, 117, 138, 0.5)",show:v(a),trigger:"hover",onHover:d},{content:re(()=>[Y(vl,{isShowControlBtn:"",deviceType:v(qt).MICROPHONE},null,8,["deviceType"])]),trigger:re(()=>[Y(cn,{loading:!v(n),iconSrc:v(c).iconSrc,color:v(c).color,iconSize:v(c).iconSize,width:v(c).width,height:v(c).height,loadingWidth:v(c).loadingWidth,loadingHeight:v(c).loadingHeight,shape:v(c).shape,onClick:f},null,8,["loading","iconSrc","color","iconSize","width","height","loadingWidth","loadingHeight","shape"])]),_:1},8,["show"])):X("",!0),v(t)?X("",!0):(w(),ne(cn,{key:1,loading:!v(n),iconSrc:v(c).iconSrc,color:v(c).color,iconSize:v(c).iconSize,width:v(c).width,height:v(c).height,loadingWidth:v(c).loadingWidth,loadingHeight:v(c).loadingHeight,shape:v(c).shape,onClick:f},null,8,["loading","iconSrc","color","iconSize","width","height","loadingWidth","loadingHeight","shape"])),v(c).showText?(w(),ne(Mt,{key:2,textStyle:v(c).textStyle,color:v(c).textColor,size:v(c).textSize},{default:re(()=>[qe(ae(v(u)),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Gm=ve(Fm,[["__scopeId","data-v-7fc643fa"]]),Hm={options:{virtualHost:!0}},$m=ge(Z(F({},Hm),{__name:"Reject",props:hi,setup(i){const e=i,t=_n("reject",P("basicConfig")),n=()=>ye(this,null,function*(){yield We.reject()});return(s,r)=>(w(),G("div",{class:"btn-content"},[Y(cn,{iconSrc:v(t).iconSrc,color:v(t).color,iconSize:v(t).iconSize,width:e.width||v(t).width,height:e.height||v(t).height,shape:v(t).shape,onClick:n},null,8,["iconSrc","color","iconSize","width","height","shape"]),v(t).showText?(w(),ne(Mt,{key:0,textStyle:v(t).textStyle,color:v(t).textColor,size:v(t).textSize},{default:re(()=>[qe(ae(v(Ge)("reject")),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),jm=ve($m,[["__scopeId","data-v-ff89a116"]]),Wm={options:{virtualHost:!0}},zm=ge(Z(F({},Wm),{__name:"Speaker",props:hi,setup(i){const{t:e}=Qa(),t=it.isWeChat,n=it.isPC,s=i,{isEarPhone:r,isMuteSpeaker:o}=$e(Lt()),a=To(),l=ie(()=>r.value?"closedConfig":"basicConfig"),c=ie(()=>o.value?"closedConfig":"basicConfig"),[{deviceList:u,currentDeviceId:f}]=Eo(qt.SPEAKER),d=ie(()=>{var y;return((y=u.value)==null?void 0:y.length)>0&&a.value==="speaker"&&n}),p=t?_n("speaker",l):_n("speaker",c),g=()=>ye(this,null,function*(){o.value?yield We.unMuteSpeaker():yield We.muteSpeaker()}),h=()=>
6{if(n){const y=u.value.find(R=>R.deviceId===f.value);return y?y.label:e("call-uikit-vue.speaker_enabled")}else return o.value?e("call-uikit-vue.speaker_disabled"):e("call-uikit-vue.speaker_enabled")},m=()=>{a.value="speaker"};return(y,R)=>(w(),G("div",{class:"btn-content"},[Y(ml,{color:"rgba(107, 117, 138, 0.5)",trigger:"hover",show:d.value,onHover:m},{content:re(()=>[Y(vl,{isShowControlBtn:!0,deviceType:v(qt).SPEAKER},null,8,["deviceType"])]),trigger:re(()=>[Y(cn,{iconSrc:v(p).iconSrc,color:v(p).color,iconSize:s.iconSize||v(p).iconSize,width:s.width||v(p).width,height:s.height||v(p).height,shape:v(p).shape,onClick:g},null,8,["iconSrc","color","iconSize","width","height","shape"])]),_:1},8,["show"]),v(p).showText?(w(),ne(Mt,{key:0,width:"70px",truncated:!0,textStyle:v(p).textStyle,color:v(p).textColor,size:v(p).textSize,lineClamp:2},{default:re(()=>[qe(ae(h()),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Km=ve(zm,[["__scopeId","data-v-0bd3968a"]]),Ym={options:{virtualHost:!0}},qm=ge(Z(F({},Ym),{__name:"SwitchCamera",setup(i){const{localUserInfoExcludeVolume:e}=$e(Sn()),t=ie(()=>e==null?void 0:e.value.isVideoAvailable),n=ie(()=>t.value?"basicConfig":"disableConfig"),s=_n("switchCamera",n),r=()=>ye(this,null,function*(){t.value&&(yield We.switchCamera())});return(o,a)=>(w(),G("div",{class:"btn-content"},[Y(cn,{iconSrc:v(s).iconSrc,iconSize:v(s).iconSize,color:v(s).color,width:v(s).width,height:v(s).height,buttonStyle:v(s).buttonStyle,shape:"circle",onClick:r},null,8,["iconSrc","iconSize","color","width","height","buttonStyle"]),v(s).showText?(w(),ne(Mt,{key:0,textStyle:v(s).textStyle,color:v(s).textColor,size:v(s).textSize},{default:re(()=>[qe(ae(v(Ge)("switch camera")),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Jm=ve(qm,[["__scopeId","data-v-b6e4c50b"]]),Qm={options:{virtualHost:!0}},Zm=ge(Z(F({},Qm),{__name:"VirtualBackground",props:hi,setup(i){const e=i,t=P(!0),{localUserInfoExcludeVolume:n}=$e(Sn()),s=ie(()=>n==null?void 0:n.value.isVideoAvailable),{enableVirtualBackground:r}=$e(Lt()),o=ie(()=>t.value?r.value?"closedConfig":s.value?"basicConfig":"disableConfig":"loadingConfig"),a=_n("virtualBackground",o),l=()=>ye(this,null,function*(){s.value&&(t.value=!1,yield We.setBlurBackground(!r.value),t.value=!0)});return(c,u)=>(w(),G("div",{class:"btn-content"},[Y(cn,{loading:!v(t),iconSrc:v(a).iconSrc,color:v(a).color,iconSize:e.iconSize||v(a).iconSize,width:e.width||v(a).width,height:e.height||v(a).height,shape:v(a).shape,loadingWidth:v(a).loadingWidth,loadingHeight:v(a).loadingHeight,buttonStyle:v(a).buttonStyle,onClick:l},null,8,["loading","iconSrc","color","iconSize","width","height","shape","loadingWidth","loadingHeight","buttonStyle"]),v(a).showText?(w(),ne(Mt,{key:0,width:"70px",lineClamp:2,textStyle:v(a).textStyle,color:v(a).textColor,size:v(a).textSize},{default:re(()=>[qe(ae(v(Ge)("virtual-background")),1)]),_:1},8,["textStyle","color","size"])):X("",!0)]))}})),Xm=ve(Zm,[["__scopeId","data-v-87b3b9be"]]),e3={options:{virtualHost:!0}},t3=ge(Z(F({},e3),{__name:"ToggleButtonPanel",props:hi,setup(i){const{status:e}=Cr(),t=i,n=_n("toggleButtonPanel",P("basicConfig")),s=()=>ye(this,null,function*(){e.value=e.value==="close"?"open":"close"});return(r,o)=>(w(),G("div",{class:"btn-content"},[Y(cn,{iconSrc:v(n).iconSrc,color:v(n).color,iconSize:t.iconSize||v(n).iconSize,width:t.width||v(n).width,height:t.height||v(n).height,shape:v(n).shape,onClick:s},null,8,["iconSrc","color","iconSize","width","height","shape"])]))}})),n3=ve(t3,[["__scopeId","data-v-4b12fb60"]]),i3={options:{virtualHost:!0}},s3=ge(Z(F({},i3),{__name:"ButtonPanel",props:{isPC:{type:Boolean,default:!1}},setup(i){const e=P(null),t=P({}),{isGroupCall:n}=$e(Lt()),{status:s}=Cr()||{},r=P(!1),o=P(!1),a=P(""),l=Ed(),c=i;ln(()=>{r.value||(n.value&&!c.isPC&&l.value!==null?r.value=!0:r.value=!1)});const u=ie(()=>Et(["button-panel-container",{pc:c.isPC,mobile:!c.isPC,h5:!c.isPC,groupCall:n.value,singleCall:!n.value,close:(s==null?void 0:s.value)==="close",open:(s==null?void 0:s.value)==="open",showBackGround:r.value}])),f=Et(["toggle-button-container",{h5:it.isH5}]),d=it.isH5?{transitionProperty:"width,height,left,top",transitionDuration:"0.3s",transitionTimingFunction:"ease-in"}:{};function p(R){e.value=R}const{layout:g,config:h}=pm();Ye(h,()=>{const R={},I=h.value.flat();for(let T of I){const{name:C,props:_={}}=T;_.showText!==!1&&(_.showText=!0),R[C]=_}t.value=R},{immediate:!0});function m(R){o.value=R}const y={[N.IS_CLICKABLE]:m};return et(()=>{le.watch(j.CALL,y,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,y)}),An(gd,o),An(md,a),(R,I)=>(w(),G("div",{class:fe(v(u))},[q("div",{class:"button-group"},[Y(Xd,{unit:"%",onToggle:p,layout:v(g),focus:v(e)},{default:re(()=>[Y(Vn,{index:"accept",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Vm)]),_:1},8,["customStyle"]),Y(Vn,{index:"reject",height:"auto",customStyle:v(d)},{default:re(()=>[Y(jm)]),_:1},8,["customStyle"]),Y(Vn,{index:"microphone",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Gm)]),_:1},8,["customStyle"]),Y(Vn,{index:"hangup",height:"auto",customStyle:v(d)},{default:re(()=>[Y(xm)]),_:1},8,["customStyle"]),Y(Vn,{index:"speaker",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Km)]),_:1},8,["customStyle"]),Y(Vn,{index:"camera",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Mm)]),_:1}
6,8,["customStyle"]),Y(Vn,{index:"virtualBackground",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Xm)]),_:1},8,["customStyle"]),Y(Vn,{index:"switchCamera",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Jm)]),_:1},8,["customStyle"]),Y(Vn,{index:"inviteUser",height:"auto",customStyle:v(d)},{default:re(()=>[Y(Ud)]),_:1},8,["customStyle"])]),_:1},8,["layout","focus"])]),v(r)?(w(),G("div",{key:0,class:fe(v(f))},[Y(n3)],2)):X("",!0)],2))}})),t0=ve(s3,[["__scopeId","data-v-c46bca0e"]]),r3=ge({__name:"SingleCall",setup(i){const{callStatus:e}=$e(Lt());return(t,n)=>(w(),G("div",{class:"singlecall-container"},[Y(Pd),v(e)===v(Be).CALLING?(w(),ne(Hd,{key:0})):X("",!0),Y(qg),Y(Qd),Y(t0)]))}}),o3=ve(r3,[["__scopeId","data-v-61f01bcd"]]),a3=ge({__name:"TDialog",props:{moduleValue:{type:Boolean,default:!1},isHeaderShow:{type:Boolean,default:!0},isFooterShow:{type:Boolean,default:!0},background:{type:Boolean,default:!0},title:{type:String,default:""},center:{type:Boolean,default:!1},isH5:{type:Boolean,default:!1}},emits:["update:moduleValue","submit"],setup(i,{emit:e}){const t={OUTSIDE:"outside",INSIDE:"inside"},n=i,s=P(!0),r=P(!0),o=P(!0),a=P("");ln(()=>{a.value=n.title,s.value=n.isHeaderShow,r.value=n.isFooterShow,o.value=n.background});const l=e,c=d=>{d===t.OUTSIDE&&u()},u=()=>{l("update:moduleValue",!1)},f=()=>{l("submit"),u()};return(d,p)=>{const g=mo;return i.moduleValue?(w(),G("div",{key:0,class:fe(["dialog",[n.isH5?"dialog-h5":"",i.center?"center":""]]),onClick:p[1]||(p[1]=It(h=>c(t.OUTSIDE),["stop","prevent"]))},[q("main",{class:fe(["dialog-main",[v(o)?"":"dialog-main-back"]]),onClick:p[0]||(p[0]=It(h=>c(t.INSIDE),["stop","prevent"]))},[v(s)?(w(),G("header",{key:0,class:"dialog-main-header"},[q("h1",{class:"dialog-main-title"},ae(v(a)),1),q("i",{class:"icon icon-close",onClick:u})])):X("",!0),q("div",{class:fe(["dialog-main-content",[n.isH5?"dialog-main-content-uniapp":""]])},[Ve(d.$slots,"default",{},void 0,!0)],2),v(r)?(w(),G("footer",{key:1,class:"dialog-main-footer"},[Y(g,{class:"btn btn-cancel",onClick:u},{default:re(()=>[qe(ae(v(Ge)("Cancel")),1)]),_:1}),Y(g,{class:"btn btn-default",onClick:f},{default:re(()=>[qe(ae(v(Ge)("Done")),1)]),_:1})])):X("",!0)],2)],2)):X("",!0)}}}),l3=ve(a3,[["__scopeId","data-v-15253fcd"]]),c3=ge({__name:"TIcon",props:{file:{type:String,default:""},width:{type:String,default:"20px"},height:{type:String,default:"20px"},isApp:{type:Boolean,default:!1}},emits:["click"],setup(i,{emit:e}){const t=e,n=i,s=()=>{t("click")};return(r,o)=>{const a=vr;return w(),G("div",{class:"icon",onClick:s},[n.isApp?(w(),ne(a,{key:0,class:"icon",alt:"Image",mode:"aspectFit","lazy-load":"",src:n.file,style:Ze({width:n.width,height:n.height})},null,8,["src","style"])):(w(),G("img",{key:1,class:"icon",src:n.file,style:Ze({width:n.width,height:n.height})},null,12,["src"]))])}}}),Wo=ve(c3,[["__scopeId","data-v-4e142702"]]),u3="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%3e%3ctitle%3e编组%2014%3c/title%3e%3cdefs%3e%3cfilter%20x='-10.6%25'%20y='-5.4%25'%20width='121.2%25'%20height='110.9%25'%20filterUnits='objectBoundingBox'%20id='filter-1'%3e%3cfeOffset%20dx='0'%20dy='7'%20in='SourceAlpha'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='10'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.1%200'%20type='matrix'%20in='shadowBlurOuter1'%20result='shadowMatrixOuter1'%3e%3c/feColorMatrix%3e%3cfeMerge%3e%3cfeMergeNode%20in='shadowMatrixOuter1'%3e%3c/feMergeNode%3e%3cfeMergeNode%20in='SourceGraphic'%3e%3c/feMergeNode%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='new'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='自定义消息'%20transform='translate(-458.000000,%20-318.000000)'%3e%3cg%20id='编组-32'%20filter='url(%23filter-1)'%20transform='translate(44.000000,%2060.000000)'%3e%3cg%20id='编组-24'%20transform='translate(30.000000,%20250.000000)'%3e%3cg%20id='编组-14'%20transform='translate(384.000000,%208.000000)'%3e%3ccircle%20id='椭圆形'%20fill='%23006EFF'%20fill-rule='nonzero'%20cx='8'%20cy='8'%20r='8'%3e%3c/circle%3e%3cpolyline%20id='路径-4'%20stroke='%23FFFFFF'%20stroke-width='2'%20transform='translate(8.042641,%206.242641)%20rotate(-315.000000)%20translate(-8.042641,%20-6.242641)%20'%20points='6.04264069%2010.2426407%2010.0426407%2010.2426407%2010.0426407%202.24264069'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",d3="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='48px'%20height='48px'%20viewBox='0%200%2048%2048'%20version='1.1'%3e%3ctitle%3eic_back_white%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='02.-查看信息-示例好友'%20transform='translate(-32.000000,%20-200.
6000000)'%3e%3cg%20id='编组-6'%20transform='translate(0.000000,%20176.000000)'%3e%3cg%20id='ic_back_white'%20transform='translate(32.000000,%2024.000000)'%3e%3cg%20id='ic_back_black'%20fill='%23444444'%20fill-rule='nonzero'%3e%3cpath%20d='M9.51231071,24%20L23.5198286,38.7290411%20C23.785378,39.0082689%2023.7753168,39.4496082%2023.4973187,39.7164448%20L21.6255915,41.5130226%20C21.3466827,41.7807332%2020.9035602,41.7716553%2020.6358496,41.4927466%20C20.6351032,41.491969%2020.6343586,41.4911896%2020.6336157,41.4904085%20L4.45876399,24.4823948%20C4.2017544,24.2121467%204.2017544,23.7878533%204.45876399,23.5176052%20L20.6336157,6.50959152%20C20.900035,6.22944906%2021.3431109,6.21832422%2021.6232533,6.48474351%20C21.6240344,6.48548634%2021.6248138,6.48623097%2021.6255915,6.48697741%20L23.4973187,8.28355524%20C23.7753168,8.55039175%2023.785378,8.99173114%2023.5198286,9.27095893%20L9.51231071,24%20L9.51231071,24%20Z'%20id='Path-2'%3e%3c/path%3e%3c/g%3e%3crect%20id='矩形'%20x='0'%20y='0'%20width='48'%20height='48'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",f3="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16px'%20height='16px'%20viewBox='0%200%2016%2016'%20version='1.1'%3e%3ctitle%3e清除%3c/title%3e%3cg%20id='页面-2备份'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='创建群聊'%20transform='translate(-1243.000000,%20-413.000000)'%3e%3cg%20id='Group-1364'%20transform='translate(650.000000,%20343.000000)'%3e%3cg%20id='Group-1363'%20transform='translate(290.000000,%2046.000000)'%3e%3cg%20id='Group-1358'%20transform='translate(0.000000,%2024.000000)'%3e%3cg%20id='清除'%20transform='translate(303.000000,%200.000000)'%3e%3cpath%20d='M0,0%20L16,0%20L16,16%20L0,16%20L0,0%20Z'%20id='矩形'%3e%3c/path%3e%3cpath%20d='M1,8%20C1,11.8659999%204.13400006,15%208,15%20C11.8659999,15%2015,11.8659999%2015,8%20C15,4.13400006%2011.8659999,1%208,1%20L8,1%20C4.13400006,1%201,4.13400006%201,8%20Z'%20fill='%23999999'%3e%3c/path%3e%3cg%20id='编组'%20transform='translate(8.000000,%208.000000)%20rotate(-315.000000)%20translate(-8.000000,%20-8.000000)%20translate(4.000000,%204.000000)'%20fill='%23FFFFFF'%3e%3crect%20id='矩形备份'%20transform='translate(4.000000,%204.000000)%20rotate(-90.000000)%20translate(-4.000000,%20-4.000000)%20'%20x='1.8189894e-12'%20y='3.5'%20width='8'%20height='1'%20rx='0.5'%3e%3c/rect%3e%3crect%20id='矩形备份'%20transform='translate(4.000000,%204.000000)%20rotate(-360.000000)%20translate(-4.000000,%20-4.000000)%20'%20x='0'%20y='3.5'%20width='8'%20height='1'%20rx='0.5'%3e%3c/rect%3e%3c/g%3e%3crect%20id='矩形'%20x='0'%20y='0'%20width='16'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",h3=ge({__name:"TTransfer",props:{list:{type:Array,default:()=>[]},selectedList:{type:Array,default:()=>[]},isSearch:{type:Boolean,default:!0},isRadio:{type:Boolean,default:!1},isCustomItem:{type:Boolean,default:!1},title:{type:String,default:""},type:{type:String,default:""},resultShow:{type:Boolean,default:!0},total:{type:Number,default:0},isH5:{type:Boolean,default:!1}},emits:["search","submit","cancel","getMore"],setup(i,{emit:e}){const t=i,n=e,s=P([]),r=P(0),o=P([]),a=P(!0),l=P(!1),c=P(""),u=P(""),f=P(),d=sl(),{groupUsers:p}=nl(d);ln(()=>{const{list:I,isCustomItem:T,isSearch:C,title:_,total:A,selectedList:L}=t;if(T)for(let E=0;E<I.length;E++)I[E].conversationID.indexOf("@TIM#SYSTEM")>-1&&I.splice(E,1),s.value=I;else s.value=I;r.value=A||I.length,o.value=L&&L.length>0?L:o.value,a.value=C,l.value=T,c.value=_}),ie(()=>s.value.filter(I=>!I.isDisabled)),et(()=>{Ee.watch(be.CONV,{currentConversationID:g})}),st(()=>{Ee.unwatch(be.CONV,{currentConversationID:g})});function g(I){const T=I.replace("GROUP","");f.value=p.value[T]}const h=I=>{if(I.isDisabled)return;let T=o.value;const C=T.indexOf(I);if(C>-1)return o.value.splice(C,1);t.isRadio&&(T=[]),T.push(I),o.value=T},m=()=>{n("submit",o.value),u.value=""},y=()=>{n("cancel"),u.value=""},R=()=>{n("getMore")};return(I,T)=>{const C=mo;return w(),G("div",{class:fe(["transfer",[t.isH5?"transfer-h5":""]])},[t.isH5?(w(),G("header",{key:0,class:"transfer-header transfer-h5-header",onClick:y},[Y(Wo,{class:"icon",file:v(d3),width:"18px",height:"18px"},null,8,["file"]),q("span",{class:"title"},ae(v(c)),1),q("span",{class:"space"}
6)])):X("",!0),q("main",{class:"main"},[q("div",{class:"left"},[q("header",{class:"transfer-header"}),q("main",{class:"transfer-left-main"},[q("ul",{class:"transfer-list"},[(w(!0),G(ze,null,pt(v(s),_=>{var A,L;return w(),G(ze,{key:_.userID},[_.userID!=="moretickets_robot"?(w(),G("li",{key:0,class:"transfer-list-item",onClick:E=>h(_)},[v(o).indexOf(_)>-1?(w(),ne(Wo,{key:0,file:v(u3),class:fe([_.isDisabled&&"disabled"]),width:"18px",height:"18px"},null,8,["file","class"])):(w(),G("i",{key:1,class:fe([_.isDisabled&&"disabled","icon-unselected"])},null,2)),v(l)?Ve(I.$slots,"left",{key:3,data:_},void 0,!0):(w(),G(ze,{key:2},[q("img",{class:"avatar",src:_.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"]),q("span",{class:"name"},ae(((L=(A=v(f))==null?void 0:A[_.userID||""])==null?void 0:L.nickname)||_.nick||_.userID),1),_.isDisabled?(w(),G("span",{key:0})):X("",!0)],64))],8,["onClick"])):X("",!0)],64)}),128)),v(r)>v(s).length?(w(),G("li",{key:0,class:"transfer-list-item more",onClick:R},ae(I.$t("call-uikit-vue.view_more")),1)):X("",!0)])])]),q("div",{class:"right"},[t.isH5?X("",!0):(w(),G("header",{key:0,class:"transfer-header"},ae(v(c)),1)),i.resultShow?(w(),G("ul",{key:1,class:"transfer-list"},[v(o).length>0&&!t.isH5?(w(),G("p",{key:0,class:"transfer-text"},ae(v(o).length)+" "+ae(I.$t("call-uikit-vue.people_selected")),1)):X("",!0),(w(!0),G(ze,null,pt(v(o),(_,A)=>(w(),G("li",{key:A,class:"transfer-list-item space-between"},[q("aside",{class:"transfer-list-item-content"},[v(l)?Ve(I.$slots,"right",{key:1,data:_},void 0,!0):(w(),G(ze,{key:0},[q("img",{class:"avatar",src:_.avatar||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",onerror:"this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"},null,8,["src"]),t.isH5?X("",!0):(w(),G("span",{key:0,class:"name"},ae(_.nick||_.userID),1))],64))]),t.isH5?X("",!0):(w(),G("span",{key:0,onClick:L=>h(_)},[Y(Wo,{file:v(f3),width:"18px",height:"18px"},null,8,["file"])],8,["onClick"]))]))),128))])):X("",!0),q("footer",{class:"transfer-right-footer"},[Y(C,{class:fe(["btn btn-cancel",{"btn-cancel-pc":!t.isH5}]),onClick:y},{default:re(()=>[qe(ae(I.$t("call-uikit-vue.no")),1)]),_:1},8,["class"]),v(o).length>0?(w(),ne(C,{key:0,class:"btn",onClick:m},{default:re(()=>[qe(ae(I.$t("call-uikit-vue.yes")),1)]),_:1})):(w(),ne(C,{key:1,class:"btn btn-no",onClick:m},{default:re(()=>[qe(ae(I.$t("call-uikit-vue.yes")),1)]),_:1}))])])])],2)}}}),p3=ve(h3,[["__scopeId","data-v-07f62e92"]]),g3=ge({__name:"SelectUser",props:{isRadio:{type:Boolean,default:!1},isNeedSearch:{type:Boolean,default:!1},title:{type:String,default:""},userList:{type:Array,default:()=>[]},total:{type:Number,default:0},isShow:{type:Boolean,default:!1},isPC:{type:Boolean,default:!0}},emits:["complete","search","getMore","update:isShow"],setup(i,{emit:e}){const t=e,n=i,s=P(!1);ln(()=>{s.value=n.isShow});const r=()=>{s.value=!s.value,t("complete",[]),t("update:isShow",s.value)},o=c=>{t("complete",c)},a=c=>{t("search",c)},l=()=>{t("getMore")};return(c,u)=>(w(),ne(l3,{moduleValue:v(s),isH5:!i.isPC,isHeaderShow:!1,isFooterShow:!1,background:!1,"onUpdate:moduleValue":r},{default:re(()=>[Y(p3,{isSearch:n.isNeedSearch,title:n.title,list:n.userList,isH5:!i.isPC,isRadio:n.isRadio,total:n.total,onGetMore:l,onSearch:a,onSubmit:o,onCancel:r},null,8,["isSearch","title","list","isH5","isRadio","total"])]),_:1},8,["moduleValue","isH5"]))}}),m3=ge({__name:"StreamLoading",setup(i){return(e,t)=>(w(),G("div",{class:"stream-loading-container"},[Y(pl,{mode:"dot",color:"#FFF",loadingWidth:"50px",loadingHeight:"50px"})]))}}),uc=ve(m3,[["__scopeId","data-v-3b975da3"]]),v3={options:{virtualHost:!0}},C3=ge(Z(F({},v3),{__name:"MediaContainer",setup(i){const e=P("local"),t=P(null),n=P(!1);_r();const{localUserInfoExcludeVolume:s,remoteUserListExcludeVolume:r}=$e(Sn()),{callStatus:o,callType:a,isShowEnableVirtualBackground:l,callRole:c}=$e(Lt()),{netWorkQualityList:u}=t2(),f=ie(()=>r.value.length+1),d=Id(),p=s2(t,f),g=yd(),{isFloatWindow:h}=$e(Hn()),m=Ed(),{status:y}=Cr()||{},R=!it.isPC,I=ie(()=>String(t.value)==="0"),T=ie(()=>!L.value&&I.value&&s.value.isVideoAvailable),C=ie(()=>T.value),_=ie(()=>T.value&&l.value&&it.isWeChat),A=ie(()=>L.value||I.value),{isPC:L}=Us(),E=ie(()=>L.value||h.value?"%":"vw"),M=ie(()=>[s.value,...r.value].map(se=>{var ue;if(h.value){if(((ue=g.value)==null?void 0:ue[se.domId])>=10)return se.domId}else return se.domId})),B=ie(()=>!(c.value===Dt.CALLEE&&o.value===Be.CALLING&&!h.value)),b=ie(()=>{let se="";return c.value===Dt.CALLEE&&o.value===Be.CALLING&&!h.value&&(se="hidden"),{visibility:se}});function k(se){t.value=se,m.value=se,y.value=se!==null?"close":"open"}function U(se){var ue,oe;return it.isWeChat?!((oe=(ue=d.value)==null?void 0:ue.find(W=>
6W.userID===se.userId))!=null&&oe.hasVideo):!se.isVideoAvailable}function O(se){var ue,oe;return it.isWeChat?!((oe=(ue=d.value)==null?void 0:ue.find(W=>W.userID===se.userId))!=null&&oe.hasAudio):!se.isAudioAvailable}function D(se){if(!u.value)return;const ue=se!==s.value.userId;if(!it.isWeChat&&ue)return;const oe=u.value.find(W=>W.userId===se);return oe&&(oe==null?void 0:oe.quality)>=4}Ye([r,a],()=>{var se,ue;(ue=(se=r.value)==null?void 0:se[0])!=null&&ue.isEnter&&(e.value="remote"),a.value===rt.AUDIO?n.value=!1:n.value=!0});const J=ie(()=>Et(["groupcall-media-container",{mobile:!L.value,pc:L.value,"two-layout":f.value===2&&t.value===null,float:h.value}])),ee=ie(()=>o.value===Be.CALLING&&(a.value===rt.AUDIO&&!s.value.isAudioAvailable||a.value===rt.VIDEO&&!s.value.isVideoAvailable));return(se,ue)=>(w(),ne(jd,{id:"source",disabled:!v(h),source:"#source",to:"body"},{default:re(()=>[Y(qd,null,{default:re(()=>[q("div",{class:fe(v(J)),style:Ze([v(b)])},[Y(Xd,{unit:v(E),"enable-focus":R,focus:v(t),length:v(f),layout:v(p),onToggle:k},{default:re(()=>[(w(),ne(Vn,{index:0,key:v(s).userId},{default:re(()=>[Y(zd,{domId:v(s).domId,"show-audio-stream":!v(s).isVideoAvailable,show:v(M).includes(v(s).domId)&&v(B)},{"audio-stream":re(()=>[Y(eo,{"user-id":v(s).userId,username:v(s).displayUserInfo,avatar:v(s).avatar,"is-video-available":v(s).isVideoAvailable},null,8,["user-id","username","avatar","is-video-available"])]),loading:re(()=>[v(ee)?(w(),ne(uc,{key:0})):X("",!0)]),"stream-info":re(()=>[v(h)?X("",!0):(w(),ne(Xr,{key:0,"is-self":!0,"show-nick-name":v(A),showSwitchCameraButton:v(C),showVirtualBackgroundButton:v(_),showNetWorkStatus:D(v(s).userId),nickName:v(s).displayUserInfo,isMuted:!v(s).isAudioAvailable,volume:v(g)&&v(g)[v(s).domId]},null,8,["show-nick-name","showSwitchCameraButton","showVirtualBackgroundButton","showNetWorkStatus","nickName","isMuted","volume"]))]),_:1},8,["domId","show-audio-stream","show"])]),_:1})),(w(!0),G(ze,null,pt(v(r),(oe,W)=>(w(),ne(Vn,{key:oe.userId,index:W+1},{default:re(()=>[Y(Kd,{domId:oe.domId,"show-audio-stream":U(oe),show:v(M).includes(oe.domId)&&v(B)},{"audio-stream":re(()=>[Y(eo,{"user-id":oe.userId,username:oe.displayUserInfo,avatar:oe.avatar},null,8,["user-id","username","avatar"])]),loading:re(()=>[oe.isEnter?X("",!0):(w(),ne(uc,{key:0}))]),"stream-info":re(()=>[v(h)?X("",!0):(w(),ne(Xr,{key:0,"show-nick-name":v(L)||String(v(t))===String(W+1),"show-control-button":!1,showNetWorkStatus:D(oe.userId),nickName:oe.displayUserInfo,"is-muted":O(oe),volume:v(g)&&v(g)[oe.domId]},null,8,["show-nick-name","showNetWorkStatus","nickName","is-muted","volume"]))]),_:2},1032,["domId","show-audio-stream","show"])]),_:2},1032,["index"]))),128))]),_:1},8,["unit","focus","length","layout"])],6)]),_:1})]),_:1},8,["disabled"]))}})),_3=ve(C3,[["__scopeId","data-v-3af9a7fe"]]),y3={options:{virtualHost:!0}},I3=ge(Z(F({},y3),{__name:"BackGround",setup(i){return(e,t)=>(w(),ne(Vd,{bgColor:"#22262ed9",bgImage:v(ai),customStyle:{position:"absolute",zIndex:0}},null,8,["bgImage"]))}})),dc=30,E3=ge({__name:"GroupCall",setup(i){const e=P(null),t=P("open"),n=P(!1),s=P(0),r=P([]),o=P([]),a=P(0),l=e,c={status:t},{callRole:u,callStatus:f}=$e(Lt()),{isFloatWindow:d}=$e(Hn()),{localUserInfoExcludeVolume:p,remoteUserListExcludeVolume:g}=$e(Sn()),{isPC:h}=Us(),m=A=>ye(this,null,function*(){if(n.value=A,n.value){yield I();const L=yield We.getGroupProfile();s.value=L.memberCount}}),y=()=>{n.value=!1,le.update(j.CALL,N.SHOW_SELECT_USER,!1),a.value=0,r.value=[]},R=()=>ye(this,null,function*(){a.value+=dc,yield I()}),I=()=>ye(this,null,function*(){const A=yield We.getGroupMemberList(dc,a.value),L=[...g.value,p.value].map(E=>E.userId);r.value.push(...A),r.value=r.value.map(E=>(L.includes(E.userID)&&(E=Z(F({},E),{isDisabled:!0})),E)),o.value=r.value}),T=A=>ye(this,null,function*(){try{if(A.length<=0)return;n.value=!1,le.update(j.CALL,N.SHOW_SELECT_USER,!1),a.value=0;const L=A.map(E=>E.userID);yield We.inviteUser({userIDList:L}),r.value=[]}catch(L){}}),C=A=>{A?r.value=r.value.filter(L=>L.userID.includes(A)||L.nick.includes(A)):r.value=o.value},_={[N.SHOW_SELECT_USER]:m};return et(()=>{le.watch(j.CALL,_,{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,_)}),c.status=P("open"),l.value=null,An(hd,c),An(fd,l),(A,L)=>(w(),G("div",{class:"groupcall-container"},[Y(Pd),v(f)===v(Be).CALLING&&v(u)===v(Dt).CALLEE&&!v(d)?(w(),ne(Hd,{key:0})):X("",!0),Y(_3),Y(Qd),Y(t0,{isPC:v(h)},null,8,["isPC"]),Y(I3),Y(g3,{isShow:v(n),isNeedSearch:!0,userList:v(r),isPC:v(h),total:v(s),onGetMore:R,onComplete:T,onSearch:C,"onUpdate:isShow":y},null,8,["isShow","userList","isPC","total"])]))}}),S3=ve(E3,[["__scopeId","data-v-dce2741c"]]),T3={};function L3(i,e){return w(),G("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","data-v-ea893728":""},[q("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})])}
6const w3=ve(T3,[["render",L3]]),fc="/assets/permit-zh-DdaxvTtH.jpg",A3="/assets/permit-en-B3Wz2mfj.jpg",b3="/assets/permit-zh-D2fRNfdh.png",R3="/assets/permit-en-DYG29l_D.png",O3=ge({__name:"SystemPermitTip",props:{platform:{},language:{}},setup(i){const e={mac:{"zh-cn":fc,en:A3},win:{"zh-cn":b3,en:R3}},t=i,n=ie(()=>t.platform==="mac"?"mac-privacy":"win-privacy"),s=ie(()=>t.platform==="mac"?"mac-preferences":"win-preferences"),r=P(fc),o=P(!0),a=c=>{c&&it.isPC&&(o.value=!0)},l=()=>{o.value=!1};return Ye(()=>t.language,()=>{r.value=e[t.platform][t.language]},{immediate:!0}),et(()=>{le.watch(j.CALL,{[N.SHOW_PERMISSION_TIP]:a},{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,{[N.SHOW_PERMISSION_TIP]:a})}),(c,u)=>v(o)?(w(),G("div",{key:0,class:"card"},[q("div",{class:"card-body"},[q("div",{class:"close",onClick:l},[Y(w3)]),q("div",{class:"card-wrapper"},[q("div",{class:"title"},ae(v(Ge)("browser-authorization")),1),q("div",{class:"button"},ae(v(Ge)(v(s))),1),q("div",{class:"allow"},ae(v(Ge)(v(n))),1),q("div",{class:"image-wrapper"},[q("img",{src:v(r),class:"image",alt:"system permit"},null,8,["src"])])])])])):X("",!0)}}),D3=ve(O3,[["__scopeId","data-v-6c5f4624"]]),M3=ge({__name:"PermitTip",setup(i){const e=ie(()=>it.isMAC?Ia.MAC:Ia.WIN),t=P(le.getData(j.CALL,N.LANGUAGE)),n=s=>t.value=s;return et(()=>{le.watch(j.CALL,{[N.LANGUAGE]:n},{notifyRangeWhenWatch:N.MYSELF})}),st(()=>{le.unwatch(j.CALL,{[N.LANGUAGE]:n})}),(s,r)=>(w(),G("div",{class:"tip"},[q("div",{class:"card"},[Y(D3,{platform:v(e),language:v(t)},null,8,["platform","language"])])]))}}),k3=ve(M3,[["__scopeId","data-v-698ade3d"]]),n0={};let zo=null,N3=1;const x3=()=>{const i=document.body,e=document.createElement("div");zo&&(i.removeChild(zo.el),qs(null,e));const t=Y(k3,{index:`permit-item-${N3++}`,destroy(){qs(null,e)}});qs(t,e),i.appendChild(e.firstElementChild),zo=t};n0.show=()=>x3();const U3=ge({__name:"Toast",props:{type:{},duration:{},message:{},index:{},showClose:{type:Boolean},destroy:{type:Function},close:{type:Function}},setup(i){const e=i,t=P(!1),n=P(null),s=ie(()=>`toast-container ${e.type}`),r=()=>{e.destroy()},o=()=>{e.close(),t.value=!1},a=()=>{n.value&&clearTimeout(n.value),e.duration&&(n.value=setTimeout(()=>{o()},e.duration))};return et(()=>{t.value=!0,a()}),st(()=>{n.value&&clearTimeout(n.value)}),(l,c)=>(w(),ne(fh,{name:"slide-up",onAfterLeave:r},{default:re(()=>[_t((w(),G("div",{key:l.index,class:fe(s.value)},[q("div",{class:"toast-content"},ae(l.message),1),_t(q("i",{class:"toast-close-icon",onClick:o},null,512),[[yt,l.showClose]])],2)),[[yt,t.value]])]),_:1}))}}),P3=ve(U3,[["__scopeId","data-v-d5ad407a"]]),_i={},Bn=[];let V3=1;function B3(){var e,t,n;const i=Bn.length;return i>0?(n=(t=(e=Bn[i-1])==null?void 0:e.el)==null?void 0:t.style)==null?void 0:n.top:"30px"}function F3(){var e,t;const i=Bn.length;return i>0?(t=(e=Bn[i-1])==null?void 0:e.el)==null?void 0:t.offsetHeight:0}const i0=i=>{const{type:e,duration:t=3e3,message:n,showClose:s=!1,onClose:r}=i,o=document.body,a=document.createElement("div"),l=Y(P3,{type:e,duration:t,message:n,showClose:s,index:`toast-item-${V3++}`,close(){var p,g;const f=Bn.findIndex(h=>h===l),d=parseInt((g=(p=Bn[f])==null?void 0:p.el)==null?void 0:g.offsetHeight)+20;for(let h=0;h<Bn.length;h++)h<f||(Bn[h].el.style.top=parseInt(Bn[h].el.style.top)-d+"px");Bn.splice(f,1)},destroy(){qs(null,a)}});qs(l,a),o.appendChild(a.firstElementChild);const c=B3(),u=F3();l.el.style.top=parseInt(c)+parseInt(u)+20+"px",Bn.push(l)};["info","waring","error","success"].forEach(i=>{let e={};_i[i]=t=>{typeof t=="string"?e.message=t:e=t,i0(F({type:i},e))}});_i.show=i=>{let e={};return typeof i=="string"?(e.message=i,e.type="info"):e=i,i0(F({type:"info"},e))};const G3=ge({__name:"TUICallKit",props:{beforeCalling:{},afterCalling:{},onMinimized:{},onMessageSentByMe:{},kickedOut:{},statusChanged:{},allowedMinimized:{type:Boolean,default:!0},allowedFullScreen:{type:Boolean,default:!0},videoDisplayMode:{default:"cover"},videoResolution:{default:"480p"}},setup(i){const{isPC:e}=Us(),t=ie(()=>e.value?"TUICallKit-desktop":"TUICallKit-mobile transition-animation"),n=P(""),s=P(""),r=P(""),o=P(!1),a=i,l=P(le.getData(j.CALL,N.CALL_STATUS)),c=P(le.getData(j.CALL,N.CALL_ROLE)),u=P(le.getData(j.CALL,N.CALL_MEDIA_TYPE
6)),f=P(le.getData(j.CALL,N.IS_GROUP)),d=P(le.getData(j.CALL,N.IS_EAR_PHONE)),p=P(null),g=P(le.getData(j.CALL,N.LOCAL_USER_INFO_EXCLUDE_VOLUMN)),h=P(le.getData(j.CALL,N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST)),m=P(le.getData(j.CALL,N.CALLER_USER_INFO)),y=P(le.getData(j.CALL,N.IS_MINIMIZED)),R=P(le.getData(j.CALL,N.ENABLE_VIRTUAL_BACKGROUND)),I=P(le.getData(j.CALL,N.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND)),T=P(le.getData(j.CALL,N.CUSTOM_UI_CONFIG)),C=P(le.getData(j.CALL,N.IS_MUTE_SPEAKER)),_=Lr({callStatus:l,callRole:c,callType:u,isGroupCall:f,isEarPhone:d,focusElement:p,allowedFullScreen:a.allowedFullScreen,enableVirtualBackground:R,isShowEnableVirtualBackground:I,isMuteSpeaker:C}),A=Lr({callerUserInfo:m}),L=Lr({localUserInfoExcludeVolume:g,remoteUserListExcludeVolume:h}),E=Lr({isFloatWindow:y}),{beforeCalling:M,afterCalling:B,onMinimized:b,onMessageSentByMe:k,videoDisplayMode:U,videoResolution:O,kickedOut:D,statusChanged:J,allowedMinimized:ee}=$e(a),se=_e=>{_.callStatus=_e},ue=_e=>{_.isGroupCall=_e},oe=_e=>{_e.text&&Ie(_e.text,_e.type||"info")},W=_e=>{_.callType=_e,!e.value&&o.value&&(r.value="miniMized-mobile-audio",s.value=""),!e.value&&!o.value&&(s.value="mobile-audio")},V=_e=>{E.isFloatWindow=_e,_e?e.value?n.value="miniMized":_.callType===rt.AUDIO?s.value="miniMized-mobile-audio":r.value="miniMized-mobile-video":(s.value="mobile-audio",n.value="",r.value="")},S=_e=>{if(_e&&e.value)try{n0.show()}catch(K){}},x=_e=>{_.callRole=_e},H=_e=>{L.localUserInfoExcludeVolume=_e},z=_e=>{L.remoteUserListExcludeVolume=_e},de=_e=>{A.callerUserInfo=_e},he=_e=>{_.isEarPhone=_e},Te=_e=>{_.enableVirtualBackground=_e},Oe=_e=>{_.isShowEnableVirtualBackground=_e},$=_e=>{T.value=_e},Q=_e=>{_.isMuteSpeaker=_e};ln(()=>{We.setCallback({beforeCalling:M&&M.value,afterCalling:B&&B.value,onMinimized:b&&b.value,onMessageSentByMe:k&&k.value,kickedOut:D&&D.value,statusChanged:J&&J.value})});const Ce={[N.CALL_STATUS]:se,[N.IS_GROUP]:ue,[N.TOAST_INFO]:oe,[N.CALL_MEDIA_TYPE]:W,[N.SHOW_PERMISSION_TIP]:S,[N.CALL_ROLE]:x,[N.LOCAL_USER_INFO_EXCLUDE_VOLUMN]:H,[N.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]:z,[N.CALLER_USER_INFO]:de,[N.IS_EAR_PHONE]:he,[N.ENABLE_VIRTUAL_BACKGROUND]:Te,[N.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND]:Oe,[N.CUSTOM_UI_CONFIG]:$,[N.IS_MUTE_SPEAKER]:Q};ln(()=>{if(We.enableFloatWindow(ee.value),!ee.value){const _e=le.getData(j.CALL,N.IS_MINIMIZED);_e&&le.update(j.CALL,N.IS_MINIMIZED,!_e)}}),et(()=>{We.setVideoDisplayMode(U.value),We.setVideoResolution(O.value),le.watch(j.CALL,Ce,{notifyRangeWhenWatch:N.MYSELF}),le.watch(j.CALL,{[N.IS_MINIMIZED]:V})});function Ie(_e,K){switch(K){case"info":_i==null||_i.info(_e);break;case"error":_i==null||_i.error(_e);break}}return Nu(()=>ye(this,null,function*(){le.unwatch(j.CALL,Z(F({},Ce),{[N.IS_MINIMIZED]:V}))})),st(()=>ye(this,null,function*(){le.unwatch(j.CALL,Z(F({},Ce),{[N.IS_MINIMIZED]:V}))})),An(cd,_),An(ud,A),An(dd,L),An(pd,E),An(vd,T),(_e,K)=>{const ce=fi;return v(_).callStatus!==v(Be).IDLE?(w(),G("div",{key:0,id:"tuicallkit-id",style:Ze([{visibility:v(E).isFloatWindow?"hidden":""}]),class:fe([v(t),v(n),v(r),v(s)])},[v(_).isGroupCall?(w(),ne(ce,{key:1,class:"singCall"},{default:re(()=>[Y(S3)]),_:1})):(w(),ne(ce,{key:0,class:"singCall"},{default:re(()=>[Y(o3)]),_:1}))],6)):X("",!0)}}}),yr=ve(G3,[["__scopeId","data-v-43211dd0"]]),s0="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.53577%206.68238C1.20562%205.72728%201.62355%204.70149%202.43641%204.1008C3.05265%203.64541%203.6717%203.18549%204.02494%202.92276C4.1928%202.79791%204.4281%202.82522%204.5636%202.98459L6.48855%205.24857C6.61441%205.39659%206.61447%205.61396%206.4887%205.76205L5.30836%207.1519C5.20091%207.27841%205.18302%207.45887%205.26796%207.60146C5.65041%208.24345%206.07008%208.79334%206.63719%209.36029C7.20763%209.93056%207.75742%2010.3421%208.40306%2010.7235C8.54576%2010.8079%208.72594%2010.7899%208.85234%2010.6827L10.2365%209.50861C10.3847%209.38295%2010.602%209.38304%2010.7501%209.50883L13.0159%2011.4342C13.1749%2011.5693%2013.202%2011.8044%2013.078%2011.9721L11.8927%2013.5755C11.2968%2014.3817%2010.279%2014.7916%209.33092%2014.4654C7.57835%2013.8624%205.93235%2012.8617%204.53353%2011.4633C3.13872%2010.0689%202.13946%208.42883%201.53577%206.68238Z'%20fill='%231C66E5'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.88876%202.1333C8.69239%202.1333%208.5332%202.29249%208.5332%202.48886V6.1737C8.5332%206.37006%208.69239%206.52925%208.88876%206.52925H12.5736C12.77%206.52925%2012.9292%206.37006%2012.9292%206.1737V5.98782C12.9292%205.7537%2013.1723%205.59883%2013.3845%205.69784L14.0714%206.
601841C14.3071%206.12841%2014.5773%205.95634%2014.5773%205.69621V2.96633C14.5773%202.7062%2014.3071%202.53413%2014.0714%202.64414L13.3845%202.9647C13.1723%203.06371%2012.9292%202.90884%2012.9292%202.67472V2.48886C12.9292%202.29249%2012.77%202.1333%2012.5736%202.1333H8.88876Z'%20fill='%231C66E5'/%3e%3c/svg%3e",H3=ge({__name:"JoinGroupCard",props:{userListInfo:{type:Array,default:[]}},emits:["joinGroupCall"],setup(i,{emit:e}){const t=e,n=P(!1),s=()=>{t("joinGroupCall"),n.value=!1},r=()=>{n.value=!n.value};return(o,a)=>(w(),G("div",{class:"banner-pc"},[q("div",{class:"top",onClick:r},[Y(Qt,{class:"call-icon",src:v(s0),width:"16px",height:"16px"},null,8,["src"]),q("span",{class:"text"},ae(i.userListInfo.length)+" "+ae(v(Ge)("people on the call")),1)]),_t(q("div",{class:"content"},[q("div",{class:"content-arrows"}),q("div",{class:"avatar-box"},[(w(!0),G(ze,null,pt(i.userListInfo,l=>(w(),ne(Qt,{class:"avatar",src:l==null?void 0:l.avatar,defaultSrc:v(ai),fit:"cover",width:"32px",height:"32px"},null,8,["src","defaultSrc"]))),256))]),q("div",{class:"btn",onClick:s},ae(v(Ge)("join")),1)],512),[[yt,v(n)]])]))}}),$3=ve(H3,[["__scopeId","data-v-f0058ded"]]),j3="data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.5%203.93403e-07L5%203.75L0.5%201.59204e-07L0.5%201.56205L4.61589%204.99196L5%205.31205L5.38411%204.99196L9.5%201.56205L9.5%203.93403e-07Z'%20fill='%23666666'/%3e%3c/svg%3e",W3=ge({__name:"JoinGroupCard",props:{userListInfo:{type:Array,default:[]}},emits:["joinGroupCall"],setup(i,{emit:e}){const t=P({margin:"8px 10px 8px 0px"}),n=P({margin:"6px",borderRadius:"4px"}),s=P(!1),r=e,o=()=>{r("joinGroupCall"),s.value=!1},a=()=>{s.value=!s.value};return(l,c)=>(w(),G("div",{class:"banner-h5"},[q("div",{class:"top",onClick:a},[q("div",{class:"left"},[Y(Qt,{class:"call-icon",src:v(s0),width:"16px",height:"16px",customStyle:v(t)},null,8,["src","customStyle"]),q("span",{class:"text"},ae(i.userListInfo.length)+" "+ae(v(Ge)("people on the call")),1)]),Y(Qt,{src:v(j3),width:"9px",height:"9px"},null,8,["src"])]),_t(q("div",{class:"content-box"},[q("div",{class:"content"},[q("div",{class:"avatar-box"},[(w(!0),G(ze,null,pt(i.userListInfo,u=>(w(),ne(Qt,{src:u==null?void 0:u.avatar,customStyle:v(n),defaultSrc:v(ai),fit:"cover",width:"50px",height:"50px"},null,8,["src","customStyle","defaultSrc"]))),256))]),q("div",{class:"btn",onClick:It(o,["stop"])},ae(v(Ge)("join")),1)])],512),[[yt,v(s)]])]))}}),z3=ve(W3,[["__scopeId","data-v-42191140"]]),K3=ge({__name:"JoinGroupCard",setup(i){const e=P(it.isPC),t=P(null),{groupId:n,roomId:s,roomIdType:r,callMediaType:o,groupCallMembers:a,callStatus:l}=$e(u2()),c=ie(()=>n&&(l==null?void 0:l.value)===Be.IDLE&&a.value.length),u=()=>ye(this,null,function*(){if(a.value.length>9){t.value.show({message:"Supports a maximum of 9 people for simultaneous calls",type:"success"});return}const f={type:o.value,groupID:n.value,roomID:r.value===1?Number(s.value):0,strRoomID:String(s.value)};try{yield We.joinInGroupCall(f)}catch(d){}});return(f,d)=>_t((w(),G("div",null,[v(e)?(w(),ne($3,{key:0,userListInfo:v(a),onJoinGroupCall:u},null,8,["userListInfo"])):(w(),ne(z3,{key:1,userListInfo:v(a),onJoinGroupCall:u},null,8,["userListInfo"])),Y(Jd,{ref_key:"message",ref:t},null,512)],512)),[[yt,v(c)]])}}),Y3=i=>(i.component("TUICallKit",{server:We}),We.bindTUICore(i),yr),q3=i=>{i.component("TUICallKit",yr).component("JoinGroupCard",K3)};yr.plugin=Y3;yr.install=q3;const hc={AUDIO_CALL:1,VIDEO_CALL:2};var J3={androidInfo:{sound:"private_ring.mp3",XiaoMiChannelID:"high_custom_1",OPPOChannelID:"tuikit"},apnsInfo:{sound:"01.caf",image:"https://web.sdk.qcloud.com/im/demo/latest/faviconnew.png"}},Q3={title:"call",description:"you have a call",androidSound:"private_ring",androidOPPOChannelID:"tuikit",iOSSound:"01.caf"},Z3={[Fe.TYPES.MSG_TEXT]:"[文本]",[Fe.TYPES.MSG_FACE]:"[动画表情]",[Fe.TYPES.MSG_IMAGE]:"[图片]",[Fe.TYPES.MSG_FILE]:"[文件]",[Fe.TYPES.MSG_AUDIO]:"[语音]",[Fe.TYPES.MSG_VIDEO]:"[视频]",[Fe.TYPES.MSG_LOCATION]:"[地理位置]",[Fe.TYPES.MSG_MERGER]:"[聊天记录]",[Fe.TYPES.MSG_CUSTOM]:"[自定义消息]"},Ki=(i=>(i.CHAT="chat",i.CALL="call",i))(Ki||{});let r0=class Ws{constructor(){this.name="OfflinePushInfoManager",this.offlinePushInfo={},this.offlinePushInfo={[Ki.CHAT]:J3,[Ki.CALL]:Q3}}static getInstance(){return Ws.instance||(Ws.instance=new Ws),Ws.instance}getOfflinePushInfo(e){return Object.values(Ki).includes(e)?this.offlinePushInfo[e]:null}genTitle(e,t){var n=e==null?void 0:e.getShowName();return e.type===Fe.TYPES.CONV_C2C&&(n=(t==null?void 0:t.nick)||(t==null?void 0:t.userID)),n}genDesc(e,t){var n="";return e===Fe.TYPES.MSG_TEXT&&(n=Ps(t.text)),e===Fe.TYPES.MSG_CUSTOM&&(n=t.description),n||pe.t("TUIChat.".concat(Z3[e]))}create(e){var t,{conversation:n,messageType:s="",payload:r={}}=e||{},o=Ee.getData(be.USER,"userProfile"),a={sender:n.type===Fe.TYPES.CONV_GROUP?(t=n.groupProfile)===null||t===void 0?void 0:t.groupID:o==null?void 0:o.userID,nickName:o==null?void 0:o.nick,chatType:n.type===Fe.TYPES.CONV_GROUP?2:1,version:1,action:1};return Wr({title:this.genTitle(n,o),description:this.genDesc(s,r),extension:JSON.stringify({entity:a})},this.offlinePushInfo[Ki.CHAT])}};r0.instance=null;const Wn=r0.getInstance(),X3=ge({__name:"index",emits:["toggleMultipleSelectMode"],setup(i,{emit:e}){const t=e;let n=[],s=!1;const r=P(!1),o=P();et(()=>{Ee.watch(be.CUSTOM,{singleForwardMessageID:a,multipleForwardMessageID:l})}),st(()=>{Ee.unwatch(be.CUSTOM,{singleForwardMessageID:a,multipleForwardMessageID:l}),c()});function a(g){typeof g!="undefined"&&(s=!1,n=[g],f())}function l(g){if(!g)return;s=!1;const{isMergeForward:h,messageIDList:m}=g||{};(m==null?void 0:m.length)>0?(s=h,n=m,f()):tn({message:pe.t("TUIChat.未选择消息"),type:pn.ERROR})}function c(){Ee.update(be.CUSTOM,"singleForwardMessageID",void 0),Ee.update(be.CUSTOM,"multipleForwardMessageID",void 0)}function u(){c(),r.value=!1}function f(){p(),r.value=!0}function d(g){if((g==null?void 0:g.length)===0)return;const h=g.map(R=>Ee.getConversationModel(R.userID)),m=n.map(R=>Ee.getMessageModel(R)).sort((R,I)=>R.time-I.time),y=h.map(R=>{const I={conversation:R,messageType:Fe.TYPES.MSG_MERGER};return bt.sendForwardMessage([R],m,{needMerge:s,offlinePushInfo:Wn.create(I),params:{needReadReceipt:Ui()}})});Promise.allSettled(y).then(R=>{for(const I of R){const{status:T}=I;if(T==="rejected"){const C=I.reason.code===80001?pe.t("TUIChat.内容包含敏感词汇"):I.reason.message;tn({message:C,type:pn.ERROR});break}}}),u(),t("toggleMultipleSelectMode",!1)}function p(){const g=Ee.getData(be.CONV,"conversationList");o.value=g.map(h=>({userID:h.conversationID,nick:h.getShowName(),avatar:h.getAvatar()}))}return(g,h)=>(w(),ne(Co,{visible:r.value,useMask:!1},{default:re(()=>
6[Y($u,{title:v(pe).t("TUIChat.转发"),isSearch:!1,isCustomItem:!1,list:o.value,isHiddenBackIcon:v(He),onCancel:u,onSubmit:d},null,8,["title","list","isHiddenBackIcon"])]),_:1},8,["visible"]))}}),ev=ge({__name:"index",props:{displayName:{},avatar:{}},emits:["closeChat"],setup(i,{emit:e}){const t=i,n=e,s=P(),r=P(""),o=P(!1),a=P(""),l=P([]),c=p=>{var g;(g=nt)==null||g.setNavigationBarTitle({title:p||""})};et(()=>{Ee.watch(be.CONV,{currentConversation:u}),Ee.watch(be.CHAT,{typingStatus:f})}),st(()=>{Ee.unwatch(be.CONV,{currentConversation:u}),Ee.unwatch(be.CHAT,{typingStatus:f})}),xu(()=>{s.value&&c(s.value.getShowName())});function u(p){var h,m,y,R,I;const g=(p==null?void 0:p.type)===Fe.TYPES.CONV_GROUP;g&&((h=s.value)==null?void 0:h.conversationID)!==(p==null?void 0:p.conversationID)&&(l.value=Fn.getExtensionList(ct.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID,{filterManageGroup:!g})),g||(l.value=[]),s.value=p,a.value=(y=(m=s.value)==null?void 0:m.groupProfile)==null?void 0:y.groupID,r.value=(R=s==null?void 0:s.value)==null?void 0:R.getShowName(),c((I=s==null?void 0:s.value)==null?void 0:I.getShowName())}function f(p){var g;o.value=p,o.value?r.value=pe.t("TUIChat.对方正在输入"):r.value=((g=s.value)==null?void 0:g.getShowName())||""}function d(p){n("closeChat",p)}return(p,g)=>v(Jt).isAliMini?X("",!0):(w(),G("div",{key:0,class:"chat-header chat-header-h5"},[v(Se)?X("",!0):(w(),G("div",{key:0,class:"chat-header-back chat-header-h5-back",onClick:g[0]||(g[0]=h=>{var m;return d((m=s.value)==null?void 0:m.conversationID)})},[Y(dt,{file:v(ju)},null,8,["file"])])),q("div",{class:"chat-header-content chat-header-h5-content"},ae(t.displayName||r.value),1),q("div",{class:"chat-header-setting chat-header-h5-setting"})]))}}),tv=ve(ev,[["__scopeId","data-v-7a81f3e8"]]),nv=ge({__name:"message-container",props:{sender:{default:""},avatar:{default:""},type:{},time:{}},setup(i){const e=i,t=Fe.TYPES,n=ie(()=>[t.MSG_IMAGE,t.MSG_VIDEO,t.MSG_MERGER].includes(e.type));return(s,r)=>(w(),G("div",{class:"simple-message-container"},[q("div",{class:"simple-message-avatar"},[Y(ar,{url:e.avatar},null,8,["url"])]),q("div",null,[q("div",{class:"simple-message-sender"},ae(e.sender),1),q("div",{class:"simple-message-body"},[q("div",{class:fe({"simple-message-content":!0,"no-padding":n.value})},[Ve(s.$slots,"default",{},void 0,!0)],2),q("div",{class:"timestamp"},ae(v(Ca)(e.time*1e3)),1)])])]))}}),iv=ve(nv,[["__scopeId","data-v-796af046"]]),sv=ge({__name:"index",props:{visible:{type:Boolean,default:!0},popDirection:{default:"bottom"},useMask:{type:Boolean,default:!0},isFullScreen:{type:Boolean,default:!0},overlayColor:{},drawerStyle:{default:()=>({})}},emits:["onOverlayClick"],setup(i,{expose:e,emit:t}){var u;const n=t,s=i,r=P(),o=P(),a=P(!1),l=P(s.drawerStyle[s.popDirection]||{});Ye(()=>s.visible,f=>{f?a.value=!0:setTimeout(()=>{a.value=!1},150)},{immediate:!0});function c(f){n("onOverlayClick",f)}return e({drawerDomRef:r,overlayDomRef:(u=o.value)==null?void 0:u.overlayDomRef}),(f,d)=>(w(),ne(Co,{ref_key:"overlayDomInstanceRef",ref:o,visible:s.visible,useMask:s.useMask,maskColor:s.overlayColor,isFullScreen:s.isFullScreen,onOnOverlayClick:c},{default:re(()=>[a.value?(w(),G("div",{key:0,ref_key:"drawerDomRef",ref:r,class:fe({drawer:!0,"origin-bottom":s.popDirection==="bottom","origin-right":s.popDirection==="right","slide-bottom":f.visible&&s.popDirection==="bottom","slide-right":f.visible&&s.popDirection==="right"}),style:Ze({minHeight:l.value.minHeight,maxHeight:l.value.maxHeight,borderRadius:l.value.borderRadius,boxShadow:l.value.boxShadow,width:l.value.width})},[q("div",{class:"drawer-container"},[Ve(f.$slots,"default",{},void 0,!0)])],6)):X("",!0)]),_:3},8,["visible","useMask","maskColor","isFullScreen"]))}}),Cl=ve(sv,[["__scopeId","data-v-5bab1543"]]),rv=ge({__name:"index",props:{renderData:{},disabled:{type:Boolean,default:!1},messageItem:{default:()=>({})}},emits:["assignMessageIDInUniapp"],setup(i,{emit:e}){const t=e,n=i,s=P(!1);function r(){n.disabled||(He.value?t("assignMessageIDInUniapp",n.messageItem.ID):s.value=!0)}function o(){s.value=!1}return(a,l)=>(w(),G("div",null,[q("div",{class:"message-record-container",onClick:r},[q("div",{class:"record-title"},ae(n.renderData.title),1),q("div",{class:"record-abstract-container"},[(w(!0),G(ze,null,pt(n.renderData.abstractList.slice(0,7),(c,u)=>(w(),G("div",{key:u,class:"record-abstract-item"},ae(v(Ps)(c)),1))),128))]),q("div",{class:"record-footer"},ae(v(pe).t("TUIChat.聊天记录")),1)]),!n.disabled&&v(Se)?(w(),ne(Co,{key:0,visible:s.value,onOnOverlayClick:l[0]||(l[0]=c=>s.value=!1)},{default:re(()=>[Y(Ra,{isMounted:s.value,renderData:n.renderData,messageID:n.messageItem.ID,onCloseOverlay:o},null,8,["isMounted","renderData","messageID"])]),_:1},8,["visible"])):!n.disabled&&v(Kn)&&!v(He)?(w(),ne(Cl,{key:1,visible:s.value,isFullScreen:!0,overlayColor:"transparent",popDirection:"right"},{default:re(()=>[Y(Ra,{isMounted:s.value,renderData:n.renderData,messageID:n.messageItem.ID,onCloseOverlay:o},null,8,["isMounted","renderData","messageID"])]),_:1},8,["visible"])):X("",!0)]))}}),o0=ve(rv,[["__scopeId","data-v-b8bdf003"]]);var ov="/packages/TUIKit/components/TUIChat/video-play",av=i=>"".concat(ov,"?videoUrl=").concat(encodeURIComponent(i)),lv=i=>{var e,t=Fu[bi.videoPlay]||"/video-play",n=Gu.fillPathParams(t,{fromMini:"1",language:Rh(),videoUrl:i}),s=((e=n.search)===null||e===void 0?void 0:e.replace(/^\?/,""))||"";return"".concat(Jt.getHost()).concat(n.pathname).concat(s?"?".concat(s):"")},a0=i=>{if(i){if(Jt.isAliMini){var e=lv(i);ns.open(bi.appWebView,{url:encodeURIComponent(e)});return}uni.navigateTo({url:av(i)})}};const cv=ge({__name:"index",props:{messageID:{default:""},isMounted:{type:Boolean,default:!1}},emits:["closeOverlay"],setup(i,{emit:e}){const t=e,n=i,s=Fe.TYPES,r=P(!1),o=P([]),a=P({title:"",messageList:[]}),l=P();Ye(()=>o.value.length,h=>ye(this,null,function*(){if(r.value=!1,h<1)return;const m=o.value[o.value.length-1];if(m.downloadKey&&m.messageList.length===0)try{const y=yield bt.downloadMergedMessages({payload:m,type:Fe.TYPES.MSG_MERGER});o.value[o.value.length-1]=y.payload}catch(y){r.value=!0}a.value=o.value[o.value.length-1]})),Ye(()=>n.isMounted,h=>{if(h){if(!n.messageID)throw new Error("messageID is required when first render of simple-message-list.");const m=Ee.getMessageModel(n.messageID).getMessage().payload;o.value=[m]}else o.value=[]},{immediate:!0});const c=ie(()=>o.value.length>1),u=ie(()=>{var h;
6return(h=a.value)!=null&&h.messageList?a.value.messageList.length>0:!1});function f(h,m){o.value.push(m.messageBody[0].payload),h.stopPropagation()}function d(){o.value.pop(),o.value.length<1&&t("closeOverlay")}function p(h){He.value&&a0(h)}function g(h){let m="";return h.indexOf("@custom")>-1?m=Fh+h:(m=Gh+h,m.indexOf("@2x")===-1?m+="@2x.png":m+=".png"),m}return(h,m)=>{const y=vr,R=hh;return w(),G("div",{class:fe({"simple-message-list-container":!0,"simple-message-list-container-mobile":v(gn)})},[q("div",{class:"header-container"},[q("span",{class:"back",onClick:d},[Y(dt,{class:"close-icon",file:v(ju),size:"18px"},null,8,["file"]),c.value?(w(),G("span",{key:0},ae(v(pe).t("TUIChat.返回")),1)):(w(),G("span",{key:1},ae(v(pe).t("TUIChat.关闭")),1))]),q("span",{class:"title"},ae(a.value.title),1)]),r.value?(w(),G("div",{key:0}," Load Merge Message Error ")):u.value?(w(),G("div",{key:1,ref_key:"simpleMessageListRef",ref:l,class:"message-list"},[(w(!0),G(ze,null,pt(a.value.messageList,I=>(w(),G("div",{key:I.ID,class:fe({"message-item":!0})},[Y(iv,{sender:I.nick,avatar:I.avatar,type:I.messageBody[0].type,time:I.time},{default:re(()=>[I.messageBody[0].type===v(s).MSG_TEXT?(w(),G("div",{key:0,class:"message-text"},[(w(!0),G(ze,null,pt(v(Wu)(I.messageBody[0].payload.text),(T,C)=>(w(),G("span",{key:C,class:"message-text-container"},[T.type==="text"?(w(),G("span",{key:0,class:"text"},ae(T.content),1)):(w(),G("img",{key:1,class:"simple-emoji",src:T.content,alt:"small-face"},null,8,["src"]))]))),128))])):I.messageBody[0].type===v(s).MSG_IMAGE?(w(),G("div",{key:1,class:"message-image"},[q("img",{class:"image",src:I.messageBody[0].payload.imageInfoArray[2].url,mode:"widthFix",alt:"image"},null,8,["src"])])):I.messageBody[0].type===v(s).MSG_VIDEO?(w(),G("div",{key:2,class:"message-video"},[v(He)?(w(),G("div",{key:0,onClick:T=>p(I.messageBody[0].payload.remoteVideoUrl)},[Y(y,{class:"image",src:I.messageBody[0].payload.thumbUrl,mode:"widthFix",alt:"image","lazy-load":""},null,8,["src"]),Y(dt,{class:"video-play-icon",file:v(Yu)},null,8,["file"])],8,["onClick"])):(w(),ne(R,{key:1,class:"video",controls:"",poster:I.messageBody[0].payload.thumbUrl},{default:re(()=>[q("source",{src:I.messageBody[0].payload.remoteVideoUrl,type:"video/mp4"},null,8,["src"])]),_:2},1032,["poster"]))])):I.messageBody[0].type===v(s).MSG_AUDIO?(w(),G("div",{key:3,class:"message-audio"},[q("span",null,ae(v(pe).t("TUIChat.语音"))+" ",1),q("span",null,ae(I.messageBody[0].payload.second)+"s",1)])):I.messageBody[0].type===v(s).MSG_FACE?(w(),G("div",{key:4,class:"message-face"},[q("img",{class:"image",src:g(I.messageBody[0].payload.data),alt:"face"},null,8,["src"])])):I.messageBody[0].type===v(s).MSG_FILE?(w(),G("div",{key:5,class:"message-file"},ae(v(pe).t("TUIChat.[文件]")),1)):I.messageBody[0].type===v(s).MSG_LOCATION?(w(),G("div",{key:6},ae(v(pe).t("TUIChat.[地理位置]")),1)):I.messageBody[0].type===v(s).MSG_MERGER?(w(),G("div",{key:7,class:"message-merger",onClickCapture:T=>f(T,I)},[Y(o0,{disabled:"",renderData:I.messageBody[0].payload},null,8,["renderData"])],40,["onClickCapture"])):I.messageBody[0].type===v(s).MSG_CUSTOM?(w(),G("div",{key:8},ae(v(pe).t("TUIChat.[自定义消息]")),1)):X("",!0)]),_:2},1032,["sender","avatar","type","time"])]))),128))],512)):X("",!0)],2)}}}),Ra=ve(cv,[["__scopeId","data-v-f33f9d10"]]),uv=ge({__name:"index",props:{groupID:{default:""}},setup(i){const e=i,t=P(),n=P(0),s=P(!1),r=P([]);Ye(s,f=>{f&&l().then(d=>{r.value=d,n.value=d.length})}),Ye(()=>r.value.length,(f,d)=>{d>0&&f===0&&(s.value=!1)});function o(){return ye(this,null,function*(){return(yield ts.getGroupApplicationList()).data.applicationList.filter(p=>p.groupID===e.groupID)})}function a(){s.value=!s.value}function l(){return ye(this,null,function*(){const f=yield o();if(f.length===0)return[];const d=f.map(m=>m.applicationType===0?m.applicant:m.userID),{data:p}=yield il.getUserProfile({userIDList:d}),g={};return p.forEach(m=>{g[m.userID]=m}),f.map(m=>{const y=g[m.applicationType===0?m.applicant:m.userID];return{nick:y.nick||y.userID||"anonymous",avatar:y.avatar||"",isRemoved:!1,application:m}})})}function c(f,d,p){ts.handleGroupApplication({handleAction:d,application:f.application}).then(()=>{r.value[p].isRemoved=!0,setTimeout(()=>{r.value.splice(p,1),n.value-=1},150)}).catch(()=>{})}et(()=>{o().then(f=>{n.value=f.length}),Ee.watch(be.GRP,{groupSystemNoticeList:u})}),st(()=>{Ee.unwatch(be.GRP,{groupSystemNoticeList:u})});function u(){l().then(f=>{r.value=f,n.value=f.length})}return(f,d)=>(w(),G("div",null,[n.value>0?(w(),G("div",{key:0,class:"application-tips"},[q("div",null,ae(n.value)+ae(v(pe).t("TUIChat.条入群申请")),1),q("div",{class:"application-tips-btn",onClick:a},ae(v(pe).t("TUIChat.点击处理")),1)])):X("",!0),Y(Cl,{ref_key:"drawerDomInstanceRef",ref:t,visible:s.value,zIndex:998,popDirection:v(gn)?"bottom":"right",isFullScreen:v(gn),overlayColor:v(gn)?void 0:"transparent",drawerStyle:{bottom:{minHeight:"60vh",maxHeight:"80vh",borderRadius:"12px 12px 0 0"},right:{width:"360px",borderRadius:"12px 0 0 12px",boxShadow:"0 0 10px 0 #d0d0d0"}},onOnOverlayClick:a},{default:re(()=>[q("div",{class:fe({"application-contaienr":!0})},[q("header",{class:"application-header"},[q("div",{onClick:a},[v(Se)?(w(),ne(dt,{key:0,file:v(Wh),size:"16px"},null,8,["file"])):(w(),G("div",{key:1},ae(v(pe).t("关闭")),1))])]),q("main",null,[(w(!0),G(ze,null,pt(r.value,(p,g)=>(w(),G("div",{key:p.nick,class:fe({"application-item":!0,removed:p.isRemoved})},[Y(ar,{style:{flex:"0 0 auto"},url:p.avatar,useSkeletonAnimation:!0},null,8,["url"]),q("div",{class:"application-item-info"},[q("div",{class:"application-item-nick"}
6,ae(p.nick),1),q("div",{class:"application-item-note"},ae(v(pe).t("TUIChat.申请加入")),1)]),q("div",{class:"application-item-operation"},[q("div",{class:"agree",onClick:h=>c(p,"Agree",g)},ae(v(pe).t("TUIChat.同意")),9,["onClick"]),q("div",{class:"reject",onClick:h=>c(p,"Reject",g)},ae(v(pe).t("TUIChat.拒绝")),9,["onClick"])])],2))),128))])])]),_:1},8,["visible","popDirection","isFullScreen","overlayColor"])]))}}),dv=ve(uv,[["__scopeId","data-v-426c986c"]]),fv=ge({__name:"message-text",props:{content:{default:()=>({})},messageItem:{default:()=>({})},enableURLHighlight:{type:Boolean,default:!1}},setup(i){const e=i,t=P([]);Ye(()=>e.messageItem,(s,r)=>{var o,a,l,c,u,f;if((s==null?void 0:s.ID)!==(r==null?void 0:r.ID)){if(e.enableURLHighlight&&Vr.reportFeature(208),e.messageItem.getMessageContent?t.value=(o=e.messageItem.getMessageContent())==null?void 0:o.text:t.value=(l=(a=Ee.getMessageModel(e.messageItem.ID))==null?void 0:a.getMessageContent())==null?void 0:l.text,t.value=t.value||((c=e.content)==null?void 0:c.text),!((u=t.value)!=null&&u.length)){t.value=[];return}t.value=(f=t.value.map(d=>{if(d.name==="img"&&(d==null?void 0:d.type)==="custom")return d;if(e.enableURLHighlight&&d.name==="text"&&d.text){if(!zl)return d;const p=zl(d.text);if(p.length)return p.map(g=>({name:g.type,text:g.text,url:g.url}))}return d}))==null?void 0:f.flat()}},{deep:!0,immediate:!0});function n(s){s&&(He.value?nt.navigateTo({url:`/pages/views/webview?url=${s}`}):nt.open(s,"_blank"))}return(s,r)=>(w(),G("div",{class:fe(["message-text-container",v(Se)&&"text-select"])},[(w(!0),G(ze,null,pt(t.value,(o,a)=>(w(),G("span",{key:a},[o.name==="text"?(w(),G("span",{key:0,class:"text"},ae(o.text),1)):o.name==="url"?(w(),G("span",{key:1,class:"url-link",onClick:l=>n(o.url)},ae(o.text),9,["onClick"])):(w(),G("img",{key:2,class:"emoji",src:o.src,alt:o.emojiKey},null,8,["src","alt"]))]))),128))],2))}}),hv=ve(fv,[["__scopeId","data-v-cc86a6f5"]]),pv=ge({__name:"message-image",props:{content:{default:()=>({})},messageItem:{default:()=>({})}},emits:["previewImage"],setup(i,{emit:e}){const t=e,n=i,s=P({width:"auto",height:"auto"}),r=P("aspectFit"),o=P(!1),a=P("right"),l=f=>{const{width:d,height:p}=f;if(d===0||p===0)return;const g=160,h=200,m=100,y=60,R=d/p,I=g/y,T=m/h;o.value=R>I||R<T;let C=d,_=p;if(o.value){r.value="aspectFill";const A=g/y;R>A?(C=Math.max(m,Math.min(g,d)),_=y):(_=Math.max(y,Math.min(h,p)),C=m)}else r.value="aspectFit",d>g&&(C=g,_=g*p/d),_>h&&(C=h*C/_,_=h),C<m&&(C=m,_=m*p/d),_<y&&(C=y*d/p,_=y);s.value.width=C+"px",s.value.height=_+"px"};ln(()=>{var f;l(n.content),a.value=((f=n.messageItem)==null?void 0:f.flow)==="out"?"left":"right"});const c=f=>{l(f.detail)},u=()=>{var f;(((f=n.messageItem)==null?void 0:f.status)==="success"||n.messageItem.progress===1)&&t("previewImage")};return(f,d)=>{const p=vr,g=fi;return w(),G("div",{class:"image-container",onClick:u},[Y(p,{class:"message-image",mode:r.value,src:n.content.url,style:Ze({width:s.value.width,height:s.value.height}),onLoad:c},null,8,["mode","src","style"]),o.value?(w(),ne(g,{key:0,class:fe(["long-image-tag",a.value])},{default:re(()=>[qe(ae(v(pe).t("TUIChat.长图")),1)]),_:1},8,["class"])):X("",!0)])}}}),gv=ve(pv,[["__scopeId","data-v-f7132e3e"]]),mv="data:image/svg+xml,%3csvg%20width='62'%20height='78'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23prefix__clip0_1_7)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M28%2039.5c0-6.638-2.558-12.755-7-17l5-5.5c5.936%205.662%209%2013.637%209%2022.5%200%208.604-3.364%2016.373-9%2022L21%2056c4.225-4.22%207-10.048%207-16.5zm18.025%2038.502L41%2073c8.457-8.442%2013.25-20.631%2013.25-33.54C54.25%2026.147%2048.925%2013.493%2040%205l5.084-5C55.503%209.91%2062%2023.924%2062%2039.46c0%2015.062-6.108%2028.694-15.975%2038.542zM7.75%2047.23c4.28%200%207.75-3.479%207.75-7.77%200-4.29-3.47-7.77-7.75-7.77-4.28%200-7.75%203.48-7.75%207.77%200%204.291%203.47%207.77%207.75%207.77z'%20fill='%23444'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='prefix__clip0_1_7'%3e%3cpath%20fill='%23fff'%20d='M0%200h62v78H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",vv=ge({__name:"message-audio",props:{broadcastNewAudioSrc:{},messageItem:{default:()=>({})},content:{default:()=>({})}},emits:["getGlobalAudioContext","setAudioPlayed"],setup(i,{emit:e}){const t=e,n=i,s=new Map,r=P(!1);st(()=>{var y;const m=h();r.value&&u(),(y=m==null?void 0:m.destroy)==null||y.call(m),s.delete("audio")}),Ye(()=>n.broadcastNewAudioSrc,m=>{m!==n.content.url&&r.value&&(u(),r.value=!1)});function o(){if(t("getGlobalAudioContext",s,{newAudioSrc:n.content.url}),n.messageItem.hasRiskContent||!n.content.url){tn({message:"暂不支持播放"});return}h()||(s.set("audio",uni.createInnerAudioContext()),l()),a()}function a(){r.value?u():c()}function l(){const m=h();m&&(m.src=n.content.url,r.value=!1,m.onPlay(f),m.onStop(d),m.onEnded(p),m.onError(g))}function c(){const m=h();m&&(m.play(),n.messageItem.flow==="in"&&t("setAudioPlayed",n.messageItem.ID))}function u(){const m=h();if(m)try{m.stop()}catch(y){}}function f(){r.value=!0}function d(){r.value=!1}function p(){r.value=!1}function g(){}function h(){return s.get("audio")}return(m,y)=>(w(),G("div",{class:fe({"message-audio":!0,reserve:n.messageItem.flow==="out"}),onClick:o},[q("div",{class:"audio-icon-container"},[q("div",{class:fe({mask:!0,play:r.value})},null,2),Y(dt,{class:"icon",width:"15px",height:"20px",file:v(mv)},null,8,["file"])]),q("div",{class:"time",style:Ze({width:`${n.content.second*5}px`})},ae(n.content.second||1)+' " ',5)],2))}}),Cv=ve(vv,[["__scopeId","data-v-72824299"]]),_v="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAqCAYAAAD1T9h6AAAAAXNSR0IArs4c6QAAA0BJREFUaEPtWd9LU3EUP+d7N91QFkJolBDoLOdM0GnzwYcV9CAZPVRCCZkP9WRQVPQSNaL/oKJfDxH0kPUQCRbRg4uwNJmC6fLXgsDCDBKWsul2vyfuxpW7MnR332sad0/b937P55zP55z7/XB3ETSfykpvUYwSJ4BDPQAWEXGr9vpK3xFRRoBRkFjnts15nYFAILFSTLbXUQUod9cdSHA6R8TzsgVV4hHZF4Zw51hz00u/389FYC6HkSSgFB+X5ctGJEFkYbDgrckP/a8NwU+OjSx3qMozhmMA1uvWQttIKBCYyySpz+ezff0+10wExznnm7SxKVx8wwCmM8FU9hLAogVg2m6vGQ4G78a18eh0ey6STIeVRSWJw+5p+31TpgkrfL78+MxcCwC1cE72TOP/tp8hm0cGt8eG+zsQkZKj6nR5nhJRcYpATvtEqLdPVMJdDQ0F0R/RNiA8RMRzROEyxgYKC7ae7+np/IlOV+1b9bTJ3eLYk+nYrKYor7fRMRuZ2csRSpBAxyGB+RzIDURFaj6J4fPxUPAKlpbX9KuL4dGButUU9C/2+P1+9vBx11Hi8hkNibMbhoBadJmr9gIn3pz8LWFPGgG7xdqUjZEZ1RlEFgegb8Cgl1FOt8wXbqa8BmfTCCCyeVFGZiCZtBrTCBiV1EjcPwhkY2RGFZrylZgbIH6ac9qZZmTaU0iUkRlFxOM5ZY1Eg/e1JNI6INrIjCBSVlHv5XzxhoqdRsAoIxNJRBmnhelI97IE1rORaUXQjv2GMzKFiElA5EzrwTI7oEc1kTFmB0SqqQfL7IAe1UTGmB0QqaYeLLMDelQTGWN2QKSaerDMDuhRTWTM/9sByEnsDw8NzYhUSzRWaVVVISxaupaeiZ0uzz
6sisigLkmS5MT7y/oHopCLxdrh3t8pyol3BRMSE8vf6IyJemlxguBCLlOybmnoSFZlUFFZx8RG7zfHpFXHKTRFgYXRWeysoGl9SXSHBULonS7EX62WclLGRZFsjJ/mkWnySgN3amnzJV+aqvsQJD4pSai1wGNKziY+D15Zes24kEmrxyS5o1VLGCWLK61bart7Ya6HmanIoNywAfgabdHVysC+kxvwC0SKlujS63bMAAAAASUVORK5CYII=",yv=ge({__name:"message-file",props:{content:{default:()=>({})},messageItem:{default:()=>({})}},setup(i){const e=i,t=()=>{const s={mode:"cors",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded"})};if(window!=null&&window.fetch)fetch(e.content.url,s).then(r=>r.blob()).then(r=>{const o=document.createElement("a"),a=window.URL.createObjectURL(r);o.href=a,o.download=e.content.name,o.click()});else{const r=document.createElement("a");r.href=e.content.url,r.target="_blank",r.download=e.content.name,r.click()}},n=()=>{e.messageItem.hasRiskContent||!e.content.url||t()};return(s,r)=>(w(),G("div",{class:"file-message-montainer",title:v(pe).t("TUIChat.单击下载"),onClick:n},[Y(dt,{file:v(_v),style:{margin:"auto 8px"}},null,8,["file"]),q("div",null,[q("div",null,ae(e.content.name),1),q("div",null,ae(e.content.size),1)])],8,["title"]))}}),Iv=ve(yv,[["__scopeId","data-v-e42941fb"]]),Ev=ge({__name:"message-face",props:{content:{type:Object,default:()=>({})}},setup(i){const e=i,t=P(e.content.url);return et(()=>{e.content.type}),(n,s)=>(w(),G("div",{class:"message-image"},[q("img",{mode:"aspectFit",class:"message-image",src:t.value},null,8,["src"])]))}}),Sv=ve(Ev,[["__scopeId","data-v-cfd8a8ed"]]),Tv=ge({__name:"message-location",props:{content:{type:Object,default:()=>({})}},setup(i){const e=i,t=P(),n=ie(()=>{const{latitude:o,longitude:a}=s.value;return`https://maps.googleapis.com/maps/api/staticmap?center=${o},${a}&zoom=15&size=${Se?300:220}x${Se?200:180}&maptype=roadmap&markers=color:red%7Clabel:A%7C${o},${a}&key=AIzaSyB_tf4WPUSpfk6LwAB-hWfzd6KVeLuwIkY`}),s=P({latitude:22.320047,longitude:114.173355}),r=()=>{const{latitude:o,longitude:a}=s.value,l=`https://www.google.com/maps?q=${o},${a}`;window.open(l,"_blank")};return ln(()=>{t.value=e.content,s.value.latitude=Number(e.content.latitude),s.value.longitude=Number(e.content.longitude)}),(o,a)=>(w(),G("div",{class:"message-location",title:v(pe).t("点击查看详情"),onClick:r},[q("img",{src:n.value},null,8,["src"])],8,["title"]))}}),l0=ve(Tv,[["__scopeId","data-v-7fc61e51"]]),Lv={options:{styleIsolation:"shared"}},wv=ge(Z(F({},Lv),{__name:"message-faq",props:{item:{},isCustom:{}},setup(i){const e=()=>{Se.value&&Oh()};return(t,n)=>{const s=fi,r=Za(Xa("mt-icon"),ll);return w(),ne(s,{class:"moreticket-faq-msg"},{default:re(()=>[Y(s,{class:"card"},{default:re(()=>[Y(s,{class:"title"},{default:re(()=>[qe(ae(v(pe).t("TUIChat.常见问题")),1)]),_:1}),(w(!0),G(ze,null,pt(t.isCustom.faqList,(o,a)=>(w(),ne(Yl,{key:a,url:o.linkUrl,class:"faq-list-item",onClick:e},{default:re(()=>[Y(s,{class:"question"},{default:re(()=>[qe(ae(o.title),1)]),_:2},1024),Y(r,{type:"arrow-right",size:"14"})]),_:2},1032,["url"]))),128))]),_:1}),Y(s,{class:"link-list-container"},{default:re(()=>[(w(!0),G(ze,null,pt(t.isCustom.linkList,(o,a)=>(w(),ne(Yl,{key:a,class:"item card",url:o.linkUrl,onClick:e},{default:re(()=>[Y(dt,{size:"28px",file:o.icon},null,8,["file"]),Y(s,null,{default:re(()=>[qe(ae(o.title),1)]),_:2},1024)]),_:2},1032,["url"]))),128))]),_:1})]),_:1})}}})),Av=ve(wv,[["__scopeId","data-v-30d360c8"]]);var Ko={Pending:"PENDING",Completed:"COMPLETED",Cancelled:"CANCELLED"},bv={[xt.MTS_SELLER_SUPPLEMENT_ADDRESS_REQUEST_MSG]:{status:Ko.Pending,titleKey:"message.custom.发起地址补录",contentKey:"message.custom.商家已发起地址补录,请买家补充收货地址。"},[xt.MTS_SELLER_SUPPLEMENT_ADDRESS_CANCEL_MSG]:{status:Ko.Cancelled,titleKey:"message.custom.取消地址补录",contentKey:"message.custom.商家已取消本次地址补录。"},[xt.MTS_USER_SUPPLEMENT_ADDRESS_COMPLETED_MSG]:{status:Ko.Completed,titleKey:"message.custom.地址已补录",contentKey:"message.custom.买家已完成地址补录。"}};function Rv(i){if(i)return bv[i]}function Ov(i){return i===xt.MTS_SELLER_SUPPLEMENT_ADDRESS_REQUEST_MSG}function Dv(i){return i===xt.MTS_USER_SUPPLEMENT_ADDRESS_COMPLETED_MSG}const Mv=ge({__name:"message-custom",props:{messageItem:{default:void 0},content:{default:void 0}},setup(i){const{t:e}=Qa(),t=i,n=P(),s=P(),r=P(),o=P({businessID:""}),{isPC:a}=Us(),l=P(),c=ie(()=>String(o.value.businessID||"")),u=ie(()=>Rv(c.value)),f=ie(()=>!!u.value),d=ie(()=>{if(typeof o.value.content=="string"){const _=Gn(o.value.content);return typeof _=="object"&&_?_:{}}return typeof o.value.content=="object"&&o.value.content?o.value.content:{}}),p=ie(()=>F(F({},typeof o.value=="object"&&o.value?o.value:{}),d.value)),g=ie(()=>{var _;return((_=u.value)==null?void 0:_.status)||"PENDING"}),h=ie(()=>Ov(c.value)),m=ie(()=>Dv(c.value)),y=ie(()=>h.value||m.value),R=ie(()=>pe.t(m.value?"message.custom.查看地址":"message.custom.去填写")),I=ie(()=>p.value.orderId||p.value.orderID||"");ln(()=>{n.value=t.content,s.value=t.messageItem;const{payload:_}=t.messageItem;o.value=_.data||"",o.value=Gn(_.data),_.data===xt.SERVICE&&(r.value=Gn(_.extension))});const T=_=>{window.open(_),window.open(_,"_blank")},C=()=>{var A;const _=I.value;if(!_){p.value.url&&T(p.value.url);return}if(a.value){(A=l.value)==null||A.open(_);return}ns.open(bi.supplementAddress,{orderId:_})};return(_,A)=>{var B;const L=ph,E=fi,M=mo;return w(),G("div",{class:"custom"},[o.value.businessID===v(xt).SERVICE?(w(),G("div",{key:0},[q("h1",null,[Y(L,null,{default:re(()=>
6[qe(ae(r.value.title),1)]),_:1}),r.value.hyperlinks_text?(w(),G("a",{key:0,href:r.value.hyperlinks_text.value,target:"view_window"},ae(r.value.hyperlinks_text.key),9,["href"])):X("",!0)]),r.value.item&&r.value.item.length>0?(w(),G("ul",{key:0},[(w(!0),G(ze,null,pt(r.value.item,(b,k)=>(w(),G("li",{key:k},[v(Hh)(b.value)?(w(),G("a",{key:0,href:b.value,target:"view_window"},ae(b.key),9,["href"])):(w(),G("p",{key:1},ae(b.key),1))]))),128))])):X("",!0),q("article",null,ae(r.value.description),1)])):o.value.businessID===v(xt).EVALUATE?(w(),G("div",{key:1,class:"evaluate"},[q("h1",null,ae(v(pe).t("message.custom.对本次服务评价")),1),q("ul",{class:"evaluate-list"},[(w(!0),G(ze,null,pt(Math.max(o.value.score,0),(b,k)=>(w(),G("li",{key:k,class:"evaluate-list-item"},[Y(dt,{file:v(zh),class:"file-icon"},null,8,["file"])]))),128))]),q("article",null,ae(o.value.comment),1)])):o.value.businessID===v(xt).ORDER?(w(),G("div",{key:2,class:"order",onClick:A[0]||(A[0]=b=>T(o.value.link))},[q("img",{src:o.value.imageUrl},null,8,["src"]),q("main",null,[q("h1",null,ae(o.value.title),1),q("p",null,ae(o.value.description),1),q("span",null,ae(o.value.price),1)])])):o.value.businessID===v(xt).LINK?(w(),G("div",{key:3,class:"textLink"},[q("p",null,ae(o.value.text),1),q("a",{href:o.value.link,target:"view_window"},ae(v(pe).t("message.custom.查看详情>>")),9,["href"])])):o.value.businessID===v(xt).LOCATION?(w(),ne(l0,{key:4,content:o.value},null,8,["content"])):o.value.businessID===v(xt).CUSTOM_FAQ_MSG?(w(),ne(Av,{key:5,item:s.value,isCustom:o.value},null,8,["item","isCustom"])):f.value?(w(),G("div",{key:6,class:fe(["supplement-address-card",`supplement-address-card-${g.value.toLowerCase()}`])},[q("div",{class:"supplement-address-card-header"},[Y(E,{class:"h1"},{default:re(()=>{var b;return[qe(ae(v(pe).t(((b=u.value)==null?void 0:b.titleKey)||"message.custom.地址补录")),1)]}),_:1})]),q("p",{class:"supplement-address-card-content"},ae(v(pe).t(((B=u.value)==null?void 0:B.contentKey)||"message.custom.地址补录")),1),q("div",{class:"supplement-address-card-footer"},[y.value?(w(),ne(M,{key:0,class:"supplement-address-card-button",onClick:It(C,["stop"])},{default:re(()=>[qe(ae(R.value),1)]),_:1})):X("",!0)])],2)):(w(),G("span",{key:7,innerHTML:_.content.custom},null,8,["innerHTML"])),f.value&&v(a)?(w(),ne(Kh,{key:8,ref_key:"supplementAddressPopupRef",ref:l},null,512)):X("",!0)])}}}),kv=ve(Mv,[["__scopeId","data-v-404358a1"]]),Nv=ge({__name:"message-tip",props:{content:{type:Object,default:()=>({})},text:{type:String,default:""}},setup(i){const e=i,t=ie(()=>{var n,s;return((n=e.content)==null?void 0:n.text)||((s=e.content)==null?void 0:s.custom)||(e==null?void 0:e.text)||""});return(n,s)=>(w(),G("div",{class:"message-tip"},[q("span",null,ae(t.value),1)]))}}),xv=ve(Nv,[["__scopeId","data-v-b209b3e5"]]),Uv=ge({__name:"index",props:{message:{default:()=>({})}},emits:["openReadUserPanel"],setup(i,{emit:e}){const t=e,n=i,s=Ot.getFeatureConfig("ReadStatus"),r=Fe.TYPES,o=P(Ee.getData(be.USER,"displayMessageReadReceipt"));et(()=>{Ee.watch(be.USER,{displayMessageReadReceipt:p})}),st(()=>{Ee.unwatch(be.USER,{displayMessageReadReceipt:p})});const a=ie(()=>{if(!s||!o.value)return!1;
6const{ID:g,type:h,flow:m,status:y,hasRiskContent:R,conversationID:I,conversationType:T,needReadReceipt:C=!1}=n.message;if(R)return!1;const{groupProfile:_}=Ee.getConversationModel(I)||{};if((_==null?void 0:_.type)===r.GRP_AVCHATROOM||(_==null?void 0:_.type)===r.GRP_COMMUNITY)return!1;if(h===r.MSG_CUSTOM){const A=Ee.getMessageModel(g);if((A==null?void 0:A.getSignalingInfo())!==null)return!1}return m!=="out"||y!=="success"?!1:T==="GROUP"?C:T==="C2C"}),l=ie(()=>{const{conversationType:g,needReadReceipt:h=!1,isPeerRead:m=!1}=n.message,{readCount:y=0,unreadCount:R=0,isPeerRead:I=!1}=n.message.readReceiptInfo;return g==="C2C"?h?I?0:1:m?0:1:g==="GROUP"?h?y===0?1:R===0?2:4:3:1}),c=ie(()=>{const{readCount:g=0}=n.message.readReceiptInfo;switch(l.value){case 0:return pe.t("TUIChat.已读");case 1:return pe.t("TUIChat.未读");case 2:return pe.t("TUIChat.全部已读");case 4:return`${g}${pe.t("TUIChat.人已读")}`;default:return""}}),u=ie(()=>{const{conversationType:g}=n.message;return g==="C2C"?l.value!==0:g==="GROUP"?l.value!==2:!1}),f=ie(()=>n.message.needReadReceipt&&n.message.conversationType==="GROUP"&&(l.value===4||l.value===1));function d(){f.value&&t("openReadUserPanel")}function p(g){o.value=g}return(g,h)=>_t((w(),G("div",{class:fe({"message-label":!0,unread:u.value,"finger-point":f.value}),onClick:d},[q("span",null,ae(c.value),1)],2)),[[yt,a.value]])}}),Pv=ve(Uv,[["__scopeId","data-v-90681ba2"]]);var fn=(i=>(i[i.TYPE_NONE=0]="TYPE_NONE",i[i.TYPE_TEXT=1]="TYPE_TEXT",i[i.TYPE_CUSTOM=2]="TYPE_CUSTOM",i[i.TYPE_IMAGE=3]="TYPE_IMAGE",i[i.TYPE_SOUND=4]="TYPE_SOUND",i[i.TYPE_VIDEO=5]="TYPE_VIDEO",i[i.TYPE_FILE=6]="TYPE_FILE",i[i.TYPE_LOCATION=7]="TYPE_LOCATION",i[i.TYPE_FACE=8]="TYPE_FACE",i[i.TYPE_GROUP_TIPS=9]="TYPE_GROUP_TIPS",i[i.TYPE_MERGER=10]="TYPE_MERGER",i))(fn||{});const Vv=ge({__name:"index",props:{message:{default:()=>({})}},emits:["scrollTo","blinkMessage"],setup(i,{emit:e}){const t=e,n=i;let s=0;const r=P(""),o=P(!1),a=P({}),l=ie(()=>{var f;try{const d=JSON.parse(((f=n.message)==null?void 0:f.cloudCustomData)||"{}"),p=Ee.getMessageModel(d.messageReply.messageID);return p==null?void 0:p.isRevoked}catch(d){return!0}});et(()=>{var f;try{const d=JSON.parse(((f=n.message)==null?void 0:f.cloudCustomData)||"{}");
6o.value=!!d.messageReply,o.value&&(a.value=d.messageReply,r.value=c(a.value))}catch(d){o.value=!1}});function c(f){let d="",p="";switch(f.messageType){case fn.TYPE_TEXT:d="[文本]";break;case fn.TYPE_CUSTOM:d="[自定义消息]";break;case fn.TYPE_IMAGE:d="[图片]";break;case fn.TYPE_SOUND:d="[音频]";break;case fn.TYPE_VIDEO:d="[视频]";break;case fn.TYPE_FILE:d="[文件]";break;case fn.TYPE_LOCATION:d="[地理位置]";break;case fn.TYPE_FACE:d="[动画表情]";break;case fn.TYPE_GROUP_TIPS:d="[群提示]";break;case fn.TYPE_MERGER:d="[聊天记录]";break;default:d="[消息]";break}return[fn.TYPE_TEXT,fn.TYPE_MERGER].includes(f.messageType)&&(p=f.messageAbstract),p||pe.t(`TUIChat.${d}`)}function u(){return ye(this,null,function*(){var g;if(l.value)return;const f=(g=a.value)==null?void 0:g.messageID,p=Ee.getData(be.CHAT,"messageList").some(h=>h.ID===f);if(f&&p)try{const h=yield rr("#messageScrollList","messageList"),m=yield rr("#tui-"+f,"messageList"),{scrollTop:y}=yield va("#messageScrollList","messageList"),R=m.top+y-h.top-s++%2,I=m.top<h.top;if(!(He.value||Se.value)&&window){const T=document.getElementById("messageScrollList");I&&T&&(T.scrollTop=R)}else(He.value||Se.value)&&I&&t("scrollTo",R);t("blinkMessage",f)}catch(h){}else tn({message:pe.t("TUIChat.无法定位到原消息"),type:pn.WARNING})})}return(f,d)=>o.value?(w(),G("div",{key:0,class:fe({"reference-content":!0,reverse:f.message.flow==="out"}),onClick:u},[l.value?(w(),G("div",{key:0,class:"revoked-text"},ae(v(pe).t("TUIChat.引用内容已撤回")),1)):(w(),G("div",{key:1,class:"max-double-line"},ae(a.value.messageSender)+": "+ae(v(Ps)(r.value)),1))],2)):X("",!0)}}),Bv=ve(Vv,[["__scopeId","data-v-9d58cbf6"]]);class Yi{constructor(){this.isUseCache=!0,this.translationCache=new Map}static getInstance(){return Yi.instance||(Yi.instance=new Yi),Yi.instance}get(e){var t=this;return or(function*(){if(t.isUseCache){var n=t.translationCache.get(e.ID);if(n!==void 0)return n}var s=Ee.getMessageModel(e.ID);if(!s)return[];for(var{text:r}=s.getMessageContent()||{},o=[],a=yield t.getNickList(s),l=0;l<r.length;++l){var c=r[l];if(c.name==="img"){o.push({type:"face",value:c.src});continue}for(var{transSplitingList:u,atNickList:f}=t.getSplitResult(c.text,a),d=0;d<u.length;++d)o.push({type:"text",value:u[d]}),d<f.length&&o.push({type:"mention",value:f[d]})}var p=[],g=o.filter((m,y)=>m.type==="text"&&m.value.trim()!==""?(p.push(y),!0):!1).map(m=>m.value);if(g.length===0)return t.translationCache.set(s.ID,o),o;var h=yield t.getTranslationStandard(g);return h.forEach((m,y)=>{o[p[y]].value=m}),t.translationCache.set(s.ID,o),o})()}clear(){this.translationCache.clear()}disableCache(){this.isUseCache=!1}enableCache(){this.isUseCache=!0}getTranslationStandard(e){return new Promise((t,n)=>{bt.translateText({sourceTextList:e,sourceLanguage:"auto"}).then(s=>{var{data:{translatedTextList:r}}=s;t(r)}).catch(s=>{n(s)})})}getNickList(e){return or(function*(){var t=[],{atUserList:n=[]}=e,s=Fe.TYPES.MSG_AT_ALL;if(n.includes(s)&&t.push("@".concat(pe.t("TUIChat.所有人"))),n.length>0){var{data:r}=yield il.getUserProfile({userIDList:n});r.forEach(o=>{var a="@".concat(o.nick||o.userID);t.push(a)})}return[...new Set(t)]})()}getSplitResult(e,t){for(var n=0,s=[],r=[];n<e.length;){var o=e.indexOf("@",n);if(o===-1){s.push(e.substring(n));break}for(var a=!1,l=0;l<t.length;++l){var c=e.indexOf(t[l],o);if(c!==-1&&c===o){s.push(e.substring(n,c)),r.push(t[l]),n=c+t[l].length,a=!0;break}}if(!a){s.push(e.substring(n));break}}return{transSplitingList:s,atNickList:r}}}Yi.instance=void 0;var Fv=Yi.getInstance();const Gv=ge({__name:"translation-content",props:{message:{default:()=>({})},translationContentVisible:{type:Boolean},isSingleTranslation:{type:Boolean},translationWrapperRef:{}},setup(i){const e=i,t=P(!1),n=P(""),s=P([]);return Ye(()=>e.translationContentVisible,r=>{r&&Fv.get(e.message).then(o=>{t.value=!0,s.value=o}).catch(o=>{t.value=!0,emits("toggleErrorStatus",!0),n.value=o.message})},{immediate:!0}),(r,o)=>(w(),G("div",{class:"message-translation-container"},[t.value?(w(),G("div",{key:0,id:`translation-content-${e.message.ID}`,class:fe({"translation-content":!0,occur:!0})},[s.value.length>0?(w(!0),G(ze,{key:0},pt(s.value,(a,l)=>(w(),G("span",{key:l},[a.type==="face"?(w(),G("img",{key:0,class:"text-face",src:a.value},null,8,["src"])):(w(),G("span",{key:1,class:"text-plain"},ae(a.value),1))]))),128)):(w(),G(ze,{key:1},[qe(ae(n.value),1)],64))],8,["id"])):X("",!0),q("div",{class:fe({loading:!0,"loading-end":t.value})},ae(v(pe).t("TUIChat.翻译中"))+"... ",3)]))}}),Hv=ve(Gv,[["__scopeId","data-v-16f272ff"]]),$v="data:image/svg+xml,%3csvg%20width='13'%20height='13'%20viewBox='0%200%2013%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.50001%2013C2.91038%2013%200%2010.0896%200%206.50001C0%202.91038%202.91038%200%206.50001%200C10.0896%200%2013%202.91038%2013%206.50001C13%2010.0896%2010.0896%2013%206.50001%2013ZM5.05051%209.05234C5.31489%209.31679%205.74359%209.31685%206.00805%209.05247C6.00809%209.05242%206.00813%209.05238%206.00817%209.05234L10.1129%204.94758C10.3774%204.68313%2010.3774%204.25437%2010.1129%203.98992C9.84847%203.72546%209.41971%203.72546%209.15526%203.98992L5.50008%207.58659L3.86425%205.95076C3.5998%205.68631%203.17104%205.68631%202.90659%205.95076C2.64213%206.21521%202.64213%206.64398%202.90659%206.90843L5.05051%209.05235L5.05051%209.05234Z'%2
60fill='%23999'/%3e%3c/svg%3e",jv=ge({__name:"index",props:{message:{default:()=>({})}},setup(i){const e=i,t=P(!1),n=P(!1),s=P();let r=!0;et(()=>{Ee.watch(be.CHAT,{translateTextInfo:a})}),st(()=>{Ee.unwatch(be.CHAT,{translateTextInfo:a})});function o(l){n.value=l}function a(l){if(l===void 0)return;r=!1;const c=l.get(e.message.conversationID)||[];for(let u=0;u<c.length;++u){const{messageID:f,visible:d}=c[u];if(f===e.message.ID&&d!==void 0){c.length===1&&d&&(r=!0),n.value=!1,t.value=d;break}}}return(l,c)=>t.value?(w(),G("div",{key:0,ref_key:"translationWrapperRef",ref:s,class:fe({"message-translation":!0,reverse:e.message.flow==="out",error:n.value})},[Y(Hv,{message:e.message,translationContentVisible:t.value,translationWrapperRef:s.value,isSingleTranslation:v(r),onToggleErrorStatus:o},null,8,["message","translationContentVisible","translationWrapperRef","isSingleTranslation"]),q("div",{class:"copyright"},[Y(dt,{file:v($v),size:"13px"},null,8,["file"]),q("div",{class:"copyright-text"},ae(v(pe).t("TUIChat.由IM提供翻译支持")),1)])],2)):X("",!0)}}),Wv=ve(jv,[["__scopeId","data-v-53f82d82"]]);class qi{constructor(){this.isUseCache=!0,this.convertCache=new Map}static getInstance(){return qi.instance||(qi.instance=new qi),qi.instance}get(e){var t=this;return or(function*(){if(t.isUseCache){var n=t.convertCache.get(e.ID);if(n!==void 0)return n}var s=Ee.getMessageModel(e.ID);if(!s)return Promise.reject("message not found");var r=yield bt.convertVoiceToText({message:s}),{data:{result:o}={}}=r;return o?t.convertCache.set(s.ID,o):o="",o})()}clear(){this.convertCache.clear()}disableCache(){this.isUseCache=!1}enableCache(){this.isUseCache=!0}}qi.instance=void 0;var zv=qi.getInstance();const Kv=ge({__name:"convert-content",props:{message:{default:()=>({})},contentVisible:{type:Boolean}},emits:["toggleErrorStatus"],setup(i,{emit:e}){const t=e,n=i,s=P(!1),r=P("");return Ye(()=>n.contentVisible,o=>{o&&zv.get(n.message).then(a=>{s.value=!0,r.value=a}).catch(a=>{s.value=!0,t("toggleErrorStatus",!0),r.value=a.message})},{immediate:!0}),(o,a)=>(w(),G("div",{class:"message-convert-container"},[s.value?(w(),G("div",{key:0,class:fe({"convert-content":!0,occur:!0})},ae(r.value),1)):X("",!0),q("div",{class:fe({loading:!0,"loading-end":s.value})},ae(v(pe).t("TUIChat.转换中"))+"... ",3)]))}}),Yv=ve(Kv,[["__scopeId","data-v-dbf7e235"]]),qv=ge({__name:"index",props:{message:{default:()=>({})}},setup(i){const e=i,t=P(!1),n=P(!1),s=P();let r=!0;et(()=>{Ee.watch(be.CHAT,{voiceToTextInfo:a})}),st(()=>{Ee.unwatch(be.CHAT,{voiceToTextInfo:a})});function o(l){n.value=l}function a(l){if(l===void 0)return;r=!1;const c=l.get(e.message.conversationID)||[];for(let u=0;u<c.length;++u){const{messageID:f,visible:d}=c[u];if(f===e.message.ID&&d!==void 0){c.length===1&&d&&(r=!0),n.value=!1,t.value=d;break}}}return(l,c)=>t.value?(w(),G("div",{key:0,ref_key:"convertWrapperRef",ref:s,class:fe({"message-convert":!0,reverse:e.message.flow==="out",error:n.value})},[Y(Yv,{message:e.message,contentVisible:t.value,isSingleConvert:v(r),convertWrapperRef:s.value,onToggleErrorStatus:o},null,8,["message","contentVisible","isSingleConvert","convertWrapperRef"])],2)):X("",!0)}}),Jv=ve(qv,[["__scopeId","data-v-67884ecf"]]),Qv="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;'%3e%3ccircle%20id='&%23230;&%23164;&%23173;&%23229;&%23156;&%23134;&%23229;&%23189;&%23162;'%20cx='22'%20cy='22'%20r='22'%20fill='%23147AFF'/%3e%3cpath%20id='&%23232;&%23183;&%23175;&%23229;&%23190;&%23132;'%20d='M29.8629%2013.8987C30.2582%2013.5129%2030.8913%2013.5206%2031.277%2013.9159L33.035%2015.7172C33.4207%2016.1124%2033.4131%2016.7454%2033.0179%2017.1312L19.0302%2030.7857C18.6448%2031.162%2018.0305%2031.1653%2017.641%2030.7933L10.9897%2024.4405C10.5904%2024.0591%2010.5758%2023.4262%2010.9571%2023.0268L12.6958%2021.2055C13.0772%2020.8061%2013.7102%202
60.7914%2014.1096%2021.1727L18.3055%2025.1785L29.8629%2013.8987Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",Zv=ge({__name:"index",props:{isSelected:{type:Boolean}},emits:["onChange"],setup(i,{emit:e}){const t=e,n=i;function s(){t("onChange",!n.isSelected)}return(r,o)=>(w(),G("div",{class:"radio-select",onClick:s},[n.isSelected?(w(),ne(dt,{key:1,file:v(Qv),size:"20px"},null,8,["file"])):(w(),G("div",{key:0,class:"radio-no-select"}))]))}}),Xv=ve(Zv,[["__scopeId","data-v-110d9ace"]]),eC="/assets/loading-DB306kU9.png",tC="https://web.sdk.qcloud.com/component/TUIKit/assets/has_risk_default.png",nC=ge({__name:"message-bubble",props:{messageItem:{default:()=>({})},content:{default:()=>({})},classNameList:{default:()=>[]},blinkMessageIDList:{default:()=>[]},isMultipleSelectMode:{type:Boolean,default:!1},isAudioPlayed:{type:Boolean,default:!1},multipleSelectedMessageIDList:{default:()=>[]}},emits:["resendMessage","blinkMessage","setReadReceiptPanelVisible","changeSelectMessageIDList","onAvatarLongPress","scrollTo"],setup(i,{emit:e}){const t=e,n=i,s=Fe.TYPES,r=[s.MSG_LOCATION,s.MSG_TEXT,s.MSG_CUSTOM,s.MSG_MERGER,s.MSG_FACE],{blinkMessageIDList:o,messageItem:a}=$e(n),l=ie(()=>n.multipleSelectedMessageIDList.includes(a.value.ID)),c=ie(()=>a.value.flow==="in"&&a.value.status==="success"&&a.value.type===s.MSG_AUDIO&&!n.isAudioPlayed),u=ie(()=>["message-bubble",l.value?"multiple-selected":"",...n.classNameList]),f=ie(()=>[s.MSG_IMAGE,s.MSG_VIDEO,s.MSG_MERGER,s.MSG_CUSTOM].includes(a.value.type)),d=ie(()=>{let E=pe.t("TUIChat.涉及敏感内容")+", ";return a.value.flow==="out"?E+=pe.t("TUIChat.发送失败"):E+=pe.t(a.value.type===s.MSG_AUDIO?"TUIChat.无法收听":"TUIChat.无法查看"),E}),p=ie(()=>{var E,M;return(E=a.value)!=null&&E.ID?(M=o==null?void 0:o.value)==null?void 0:M.includes(a.value.ID):!1});function g(E){t("changeSelectMessageIDList",{type:E?"add":"remove",messageID:a.value.ID})}function h(){var E;(E=a.value)!=null&&E.hasRiskContent||t("resendMessage")}function m(E){t("blinkMessage",E)}function y(E){t("scrollTo",E)}function R(){t("setReadReceiptPanelVisible",!0,a.value)}let I;const T=P(!1);function C(E){E.stopPropagation(),L()}function _(E){E.stopPropagation(),T.value=!1,I=setTimeout(()=>{T.value=!0,L()},500)}function A(E){E.stopPropagation(),clearTimeout(I),setTimeout(()=>{T.value=!1},200)}function L(){if(a.value.conversationType!=="GROUP"||a.value.flow!=="in")return;const E=n.content.showName||a.value.from,M={id:a.value.from,label:E};t("onAvatarLongPress",M)}return(E,M)=>{const B=fi;return w(),G("div",{class:fe(u.value)},[E.isMultipleSelectMode?(w(),ne(Xv,{key:0,class:"multiple-select-radio",isSelected:l.value,onOnChange:g},null,8,["isSelected"])):X("",!0),q("div",{class:fe({"control-reverse":v(a).flow==="out"})},[q("div",{class:"message-bubble-content"},[q("div",{class:fe(["message-bubble-main-content",[v(a).flow==="in"?"":"reverse"]])},[Y(ar,{useSkeletonAnimation:"",url:v(a).avatar||"",style:Ze({flex:"0 0 auto",border:"1rpx solid rgba(0, 0, 0, 0.05)"}),"border-radius":"18px",onContextmenu:It(C,["prevent","right"]),onLongpress:It(C,["stop"]),onTouchstart:It(_,["stop"]),onTouchend:It(A,["stop"])},null,8,["url","style"]),q("main",{class:"message-body",onClick:M[1]||(M[1]=It(()=>{},["stop"]))},[v(a).flow==="in"&&v(a).conversationType==="GROUP"?(w(),G("div",{key:0,class:"message-body-nick-name"},ae(E.content.showName),1)):X("",!0),q("div",{class:fe(["message-body-main",v(a).flow==="out"&&"message-body-main-reverse"])},[q("div",{class:fe(["blink","message-body-content",v(a).flow==="out"?"content-out":"content-in",v(a).hasRiskContent&&"content-has-risk",f.value?"content-no-padding":"",f.value&&p.value?"blink-shadow":"",!f.value&&p.value?"blink-content":""])},[q("div",{class:"content-main"},[(v(a).type===v(s).MSG_IMAGE||v(a).type===v(s).MSG_VIDEO)&&v(a).hasRiskContent?(w(),G("img",{key:0,class:fe(["message-risk-replace",!v(Se)&&"message-risk-replace-h5"]),src:tC},null,2)):Ve(E.$slots,"default",{key:1},void 0,!0)]),v(a).hasRiskContent?(w(),G("div",{key:0,class:"content-has-risk-tips"},ae(d.value),1)):X("",!0)],2),c.value?(w(),G("div",{key:0,class:"audio-unplay-mark"})):X("",!0),v(a).status==="fail"||v(a).hasRiskContent?(w(),G("div",{key:1,class:"message-label fail",onClick:M[0]||(M[0]=b=>h())}," ! ")):X("",!0),v(a).status==="unSend"&&r.includes(v(a).type)?(w(),ne(dt,{key:2,class:"message-label loading-circle",file:v(eC),width:"15px",height:"15px"},null,8,["file"])):X("",!0),Y(B,{class:"message-label align-self-bottom"},{default:re(()=>[Y(Pv,{message:v(Ph)(v(a)),onOpenReadUserPanel:R},null,8,["message"])]),_:1})],2)])],2),q("div",{class:"message-bubble-extra-content"},[Y(Wv,{class:fe(v(a).flow==="out"?"reverse":"flex-row"),message:v(a)},null,8,["class","message"]),Y(Jv,{class:fe(v(a).flow==="out"?"reverse":"flex-row"),message:v(a)},null,8,["class","message"]),Y(Bv,{class:fe(v(a).flow==="out"?"reverse":"flex-row"),message:v(a),onBlinkMessage:m,onScrollTo:y},null,8,["class","message"])])])],2)],2)}}}
6),c0=ve(nC,[["__scopeId","data-v-30f1217b"]]),iC=ge({__name:"message-timestamp",props:{currTime:{type:Number,default:0},prevTime:{type:Number,default:0}},setup(i){const e=i,{currTime:t,prevTime:n}=$e(e),s=P(!1),r=P(""),o=(a,l)=>(s.value=!1,a<=0?"":!l||l<=0?(s.value=!0,Ca(a*1e3)):a-l>=600?(s.value=!0,Ca(a*1e3)):"");return Ye(()=>[t.value,n.value],(a,l)=>{(a==null?void 0:a.toString())!==(l==null?void 0:l.toString())&&(r.value=o(t.value,n.value))},{immediate:!0}),(a,l)=>s.value?(w(),G("div",{key:0,class:"message-timestamp"},ae(r.value),1)):X("",!0)}}),sC=ve(iC,[["__scopeId","data-v-af8a77bd"]]),rC=ge({__name:"message-video",props:{content:{default:()=>({})},messageItem:{default:()=>({})}},setup(i){const e=i;function t(){a0(e.content.url)}return(n,s)=>{const r=vr;return w(),G("div",{class:"message-video"},[q("div",{class:"message-video-box",onClick:t},[Y(r,{class:"message-video-box",src:e.content.snapshotUrl,alt:"Image","lazy-load":""},null,8,["src"]),e.messageItem.status==="success"||e.messageItem.progress===1?(w(),ne(dt,{key:0,class:"video-play",file:v(Yu)},null,8,["file"])):X("",!0)])])}}}),oC=ve(rC,[["__scopeId","data-v-d22c9b8a"]]),aC="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40px'%20height='40px'%20viewBox='0%200%2040%2040'%20version='1.1'%3e%3ctitle%3e编组%2014%3c/title%3e%3cdefs%3e%3cpath%20d='M467,0%20C474.731986,-2.71135202e-14%20481,6.2680135%20481,14%20L481,247%20C481,254.731986%20474.731986,261%20467,261%20L353.036,261%20L340.862492,273.204941%20C339.302377,274.769018%20336.769719,274.77223%20335.205642,273.212116%20C335.203247,273.209727%20335.200856,273.207335%20335.198467,273.204941%20L323.024,261%20L14,261%20C6.2680135,261%202.72325209e-15,254.731986%200,247%20L0,14%20C8.29461588e-16,6.2680135%206.2680135,3.19669972e-15%2014,0%20L467,0%20Z'%20id='path-1'%3e%3c/path%3e%3cfilter%20x='-10.1%25'%20y='-14.0%25'%20width='120.2%25'%20height='135.4%25'%20filterUnits='objectBoundingBox'%20id='filter-2'%3e%3cfeOffset%20dx='0'%20dy='10'%20in='SourceAlpha'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='14.5'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.06%200'%20type='matrix'%20in='shadowBlurOuter1'%3e%3c/feColorMatrix%3e%3c/filter%3e%3c/defs%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='消息状态'%20transform='translate(-541.000000,%20-196.000000)'%3e%3cg%20id='编组-11'%20transform='translate(499.000000,%20163.000000)'%3e%3cg%20id='形状结合'%3e%3cuse%20fill='black'%20fill-opacity='1'%20filter='url(%23filter-2)'%20xlink:href='%23path-1'%3e%3c/use%3e%3cuse%20fill='%23FFFFFF'%20fill-rule='evenodd'%20xlink:href='%23path-1'%3e%3c/use%3e%3c/g%3e%3cg%20id='编组-19'%20transform='translate(8.000000,%201.000000)'%20fill-rule='nonzero'%3e%3cg%20id='编组-17'%20transform='translate(34.000000,%2032.000000)'%3e%3cg%20id='编组-14'%20transform='translate(0.000000,%200.249660)'%3e%3crect%20id='矩形'%20stroke='%23444444'%20stroke-width='4'%20x='6'%20y='11.7115453'%20width='20.4869565'%20height='24.5849258'%20rx='1'%3e%3c/rect%3e%3cpath%20d='M36,2.01560374%20L36,28.7262543%20C36,29.0023967%2035.7761424,29.2262543%2035.5,29.2262543%20L32.4652074,29.2262543%20C32.1890657,29.2262525%2031.9652084,29.002396%2031.9652057,28.7262543%20L31.9651258,6.04681123%20L31.9651258,6.04681123%20L12.2913043,6.04719144%20C12.015162,6.04720643%2011.7913,5.82335314%2011.7912947,5.54721076%20C11.7912947,5.54720754%2011.7912947,5.54720432%2011.7913043,5.5472011%20L11.7913043,2.51560374%20C11.7913043,2.23946137%2012.015162,2.01560374%2012.2913043,2.01560374%20L36,2.01560374%20L36,2.01560374%20Z'%20id='路径-3'%20fill='%23444444'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",lC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2040%2041'%20class='design-iconfont'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M34,2%20L34,28.6209709%20L20.7153357,28.6209709%20L17.9993455,31.4022694%20L15.2847485,28.6219998%20L2,28.6219998%20L2,2%20L34,2%20Z'%20transform='translate(2%203.273066)'%20fill-rule='nonzero'%20stroke='%23444'%20stroke-width='4'/%3e%3cpath%20fill='%23444'%20d='M11%2016.12483H15V20.15603749H11z'%20transform='translate(0%20.24966)'/%3e%3cpath%20fill='%23444'%20d='M18%2016.12483H22V20.15603749H18z'%20transform='translate(0%20.24966)'/%3e%3cpath%20fill='%23444'%20d='M25%2016.12483H29V20.15603749H25z'%20transform='translate(0%20.24966)'/%3e%3c/g%3e%3c/svg%3e",cC="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='40px'%20height='40px'%20viewBox='0%200%2040%2040'%20version='1.1'%3e%3ctitle%3e矩形%3c/title%3e%3cdefs%3e%3cpath%20d='M467,0%20C474.731986,-2.71135202e-14%20481,6.2680135%20481,14%20L481,247%20C481,254.731986%20474.731986,261%20467,261%20L353.036,261%20L340.862492,273.204941%20C339.302377,274.769018%20336.769719,274.77223%20335.205642,273.212116%20C335.203247,273.209727%20335.200856,273.207335%20335.198467,273.204941%20L323.024,261%20L14,261%20C6.2680135,261%202.72325209e-15,254.731986%200,247%20L0,14%20C8.29461588e-16,6.2680135%206.2680135,3.19669972e-15%2014,0%20L467,0%20Z'%20id='path-1'%3e%3c/path%3e%3cfilter%20x='-10.1%25'%20y='-14.0%25'%20width='120.2%25'%20height='135.4%25'%20filterUnits='objectBoundingBox'%20id='filter-2'%3e%3cfeOffset%20dx='0'%20dy='10'%20in='SourceAlpha'%20result='shadowOffsetOuter1'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='14.5'%20in='shadowOffsetOuter1'%20result='shadowBlurOuter1'%3e%3c/feGaussianBlur%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.06%200'%20type='matrix'%20in='shadowBlurOuter1'%3e%3c/feColorMatrix%3e%3c/filter%3e%3c/defs%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='消息状态'%20transform='translate(-660.000000,%20-327.000000)'%3e%3cg%20id='编组-11'%20transform='translate(499.000000,%20163.000000)'%3e%3cg%20id='形状结合'%3e%3cuse%20fill='black'%20fill-opacity='1'%20filter='url(%23filter-2)'%20xlink:href='%23path-1'%3e%3c/use%3e%3cuse%20fill='%23FFFFFF'%20fill-rule='evenodd'%20xlink:href='%23path-1'%3e%3c/use%3e%3c/g%3e%3cg%20id='编组-19'%20transform='translate(8.000000,%201.000000)'%20fill='%23444444'%20fill-rule='nonzero'%3e%3cg%20id='编组-13'%20transform='translate(119.000000,%20131.000000)'%3e%3cg%20id='编组-21'%20transform='translate(34.000000,%2032.000000)'%3e%3cpath%20d='M9.94902685,18.825399%20C9.94902685,19.1015414%2
609.72516923,19.325399%209.44902685,19.325399%20C9.31552791,19.325399%209.18757266,19.2720125%209.09366105,19.1771306%20L2.13687841,12.1484693%20C1.94403281,11.9536312%201.94403281,11.6398441%202.13687841,11.445006%20L9.09366105,4.41634471%20C9.28791708,4.2200816%209.60449539,4.21845454%209.8007585,4.41271056%20C9.89564042,4.50662217%209.94902685,4.63457741%209.94902685,4.76807636%20L9.94824421,9.73507632%20L22.6994692,9.73558854%20C31.0812313,9.73558854%2038,15.6504194%2038,23.1330579%20C38,30.5145797%2031.2669616,36.3703807%2023.0384554,36.5272976%20L22.6994692,36.5305273%20L10.4390092,36.5305273%20C9.88672441,36.5305273%209.43900916,36.082812%209.43900916,35.5305273%20L9.43900916,33.408229%20C9.43900916,32.8559443%209.88672441,32.408229%2010.4390092,32.408229%20L22.6994692,32.408229%20C28.9648068,32.408229%2033.9198585,28.1721729%2033.9198585,23.1330579%20C33.9198585,18.1779281%2029.1285988,13.9993117%2023.0116273,13.861401%20L22.6994692,13.8578868%20L9.94824421,13.8570763%20L9.94902685,18.825399%20Z'%20id='路径'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",uC="data:image/svg+xml,%3csvg%20width='19'%20height='18'%20viewBox='0%200%2019%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_313_82772'%20fill='white'%3e%3crect%20x='7'%20y='7.62939e-06'%20width='12'%20height='12'%20rx='0.5'/%3e%3c/mask%3e%3crect%20x='7'%20y='7.62939e-06'%20width='12'%20height='12'%20rx='0.5'%20fill='%23444444'%20stroke='%23CCCCCC'%20stroke-width='4'%20mask='url(%23path-1-inside-1_313_82772)'/%3e%3cpath%20d='M12.7426%203.61601H12.6745L12.6496%203.67939L10.9636%207.96339L10.9098%208.10001H11.0566H11.5846H11.6536L11.6781%208.03553L12.1096%206.90001H13.9397L14.3712%208.03553L14.3957%208.10001H14.4646H14.9986H15.1455L15.0917%207.96339L13.4057%203.67939L13.3808%203.61601H13.3126H12.7426ZM13.7079%206.28601H12.3421L13.03%204.49341L13.7079%206.28601Z'%20fill='%23CCCCCC'%20stroke='%23CCCCCC'%20stroke-width='0.2'/%3e%3cmask%20id='path-3-inside-2_313_82772'%20fill='white'%3e%3crect%20y='6.00001'%2
60width='12'%20height='12'%20rx='0.5'/%3e%3c/mask%3e%3crect%20y='6.00001'%20width='12'%20height='12'%20rx='0.5'%20fill='%23444444'%20stroke='%23CCCCCC'%20stroke-width='4'%20mask='url(%23path-3-inside-2_313_82772)'/%3e%3cpath%20d='M5.77801%208.97401H5.67801V9.07401V10.054H3.63H3.53V10.154V12.974V13.074H3.63H4.062H4.162V12.974V12.696H5.67801V14.642V14.742H5.77801H6.222H6.322V14.642V12.696H7.84401V12.974V13.074H7.94401H8.37601H8.47601V12.974V10.154V10.054H8.37601H6.322V9.07401V8.97401H6.222H5.77801ZM4.162%2012.076V10.674H5.67801V12.076H4.162ZM6.322%2012.076V10.674H7.84401V12.076H6.322Z'%20fill='%23CCCCCC'%20stroke='%23CCCCCC'%20stroke-width='0.2'/%3e%3c/svg%3e",dC="/assets/tool-copy-C9r3RIIK.svg",fC="/assets/tool-quote-D0gZRlWQ.svg",hC="/assets/tool-revoke-oNO7sdCC.svg",pC="/assets/tool-translate-BYoWgjJT.svg",gC="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='path-1-inside-1_1_4'%20fill='white'%3e%3crect%20y='6.10352e-05'%20width='16'%20height='16'%20rx='0.5'/%3e%3c/mask%3e%3crect%20y='6.10352e-05'%20width='16'%20height='16'%20rx='0.5'%20fill='white'%20stroke='%23444444'%20stroke-width='4'%20mask='url(%23path-1-inside-1_1_4)'/%3e%3cpath%20d='M4.51199%205.81608V6.39208H5.74399C6.10399%207.62408%206.74399%208.69608%207.67199%209.60808C6.80799%2010.3921%205.70399%2010.9601%204.35999%2011.3201L4.66399%2011.8241C6.02399%2011.4321%207.15999%2010.8161%208.07199%209.97608C8.93599%2010.7201%2010.024%2011.3361%2011.352%2011.8321L11.664%2011.3521C10.384%2010.8801%209.31999%2010.2881%208.47199%209.56808C9.25599%208.72008%209.84799%207.65608%2010.24%206.39208H11.488V5.81608H8.43199C8.17599%205.26408%207.90399%204.79208%207.59999%204.40808L7.02399%204.61608C7.34399%204.99208%207.60799%205.39208%207.82399%205.81608H4.51199ZM6.31199%206.39208H9.63999C9.30399%207.49608%208.78399%208.43208%208.07199%209.20808C7.23999%208.40808%206.65599%207.47208%206.31199%206.39208Z'%20fill='%23444444'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.31199%205.61608H7.48751C7.31129%205.31249%207.10719%205.02243%206.87168%204.74571L6.68467%204.52597L7.66745%204.17108L7.7568%204.28394C8.0517%204.65645%208.31433%205.10396%208.55891%205.61608H11.688V6.59208H10.3863C10.0114%207.74389%209.46813%208.73403%208.75997%209.54663C9.55979%2010.1899%2010.5494%2010.7279%2011.7332%2011.1644L11.9682%2011.2511L11.4323%2012.0756L11.282%2012.0194C10.0044%2011.5423%208.9389%2010.9527%208.07627%2010.2412C7.1617%2011.0446%206.04107%2011.6353%204.71938%2012.0163L4.57197%2012.0587L4.05139%2011.1957L4.30824%2011.1269C5.54648%2010.7952%206.56828%2010.2862%207.38032%209.59789C6.54448%208.73191%205.95109%207.72929%205.59553%206.59208H4.31199V5.61608ZM5.74399%206.39208C6.08545%207.56066%206.67884%208.58529%207.53097%209.46597C7.57721%209.51377%207.62422%209.56114%207.67199%209.60808C7.62257%209.65292%207.57237%209.69705%207.52139%209.74048C6.72554%2010.4184%205.73841%2010.9245%204.56%2011.2645C4.49393%2011.2835%204.42726%2011.3021%204.35999%2011.3201L4.66399%2011.8241C6.02399%2011.4321%207.15999%2010.8161%208.07199%209.97608C8.93599%2010.7201%2010.024%2011.3361%2011.352%2011.8321L11.664%2011.3521C11.5996%2011.3283%2011.5357%2011.3043%2011.4724%2011.2799C10.3526%2010.8491%209.40393%2010.3229%208.6263%209.69577C8.57409%209.65366%208.52265%209.6111%208.47199%209.56808C8.51719%209.51918%208.56176%209.46957%208.60569%209.41924C9.32359%208.59671%209.87059%207.5832%2010.24%206.39208H11.488V5.81608H8.43199C8.17599%205.26408%207.90399%204.79208%207.59999%204.40808L7.02399%204.61608C7.07008%204.67024%207.115%204.72489%207.15879%204.78004C7.3708%205.04705%207.55614%205.32573%207.71752%205.61608C7.75424%205.68215%207.78972%205.74881%207.82399%205.81608H4.51199V6.39208H5.74399ZM6.31199%206.39208C6.3334%206.45931%206.35574%206.52597%206.37901%206.59208C6.70795%207.52643%207.223%208.34973%207.92962%209.06741C7.97624%209.11476%208.0237%209.16165%208.07199%209.20808C8.07199%209.20808%208.07198%209.20809%208.07199%209.20808C8.11712%209.1589%208.16148%209.10906%208.20507%209.05858C8.80725%208.36128%209.26261%207.54091%209.5765%206.59208C9.59834%206.52604%209.61951%206.45937%209.63999%206.39208H6.31199ZM6.59144%206.59208C6.90978%207.46685%207.39807%208.23985%208.06267%208.91746C8.62858%208.25932%209.06168%207.48673%209.36556%206.59208H6.59144Z'%2
60fill='%23444444'/%3e%3c/svg%3e",mC=ge({__name:"index",props:{messageItem:{default:()=>({})},isMultipleSelectMode:{type:Boolean,default:!1}},emits:["toggleMultipleSelectMode"],setup(i,{expose:e,emit:t}){const n=i,s=Ot.getFeatureConfig(),r=Fe.TYPES,o=P([{key:"copy",text:pe.t("TUIChat.复制"),iconUrl:Se.value?aC:dC,renderCondition(){return!s.CopyMessage||!a.value?!1:a.value.type===r.MSG_TEXT},clickEvent:d},{key:"revoke",text:pe.t("TUIChat.撤回"),iconUrl:Se.value?cC:hC,renderCondition(){return!s.RevokeMessage||!a.value?!1:a.value.flow==="out"&&a.value.status==="success"},clickEvent:f},{key:"quote",text:pe.t("TUIChat.引用"),iconUrl:Se.value?lC:fC,renderCondition(){if(!s.QuoteMessage||!a.value)return!1;const I=Ee.getMessageModel(a.value.ID);return a.value.status==="success"&&!I.getSignalingInfo()},clickEvent:g},{key:"translate",text:pe.t("TUIChat.翻译"),visible:!1,iconUrl:Se.value?uC:pC,renderCondition(){return!s.TranslateMessage||!a.value?!1:a.value.status==="success"&&a.value.type===r.MSG_TEXT},clickEvent:h},{key:"convert",text:pe.t("TUIChat.转文字"),visible:!1,iconUrl:gC,renderCondition(){return!s.VoiceToText||!a.value?!1:a.value.status==="success"&&a.value.type===r.MSG_AUDIO},clickEvent:m}]),a=P(),l=P();et(()=>{Ee.watch(be.CHAT,{translateTextInfo:y,voiceToTextInfo:R})}),st(()=>{Ee.unwatch(be.CHAT,{translateTextInfo:y,voiceToTextInfo:R})}),ln(()=>{a.value=Ee.getMessageModel(n.messageItem.ID)});const c=ie(()=>{for(let I=0;I<o.value.length;++I)if(o.value[I].renderCondition())return!1;return!0});function u(I){o.value[I].clickEvent()}function f(){a.value&&Jt.showModal({title:"",content:pe.t("TUIChat.是否撤回该条消息"),confirmText:pe.t("TUIChat.确定"),showCancel:!0,success:({confirm:I})=>{I&&Ee.getMessageModel(a.value.ID).revokeMessage().then(()=>{ol("revokeMessage")}).catch(C=>{if(C.code===20016||C.code===10031){const _=pe.t("TUIChat.已过撤回时限");tn({message:_,type:pn.ERROR})}})}})}function d(){return ye(this,null,function*(){var T,C;const I=(T=a.value)==null?void 0:T.payload.text;(He.value||Se.value)&&((C=nt)==null||C.setClipboardData({data:Ps(I)}))})}function p(I){}function g(){a.value&&a.value.quoteMessage()}function h(){if(!Ee.getData(be.APP,"enabledTranslationPlugin")){tn({message:pe.t("TUIChat.请开通翻译功能"),type:pn.WARNING});return}if(!a.value)return;const T=o.value.findIndex(C=>C.key==="translate");Ee.update(be.CHAT,"translateTextInfo",{conversationID:a.value.conversationID,messageID:a.value.ID,visible:!o.value[T].visible})}function m(){if(!Ee.getData(be.APP,"enabledVoiceToText")){tn({message:pe.t("TUIChat.请开通语音转文字功能"),type:""});return}if(!a.value)return;const T=o.value.findIndex(C=>C.key==="convert");Ee.update(be.CHAT,"voiceToTextInfo",{conversationID:a.value.conversationID,messageID:a.value.ID,visible:!o.value[T].visible})}function y(I){if(I===void 0)return;const T=I.get(n.messageItem.conversationID)||[],C=o.value.findIndex(_=>_.key==="translate");for(let _=0;_<T.length;++_){const{messageID:A,visible:L}=T[_];if(A===n.messageItem.ID){o.value[C].text=pe.t(L?"TUIChat.隐藏":"TUIChat.翻译"),o.value[C].visible=!!L;return}}o.value[C].text=pe.t("TUIChat.翻译")}function R(I){if(I===void 0)return;const T=I.get(n.messageItem.conversationID)||[],C=o.value.findIndex(_=>_.key==="convert");for(let _=0;_<T.length;++_){const{messageID:A,visible:L}=T[_];if(A===n.messageItem.ID){o.value[C].text=pe.t(L?"TUIChat.隐藏":"TUIChat.转文字"),o.value[C].visible=!!L;return}}o.value[C].text=pe.t("TUIChat.转文字")}return e({messageToolDom:l}),(I,T)=>!c.value&&!I.messageItem.hasRiskContent?(w(),G("div",{key:0,ref_key:"messageToolDom",ref:l,class:fe(["dialog-item",v(Se)?"dialog-item-web":"dialog-item-h5"])},[v(s).EmojiReaction?Ve(I.$slots,"TUIEmojiPlugin",{key:0},void 0,!0):X("",!0),q("div",{class:fe(["dialog-item-list",v(Se)?"dialog-item-list-web":"dialog-item-list-h5"])},[(w(!0),G(ze,null,pt(o.value,(C,_)=>(w(),G(ze,null,[C.renderCondition()?(w(),G("div",{key:C.key,class:"list-item",onClick:A=>u(_),onMousedown:A=>(C.key,void 0)},[Y(dt,{file:C.iconUrl,size:"15px"},null,8,["file"]),q("span",{class:"list-item-text"},ae(C.text),1)],40,["onClick","onMousedown"])):X("",!0)],64))),256))],2)],2)):X("",!0)}}),vC=ve(mC,[["__scopeId","data-v-ae7b9143"]]),CC=ge({__name:"message-revoked",props:{isEdit:{type:Boolean,default:()=>!1},messageItem:{type:Object,default:()=>({})}},emits:["messageEdit"],setup(i,{emit:e}){const t=i,n=P(),s=P(!1),r=e;ln(()=>{n.value=t.messageItem,s.value=t.isEdit});const o=()=>{r("messageEdit")};return(a,l)=>{const c=vo;return n.value?(w(),G("div",{key:0,class:"revoke"},[n.value.flow==="in"?(w(),G("span",{key:0},ae(n.value.nick||n.value.from),1)):n.value.from===n.value.revoker?(w(),G("span",{key:1},ae(v(pe).t("TUIChat.您")),1)):(w(),G("span",{key:2},ae(n.value.revoker),1)),q("span",null,ae(v(pe).t("TUIChat.撤回了一条消息")),1),n.value.flow==="out"&&s.value?(w(),ne(c,{key:3,class:"edit",onClick:It(o,["stop"])},{default:re(()=>[qe(ae(v(pe).t("TUIChat.重新编辑")),1)]),_:1})):X("",!0)])):X("",!0)}}}),_C=ve(CC,[["__scopeId","data-v-5724da8f"]]),yC=ge({__name:"moretickets-tip",props:{item:{},isCustom:{}},setup(i){const e=i,t=ie(()=>{var r,o,a;if(e.isCustom.businessID===xt.CUSTOM_ORDER_STATUS_CHANGE_MSG){const l=(r=e.isCustom)==null?void 0:r.content;
6return`${l.tips}:${l.message}`}return(a=(o=e.isCustom)==null?void 0:o.content)!=null?a:"--"}),n=ie(()=>e.isCustom.businessID===xt.CUSTOM_SENSITIVE_MSG),s=ie(()=>{var r,o,a,l,c;return(c=(l=(a=JSON.parse((o=JSON.stringify((r=e.isCustom)==null?void 0:r.content))!=null?o:"{}"))==null?void 0:a.message)==null?void 0:l.replace(/\\/g,""))!=null?c:""});return(r,o)=>{const a=vo;return w(),G("div",{class:"message-tip"},[n.value?(w(),ne(a,{key:0,innerHTML:s.value},null,8,["innerHTML"])):(w(),ne(a,{key:1},{default:re(()=>[qe(ae(t.value),1)]),_:1}))])}}}),pc=ve(yC,[["__scopeId","data-v-643e34bc"]]);function u0(i){var e,t=Gn(i==null||(e=i.payload)===null||e===void 0?void 0:e.data);if((t==null?void 0:t.businessID)===1&&t!==null&&t!==void 0&&t.data){var n=Gn(t.data);if(n.businessID==="av_call"||n.businessID==="rtc_call")return!0}return!1}function IC(i){var e,t=Gn(i==null||(e=i.payload)===null||e===void 0?void 0:e.data);return(t==null?void 0:t.businessID)==="ROOM_INVITE_ACTION"||(t==null?void 0:t.businessID)==="tuikit_engine_room"}function d0(i){var e,t=Gn(i==null||(e=i.payload)===null||e===void 0?void 0:e.data);return(t==null?void 0:t.businessID)==="group_room_message"}function gc(i){return i.type===Fe.TYPES.MSG_CUSTOM&&(u0(i)||d0(i)||IC(i))}const EC=ge({__name:"message-plugin-layout",props:{message:{default:()=>({})},showStyle:{default:""},bubbleClassNameList:{default:()=>[]},blinkMessageIDList:{default:()=>[]}},emits:["resendMessage","handleToggleMessageItem","handleH5LongPress"],setup(i,{emit:e}){const t=i,n=e,s=ie(()=>{var l;return Ee.getMessageModel((l=t.message)==null?void 0:l.ID)}),r=l=>{n("resendMessage",l)},o=(l,c,u=!1)=>{n("handleToggleMessageItem",l,c,u)},a=(l,c,u)=>{n("handleH5LongPress",l,c,u)};return(l,c)=>(w(),G("div",{class:"message-plugin"},[t.showStyle==="tip"?(w(),G("div",{key:0,class:"message-plugin-tip"},[Ve(l.$slots,"messageTip",{},void 0,!0)])):t.showStyle==="bubble"?(w(),G("div",{key:1,class:"message-plugin-bubble-content",onLongpress:c[1]||(c[1]=u=>o(u,s.value,!0)),onContextmenu:c[2]||(c[2]=It(u=>o(u,s.value),["prevent","right"])),onTouchstart:c[3]||(c[3]=u=>a(u,s.value,"touchstart")),onTouchend:c[4]||(c[4]=u=>a(u,s.value,"touchend")),onMouseover:c[5]||(c[5]=u=>a(u,s.value,"touchend"))},[Y(c0,{messageItem:s.value,content:s.value.getMessageContent(),blinkMessageIDList:t.blinkMessageIDList,classNameList:t.bubbleClassNameList,onResendMessage:c[0]||(c[0]=u=>r(s.value))},{messageElement:re(()=>[v(He)?X("",!0):Ve(l.$slots,"messageBubble",{key:0},void 0,!0)]),default:re(()=>[v(He)?Ve(l.$slots,"messageBubble",{key:0},void 0,!0):X("",!0)]),_:3},8,["messageItem","content","blinkMessageIDList","classNameList"])],32)):X("",!0)]))}}),SC=ve(EC,[["__scopeId","data-v-30f138fc"]]),TC=ge({__name:"message-call-group",props:{message:{default:()=>({})},signalingInfo:{default:()=>({})},customContent:{default:()=>({})},blinkMessageIDList:{default:()=>[]}},setup(i){const e=i,t=Fe.TYPES,n=ie(()=>!!e.signalingInfo),s=ie(()=>{var a;return(a=e.message)==null?void 0:a.conversationType}),r=ie(()=>{var a;return(a=e.customContent)==null?void 0:a.custom}),o=ie(()=>{var a,l;return(a=e.message)!=null&&a.ID?(l=e.blinkMessageIDList)==null?void 0:l.includes(e.message.ID):!1});return(a,l)=>n.value&&s.value===v(t).CONV_GROUP?(w(),G("div",{key:0,class:fe({"blink-text":o.value})},ae(r.value),3)):X("",!0)}}),LC=ve(TC,[["__scopeId","data-v-e379a64c"]]),wC="data:image/svg+xml,%3csvg%20width='33'%20height='23'%20viewBox='0%200%2033%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.5%204.33337C0.5%202.12424%202.29086%200.333374%204.5%200.333374H19.1667C21.3758%200.333374%2023.1667%202.12424%2023.1667%204.33337V18.3334C23.1667%2020.5425%2021.3758%2022.3334%2019.1667%2022.3334H4.5C2.29086%2022.3334%200.5%2020.5425%200.5%2018.3334V4.33337ZM4.5%205.45837C4.5%204.90609%204.94771%204.45837%205.5%204.45837H7.5C8.05228%204.45837%208.5%204.90609%208.5%205.45837V7.58337C8.5%208.13566%208.05228%208.58337%207.5%208.58337H5.5C4.94771%208.58337%204.5%208.13566%204.5%207.58337V5.45837ZM33%204.85879C33%203.68986%2031.7222%202.97013%2030.7225%203.576L25.5742%206.69633L25.3333%2
606.8423V7.12393V15.43V15.7017L25.5613%2015.8495L30.684%2019.1709C31.6819%2019.8179%2033%2019.1016%2033%2017.9122V4.85879ZM31.2408%204.43119C31.5741%204.22923%2032%204.46914%2032%204.85879V17.9122C32%2018.3087%2031.5606%2018.5475%2031.228%2018.3318L26.3333%2015.1583V7.40555L31.2408%204.43119Z'%20fill='%23333333'%20/%3e%3c/svg%3e",AC="data:image/svg+xml,%3csvg%20width='32'%20height='12'%20viewBox='0%200%2032%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.6347%2011.9983C9.72788%2011.9992%2010.6193%2011.1223%2010.6362%2010.0292L10.673%207.64717C11.6292%207.36896%2013.5482%206.92739%2016.0961%206.92739C18.6443%206.92739%2020.5804%207.36912%2021.5479%207.64767L21.5621%209.97475C21.5689%2011.0721%2022.4585%2011.9591%2023.5559%2011.9625L29.9833%2011.9825C31.0878%2011.9859%2031.986%2011.0933%2031.9895%209.98883L32%206.68064C32%204.65824%2030.7746%202.85759%2028.9507%202.2C26.1675%201.1964%2021.6615%200%2016%200C10.3386%200%205.83262%201.1964%203.04934%202.2C2.38985%202.43778%201.80885%202.82489%201.33541%203.31805C0.499655%204.18858%200.000161509%205.38952%200%206.68064L0.00557949%209.99594C0.00743508%2011.0985%200.90127%2011.9916%202.00385%2011.9926L8.6347%2011.9983Z'%20fill='%23333333'%20/%3e%3c/svg%3e",bC=ge({__name:"message-call-c2c",props:{message:{type:Object,default:()=>({})},signalingInfo:{type:Object,default:()=>({})},customContent:{type:Object,default:()=>({})}},setup(i){const e=i,t=P(Fe.TYPES),n=ie(()=>e.signalingInfo!=null),s=ie(()=>{var c,u;switch((u=Gn((c=e.signalingInfo)==null?void 0:c.data))==null?void 0:u.call_type){case 1:return{type:1,icon:AC};case 2:return{type:2,icon:wC}}return{type:0,icon:""}}),r=ie(()=>{var l;return(l=e.message)==null?void 0:l.conversationType}),o=ie(()=>{var l;return(l=e.customContent)==null?void 0:l.custom}),a=()=>{var l,c,u,f;if(r.value===Fe.TYPES.CONV_C2C){const d=((l=e.message)==null?void 0:l.flow)==="out"?(c=e.message)==null?void 0:c.to:(u=e.message)==null?void 0:u.from;Fn.callService({serviceName:ct.TUICalling.SERVICE.NAME,method:ct.TUICalling.SERVICE.METHOD.START_CALL,params:{userIDList:[d],type:(f=s==null?void 0:s.value)==null?void 0:f.type,callParams:{offlinePushInfo:Wn.getOfflinePushInfo(Ki.CALL)},version:"v3"}})}};return(l,c)=>n.value&&r.value===t.value.CONV_C2C?(w(),G("div",{key:0,class:fe(["call",["call-"+r.value,i.message.flow==="out"&&"call-reverse"]]),onClick:a},[q("div",{class:fe(["icon",i.message.flow==="out"&&s.value.type===2&&"icon-reverse"])},[Y(dt,{file:s.value.icon},null,8,["file"])],2),q("span",{class:"call-content"},ae(o.value),1)],2)):X("",!0)}}),RC=ve(bC,[["__scopeId","data-v-078760b0"]]),OC=ge({__name:"message-room-default",props:{message:{default:()=>({})}},setup(i){const e=i;return(t,n)=>(w(),G("div",{class:fe(["room-default",v(He)&&"room-default-uni",e.message.flow==="in"?"room-default-in":"room-default-out"])},ae(v(pe).t("message.custom.自定义消息")),3))}}),DC=ve(OC,[["__scopeId","data-v-ae1e784c"]]),MC=ge({__name:"message-plugin",props:{message:{default:()=>({})},blinkMessageIDList:{default:()=>[]}},emits:["resendMessage","handleToggleMessageItem","handleH5LongPress"],setup(i,{emit:e}){const t=i,n=e,s=ie(()=>Ee.getMessageModel(t.message.ID)),r=ie(()=>{var f;return(f=s==null?void 0:s.value)==null?void 0:f.getSignalingInfo()}),o=ie(()=>{var f;return(f=s==null?void 0:s.value)==null?void 0:f.getMessageContent()}),a=ie(()=>{var d;let f={pluginType:"",showStyle:""};return u0(s.value)?f={pluginType:"call",showStyle:((d=s.value)==null?void 0:d.conversationType)===Fe.TYPES.CONV_GROUP?"tip":"bubble"}:d0(s.value)&&(f={pluginType:"room",showStyle:"bubble"}),f}),l=f=>{n("resendMessage",f)},c=(f,d,p=!1)=>{n("handleToggleMessageItem",f,d,p)},u=(f,d,p)=>{n("handleH5LongPress",f,d,p)};return(f,d)=>(w(),ne(SC,{message:t.message,showStyle:a.value.showStyle,bubbleClassNameList:[a.value.pluginType==="room"?"message-bubble-room":""],onResendMessage:l,onHandleToggleMessageItem:c,onHandleH5LongPress:u},{messageTip:re(()=>[Y(LC,{message:t.message,signalingInfo:r.value,customContent:o.value,blinkMessageIDList:t.blinkMessageIDList},null,8,["message","signalingInfo","customContent","blinkMessageIDList"])]),messageBubble:re(()=>[a.value.pluginType==="call"?(w(),ne(RC,{key:0,message:t.message,signalingInfo:r.value,customContent:o.value},null,8,["message","signalingInfo","customContent"])):X("",!0),a.value.pluginType==="room"?(w(),ne(DC,{key:1,message:t.message},null,8,["message"])):X("",!0)]),_:1},8,["message","showStyle","bubbleClassNameList"]))}}),kC=ve(MC,[["__scopeId","data-v-a7d0ed11"]]),NC=ge({__name:"index",props:{isFetching:{type:Boolean,default:!1},isTerminateObserve:{type:Boolean,default:!1}},emits:["onExposed"],setup(i,{emit:e}){var a;const t=e,n=i;let s=null;const r=P(),o=((a=sr())==null?void 0:a.proxy)||sr();return et(()=>{n.isTerminateObserve||(He.value?(s=uni.createIntersectionObserver(o).relativeToViewport(),s.observe(".fetch-more-block",()=>{t("onExposed")})):(s=new IntersectionObserver(([l])=>{l.isIntersecting&&t("onExposed")},{threshold:1}),r.value&&s.observe(r.value)))}),st(()=>{s&&(s.disconnect(),s=null)}),Ye(()=>n.isTerminateObserve,l=>{s&&(l?s.disconnect():r.value&&(s.disconnect(),He.value?s.observe(".fetch-more-block",()=>{t("onExposed")}):s.observe(r.value)))}),(l,c)=>(w(),G("div",{ref_key:"selfDomRef",ref:r,class:"fetch-more-block"},[n.isFetching?Ve(l.$slots,"fetching",{key:0}
6,()=>[q("div",null,ae(v(pe).t("TUIChat.正在加载")),1)],!0):Ve(l.$slots,"fetchEnd",{key:1},()=>[q("div",null,ae(v(pe).t("TUIChat.加载结束")),1)],!0)],512))}}),xC=ve(NC,[["__scopeId","data-v-14af0c5a"]]),UC=ge({__name:"index",props:{message:{default:()=>({})},userInfo:{}},emits:["setReadReceiptPanelVisible"],setup(i,{emit:e}){const t=e,n=i;let s="",r="";const o=["unread","read"],a={unread:!1,read:!1,close:!1},l=P(!1),c=P(!1),u=P(!1),f=P(!1),d=P("unread"),p=P(I());et(()=>ye(this,null,function*(){yield m(),ei(()=>{u.value=!0})})),Ye(()=>n.message.readReceiptInfo.readCount,()=>{m()});function g(_="all"){return ye(this,null,function*(){const A=Ee.getMessageModel(n.message.ID);let L={},E={};(_==="all"||_==="unread")&&(L=yield bt.getGroupMessageReadMemberList({message:A,filter:1,cursor:s,count:100}),L&&(s=L.data.cursor,L.data.isCompleted&&(a.unread=!0))),(_==="all"||_==="read")&&(E=yield bt.getGroupMessageReadMemberList({message:A,filter:0,cursor:r,count:100}),E&&(r=E.data.cursor,E.data.isCompleted&&(a.read=!0)));const{unreadCount:M,readCount:B}=A.readReceiptInfo;return{unreadResult:F({count:M},L.data),readResult:F({count:B},E.data)}})}function h(){return ye(this,null,function*(){if(!(a[d.value]||l.value)&&(l.value=!0,d.value==="unread"||d.value==="read")){const{unreadResult:_,readResult:A}=yield g(d.value);y();try{p.value.unread.memberList=p.value.unread.memberList.concat(_.unreadUserInfoList||[]),p.value.read.memberList=p.value.read.memberList.concat(A.readUserInfoList||[])}finally{l.value=!1}}})}function m(){return ye(this,null,function*(){s="",r="",f.value=!1,a.unread=!1,a.read=!1;const{unreadResult:_,readResult:A}=yield g("all");y(),R("read",A.count,A.readUserInfoList),R("unread",_.count,_.unreadUserInfoList),R("close")})}function y(){a.read&&a.unread&&(f.value=!0)}function R(_,A,L){p.value[_].count=A,p.value[_].memberList=L||[]}function I(){return{read:{tabName:pe.t("TUIChat.已读"),count:void 0,memberList:[]},unread:{tabName:pe.t("TUIChat.未读"),count:void 0,memberList:[]},close:{tabName:pe.t("TUIChat.关闭"),count:void 0,memberList:[]}}}function T(_){d.value=_}function C(){c.value=!0,setTimeout(()=>{t("setReadReceiptPanelVisible",!1)},200)}return(_,A)=>(w(),ne(Co,{maskColor:"transparent",onOnOverlayClick:C},{default:re(()=>[q("div",{class:fe({"read-receipt-panel":!0,"read-receipt-panel-mobile":v(gn),"read-receipt-panel-uni":v(Yh),"read-receipt-panel-close-mobile":v(gn)&&c.value})},[q("div",{class:"header"},[q("div",{class:"header-text"},ae(v(pe).t("TUIChat.消息详情")),1),q("div",{class:"header-close-icon"},[Y(dt,{size:"12px",hotAreaSize:"8",file:v(zu),onOnClick:C},null,8,["file"])])]),q("div",{class:"read-status-counter-container"},[(w(),G(ze,null,pt(o,L=>q("div",{key:L,class:fe({"read-status-counter":!0,active:L===d.value}),onClick:E=>T(L)},[q("div",{class:"status-text"},ae(p.value[L].tabName),1),q("div",{class:"status-count"},ae(p.value[L].count===void 0?"":p.value[L].count),1)],10,["onClick"])),64))]),q("div",{class:"read-status-member-list"},[p.value[d.value].count===0&&u.value?(w(),G("div",{key:0,class:"empty-list-tip"}," - "+ae(v(pe).t("TUIChat.空"))+" - ",1)):u.value?(w(),G(ze,{key:1},[d.value==="unread"?(w(!0),G(ze,{key:0},pt(p.value[d.value].memberList,L=>{var E,M;return w(),G("div",{key:L.userID,class:"read-status-member-container"},[Y(ar,{class:"read-status-avatar",useSkeletonAnimation:"",url:((E=_.userInfo)==null?void 0:E[L.userID].faceImgUrl)||L.avatar||""},null,8,["url"]),q("div",{class:"username"},ae(((M=_.userInfo)==null?void 0:M[L.userID].nickname)||L.nick||L.userID),1)])}),128)):X("",!0),d.value==="read"?(w(!0),G(ze,{key:1},pt(p.value[d.value].memberList,L=>{var E,M;return w(),G("div",{key:L.userID,class:"read-status-member-container"},[Y(ar,{class:"read-status-avatar",useSkeletonAnimation:"",url:((E=_.userInfo)==null?void 0:E[L.userID].faceImgUrl)||L.avatar||""},null,8,["url"]),q("div",{class:"username"},ae(((M=_.userInfo)==null?void 0:M[L.userID].nickname)||L.nick||L.userID),1)])}),128)):X("",!0)],64)):X("",!0),u.value?(w(),G("div",{key:2,class:"fetch-more-container"},[Y(xC,{isFetching:l.value,isTerminateObserve:f.value,onOnExposed:h},null,8,["isFetching","isTerminateObserve"])])):X("",!0)])],2)]),_:1}))}}),PC=ve(UC,[["__scopeId","data-v-23b057c3"]]),VC="data:image/svg+xml,%3csvg%20t='1660053550964'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3181'%20width='200'%20height='200'%3e%3cpath%20d='M95.658667%20461.354667a71.637333%2071.637333%200%200%200%200%20101.290666l365.696%20365.696a71.637333%2071.637333%200%200%200%20101.290666%200l365.696-365.696a71.637333%2071.637333%200%201%200-101.248-101.290666L512%20776.448l-315.093333-315.093333a71.594667%2071.594667%200%200%200-101.248%200z'%20p-id='3182'%20fill='%23bfbfbf'%3e%3c/path%3e%3cpath%20d='M95.658667%2095.658667a71.637333%2071.637333%200%200%200%200%20101.248l365.696%20365.738666a71.594667%2071.594667%200%200%200%20101.290666%200l365.696-365.738666a71.637333%2071.637333%200%200%200-101.248-101.248L512%20410.709333%20196.906667%2095.658667a71.637333%2071.637333%200%200%200-101.248%200z'%20p-id='3183'%20fill='%23bfbfbf'%3e%3c/path%3e%3c/svg%3e",BC=ge({__name:"index",emits:["scrollToLatestMessage"],setup(i,{expose:e,emit:t}){const n=t,s=P([]),r=P(""),o=P(0),a=P(0),l=P(!1),c=P(!1),u=P(!1),f=ie(()=>a.value?`${a.value}${pe.t("TUIChat.条新消息")}`:pe.t("TUIChat.回到最新位置"));Ye(()=>[l.value,c.value],()=>{u.value=l.value||c.value,u.value||R()},{immediate:!0}),et(()=>{Ee.watch(be.CHAT,{messageList:p,newMessageList:g}),Ee.watch(be.CONV,{currentConversation:h})}),st(()=>{Ee.unwatch(be.CHAT,{messageList:p,newMessageList:g}),Ee.unwatch(be.CONV,{currentConversation:h})});function d(C){var _,A;return((A=Gn((_=C.payload)==null?void 0:_.data))==null?void 0:A.businessID)==="user_t
6yping_status"}function p(C){var A,L;s.value=C||[];const _=(L=s.value)==null?void 0:L[((A=s.value)==null?void 0:A.length)-1];c.value=!!(_&&(_==null?void 0:_.time)<(o==null?void 0:o.value))}function g(C){Array.isArray(C)&&u.value&&C.forEach(_=>{_&&_.conversationID===r.value&&!_.isDeleted&&!_.isRevoked&&!d(_)&&(a.value+=1)})}function h(C){var _;(C==null?void 0:C.conversationID)!==r.value&&R(),r.value=(C==null?void 0:C.conversationID)||"",o.value=((_=C==null?void 0:C.lastMessage)==null?void 0:_.lastTime)||0}function m(C){return ye(this,null,function*(){var _,A,L,E,M;if(C.target)try{const{height:B}=(yield rr(`#${(_=C.target)==null?void 0:_.id}`,"messageList"))||{},b=((A=C.target)==null?void 0:A.scrollHeight)||((L=C.detail)==null?void 0:L.scrollHeight),k=((E=C.target)==null?void 0:E.scrollTop)||((M=C.detail)==null?void 0:M.scrollTop)||0;if(b-k>2*B){l.value=!0;return}l.value=!1}catch(B){l.value=!1}})}function y(){Ee.getData(be.CHAT,"messageSource")!==void 0&&Ee.update(be.CHAT,"messageSource",void 0)}function R(){a.value=0}function I(){y(),R(),n("scrollToLatestMessage")}function T(){u.value=!1}return e({judgeScrollOverOneScreen:m,isScrollButtonVisible:u,clearButtonVisible:T}),(C,_)=>u.value?(w(),G("div",{key:0,class:"scroll-button",onClick:I},[Y(dt,{width:"10px",height:"10px",file:v(VC)},null,8,["file"]),q("div",{class:"scroll-button-text"},ae(f.value),1)])):X("",!0)}}),FC=ve(BC,[["__scopeId","data-v-40e68bb9"]]),mc="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20class='icon'%20width='32px'%20height='32.00px'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23444444'%20d='M384%20512L731.733333%20202.666667c17.066667-14.933333%2019.2-42.666667%204.266667-59.733334-14.933333-17.066667-42.666667-19.2-59.733333-4.266666l-384%20341.333333c-10.666667%208.533333-14.933333%2019.2-14.933334%2032s4.266667%2023.466667%2014.933334%2032l384%20341.333333c8.533333%206.4%2019.2%2010.666667%2027.733333%2010.666667%2012.8%200%2023.466667-4.266667%2032-14.933333%2014.933333-17.066667%2014.933333-44.8-4.266667-59.733334L384%20512z'%20/%3e%3c/svg%3e",GC="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20class='icon'%20width='200px'%20height='200.00px'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23444444'%20d='M945.066667%20898.133333l-189.866667-189.866666c55.466667-64%2087.466667-149.333333%2087.466667-241.066667%200-204.8-168.533333-373.333333-373.333334-373.333333S96%20264.533333%2096%20469.333333%20264.533333%20842.666667%20469.333333%20842.666667c91.733333%200%20174.933333-34.133333%20241.066667-87.466667l189.866667%20189.866667c6.4%206.4%2014.933333%208.533333%2023.466666%208.533333s17.066667-2.133333%2023.466667-8.533333c8.533333-12.8%208.533333-34.133333-2.133333-46.933334zM469.333333%20778.666667C298.666667%20778.666667%20160%20640%20160%20469.333333S298.666667%20160%20469.333333%20160%20778.666667%20298.666667%20778.666667%20469.333333%20640%20778.666667%20469.333333%20778.666667z'%20/%3e%3cpath%20fill='%23444444'%20d='M597.333333%20437.333333h-96V341.333333c0-17.066667-14.933333-32-32-32s-32%2014.933333-32%2032v96H341.333333c-17.066667%200-32%2014.933333-32%2032s14.933333%2032%2032%2032h96V597.333333c0%2017.066667%2014.933333%2032%2032%2032s32-14.933333%2032-32v-96H597.333333c17.066667%200%2032-14.933333%2032-32s-14.933333-32-32-32z'%20/%3e%3c/svg%3e",HC="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20class='icon'%20width='200px'%20height='200.00px'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23444444'%20d='M945.066667%20898.133333l-189.866667-189.866666c55.466667-64%2087.466667-149.333333%2087.466667-241.066667%200-204.8-168.533333-373.333333-373.333334-373.333333S96%20264.533333%2096%20469.333333%20264.533333%20842.666667%20469.333333%20842.666667c91.733333%200%20174.933333-34.133333%20241.066667-87.466667l189.866667%20189.866667c6.4%206.4%2014.933333%208.533333%2023.466666%208.533333s17.066667-2.133333%2023.466667-8.533333c8.533333-12.8%208.533333-34.133333-2.133333-46.933334zM469.333333%20778.666667C298.666667%20778.666667%20160%20640%20160%20469.333333S298.666667%20160%20469.333333%20160%20778.666667%20298.666667%20778.666667%20469.333333%20640%20778.666667%20469.333333%20778.666667z'%20/%3e%3cpath%20fill='%23444444'%20d='M597.333333%20437.333333H341.333333c-17.066667%200-32%2014.933333-32%2032s14.933333%2032%2032%2032h256c17.066667%200%2032-14.933333%2032-32s-14.933333-32-32-32z'%20/%3e%3c/svg%3e",$C="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20class='icon'%20width='200px'%20height='200.00px'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23444444'%20d='M672%20418H144c-17.7%200-32%2014.3-32%2032v414c0%2017.7%2014.3%2032%2032%2032h528c17.7%200%2032-14.3%2032-32V450c0-17.7-14.3-32-32-32z%20m-44%20402H188V494h440v326zM819.3%20328.5c-78.8-100.7-196-153.6-314.6-154.2l-0.2-64c0-6.5-7.6-10.1-12.6-6.1l-128%20101c-4%203.1-3.9%209.1%200%2012.3L492%20318.6c5.1%204%2012.7%200.4%2012.6-6.1v-63.9c12.9%200.1%2025.9%200.9%2038.8%202.5%2042.1%205.2%2082.1%2018.2%20119%2038.7%2038.1%2021.2%2071.2%2049.7%2098.4%2084.3%2027.1%2034.7%2046.7%2073.7%2058.1%20115.8%2011%2040.7%2014%2082.7%208.9%20124.8-0.7%205.4-1.4%2010.8-2.4%2016.1h74.9c14.8-103.6-11.3-213-81-302.3z'%20/%3e%3c/svg%3e",jC="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20class='icon'%20width='200px'%20height='200.00px'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23444444'%20d='M480.5%20251.2c13-1.6%2025.9-2.4%2038.8-2.5v63.9c0%206.5%207.5%2010.1%2012.6%206.1L660%20217.6c4-3.2%204-9.2%200-12.3l-128-101c-5.1-4-12.6-0.4-12.6%206.1l-0.2%2064c-118.6%200.5-235.8%2053.4-314.6%20154.2-69.6%2089.2-95.7%20198.6-81.1%20302.4h74.9c-0.9-5.3-1.7-10.7-2.4-16.1-
65.1-42.1-2.1-84.1%208.9-124.8%2011.4-42.2%2031-81.1%2058.1-115.8%2027.2-34.7%2060.3-63.2%2098.4-84.3%2037-20.6%2076.9-33.6%20119.1-38.8zM880%20418H352c-17.7%200-32%2014.3-32%2032v414c0%2017.7%2014.3%2032%2032%2032h528c17.7%200%2032-14.3%2032-32V450c0-17.7-14.3-32-32-32z%20m-44%20402H396V494h440v326z'%20/%3e%3c/svg%3e",WC="data:image/svg+xml,%3csvg%20width='11'%20height='17'%20viewBox='0%200%2011%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.13023%2014.4401C9.3928%2014.4401%209.64461%2014.5444%209.83027%2014.73C10.0159%2014.9157%2010.1202%2015.1675%2010.1202%2015.4301C10.1202%2015.6926%2010.0159%2015.9445%209.83027%2016.1301C9.64461%2016.3158%209.3928%2016.4201%209.13023%2016.4201H1.87023C1.60767%2016.4201%201.35586%2016.3158%201.1702%2016.1301C0.984536%2015.9445%200.880234%2015.6926%200.880234%2015.4301C0.880234%2015.1675%200.984536%2014.9157%201.1702%2014.73C1.35586%2014.5444%201.60767%2014.4401%201.87023%2014.4401H9.13023ZM5.50023%200.580078C5.7628%200.580078%206.01461%200.684381%206.20027%200.870042C6.38593%201.0557%206.49023%201.30751%206.49023%201.57008V8.59446L8.40027%206.51084C8.57111%206.32101%208.8087%206.20455%209.06339%206.18578C9.31808%206.16702%209.57018%206.2474%209.767%206.41014C9.96381%206.57287%2010.0901%206.80537%2010.1196%207.05905C10.149%207.31274%2010.0792%207.56798%209.92487%207.77144L9.86019%207.84932L6.23019%2011.8093C6.05448%2012.001%205.81039%2012.1159%205.55068%2012.1291C5.29096%2012.1423%205.03648%2012.0528%204.84221%2011.8799L4.77027%2011.8093L1.14027%207.84932C0.968705%207.66225%200.875545%207.41643%200.880038%207.16264C0.884531%206.90885%200.986334%206.66648%201.16442%206.4856C1.3425%206.30472%201.58325%206.19916%201.83694%206.19071C2.09063%206.18226%202.33788%206.27158%202.52759%206.44022L2.60019%206.51084L4.51023%208.59578V1.57008C4.51023%201.30751%204.61454%201.0557%204.8002%200.870042C4.98586%200.684381%205.23767%200.580078%205.50023%200.580078Z'%20fill='%23444444'%20/%3e%3c/svg%3e",zC=ge({__name:"image-item",props:{zoom:{type:Number,default:1},rotate:{type:Number,default:0},src:{type:String,default:""},messageItem:{type:Object,default:()=>({})}},setup(i){const e=i,t=ie(()=>{var r,o,a;const{width:n=0,height:s=0}=((a=(o=(r=e.messageItem)==null?void 0:r.payload)==null?void 0:o.imageInfoArray)==null?void 0:a[0])||{};return n>=s});return(n,s)=>{const r=gh,o=mh;return w(),ne(o,{class:"image-item","scale-area":""},{default:re(()=>[Y(r,{class:"image-item",direction:"all","out-of-bounds":!1,inertia:!0,damping:"90",friction:"2",scale:"true","scale-min":"1","scale-max":"4","scale-value":"1"},{default:re(()=>[q("img",{class:fe(["image-preview",[t.value?"is-width":"isHeight"]]),mode:"widthFix",style:Ze({transform:`scale(${e.zoom}) rotate(${e.rotate}deg)`}),src:e.src,"date-src":e.src,onClick:s[0]||(s[0]=It(()=>{},["stop"]))},null,14,["src","date-src"])]),_:1})]),_:1})}}}),KC=ve(zC,[["__scopeId","data-v-35de3a40"]]),YC=ge({__name:"index",props:{imageList:{default:()=>[]},currentImage:{}},emits:["close"],setup(i,{emit:e}){const t=i,n=new Map([[1,"jpg"],[2,"gif"],[3,"png"],[4,"bmp"]]),s=e,r=P(1),o=P(0),a=P(.1),l=P(0),c=P(),u=P();let f=0;const d={};let p=!1,g=!1,h=null;ln(()=>{l.value=t.imageList.findIndex(W=>{var V;return W.ID===((V=t==null?void 0:t.currentImage)==null?void 0:V.ID)})});const m=W=>typeof W=="number"&&isFinite(W),y=W=>{W.preventDefault(),_(W),A(W)},R=W=>{W.preventDefault(),p=!0,W.touches&&W.touches.length===2&&(g=!0,L(W))},I=W=>{var x;W.preventDefault(),W.stopPropagation();let V=0,S=0;if(g){h||(g=!1,delete d.pageX2,delete d.pageY2,h=setTimeout(()=>{h=null},200));return}if(h===null){switch(p){case!0:V=(x=W==null?void 0:W.changedTouches[0])==null?void 0:x.pageX,S=V-f,S>100?D():S<-100&&O();break;case!1:b();break}h=setTimeout(()=>{h=null},200)}},T=()=>{g=!1,delete d.pageX1,delete d.pageY1},C=W=>{if(W.preventDefault(),Math.abs(W.deltaX)!==0&&Math.abs(W.deltaY)!==0)return;let V=r.value;V+=W.deltaY*(W.ctrlKey?-.01:.002),V=Math.min(Math.max(.125,V),4),r.value=V},_=W=>{var V;f=(V=W==null?void 0:W.changedTouches[0])==null?void 0:V.pageX,p=!1},A=W=>{const V=W==null?void 0:W.touches[0],S=W==null?void 0:W.touches[1];d.pageX1=V==null?void 0:V.pageX,d.pageY1=V==null?void 0:V.pageY,S&&(d.pageX2=S==null?void 0:S.pageX,d.pageY2=S==null?void 0:S.pageY)},L=W=>{const V=W==null?void 0:W.touches[0],S=W==null?void 0:W.touches[1];S&&(m(d.pageX2)||(d.pageX2=S.pageX),m(d.pageY2)||(d.pageY2=S.pageY));const x=(z,de,he,Te)=>Math.hypot(he-z,Te-de);if(!m(d.pageX1)||!m(d.pageY1)||!m(d.pageX2)||!m(d.pageY2))return;const H=x(V.pageX,V.pageY,S.pageX,S.pageY)/x(d.pageX1,d.pageY1,d.pageX2,d.pageY2);r.value=Math.min(Math.max(.5,r.value*H),4)};et(()=>{document!=null&&document.addEventListener&&(document==null||document.addEventListener("keydown",E))});const E=W=>{W.preventDefault(),(W==null?void 0:W.keyCode)===27&&b()},M=()=>{r.value+=.1},B=()=>{r.value=r.value-.1>a.value?r.value-.1:a.value},b=()=>{s("close")},k=()=>{o.value-=90},U=()=>{o.value+=90},O=()=>{l.value<t.imageList.length-1&&l.value++,J()},D=()=>{l.value>0&&l.value--,J()},J=()=>{r.value=1,o.value=0},ee=W=>{var V;return _a((V=W==null?void 0:W.payload)==null?void 0:V.imageInfoArray,ya.Origin)},se=()=>{var S;const W=t.imageList[l.value],V=_a((S=W==null?void 0:W.payload)==null?void 0:S.imageInfoArray,ya.Origin);if(!V){tn({message:pe.t("component.图片 url 不存在"),type:pn.ERROR});return}switch(Lh()){case"wechat":nt.getSetting({success:x=>{x!=null&&x.authSetting["scope.writePhotosAlbum"]?ue(V):nt.authorize({scope:"scope.writePhotosAlbum",success(){ue(V)},fail(){nt.showModal({title:"您已拒绝获取相册权限",content:"是否进入权限管理,调整授权?",success:H=>{if(H.confirm)nt.openSetting({success:z=>{}});else if(H.cancel)return tn({message:pe.t("component.已取消"),type:pn.ERROR})}})}})},fail:()=>{tn({message:pe.t("component.获取权限失败"),type:pn.ERROR})}});break;case"app":ue(V);break;default:oe(V);break}},ue=W=>{nt.showLoading({title:"大图提取中"}
6),nt.downloadFile({url:W,success:function(V){nt.hideLoading(),nt.saveImageToPhotosAlbum({filePath:V.tempFilePath,success:()=>{tn({message:pe.t("component.已保存至相册"),type:pn.SUCCESS})}})},fail:function(){nt.hideLoading(),tn({message:pe.t("component.图片下载失败"),type:pn.ERROR})}})},oe=W=>{var H;const V={mode:"cors",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded"})},S=t.imageList[l.value],x=(H=S==null?void 0:S.payload)==null?void 0:H.imageFormat;if(!n.has(x)){tn({message:pe.t("component.暂不支持下载此类型图片"),type:pn.ERROR});return}if(window.fetch)fetch(W,V).then(z=>z.blob()).then(z=>{const de=document.createElement("a"),he=window.URL.createObjectURL(z);de.href=he,de.download=he+"."+n.get(x),de.click()});else{const z=document.createElement("a");z.href=W,z.target="_blank",z.download=W+"."+n.get(x),z.click()}};return st(()=>{document!=null&&document.removeEventListener&&(document==null||document.removeEventListener("keydown",E))}),(W,V)=>(w(),G("div",{class:fe(["image-previewer",[v(gn)&&"image-previewer-h5"]])},[q("div",{ref_key:"image",ref:c,class:"image-wrapper",onTouchstart:It(y,["stop"]),onTouchmove:It(R,["stop"]),onTouchend:It(I,["stop"]),onTouchcancel:It(T,["stop"]),onWheel:It(C,["stop"])},[q("ul",{ref_key:"ulRef",ref:u,class:"image-list",style:Ze({width:`${W.imageList.length*100}%`,transform:`translateX(-${l.value*100/W.imageList.length}%)`,transition:"0.5s"})},[(w(!0),G(ze,null,pt(W.imageList,(S,x)=>(w(),G("li",{key:x,class:"image-item"},[Y(KC,{zoom:r.value,rotate:o.value,src:ee(S),messageItem:S,class:fe([v(He)?"image-item":""])},null,8,["zoom","rotate","src","messageItem","class"])]))),128))],4)],544),_t(q("div",{class:"icon icon-close-img",onClick:b},[Y(dt,{file:v(zu),width:"16px",height:"16px"},null,8,["file"])],512),[[yt,v(Se)]]),v(Se)&&l.value>0?(w(),G("div",{key:0,class:"image-button image-button-left",onClick:D},[Y(dt,{file:v(mc)},null,8,["file"])])):X("",!0),v(Se)&&l.value<W.imageList.length-1?(w(),G("div",{key:1,class:"image-button image-button-right",onClick:O},[Y(dt,{file:v(mc)},null,8,["file"])])):X("",!0),q("div",{class:fe(["actions-bar",v(gn)&&"actions-bar-h5"])},[v(Se)?(w(),G("div",{key:0,class:"icon-zoom-in",onClick:M},[Y(dt,{file:v(GC),width:"27px",height:"27px"},null,8,["file"])])):X("",!0),v(Se)?(w(),G("div",{key:1,class:"icon-zoom-out",onClick:B},[Y(dt,{file:v(HC),width:"27px",height:"27px"},null,8,["file"])])):X("",!0),v(Se)?(w(),G("div",{key:2,class:"icon-refresh-left",onClick:k},[Y(dt,{file:v($C),width:"27px",height:"27px"},null,8,["file"])])):X("",!0),v(Se)?(w(),G("div",{key:3,class:"icon-refresh-right",onClick:U},[Y(dt,{file:v(jC),width:"27px",height:"27px"},null,8,["file"])])):X("",!0),q("span",{class:"image-counter"},ae(l.value+1)+" / "+ae(W.imageList.length),1)],2),q("div",{class:"save",onClick:It(se,["stop","prevent"])},[Y(dt,{file:v(WC),width:"20px",height:"20px"},null,8,["file"])])],2))}}),qC=ve(YC,[["__scopeId","data-v-63da3565"]]),JC=ge({__name:"index",props:{shortcutMenus:{default:()=>[]}},setup(i){return(e,t)=>{const n=vo,s=fi,r=el;return w(),ne(s,{class:fe(["toolbar",v(Se)&&"pc"])},{default:re(()=>[Y(r,{class:"toolbar-scroll","scroll-x":"","show-scrollbar":!1,"enable-flex":"",onTouchmove:t[0]||(t[0]=It(()=>{},["stop"]))},{default:re(()=>[Y(s,{class:"toolbar-inner"},{default:re(()=>[(w(!0),G(ze,null,pt(e.shortcutMenus,(o,a)=>(w(),G(ze,{key:(o.name||"")+a},[o.hidden?X("",!0):(w(),ne(s,{key:0,class:"toolbar-item",onClick:l=>o.onClick&&o.onClick()},{default:re(()=>[o.icon?(w(),ne(dt,{key:0,file:o.icon,size:"14px"},null,8,["file"])):X("",!0),Y(n,{class:"toolbar-item-text"},{default:re(()=>[qe(ae(o.text),1)]),_:2},1024)]),_:2},1032,["onClick"]))],64))),128))]),_:1})]),_:1})]),_:1},8,["class"])}}}),QC=ve(JC,[["__scopeId","data-v-7239f913"]]),ZC=ge({__name:"index",props:{content:{default:()=>({})},messageItem:{default:()=>({})}},setup(i){const e=i;return(t,n)=>{const s=vh;return w(),G("div",{class:"progress-message"},[Ve(t.$slots,"default",{},void 0,!0),e.messageItem.status==="unSend"&&e.messageItem.progress<1?(w(),G("div",{key:0,class:"progress-container"},[v(He)?(w(),ne(s,{key:1,activeColor:"#006EFF",class:"progress-common",percent:Math.round(e.messageItem.progress*100)},null,8,["percent"])):(w(),ne(s,{key:0,class:"progress",value:e.messageItem.progress,max:"1"},null,8,["value"]))])):X("",!0)])}}}),vc=ve(ZC,[["__scopeId","data-v-6c78de84"]]);class Ln{constructor(){this.chatStorage=null}static getInstance(){return Ln.instance||(Ln.instance=new Ln),Ln.instance}getChatStorage(e){if(this.chatStorage||(this.chatStorage=this.getChatStorageFromLocalStorage()),e)return this.chatStorage[e];throw new Error("No key provided")}setChatStorage(e,t){this.chatStorage||(this.chatStorage=this.getChatStorageFromLocalStorage()),this.chatStorage[e]=t;try{He.value?nt.setStorageSync(Ln.CHAT_STORAGE_KEY,JSON.stringify(this.chatStorage)):localStorage.setItem(Ln.CHAT_STORAGE_KEY,JSON.stringify(this.chatStorage))}catch(n){throw new Error("Fail to set chat storage")}}getChatStorageFromLocalStorage(){var e="";if(He.value?e=nt.getStorageSync(Ln.CHAT_STORAGE_KEY)||"":e=localStorage.getItem(Ln.CHAT_STORAGE_KEY)||"",!e)return{};try{this.chatStorage=JSON.parse(e)}catch(t){this.chatStorage={}}return this.chatStorage}}Ln.instance=null;Ln.CHAT_STORAGE_KEY="TUI_CHAT_STORAGE";const Yo=Ln.getInstance(),XC=ge({__name:"index",props:{isGroup:{type:Boolean,default:!1},groupID:{default:""},userInfo:{default:void 0},isNotInGroup:{type:Boolean,default:!1},isMultipleSelectMode:{type:Boolean,default:!1},shortcutMenus:{default:()=>[]},announcement:{default:void 0}},emits:["closeInputToolBar","handleEditor","toggleMultipleSelectMode","onAvatarLongPress","onAnnouncementClick"],setup(i,{expose:e,emit:t}){var Fl;const n=t,s=i;let r=0,o=null,a;const l=new Set,c=((Fl=sr())==null?void 0:Fl.proxy)||sr(),u=P(),f=P([]),d=P(!1),p=P(""),g=P(""),h=P(5e3),m=P(Fe.TYPES),y=P(!1),R=P(!1),I=P([]),T=P(),C=P(),_=P(""),A=P(!1),L=P(),E=P({}),M=P();P(!1);const B=P(!1),b=P(""),k=P(),U=P(!1),O=sl(),{curUserId:D}=nl(O),J=P(!1),ee=P();function se(me){var Je,ht;const Re=V(me);return!!(Re&&Re.businessID===xt.CUSTOM_SENSITIVE_MSG&&((Je=Re.content)!=null&&Je.memberId)&&D.value!==((ht=Re.content)==null?void 0:ht.memberId))}const ue=ie(()=>
6oe.value.filter(me=>!me.isRevoked&&!me.hasRiskContent&&me.type===m.value.MSG_IMAGE)||[]),oe=ie(()=>{var me;return((me=u==null?void 0:u.value)==null?void 0:me.filter(Re=>!se(Re)))||[]}),W=()=>{J.value=!1,ee.value=void 0},V=me=>{var Re;return(Re=me.payload)!=null&&Re.data?Gn(me.payload.data):null},S=me=>x(me)||H(me)||z(me),x=me=>me.type===m.value.MSG_CUSTOM&&V(me)&&V(me).businessID===xt.CUSTOM_GROUP_MSG,H=me=>V(me)&&V(me).businessID===xt.CUSTOM_ORDER_STATUS_CHANGE_MSG,z=me=>{const Re=V(me);if(!Re||Re.businessID!==xt.CUSTOM_SENSITIVE_MSG)return!1;const{memberId:Je}=Re.content||{};return!Je||D.value===Je},de=me=>wr(me),he=me=>wr(me.getMessageContent()),Te=()=>{h.value+=300;const me=setTimeout(()=>{h.value+=1,clearTimeout(me)},300)},Oe=me=>{M.value=me},$=me=>{if(p.value=me,B.value=!0,Ui()){const{groupProfile:Re}=Ee.getConversationModel(me)||{};a=Re==null?void 0:Re.type}Object.keys(E.value).length>0&&Yo.setChatStorage("audioPlayedMapping",E.value)};et(()=>{Ee.watch(be.CHAT,{messageList:K,messageSource:Le,isCompleted:St}),Ee.watch(be.CONV,{currentConversationID:$}),Ee.watch(be.GRP,{currentGroup:Oe}),wh("messageList",c),uni.$on("scroll-to-bottom",ce),E.value=Yo.getChatStorage("audioPlayedMapping")||{}}),st(()=>{Ee.unwatch(be.CHAT,{messageList:K,isCompleted:St}),Ee.unwatch(be.CONV,{currentConversationID:$}),Ee.unwatch(be.GRP,{currentGroup:Oe}),o==null||o.disconnect(),o=null,uni.$off("scroll-to-bottom"),Object.keys(E.value).length>0&&Yo.setChatStorage("audioPlayedMapping",E.value)});const Q=Ch(function(me){var Re;(Re=C.value)==null||Re.judgeScrollOverOneScreen(me)},500,!0,!0);function Ce(me,Re){Re!=null&&Re.newAudioSrc&&(b.value=Re.newAudioSrc)}function Ie(){!u.value||!s.userInfo||u.value.forEach(me=>{var Re,Je,ht,at;if(me.type==="TIMGroupTipElem"&&me.from==="@TIM#SYSTEM"){const Wt=(Re=me.payload)==null?void 0:Re.memberList;Wt!=null&&Wt.length&&Wt.forEach(Tt=>{var zt;const vs=(zt=s.userInfo)==null?void 0:zt[Tt.userID];Tt.nick=(vs==null?void 0:vs.nickname)||Tt.nick});const Ae=(Je=me.payload)==null?void 0:Je.operatorInfo;Ae&&(Ae.nick=((at=(ht=s.userInfo)==null?void 0:ht[Ae.userID])==null?void 0:at.nickname)||Ae.nick)}})}const _e=me=>{var Je,ht;let Re="";if(me){const at=me.payload,Ae=((at==null?void 0:at.memberList)||[]).map(Tt=>(Tt==null?void 0:Tt.nick)||(Tt==null?void 0:Tt.userID)).join(", ");switch(at==null?void 0:at.operationType){case Js.TYPES.GRP_TIP_MBR_JOIN:Re=Ae+" "+pe.t("message.tip.memberJoinedGroup");break;case Js.TYPES.GRP_TIP_MBR_QUIT:Re=Ae+" "+pe.t("message.tip.memberLeftGroup");break;case Js.TYPES.GRP_TIP_MBR_KICKED_OUT:Re=Ae+" "+pe.t("message.tip.opRemovedFromGroup");break;default:Re=""}}return Re.length===0&&(Re=((Je=me.getMessageContent())==null?void 0:Je.text)||((ht=me.getMessageContent())==null?void 0:ht.custom)||""),Re};Ye(()=>[s.userInfo,u.value],Ie);function K(me){return ye(this,null,function*(){var Je,ht,at,Wt;o==null||o.disconnect(),u.value=me.filter(Ae=>!Ae.isDeleted);const Re=(ht=u.value)==null?void 0:ht[((Je=u.value)==null?void 0:Je.length)-1];T.value?Ue(T.value):!y.value&&!((at=C.value)!=null&&at.isScrollButtonVisible&&(Re==null?void 0:Re.flow)==="in")?ei(()=>{Te()}):B.value&&(B.value=!1,(Wt=C.value)==null||Wt.clearButtonVisible(),ei(()=>{Te()})),Ui()&&ei(()=>$n())})}function ce(){return ye(this,null,function*(){try{const{scrollHeight:me}=yield va("#messageScrollList","messageList");me?h.value===me?h.value=me+1:h.value=me:Te()}catch(me){Te()}})}function Le(me){return ye(this,null,function*(){T.value=me,Ue(T.value)})}function Ue(me){var Re;(Re=u.value)!=null&&Re.some(Je=>(Je==null?void 0:Je.ID)===(me==null?void 0:me.ID))&&ei(()=>ye(this,null,function*(){yield rn(me),yield kn(me==null?void 0:me.ID),T.value=void 0}))}function St(me){d.value=me}const te=()=>{var Re,Je;y.value=!0;const me=((Je=(Re=u.value)==null?void 0:Re[0])==null?void 0:Je.ID)||"";bt.getMessageList().then(()=>{ei(()=>{_.value=me;const ht=setTimeout(()=>{_.value="",y.value=!1,clearTimeout(ht)},500)})})},De=(me,Re,Je,ht=!1,at="")=>{s.isMultipleSelectMode||s.isNotInGroup||at==="right"&&!Se.value||(ht&&(R.value=!0),g.value=Re.ID)};let ut;const Ke=(me,Re,Je,ht)=>{if(s.isMultipleSelectMode||s.isNotInGroup||!Kn)return;function at(){clearTimeout(ut),De(me,Re,Je,!0)}function Wt(){ut=setTimeout(at,500)}function Ae(){clearTimeout(ut)}switch(ht){case"touchstart":Wt();break;case"touchend":Ae(),setTimeout(()=>{R.value=!1},200);break}},un=me=>{n("handleEditor",me,"reedit")},jt=me=>{Jt.showModal({title:"",content:pe.t("TUIChat.确认重发该消息?"),confirmText:pe.t("TUIChat.重新发送"),showCancel:!0,success:({confirm:Re})=>{Re&&me.resendMessage()}})},dn=(me,Re)=>{if(!u.value)return;const Je=[],ht=u.value.filter((at,Wt)=>!at.isRevoked&&!at.hasRiskContent&&at.type===m.value.MSG_IMAGE?(Je.push(Wt),!0):!1);Se.value?(J.value=!0,ee.value=Re):uni.previewImage({current:Je.indexOf(me),urls:ht.map(at=>_a(at.payload.imageInfoArray,ya.Origin)).filter(at=>at!=="")})};function kn(me){return new Promise(Re=>{if(I.value.indexOf(me)<0){I.value.push(me);const ht=setTimeout(()=>{I.value.splice(I.value.indexOf(me),1),clearTimeout(ht),Re()},3e3)}})}function Nn(me){h.value=me}function $n(){return ye(this,null,function*(){!u.value||u.value.length===0||a===m.value.GRP_AVCHATROOM||a===m.value.GRP_COMMUNITY||(o==null||o.disconnect(),o=uni.createIntersectionObserver(c,{threshold:[.7],observeAll:!0}).relativeTo("#messageScrollList",{top:-70}),o==null||o.observe(".message-li.in .message-bubble-container",me=>{var Je,ht;if(l.has(me.id))return;const Re=(Je=u.value)==null?void 0:Je.find(at=>me.id.indexOf(at.ID)>-1);Re&&Re.needReadReceipt&&Re.flow==="in"&&!((ht=Re.readReceiptInfo)!=null&&ht.isPeerRead)&&(bt.sendMessageReadReceipt([Re]),l.add(me.id))}
6))})}function xn(me,Re){me&&s.isNotInGroup||(me?k.value=Re:k.value=void 0,U.value=me)}function rn(me){return ye(this,null,function*(){const Re=me.ID,Je=u.value&&u.value.some(ht=>ht.ID===Re);if(Re&&Je){const ht=setTimeout(()=>ye(this,null,function*(){try{const at=yield rr("#messageScrollList","messageList"),Wt=yield rr("#tui-"+Re,"messageList"),{scrollTop:Ae}=yield va("#messageScrollList","messageList"),Tt=Wt.top+Ae-at.top-r++%2;Nn(Tt),clearTimeout(ht)}catch(at){}}),500)}else tn({message:pe.t("TUIChat.无法定位到原消息"),type:pn.WARNING})})}function wt(){n("closeInputToolBar")}Ye(()=>s.isMultipleSelectMode,me=>{me||en({type:"clearAll",messageID:""})});function en({type:me,messageID:Re}){me==="clearAll"?f.value=[]:me==="add"&&!f.value.includes(Re)?f.value.push(Re):me==="remove"&&(f.value=f.value.filter(Je=>Je!==Re))}function Tn(){Ee.update(be.CUSTOM,"multipleForwardMessageID",{isMergeForward:!0,messageIDList:f.value})}function sh(){Ee.update(be.CUSTOM,"multipleForwardMessageID",{isMergeForward:!1,messageIDList:f.value})}function rh(me){L.value=me,A.value=!0}function oh(me){E.value[me]=!0}function ah(me){var Re,Je;((Je=(Re=s.userInfo)==null?void 0:Re[me.id])==null?void 0:Je.userType)!==Hu.ROBOT&&n("onAvatarLongPress",me)}return e({oneByOneForwardMessage:sh,mergeForwardMessage:Tn,scrollToLatestMessage:ce}),(me,Re)=>{const Je=Za(Xa("mt-icon"),ll),ht=vo,at=fi,Wt=el;return w(),G("div",{class:fe({"tui-chat":!0,"tui-chat-h5":!v(Se)}),onClick:wt},[q("div",{class:"tui-chat-main"},[me.isGroup?(w(),ne(dv,{key:s.groupID,groupID:s.groupID},null,8,["groupID"])):X("",!0),Y(Wt,{id:"messageScrollList",class:"tui-message-list","scroll-y":"true","scroll-top":h.value,"scroll-into-view":`tui-${_.value}`,onScroll:v(Q)},{default:re(()=>[me.announcement?(w(),ne(at,{key:0,class:"notification",onClick:Re[0]||(Re[0]=Ae=>n("onAnnouncementClick"))},{default:re(()=>[Y(at,{class:"notification-content"},{default:re(()=>[Y(Je,{type:"exclamation-circle",size:14,style:{"flex-shrink":"0"}}),Y(ht,{class:"content-text"},{default:re(()=>[qe(ae(me.announcement.title),1)]),_:1})]),_:1}),Y(Je,{type:"arrow-right",size:14})]),_:1})):X("",!0),Y(at,{style:{flex:"1"}},{default:re(()=>[d.value?X("",!0):(w(),G("p",{key:0,class:"message-more",onClick:te},ae(v(pe).t("TUIChat.查看更多")),1)),q("template",null,[(w(!0),G(ze,null,pt(oe.value,(Ae,Tt)=>{var vs;return w(),G("li",{id:`tui-${Ae==null?void 0:Ae.ID}`,key:Ae==null?void 0:Ae.ID,class:fe("message-li "+Ae.flow)},[Y(sC,{currTime:Ae.time,prevTime:Tt>0?(vs=u.value)==null?void 0:vs[Tt-1].time:0},null,8,["currTime","prevTime"]),q("div",{class:"message-item",onClick:Re[2]||(Re[2]=zt=>g.value="")},[H(Ae)||z(Ae)?(w(),ne(pc,{key:0,item:Ae,isCustom:V(Ae)},null,8,["item","isCustom"])):X("",!0),x(Ae)?(w(),ne(pc,{key:1,item:Ae,isCustom:V(Ae)},null,8,["item","isCustom"])):X("",!0),Ae.type===m.value.MSG_GRP_TIP||v(Vh)(Ae)?(w(),ne(xv,{key:2,text:_e(Ae)},null,8,["text"])):!Ae.isRevoked&&!v(gc)(Ae)&&!S(Ae)?(w(),G("div",{key:3,id:`msg-bubble-${Ae.ID}`,class:"message-bubble-container",onContextmenu:It(zt=>De(zt,Ae,Tt,!0,"right"),["prevent","right"]),onLongpress:zt=>De(zt,Ae,Tt,!0,"longpress"),onTouchstart:zt=>Ke(zt,Ae,Tt,"touchstart"),onTouchend:zt=>Ke(zt,Ae,Tt,"touchend"),onMouseover:zt=>Ke(zt,Ae,Tt,"touchend")},[Y(c0,{messageItem:de(Ae),content:he(Ae),isAudioPlayed:E.value[Ae.ID],blinkMessageIDList:I.value,isMultipleSelectMode:me.isMultipleSelectMode,multipleSelectedMessageIDList:f.value,onResendMessage:zt=>jt(Ae),onBlinkMessage:kn,onScrollTo:Nn,onChangeSelectMessageIDList:en,onSetReadReceiptPanelVisible:xn,onOnAvatarLongPress:ah},{default:re(()=>[Ae.type===m.value.MSG_TEXT?(w(),ne(hv,{key:0,content:Ae.getMessageContent(),messageItem:Ae},null,8,["content","messageItem"])):Ae.type===m.value.MSG_IMAGE?(w(),ne(vc,{key:1,content:Ae.getMessageContent(),messageItem:v(wr)(Ae)},{default:re(()=>[Y(gv,{content:Ae.getMessageContent(),messageItem:Ae,onPreviewImage:zt=>dn(Tt,Ae)},null,8,["content","messageItem","onPreviewImage"])]),_:2},1032,["content","messageItem"])):Ae.type===m.value.MSG_VIDEO?(w(),ne(vc,{key:2,content:Ae.getMessageContent(),messageItem:v(wr)(Ae)},{default:re(()=>[Y(oC,{content:Ae.getMessageContent(),messageItem:Ae},null,8,["content","messageItem"])]),_:2},1032,["content","messageItem"])):Ae.type===m.value.MSG_AUDIO?(w(),ne(Cv,{key:3,content:Ae.getMessageContent(),messageItem:Ae,broadcastNewAudioSrc:b.value,onSetAudioPlayed:oh,onGetGlobalAudioContext:Ce},null,8,["content","messageItem","broadcastNewAudioSrc"])):Ae.type===m.value.MSG_MERGER?(w(),ne(o0,{key:4,renderData:Ae.payload,messageItem:Ae,onAssignMessageIDInUniapp:rh},null,8,["renderData","messageItem"])):Ae.type===m.value.MSG_FILE?(w(),ne(Iv,{key:5,content:Ae.getMessageContent()},null,8,["content"])):Ae.type===m.value.MSG_FACE?(w(),ne(Sv,{key:6,content:Ae.getMessageContent()},null,8,["content"])):Ae.type===m.value.MSG_LOCATION?(w(),ne(l0,{key:7,content:Ae.getMessageContent()},null,8,["content"])):Ae.type===m.value.MSG_CUSTOM?(w(),ne(kv,{key:8,content:Ae.getMessageContent(),messageItem:Ae},null,8,["content","messageItem"])):X("",!0)]),_:2},1032,["messageItem","content","isAudioPlayed","blinkMessageIDList","isMultipleSelectMode","multipleSelectedMessageIDList","onResendMessage"])],40,["id","onContextmenu","onLongpress","onTouchstart","onTouchend","onMouseover"])):!Ae.isRevoked&&v(gc)(Ae)?(w(),ne(kC,{key:4,message:Ae,onResendMessage:jt,onHandleToggleMessageItem:De,onHandleH5LongPress:Ke},null,8,["message"])):S(Ae)?X("",!0):(w(),ne(_C,{key:5,isEdit:Ae.type===m.value.MSG_TEXT,messageItem:Ae,onMessageEdit:zt=>un(Ae)},null,8,["isEdit","messageItem","onMessageEdit"])),Ae.ID===g.value?(w(),ne(at,{key:6,class:fe({"message-tool":!0,"message-tool-out"
6:Ae.flow==="out","message-tool-in":Ae.flow==="in","message-tool-bottom":Tt===0})},{default:re(()=>[Y(vC,{messageItem:Ae,isMultipleSelectMode:me.isMultipleSelectMode,onToggleMultipleSelectMode:Re[1]||(Re[1]=()=>n("toggleMultipleSelectMode"))},null,8,["messageItem","isMultipleSelectMode"])]),_:2},1032,["class"])):X("",!0)])],10,["id"])}),128))])]),_:1}),me.isMultipleSelectMode?X("",!0):(w(),ne(QC,{key:1,shortcutMenus:me.shortcutMenus},null,8,["shortcutMenus"]))]),_:1},8,["scroll-top","scroll-into-view","onScroll"]),Y(FC,{ref_key:"scrollButtonInstanceRef",ref:C,onScrollToLatestMessage:ce},null,512),U.value?(w(),ne(PC,{key:1,message:Object.assign({},k.value),"user-info":me.userInfo,onSetReadReceiptPanelVisible:xn},null,8,["message","user-info"])):X("",!0),Y(Cl,{visible:A.value,overlayColor:"transparent",popDirection:"right"},{default:re(()=>[Y(Ra,{style:{height:"100%"},isMounted:A.value,messageID:L.value,onCloseOverlay:Re[3]||(Re[3]=Ae=>A.value=!1)},null,8,["isMounted","messageID"])]),_:1},8,["visible"]),(w(),ne(ku,{to:"#app"},[J.value?(w(),ne(qC,{key:0,"current-image":ee.value,"image-list":ue.value,onClose:W},null,8,["current-image","image-list"])):X("",!0)]))])],2)}}}),e_=ve(XC,[["__scopeId","data-v-2b4c26dc"]]);class Ji{constructor(){this.quoteMessageMap=new Map}static getInstance(){return Ji.instance||(Ji.instance=new Ji),Ji.instance}setStore(e,t,n,s){var r;if(e&&(this.isEditorNotEmpty(t)||s!=null&&(r=s.message)!==null&&r!==void 0&&r.ID)){var o,a={};s!=null&&(o=s.message)!==null&&o!==void 0&&o.ID&&(this.quoteMessageMap.set(s.message.ID,s.message),a={messageID:s.message.ID,type:s.type});var l={conversationID:e,draftInfo:Wr({html:t,abstract:n},a)};jr.setConversationDraft(l),Ee.update(be.CHAT,"quoteMessage",{message:void 0,type:"quote"})}}getStore(e,t){var n=Ee.getConversationModel(e);if(n){if(n.conversationID&&n.draftText){var s=Gn(n.draftText);Ee.update(be.CHAT,"quoteMessage",{message:this.quoteMessageMap.get(s.messageID)||void 0,type:s.type}),t(s.html)}jr.setConversationDraft({conversationID:n.conversationID})}}generateAbstract(e){var t="";return e==null||e.forEach(n=>{switch(n.type){case"text":t+=Ps(n.payload.text||"");break;case"image":t+=pe.t("TUIChat.图片");break;case"video":t+=pe.t("TUIChat.视频");break;case"file":t+=pe.t("TUIChat.文件");break}}),t}isEditorNotEmpty(e){return e&&!e.includes("is-empty")&&e!=="<p></p>"}}Ji.instance=null;const bs=Ji.getInstance();var Cc=new Map([[3123,"文本包含本地审核拦截词"],[4004,"图片消息失败,无效的图片格式"],[4005,"文件消息失败,禁止发送违规封禁的文件"],[7004,"文件不存在,请检查文件路径是否正确"],[7005,"文件大小超出了限制,如果上传文件,最大限制是100MB"],[8001,"消息长度超出限制,消息长度不要超过12K"],[80001,"消息或者资料中文本存在敏感内容,发送失败"],[80004,"消息中图片存在敏感内容,发送失败"],[10017,"您已被禁止聊天"]]),f0=function(){var i=or(function*(e,t){Ee.getData(be.CHAT,"messageSource")&&Ee.update(be.CHAT,"messageSource",void 0),e==null||e.forEach(function(){var n=or(function*(s){var r,o,a,l,c;try{var u,f,d={to:(t==null||(u=t.groupProfile)===null||u===void 0?void 0:u.groupID)||(t==null||(f=t.userProfile)===null||f===void 0?void 0:f.userID),conversationType:t==null?void 0:t.type,payload:{},needReadReceipt:Ui()},p,g={offlinePushInfo:{}},h={conversation:t,payload:s.payload,messageType:""};switch(s==null?void 0:s.type){case"text":if(p=JSON.parse(JSON.stringify((r=s.payload)===null||r===void 0?void 0:r.text)),!p)break;d.payload={text:p},h.messageType=Fe.TYPES.MSG_TEXT,g.offlinePushInfo=Wn.create(h),(o=s.payload)!==null&&o!==void 0&&o.atUserList?(d.payload.atUserList=s.payload.atUserList,yield bt.sendTextAtMessage(d,g)):yield bt.sendTextMessage(d,g);break;case"image":d.payload={file:(a=s.payload)===null||a===void 0?void 0:a.file},h.messageType=Fe.TYPES.MSG_IMAGE,g.offlinePushInfo=Wn.create(h),yield bt.sendImageMessage(d,g);break;case"video":d.payload={file:(l=s.payload)===null||l===void 0?void 0:l.file},h.messageType=Fe.TYPES.MSG_VIDEO,g.offlinePushInfo=Wn.create(h),yield bt.sendVideoMessage(d,g);break;case"file":d.payload={file:(c=s.payload)===null||c===void 0?void 0:c.file},h.messageType=Fe.TYPES.MSG_FILE,g.offlinePushInfo=Wn.create(h),yield bt.sendFileMessage(d,g);break;default:break}ol("sendMessage")}catch(m){tn({message:Cc.get(m==null?void 0:m.code)?pe.t("TUIChat.".concat(Cc.get(m.code))):m==null?void 0:m.message,type:pn.ERROR}),Ee.getData(be.CHAT,"quoteMessage")&&Ee.update(be.CHAT,"quoteMessage",{})}});return function(s){return n.apply(this,arguments)}}())});return function(t,n){return i.apply(this,arguments)}}(),t_=(i,e)=>{!i&&!e?bt.enterTypingState():bt.leaveTypingState()};const Gs=36,qo=400,n_=ge({__name:"message-input-editor",props:{placeholder:{type:String,default:"this is placeholder"},replayOrReferenceMessage:{type:Object,default:()=>({}),required:!1},isMuted:{type:Boolean,default:!0},muteText:{type:String,default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0},isGroup:{type:Boolean,default:!1}},emits:["onTyping","onFocus","onAt"],setup(i,{expose:e,emit:t}){const n=i,s=t,r=P(""),o=P(-1),a=P(),l=P(!0),c=P(!0),u=new Map,f=P(),d=P(""),p=P(
6),g=sr(),h=P(Gs);let m=0;const y=ie(()=>Jt.isAliMini?{height:`${h.value}rpx`,"min-height":`${Gs}rpx`,"max-height":`${qo}rpx`,"line-height":`${Gs}rpx`,overflow:h.value>=qo?"auto":"hidden"}:{});ie(()=>{const W=r.value||" ";return W.endsWith(`
7`)?`${W} `:W});const R=()=>{var V;const W=(V=uni.getSystemInfoSync)==null?void 0:V.call(uni);return(W==null?void 0:W.windowWidth)||(W==null?void 0:W.screenWidth)||375},I=W=>W*750/R(),T=()=>{if(!Jt.isAliMini)return;const W=++m;ei(()=>{const V=uni.createSelectorQuery();(g!=null&&g.proxy?V.in(g.proxy):V).select(".message-input-container-area-measure").boundingClientRect(x=>{var de;if(W!==m)return;const H=(Array.isArray(x)?(de=x[0])==null?void 0:de.height:x==null?void 0:x.height)||0,z=Math.min(Math.max(Math.ceil(I(H)),Gs),qo);h.value=z}).exec()})},C=()=>{r.value="",o.value=-1,c.value=!0,h.value=Gs,u==null||u.clear()},_=W=>{r.value=W,o.value=-1},A=P(!1),L=()=>{A.value||(A.value=!0,uni.$on("insert-emoji",W=>{var V;r.value+=(V=W==null?void 0:W.emoji)==null?void 0:V.name}),uni.$on("send-message-in-emoji-picker",()=>{M()}),Ee.watch(be.CONV,{currentConversation:se}),Ee.watch(be.CHAT,{quoteMessage:ue}))},E=()=>{uni.$off("insert-emoji"),uni.$off("send-message-in-emoji-picker"),Ee.unwatch(be.CONV,{currentConversation:se}),Ee.unwatch(be.CHAT,{quoteMessage:ue}),A.value=!1};Uu(()=>{L()}),et(()=>{L(),T()}),Pu(()=>{E()}),st(()=>{d.value&&bs.setStore(d.value,r.value,r.value,p.value),E(),oe()});const M=()=>{const W=b();C(),f0(W,f.value)},B=(W,V=!1)=>{u!=null&&u.has(W==null?void 0:W.id)||u==null||u.set(W==null?void 0:W.id,W==null?void 0:W.label),r.value+=(V?"@":"")+(W==null?void 0:W.label),o.value=r.value.length},b=()=>{let W=r.value;W=Ku(W);const V=[];u==null||u.forEach((x,H)=>{W!=null&&W.includes("@"+x)&&V.push(H)});const S={text:W};return V!=null&&V.length&&(S.atUserList=V),[{type:"text",payload:S}]},k=()=>{l.value=!0},U=W=>{var V;l.value=!1,s("onFocus",(V=W==null?void 0:W.detail)==null?void 0:V.height)},O=()=>{var W;c.value=!((W=r==null?void 0:r.value)!=null&&W.length)};function D(W,V){for(const S of u.values()){const x=S.startsWith("@")?S:`@${S}`,H=W.lastIndexOf(x,V);if(H===-1)continue;const z=H+x.length;if(V>H&&V<=z)return{start:H,end:z}}return null}function J(W,V){const S=D(W,V);return S?(r.value=W.slice(0,S.start)+W.slice(S.end),o.value=S.start,!0):!1}const ee=W=>{var x,H,z,de;const V=((x=W==null?void 0:W.detail)==null?void 0:x.value)||"",S=(z=(H=W==null?void 0:W.detail)==null?void 0:H.cursor)!=null?z:V.length;if(V.length<r.value.length&&J(r.value,S)){O();return}r.value=V,o.value=S,O(),n.isGroup&&(V.endsWith("@")||V.endsWith(`@
8`))&&((de=nt)==null||de.hideKeyboard(),s("onAt",!0))};Ye(()=>[c.value,l.value],(W,V)=>{W!==V&&s("onTyping",c.value,l.value)},{immediate:!0,deep:!0}),Ye(r,T);function se(W){const V=d.value;f.value=W,d.value=W==null?void 0:W.conversationID,V!==d.value&&(V&&bs.setStore(V,r.value,r.value,p.value),C(),d.value&&bs.getStore(d.value,_))}function ue(W){p.value=W}function oe(){l.value=!0,f.value=null,d.value="",p.value=void 0,C()}return e({insertAt:B,resetEditor:C,setEditorContent:_,getEditorContent:b}),(W,V)=>{const S=_h;return w(),G("div",{class:fe({"message-input-container":!0,"message-input-container-h5":!v(Se)})},[n.isMuted?(w(),G("div",{key:0,class:"message-input-mute"},ae(n.muteText),1)):X("",!0),Y(S,{id:"editor",ref_key:"inputRef",ref:a,value:r.value,cursor:o.value,"adjust-position":!0,"cursor-spacing":"20","confirm-type":"send","confirm-hold":!0,"auto-height":!v(Jt).isAliMini,"show-count":!1,type:"text","placeholder-class":"input-placeholder",class:"message-input-container-area",style:Ze(y.value),placeholder:n.placeholder,"auto-blur":"",onConfirm:M,onInput:ee,onBlur:k,onFocus:U},null,8,["value","cursor","auto-height","style","placeholder"])],2)}}}),i_=ve(n_,[["__scopeId","data-v-e18a3026"]]),s_=ge({__name:"index",props:{show:{type:Boolean,default:!1},modal:{type:Boolean,default:!0},height:{type:String,default:"fit-content"},closeByClickOutside:{type:Boolean,default:!0},borderRadius:{type:String,default:"0px"},title:{type:String,default:""},showHeaderCloseButton:{type:Boolean,default:!1},showFooterSubmitButton:{type:Boolean,default:!1},submitButtonContent:{type:String,default:()=>pe.t("确定")}},emits:["onOpen","onClose","onSubmit"],setup(i,{emit:e}){const t=i,n=e,s=P();Ye(()=>t.show,(a,l)=>{if(a!==l)switch(a){case!0:n("onOpen",s),ei(()=>
8{Kn&&!He.value&&t.closeByClickOutside&&Vu.listen({domRefs:s.value,handler:r})});break;case!1:n("onClose",s);break}});const r=()=>{(He.value||Kn)&&n("onClose",s)},o=()=>{n("onSubmit"),r()};return(a,l)=>t.show?(w(),G("div",{key:0},[v(Se)?Ve(a.$slots,"default",{key:1},void 0,!0):(w(),G("div",{key:0,class:fe(["bottom-popup",v(He)&&"bottom-popup-uni",!v(Se)&&"bottom-popup-h5",!v(Se)&&t.modal&&"bottom-popup-modal"]),onClick:r},[q("div",{ref_key:"dialogRef",ref:s,class:fe(["bottom-popup-main",!v(Se)&&"bottom-popup-h5-main"]),style:Ze({height:t.height,borderTopLeftRadius:t.borderRadius,borderTopRightRadius:t.borderRadius}),onClick:l[0]||(l[0]=It(()=>{},["stop"]))},[i.title||i.showHeaderCloseButton?(w(),G("div",{key:0,class:"header"},[i.title?(w(),G("div",{key:0,class:"header-title"},ae(i.title),1)):X("",!0),i.showHeaderCloseButton?(w(),G("div",{key:1,class:"header-close",onClick:r},ae(v(pe).t("关闭")),1)):X("",!0)])):X("",!0),Ve(a.$slots,"default",{},void 0,!0),i.showFooterSubmitButton?(w(),G("div",{key:1,class:"footer"},[q("div",{class:"footer-submit",onClick:o},ae(i.submitButtonContent),1)])):X("",!0)],6)],2))])):X("",!0)}}),h0=ve(s_,[["__scopeId","data-v-3fcdd2c2"]]),r_=ge({__name:"index",emits:["onAtListOpen","insertAt"],setup(i,{expose:e,emit:t}){const n=t,s=P(),r=P(),o=P(),a=P(!1),l=P(),c=P(),u=P(),f=P(!1),d=P({left:0,top:0}),p=P(0),g=P(""),h=P(!1),m=P(!1),y={userID:Fe.TYPES.MSG_AT_ALL,nick:"所有人",isAll:!0,avatar:"https://web.sdk.qcloud.com/im/assets/images/at.svg"};Ee.watch(be.CONV,{currentConversationID:k=>{var U,O;if(k!==g.value)if(g.value=k,l.value=[],c.value=[],u.value=[],f.value=!1,m.value=!1,Ee.update(be.CUSTOM,"memberList",l.value),(U=g==null?void 0:g.value)!=null&&U.startsWith("GROUP")){f.value=!0;const D=(O=g==null?void 0:g.value)==null?void 0:O.substring(5);ts.switchGroup(D)}else ts.switchGroup("")}});const R=P(Fe.chat.getLoginUser());Ee.watch(be.GRP,{currentGroupMemberList:k=>{l.value=k,c.value=[y,...l.value].filter(U=>U.userID!==rl&&U.userID!==R.value),u.value=c.value,Ee.update(be.CUSTOM,"memberList",l.value)},isCompleted:k=>{m.value=k,h.value=!1}});const I=()=>ye(this,null,function*(){!f.value||h.value||m.value||(yield T())}),T=()=>ye(this,null,function*(){var k;if(!(h.value||m.value||!f.value))try{h.value=!0;const U=(k=g.value)==null?void 0:k.substring(5);yield ts.getGroupMemberList({groupID:U,count:50}),h.value=!1}catch(U){h.value=!1}}),C=k=>{f.value&&(a.value=k,a.value&&n("onAtListOpen"))},_=k=>{d.value=k},A=k=>{var U,O;p.value=k,(O=(U=r.value)==null?void 0:U[p.value])==null||O.scrollIntoView(!1)},L=k=>{u.value=k};nt.toggleAtList=C,nt.handleAtListPosition=_,nt.setCurrentSelectIndex=A,nt.setShowMemberList=L,e({toggleAtList:C}),Ye(()=>[d.value,s==null?void 0:s.value],()=>{var k;Kn||!(s!=null&&s.value)||!((k=s==null?void 0:s.value)!=null&&k.style)||(s.value.style.left=d.value.left+"px",s.value.style.top=d.value.top-s.value.clientHeight+"px")});const E=()=>{a.value=!1,u.value=c.value,d.value={left:0,top:0}},M=k=>{var U;if(Se.value&&nt.selectItem)nt.selectItem(k);else if((U=u==null?void 0:u.value)!=null&&U.length){const O=u==null?void 0:u.value[k];n("insertAt",{id:O==null?void 0:O.userID,label:(O==null?void 0:O.nick)||(O==null?void 0:O.userID)})}E()},B=k=>(k==null?void 0:k.avatar)||"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",b=k=>k!=null&&k.nick?k==null?void 0:k.nick:k==null?void 0:k.userID;return(k,U)=>{const O=el;return w(),ne(h0,{show:a.value,onOnClose:E},{default:re(()=>[q("div",{ref_key:"MessageInputAt",ref:s,class:fe([v(Se)?"message-input-at":"message-input-at-h5"])},[q("div",{ref:"dialog",class:"member-list"},[v(Se)?X("",!0):(w(),G("header",{key:0,class:"member-list-title"},[q("span",{class:"title"},ae(v(pe).t("TUIChat.选择提醒的人")),1)])),Y(O,{ref_key:"memberListBox",ref:o,class:"member-list-box","scroll-y":"true",onScrolltolower:I},{default:re(()=>[(w(!0),G(ze,null,pt(u.value,(D,J)=>(w(),G("div",{key:J,ref_for:!0,ref_key:"memberListItems",ref:r,class:fe(["member-list-box-body",[J===p.value&&"selected"]]),onClick:ee=>M(J)},[q("img",{class:"member-list-box-body-avatar",src:B(D)},null,8,["src"]),q("span",{class:"member-list-box-body-name"},ae(b(D)),1)],10,["onClick"]))),128)),h.value?(w(),G("div",{key:0,class:"member-list-box-loading"},[q("span",{class:"loading-text"},ae(v(pe).t("TUIChat.正在加载")),1)])):X("",!0)]),_:1},512)],512)],2)]),_:1},8,["show"])}}}),_c=ve(r_,[["__scopeId","data-v-e7b72a15"]]),o_=ge({__name:"index",props:{displayType:{default:"editor"}},setup(i){const e=i,t=Fe.TYPES,n=P();et(()=>{Ee.watch(be.CHAT,{quoteMessage:o})}),st(()=>{Ee.unwatch(be.CHAT,{quoteMessage:o})});const s=ie(()=>{var l,c;let a;switch((l=n.value)==null?void 0:l.type){case t.MSG_TEXT:a=Ps((c=n.value.payload)==null?void 0:c.text);break;case t.MSG_IMAGE:a=pe.t("TUIChat.图片");break;case t.MSG_AUDIO:a=pe.t("TUIChat.语音");break;case t.MSG_VIDEO:a=pe.t("TUIChat.视频");break;case t.MSG_FILE:a=pe.t("TUIChat.文件");break;case t.MSG_CUSTOM:a=pe.t("TUIChat.自定义");break;case t.MSG_FACE:a=pe.t("TUIChat.表情");break;case t.MSG_MERGER:a=pe.t("TUIChat.聊天记录");break;default:a=pe.t("TUIChat.消息");break}return a});function r(){Ee.update(be.CHAT,"quoteMessage",{message:void 0,type:"quote"})}function o(a){a!=null&&a.message&&(a==null?void 0:a.type)==="quote"?n.value=a.message:n.value=void 0}return(a,l)=>{var u,f;const c=Za(Xa("mt-icon"),ll);return n.value&&e.displayType!=="audio"?(w(),G("div",{key:0,class:fe({"input-quote-container":!0,"input-quote-container-uni":v(He),"input-quote-container-h5":!v(Se)})},[q("div",{class:"input-quote-content"},[q("div",{class:"max-one-line"},ae(((u=n.value)==null?void 0:u.nick)||((f=n.value)==null?void 0:f.from))+": "+ae(s.value),1),q("div",{class:"input-quote-close-icon",onClick:r},[Y(c,{type:"close",color:"#ffffff",style:{"font-size":"14px"}})])])],2)):X("",!0)}}}),a_=ve(o_,[["__scopeId","data-v-2f52855e"]]),l_="/assets/face-uni-C1K3HfYe.png",c_="/assets/more-uni-D0iKvFi3.png";function Gt(i){this.content=i}Gt.prototype={constructor:Gt,find:function(i){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===i)return e;return-1},get:function(i){var e=this.find(i);return e==-1?void 0:this.content[e+1]},update:function(i,e,t){var n=t&&t!=i?this.remove(t):this,s=n.find(i),r=n.content.slice();return s==-1?r.push(t||i,e):(r[s+1]=e,t&&(r[s]=t)),new Gt(r)},remove:function(i){var e=this.find(i);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Gt(t)},addToStart:function(i,e){return new Gt([i,e].concat(this.remove(i).c
vendor: 9,464 bytes, line 8
8ontent))},addToEnd:function(i,e){var t=this.remove(i).content.slice();return t.push(i,e),new Gt(t)},addBefore:function(i,e,t){var n=this.remove(e),s=n.content.slice(),r=n.find(i);return s.splice(r==-1?s.length:r,0,e,t),new Gt(s)},forEach:function(i){for(var e=0;e<this.content.length;e+=2)i(this.content[e],this.content[e+1])},prepend:function(i){return i=Gt.from(i),i.size?new Gt(i.content.concat(this.subtract(i).content)):this},append:function(i){return i=Gt.from(i),i.size?new Gt(this.subtract(i).content.concat(i.content)):this},subtract:function(i){var e=this;i=Gt.from(i);for(var t=0;t<i.content.length;t+=2)e=e.remove(i.content[t]);return e},toObject:function(){var i={};return this.forEach(function(e,t){i[e]=t}),i},get size(){return this.content.length>>1}};Gt.from=function(i){if(i instanceof Gt)return i;var e=[];if(i)for(var t in i)e.push(t,i[t]);return new Gt(e)};function p0(i,e,t){for(let n=0;;n++){if(n==i.childCount||n==e.childCount)return i.childCount==e.childCount?null:t;let s=i.child(n),r=e.child(n);if(s==r){t+=s.nodeSize;continue}if(!s.sameMarkup(r))return t;if(s.isText&&s.text!=r.text){for(let o=0;s.text[o]==r.text[o];o++)t++;return t}if(s.content.size||r.content.size){let o=p0(s.content,r.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function g0(i,e,t,n){for(let s=i.childCount,r=e.childCount;;){if(s==0||r==0)return s==r?null:{a:t,b:n};let o=i.child(--s),a=e.child(--r),l=o.nodeSize;if(o==a){t-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:t,b:n};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;c<u&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,n--;return{a:t,b:n}}if(o.content.size||a.content.size){let c=g0(o.content,a.content,t-1,n-1);if(c)return c}t-=l,n-=l}}class we{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,s=0,r){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&n(l,s+a,r||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),n,s+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,s){let r="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:r+=n),r+=c},0),r}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,s=this.content.slice(),r=0;for(t.isText&&t.sameMarkup(n)&&(s[s.length-1]=t.withText(t.text+n.text),r=1);r<e.content.length;r++)s.push(e.content[r]);return new we(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],s=0;if(t>e)for(let r=0,o=0;o<t;r++){let a=this.content[r],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),s+=a.nodeSize),o=l}return new we(n,s)}cutByIndex(e,t){return e==t?we.empty:e==0&&t==this.content.length?this:new we(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let s=this.content.slice(),r=this.size+t.nodeSize-n.nodeSize;return s[e]=t,new we(s,r)}addToStart(e){return new we([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new we(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let s=this.content[t];e(s,n,t),n+=s.nodeSize}}findDiffStart(e,t=0){return p0(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return g0(this,e,t,n)}findIndex(e){if(e==0)return Dr(0,e);if(e==this.size)return Dr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let s=this.child(t),r=n+s.nodeSize;if(r>=e)return r==e?Dr(t+1,r):Dr(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return we.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new we(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return we.empty;let t,n=0;for(let s=0;s<e.length;s++){let r=e[s];n+=r.nodeSize,s&&r.isText&&e[s-1].sameMarkup(r)?(t||(t=e.slice(0,s)),t[t.length-1]=r.withText(t[t.length-1].text+r.text)):t&&t.push(r)}return new we(t||e,n)}static from(e){if(!e)return we.empty;if(e instanceof we)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new we([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}we.empty=new we([],0);const Jo={index:0,offset:0};function Dr(i,e){return Jo.index=i,Jo.offset=e,Jo}function to(i,e){if(i===e)return!0;if(!(i&&typeof i=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(i);if(Array.isArray(e)!=t)return!1;if(t){if(i.length!=e.length)return!1;for(let n=0;n<i.length;n++)if(!to(i[n],e[n]))return!1}else{for(let n in i)if(!(n in e)||!to(i[n],e[n]))return!1;for(let n in e)if(!(n in i))return!1}return!0}let vt=class Oa{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let s=0;s<e.length;s++){let r=e[s];if(this.eq(r))return e;if(this.type.excludes(r.type))t||(t=e.slice(0,s));else{if(r.type.excludes(this.type))return e;!n&&r.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&to(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=n.create(t.attrs);return n.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Oa.none;if(e instanceof Oa)return[e];let t=e.slice();return t.sort((n,s)=>n.type.rank-s.type.rank),t}};vt.none=[];class no extends Error{}class Me{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=v0(this.content,e+this.openStart,t);return n&&new Me(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Me(m0(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Me.empty;let n=t.openStart||0,s=t.openEnd||0;if(typeof n!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Me(we.fromJSON(e,t.content),n,s)}static maxOpen(e,t=!0){let n=0,s=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)s++;return new Me(e,n,s)}}Me.empty=new Me(we.empty,0,0);function m0(i,e,t){let{index:n,offset:s}=i.findIndex(e),r=i.maybeChild(n),{index:o,offset:a}=i.findIndex(t);if(s==e||r.isText){if(a!=t&&!i.child(o).isText)throw new RangeError("Removing non-flat range");return i.cut(0,e).append(i.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return i.replaceChild(n,r.copy(m0(r.content,e-s-1,t-s-1)))}function v0(i,e,t,n){let{index:s,offset:r}=i.findIndex(e),o=i.maybeChild(s);if(r==e||o.isText)return n&&!n.canReplace(s,s,t)?null:i.cut(0,e).append(t).append(i.cut(e));let a=v0(o.content,e-r-1,t,o);return a&&i.replaceChild(s,o.copy(a))}function u_(i,e,t){if(t.openStart>i.depth)throw new no("Inserted content deeper than insertion position");if(i.depth-t.openStart!=e.depth-t.openEnd)throw new no("Inconsistent open depths");return C0(i,e,t,0)}function C0(i,e,t,n){let s=i.index(n),r=i.node(n);if(s==e.index(n)&&n<i.depth-t.openStart){let o=C0(i,e,t,n+1);return r.copy(r.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&i.depth==n&&e.depth==n){let o=i.parent,a=o.content;return rs(o,a.cut(0,i.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=d_(t,i);return rs(r,y0(i,o,a,e,n))}else return rs(r,io(i,e,n))}function _0(i,e){if(!e.type.compatibleContent(i.type))throw new no("Cannot join "+e.type.n
vendor: 10,266 bytes, line 8
8ame+" onto "+i.type.name)}function Da(i,e,t){let n=i.node(t);return _0(n,e.node(t)),n}function ss(i,e){let t=e.length-1;t>=0&&i.isText&&i.sameMarkup(e[t])?e[t]=i.withText(e[t].text+i.text):e.push(i)}function er(i,e,t,n){let s=(e||i).node(t),r=0,o=e?e.index(t):s.childCount;i&&(r=i.index(t),i.depth>t?r++:i.textOffset&&(ss(i.nodeAfter,n),r++));for(let a=r;a<o;a++)ss(s.child(a),n);e&&e.depth==t&&e.textOffset&&ss(e.nodeBefore,n)}function rs(i,e){return i.type.checkContent(e),i.copy(e)}function y0(i,e,t,n,s){let r=i.depth>s&&Da(i,e,s+1),o=n.depth>s&&Da(t,n,s+1),a=[];return er(null,i,s,a),r&&o&&e.index(s)==t.index(s)?(_0(r,o),ss(rs(r,y0(i,e,t,n,s+1)),a)):(r&&ss(rs(r,io(i,e,s+1)),a),er(e,t,s,a),o&&ss(rs(o,io(t,n,s+1)),a)),er(n,null,s,a),new we(a)}function io(i,e,t){let n=[];if(er(null,i,t,n),i.depth>t){let s=Da(i,e,t+1);ss(rs(s,io(i,e,t+1)),n)}return er(e,null,t,n),new we(n)}function d_(i,e){let t=e.depth-i.openStart,s=e.node(t).copy(i.content);for(let r=t-1;r>=0;r--)s=e.node(r).copy(we.from(s));return{start:s.resolveNoCache(i.openStart+t),end:s.resolveNoCache(s.content.size-i.openEnd-t)}}class cr{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],s=e.child(t);return n?e.child(t).cut(n):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let r=0;r<e;r++)s+=n.child(r).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return vt.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),s=e.maybeChild(t);if(!n){let a=n;n=s,s=a}let r=n.marks;for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,s=e.parent.maybeChild(e.index());for(var r=0;r<n.length;r++)n[r].type.spec.inclusive===!1&&(!s||!n[r].isInSet(s.marks))&&(n=n[r--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new so(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],s=0,r=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(r),c=r-l;if(n.push(o,a,s+l),!c||(o=o.child(a),o.isText))break;r=c-1,s+=l+1}return new cr(t,n,r)}static resolveCached(e,t){let n=yc.get(e);if(n)for(let r=0;r<n.elts.length;r++){let o=n.elts[r];if(o.pos==t)return o}else yc.set(e,n=new f_);let s=n.elts[n.i]=cr.resolve(e,t);return n.i=(n.i+1)%h_,s}}class f_{constructor(){this.elts=[],this.i=0}}const h_=12,yc=new WeakMap;class so{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const p_=Object.create(null);let li=class Ma{constructor(e,t,n,s=vt.none){this.type=e,this.attrs=t,this.marks=s,this.content=n||we.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,s=0){this.content.nodesBetween(e,t,n,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,s){return this.content.textBetween(e,t,n,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&to(this.attrs,t||e.defaultAttrs||p_)&&vt.sameSet(this.marks,n||vt.none)}copy(e=null){return e==this.content?this:new Ma(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ma(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Me.empty;let s=this.resolve(e),r=this.resolve(t),o=n?0:s.sharedDepth(t),a=s.start(o),c=s.node(o).content.cut(s.pos-a,r.pos-a);return new Me(c,s.depth-o,r.depth-o)}replace(e,t,n){return u_(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let s=this.content.child(t-1);return{node:s,index:t-1,offset:n-s.nodeSize}}resolve(e){return cr.resolveCached(this,e)}resolveNoCache(e){return cr.resolve(this,e)}rangeHasMark(e,t,n){let s=!1;return t>e&&this.nodesBetween(e,t,r=>(n.isInSet(r.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),I0(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=we.empty,s=0,r=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,s,r),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=s;l<r;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,s){if(s&&!this.type.allowsMarks(s))return!1;let r=this.contentMatchAt(e).matchType(n),o=r&&r.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=vt.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!vt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let s=we.fromJSON(e,t.content),r=e.nodeType(t.type).create(t.attrs,s,n);return r.type.checkAttrs(r.attrs),r}};li.prototype.text=void 0;class ro extends li{constructor(e,t,n,s){if(super(e,t,null,s),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):I0(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ro(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ro(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function I0(i,e){for(let t=i.length-1;t>=0;t--)e=i[t].type.name+"("+e+")";return e}class ds{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new g_(e,t);if(n.next==null)return ds.empty;let s=E0(n);n.next&&n.err("Unexpected trailing text");let r=E_(I_(s));return S_(r,n),r}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}
vendor: 12,438 bytes, lines 8-9
8matchFragment(e,t=0,n=e.childCount){let s=this;for(let r=t;s&&r<n;r++)s=s.matchType(e.child(r).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let s=[this];function r(o,a){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return we.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:f}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(f)==-1){s.push(f);let d=r(f,a.concat(u));if(d)return d}}return null}return r(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let s=n.shift(),r=s.match;if(r.matchType(e)){let o=[];for(let a=s;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<r.next.length;o++){let{type:a,next:l}=r.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!s.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:s}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let s=0;s<n.next.length;s++)e.indexOf(n.next[s].next)==-1&&t(n.next[s].next)}return t(this),e.map((n,s)=>{let r=s+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)r+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return r}).join(`
9`)}}ds.empty=new ds(!0);class g_{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function E0(i){let e=[];do e.push(m_(i));while(i.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function m_(i){let e=[];do e.push(v_(i));while(i.next&&i.next!=")"&&i.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function v_(i){let e=y_(i);for(;;)if(i.eat("+"))e={type:"plus",expr:e};else if(i.eat("*"))e={type:"star",expr:e};else if(i.eat("?"))e={type:"opt",expr:e};else if(i.eat("{"))e=C_(i,e);else break;return e}function Ic(i){/\D/.test(i.next)&&i.err("Expected number, got '"+i.next+"'");let e=Number(i.next);return i.pos++,e}function C_(i,e){let t=Ic(i),n=t;return i.eat(",")&&(i.next!="}"?n=Ic(i):n=-1),i.eat("}")||i.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function __(i,e){let t=i.nodeTypes,n=t[e];if(n)return[n];let s=[];for(let r in t){let o=t[r];o.isInGroup(e)&&s.push(o)}return s.length==0&&i.err("No node type or group '"+e+"' found"),s}function y_(i){if(i.eat("(")){let e=E0(i);return i.eat(")")||i.err("Missing closing paren"),e}else if(/\W/.test(i.next))i.err("Unexpected token '"+i.next+"'");else{let e=__(i,i.next).map(t=>(i.inline==null?i.inline=t.isInline:i.inline!=t.isInline&&i.err("Mixing inline and block content"),{type:"name",value:t}));return i.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function I_(i){let e=[[]];return s(r(i,0),t()),e;function t(){return e.push([])-1}function n(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function s(o,a){o.forEach(l=>l.to=a)}function r(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(r(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=r(o.exprs[l],a);if(l==o.exprs.length-1)return c;s(c,a=t())}else if(o.type=="star"){let l=t();return n(a,l),s(r(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return s(r(o.expr,a),l),s(r(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(a)].concat(r(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=t();s(r(o.expr,l),u),l=u}if(o.max==-1)s(r(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=t();n(l,u),s(r(o.expr,l),u),l=u}return[n(l)]}else{if(o.type=="name")return[n(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function S0(i,e){return e-i}function Ec(i,e){let t=[];return n(e),t.sort(S0);function n(s){let r=i[s];if(r.length==1&&!r[0].term)return n(r[0].to);t.push(s);for(let o=0;o<r.length;o++){let{term:a,to:l}=r[o];!a&&t.indexOf(l)==-1&&n(l)}}}function E_(i){let e=Object.create(null);return t(Ec(i,0));function t(n){let s=[];n.forEach(o=>{i[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<s.length;u++)s[u][0]==a&&(c=s[u][1]);Ec(i,l).forEach(u=>{c||s.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let r=e[n.join(",")]=new ds(n.indexOf(i.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(S0);r.next.push({type:s[o][0],next:e[a.join(",")]||t(a)})}return r}}function S_(i,e){for(let t=0,n=[i];t<n.length;t++){let s=n[t],r=!s.validEnd,o=[];for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];o.push(l.name),r&&!(l.isText||l.hasRequiredAttrs())&&(r=!1),n.indexOf(c)==-1&&n.push(c)}r&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function T0(i){let e=Object.create(null);for(let t in i){let n=i[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function L0(i,e){let t=Object.create(null);for(let n in i){let s=e&&e[n];if(s===void 0){let r=i[n];if(r.hasDefault)s=r.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=s}return t}function w0(i,e,t,n){for(let s in e)if(!(s in i))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in i){let r=i[s];r.validate&&r.validate(e[s])}}function A0(i,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new L_(i,n,e[n]);return t}let Sc=class b0{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=A0(e,n.attrs),this.defaultAttrs=T0(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ds.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:L0(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new li(this,this.computeAttrs(e),we.from(t),vt.setFrom(n))}createChecked(e=null,t,n){return t=we.from(t),this.checkContent(t),new li(this,this.computeAttrs(e),t,vt.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=we.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),r=s&&s.fillBefore(we.empty,!0);return r?new li(this,e,t.append(r),vt.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){w0(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:vt.none:e}static compile(e,t){let n=Object.create(null);e.forEach((r,o)=>n[r]=new b0(r,t,o));let s=t.spec.topNode||"doc";if(!n[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function T_(i,e,t){let n=t.split("|");return s=>{let r=s===null?"null":typeof s;if(n.indexOf(r)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${i}, got ${r}`)}}class L_{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?T_(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Lo{constructor(e,t,n,s){this.name=e,this.rank=t,this.schema=n,this.spec=s,this.attrs=A0(e,s.attrs),this.excluded=null;let r=T0(this.attrs);this.instance=r?new vt(this,r):null}create(e=null){return!e&&this.instance?this.instance:new vt(this,L0(this.attrs,e))}static compile(e,t){let n=Object.create(null),s=0;return e.forEach((r,o)=>n[r]=new Lo(r,s++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){w0(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class R0{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Gt.from(e.nodes),t.marks=Gt.from(e.marks||{}),this.nodes=Sc.compile(this.spec.nodes,this),this.marks=Lo.compile(this.spec.marks,this);let n=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let r=this.nodes[s],o=r.spec.content||"",a=r.spec.marks;if(r.contentMatch=n[o]||(n[o]=ds.parse(o,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!r.isInline||!r.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=r}r.markSet=a=="_"?null:a?Tc(this,a.split(" ")):a==""||!r.inlineContent?[]:null}for(let s in this.marks){let r=this.marks[s],o=r.spec.excludes;r.excluded=o==null?[r]:o==""?[]:Tc(this,o.split(" "))}this.nodeFromJSON=s=>li.fromJSON(this,s),this.markFromJSON=s=>vt.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Sc){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,s)}text(e,t){let n=this.nodes.text;return new ro(n,n.defaultAttrs,e,vt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Tc(i,e){let t=[];for(let n=0;n<e.length;n++){let s=e[n],r=i.marks[s],o=r;if(r)t.push(r);else for(let a in i.marks){let l=i.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function w_(i){return i.tag!=null}function A_(i){return i.style!=null}class Di{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(s=>{if(w_(s))this.tags.push(s);else if(A_(s)){let r=/[^=]*/.exec(s.style)[0];n.indexOf(r)<0&&n.push(r),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let r=e.nodes[s.node];return r.contentMatch.matchType(r)})}parse(e,t={}){let n=new wc(this,t,!1);return n.addAll(e,vt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new wc(this,t,!0);return n.addAll(e,vt.none,t.from,t.to),Me.maxOpen(n.finish())}matchTag(e,t,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){let r=this.tags[s];if(O_(e,r.tag)&&(r.namespace===void 0||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs
vendor: 9,667 bytes, lines 9-11
9){let o=r.getAttrs(e);if(o===!1)continue;r.attrs=o||void 0}return r}}}matchStyle(e,t,n,s){for(let r=s?this.styles.indexOf(s)+1:0;r<this.styles.length;r++){let o=this.styles[r],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(s){let r=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<r)break}t.splice(o,0,s)}for(let s in e.marks){let r=e.marks[s].spec.parseDOM;r&&r.forEach(o=>{n(o=Ac(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let r=e.nodes[s].spec.parseDOM;r&&r.forEach(o=>{n(o=Ac(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Di(e,Di.schemaRules(e)))}}const O0={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},b_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},D0={ol:!0,ul:!0},ur=1,ka=2,tr=4;function Lc(i,e,t){return e!=null?(e?ur:0)|(e==="full"?ka:0):i&&i.whitespace=="pre"?ur|ka:t&~tr}class Mr{constructor(e,t,n,s,r,o){this.type=e,this.attrs=t,this.marks=n,this.solid=s,this.options=o,this.content=[],this.activeMarks=vt.none,this.match=r||(o&tr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(we.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,s;return(s=n.findWrapping(e.type))?(this.match=n,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ur)){let n=this.content[this.content.length-1],s;if(n&&n.isText&&(s=/[ \t\r\n\u000c]+$/.exec(n.text))){let r=n;n.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-s[0].length))}}let t=we.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(we.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!O0.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class wc{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let s=t.topNode,r,o=Lc(null,t.preserveWhitespace,0)|(n?tr:0);s?r=new Mr(s.type,s.attrs,vt.none,!0,t.topMatch||s.type.contentMatch,o):n?r=new Mr(null,null,vt.none,!0,null,o):r=new Mr(e.schema.topNodeType,null,vt.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,s=this.top,r=s.options&ka?"full":this.localPreserveWS||(s.options&ur)>0,{schema:o}=this.parser;if(r==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r)if(r==="full")n=n.replace(/\r\n?/g,`
10`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=s.content[s.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let s=this.localPreserveWS,r=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;D0.hasOwnProperty(o)&&this.parser.normalizeLists&&R_(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:b_.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(O0.hasOwnProperty(o))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),c=!0,r.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let f=l&&l.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),c&&this.sync(r),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
11`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let r=this.parser.matchedStyles[s],o=n.getPropertyValue(r);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(r,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,n,s){let r,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(r=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,n,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}r&&this.sync(a)&&this.open--}addAll(e,t,n,s){let r=n||0;for(let o=n?e.childNodes[n]:e.firstChild,a=s==null?null:e.childNodes[s];o!=a;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o,t);this.findAtPoint(e,r)}findPlace(e,t,n){let s,r;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!s||s.length>c.length+a)&&(s=c,r=l,!c.length))break;if(l.solid){if(n)break;a+=2}}if(!s)return null;this.sync(r);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(t=this.enterInner(r,null,t))}let s=this.findPlace(e,t,n);if(s){this.closeExtra();let r=this.top;r.match&&(r.match=r.match.matchType(e.type));let o=vt.none;for(let a of s.concat(e.marks))(r.type?r.type.allowsMarkType(a.type):bc(a.type,e.type))&&(o=a.addToSet(o));return r.content.push(e.mark(o)),!0}return!1}enter(e,t,n,s){let r=this.findPlace(e.create(t),n,!1);return r&&(r=this.enterInner(e,t,n,!0,s)),r}enterInner(e,t,n,s=!1,r){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=Lc(e,r,o.options);o.options&tr&&o.content.length==0&&(a|=tr);let l=vt.none;return n=n.filter(c=>(o.type?o.type.allowsMarkType(c.type):bc(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Mr(e,t,l,s,null,a)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ur)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let s=n.length-1;s>=0;s--)e+=n[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(n?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,s=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),r=-(n?n.depth+1:0)+(s?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=r;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&s?this.nodes[l].type:n&&l>=r?n.node(l-r).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];
vendor: 8,764 bytes, line 11
11if(n.isTextblock&&n.defaultAttrs)return n}}}function R_(i){for(let e=i.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&D0.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function O_(i,e){return(i.matches||i.msMatchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector).call(i,e)}function Ac(i){let e={};for(let t in i)e[t]=i[t];return e}function bc(i,e){let t=e.schema.nodes;for(let n in t){let s=t[n];if(!s.allowsMarkType(i))continue;let r=[],o=a=>{r.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||r.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class gs{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Qo(t).createDocumentFragment());let s=n,r=[];return e.forEach(o=>{if(r.length||o.marks.length){let a=0,l=0;for(;a<r.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(r[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<r.length;)s=r.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,t);u&&(r.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:s}=Gr(Qo(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let r=this.serializeMark(e.marks[s],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n}serializeMark(e,t,n={}){let s=this.marks[e.type.name];return s&&Gr(Qo(n),s(e,t),null,e.attrs)}static renderSpec(e,t,n=null,s){return Gr(e,t,n,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new gs(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Rc(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Rc(e.marks)}}function Rc(i){let e={};for(let t in i){let n=i[t].spec.toDOM;n&&(e[t]=n)}return e}function Qo(i){return i.document||window.document}const Oc=new WeakMap;function D_(i){let e=Oc.get(i);return e===void 0&&Oc.set(i,e=M_(i)),e}function M_(i){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let s=0;s<n.length;s++)t(n[s]);else for(let s in n)t(n[s])}return t(i),e}function Gr(i,e,t,n){if(typeof e=="string")return{dom:i.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],r;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(r=D_(n))&&r.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let a,l=t?i.createElementNS(t,s):i.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=u;f<e.length;f++){let d=e[f];if(d===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:g}=Gr(i,d,t,n);if(l.appendChild(p),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:l,contentDOM:a}}const M0=65535,k0=Math.pow(2,16);function k_(i,e){return i+e*k0}function Dc(i){return i&M0}function N_(i){return(i-(i&M0))/k0}const N0=1,x0=2,Hr=4,U0=8;class Na{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&U0)>0}get deletedBefore(){return(this.delInfo&(N0|Hr))>0}get deletedAfter(){return(this.delInfo&(x0|Hr))>0}get deletedAcross(){return(this.delInfo&Hr)>0}}class mn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&mn.empty)return mn.empty}recover(e){let t=0,n=Dc(e);if(!this.inverted)for(let s=0;s<n;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[n*3]+t+N_(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let s=0,r=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let c=this.ranges[a+r],u=this.ranges[a+o],f=l+c;if(e<=f){let d=c?e==l?-1:e==f?1:t:t,p=l+s+(d<0?0:u);if(n)return p;let g=e==(t<0?l:f)?null:k_(a/3,e-l),h=e==l?x0:e==f?N0:Hr;return(t<0?e!=l:e!=f)&&(h|=U0),new Na(p,h,g)}s+=u-c}return n?e+s:new Na(e+s,0,null)}touches(e,t){let n=0,s=Dc(t),r=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+r],u=l+c;if(e<=u&&a==s*3)return!0;n+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let s=0,r=0;s<this.ranges.length;s+=3){let o=this.ranges[s],a=o-(this.inverted?r:0),l=o+(this.inverted?0:r),c=this.ranges[s+t],u=this.ranges[s+n];e(a,a+c,l,l+u),r+=u-c}}invert(){return new mn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?mn.empty:new mn(e<0?[0,-e,0]:[0,0,e])}}mn.empty=new mn([]);class oo{constructor(e,t,n=0,s=e?e.length:0){this.mirror=t,this.from=n,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new oo(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?n+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?n-s-1:void 0)}}invert(){let e=new oo;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let s=0;for(let r=this.from;r<this.to;r++){let o=this._maps[r],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(r);if(l!=null&&l>r&&l<this.to){r=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return n?e:new Na(e,s,null)}}const Zo=Object.create(null);class Xt{getMap(){return mn.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Zo[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Zo)throw new RangeError("Duplicate use of step JSON ID "+e);return Zo[e]=t,t.prototype.jsonID=e,t}}class Rt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Rt(e,null)}static fail(e){return new Rt(null,e)}static fromReplace(e,t,n,s){try{return Rt.ok(e.replace(t,n,s))}catch(r){if(r instanceof no)return Rt.fail(r.message);throw r}}}function _l(i,e,t){let n=[];for(let s=0;s<i.childCount;s++){let r=i.child(s);r.content.size&&(r=r.copy(_l(r.content,e,r))),r.isInline&&(r=e(r,t,s)),n.push(r)}return we.fromArray(n)}class Ti extends Xt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),s=n.node(n.sharedDepth(this.to)),r=new Me(_l(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return Rt.fromReplace(e,this.from,this.to,r)}invert(){return new zn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Ti(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ti&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ti(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ti(t.from,t.to,e.markFromJSON(t.mark))}}Xt.jsonID("addMark",Ti);class zn extends Xt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}
vendor: 6,491 bytes, line 11
11apply(e){let t=e.slice(this.from,this.to),n=new Me(_l(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return Rt.fromReplace(e,this.from,this.to,n)}invert(){return new Ti(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new zn(t.pos,n.pos,this.mark)}merge(e){return e instanceof zn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zn(t.from,t.to,e.markFromJSON(t.mark))}}Xt.jsonID("removeMark",zn);class Li extends Xt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Rt.fromReplace(e,this.pos,this.pos+1,new Me(we.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(n))return new Li(this.pos,t.marks[s]);return new Li(this.pos,this.mark)}}return new fs(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Li(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Li(t.pos,e.markFromJSON(t.mark))}}Xt.jsonID("addNodeMark",Li);class fs extends Xt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Rt.fromReplace(e,this.pos,this.pos+1,new Me(we.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Li(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new fs(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new fs(t.pos,e.markFromJSON(t.mark))}}Xt.jsonID("removeNodeMark",fs);class Ut extends Xt{constructor(e,t,n,s=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=s}apply(e){return this.structure&&xa(e,this.from,this.to)?Rt.fail("Structure replace would overwrite content"):Rt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new mn([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ut(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Ut(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ut)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?Me.empty:new Me(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ut(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?Me.empty:new Me(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ut(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ut(t.from,t.to,Me.fromJSON(e,t.slice),!!t.structure)}}Xt.jsonID("replace",Ut);class Vt extends Xt{constructor(e,t,n,s,r,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=s,this.slice=r,this.insert=o,this.structure=a}apply(e){if(this.structure&&(xa(e,this.from,this.gapFrom)||xa(e,this.gapTo,this.to)))return Rt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Rt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Rt.fromReplace(e,this.from,this.to,n):Rt.fail("Content does not fit in gap")}getMap(){return new mn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Vt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),r=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||s<t.pos||r>n.pos?null:new Vt(t.pos,n.pos,s,r,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Vt(t.from,t.to,t.gapFrom,t.gapTo,Me.fromJSON(e,t.slice),t.insert,!!t.structure)}}Xt.jsonID("replaceAround",Vt);function xa(i,e,t){let n=i.resolve(e),s=t-e,r=n.depth;for(;s>0&&r>0&&n.indexAfter(r)==n.node(r).childCount;)r--,s--;if(s>0){let o=n.node(r).maybeChild(n.indexAfter(r));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function x_(i,e,t,n){let s=[],r=[],o,a;i.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&u.type.allowsMarkType(n.type)){let d=Math.max(c,e),p=Math.min(c+l.nodeSize,t),g=n.addToSet(f);for(let h=0;h<f.length;h++)f[h].isInSet(g)||(o&&o.to==d&&o.mark.eq(f[h])?o.to=p:s.push(o=new zn(d,p,f[h])));a&&a.to==d?a.to=p:r.push(a=new Ti(d,p,n))}}
vendor: 18,270 bytes, lines 11-12
11),s.forEach(l=>i.step(l)),r.forEach(l=>i.step(l))}function U_(i,e,t,n){let s=[],r=0;i.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;r++;let l=null;if(n instanceof Lo){let c=o.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;u<l.length;u++){let f=l[u],d;for(let p=0;p<s.length;p++){let g=s[p];g.step==r-1&&f.eq(s[p].style)&&(d=g)}d?(d.to=c,d.step=r):s.push({style:f,from:Math.max(a,e),to:c,step:r})}}}),s.forEach(o=>i.step(new zn(o.from,o.to,o.style)))}function yl(i,e,t,n=t.contentMatch,s=!0){let r=i.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<r.childCount;l++){let c=r.child(l),u=a+c.nodeSize,f=n.matchType(c.type);if(!f)o.push(new Ut(a,u,Me.empty));else{n=f;for(let d=0;d<c.marks.length;d++)t.allowsMarkType(c.marks[d].type)||i.step(new zn(a,u,c.marks[d]));if(s&&c.isText&&t.whitespace!="pre"){let d,p=/\r?\n|\r/g,g;for(;d=p.exec(c.text);)g||(g=new Me(we.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new Ut(a+d.index,a+d.index+d[0].length,g))}}a=u}if(!n.validEnd){let l=n.fillBefore(we.empty,!0);i.replace(a,a,new Me(l,0,0))}for(let l=o.length-1;l>=0;l--)i.step(o[l])}function P_(i,e,t){return(e==0||i.canReplace(e,i.childCount))&&(t==i.childCount||i.canReplace(0,t))}function Vs(i){let t=i.parent.content.cutByIndex(i.startIndex,i.endIndex);for(let n=i.depth,s=0,r=0;;--n){let o=i.$from.node(n),a=i.$from.index(n)+s,l=i.$to.indexAfter(n)-r;if(n<i.depth&&o.canReplace(a,l,t))return n;if(n==0||o.type.spec.isolating||!P_(o,a,l))break;a&&(s=1),l<o.childCount&&(r=1)}return null}function V_(i,e,t){let{$from:n,$to:s,depth:r}=e,o=n.before(r+1),a=s.after(r+1),l=o,c=a,u=we.empty,f=0;for(let g=r,h=!1;g>t;g--)h||n.index(g)>0?(h=!0,u=we.from(n.node(g).copy(u)),f++):l--;let d=we.empty,p=0;for(let g=r,h=!1;g>t;g--)h||s.after(g+1)<s.end(g)?(h=!0,d=we.from(s.node(g).copy(d)),p++):c++;i.step(new Vt(l,c,o,a,new Me(u.append(d),f,p),u.size-f,!0))}function P0(i,e,t=null,n=i){let s=B_(i,e),r=s&&F_(n,e);return r?s.map(Mc).concat({type:e,attrs:t}).concat(r.map(Mc)):null}function Mc(i){return{type:i,attrs:null}}function B_(i,e){let{parent:t,startIndex:n,endIndex:s}=i,r=t.contentMatchAt(n).findWrapping(e);if(!r)return null;let o=r.length?r[0]:e;return t.canReplaceWith(n,s,o)?r:null}function F_(i,e){let{parent:t,startIndex:n,endIndex:s}=i,r=t.child(n),o=e.contentMatch.findWrapping(r.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=n;l&&c<s;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function G_(i,e,t){let n=we.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let a=t[o].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=we.from(t[o].type.create(t[o].attrs,n))}let s=e.start,r=e.end;i.step(new Vt(s,r,s,r,new Me(n,0,0),t.length,!0))}function H_(i,e,t,n,s){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let r=i.steps.length;i.doc.nodesBetween(e,t,(o,a)=>{let l=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(n,l)&&$_(i.doc,i.mapping.slice(r).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!g?c=!1:!p&&g&&(c=!0)}c===!1&&B0(i,o,a,r),yl(i,i.mapping.slice(r).map(a,1),n,void 0,c===null);let u=i.mapping.slice(r),f=u.map(a,1),d=u.map(a+o.nodeSize,1);return i.step(new Vt(f,d,f+1,d-1,new Me(we.from(n.create(l,null,o.marks)),0,0),1,!0)),c===!0&&V0(i,o,a,r),!1}})}function V0(i,e,t,n){e.forEach((s,r)=>{if(s.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(s.text);){let l=i.mapping.slice(n).map(t+1+r+o.index);i.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function B0(i,e,t,n){e.forEach((s,r)=>{if(s.type==s.type.schema.linebreakReplacement){let o=i.mapping.slice(n).map(t+1+r);i.replaceWith(o,o+1,e.type.schema.text(`
12`))}})}function $_(i,e,t){let n=i.resolve(e),s=n.index();return n.parent.canReplaceWith(s,s+1,t)}function j_(i,e,t,n,s){let r=i.doc.nodeAt(e);if(!r)throw new RangeError("No node at given position");t||(t=r.type);let o=t.create(n,null,s||r.marks);if(r.isLeaf)return i.replaceWith(e,e+r.nodeSize,o);if(!t.validContent(r.content))throw new RangeError("Invalid content for node type "+t.name);i.step(new Vt(e,e+r.nodeSize,e+1,e+r.nodeSize-1,new Me(we.from(o),0,0),1,!0))}function ci(i,e,t=1,n){let s=i.resolve(e),r=s.depth-t,o=n&&n[n.length-1]||s.parent;if(r<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=t-2;c>r;c--,u--){let f=s.node(c),d=s.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),g=n&&n[u+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let h=n&&n[u]||f;if(!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let a=s.indexAfter(r),l=n&&n[0];return s.node(r).canReplaceWith(a,a,l?l.type:s.node(r+1).type)}function W_(i,e,t=1,n){let s=i.doc.resolve(e),r=we.empty,o=we.empty;for(let a=s.depth,l=s.depth-t,c=t-1;a>l;a--,c--){r=we.from(s.node(a).copy(r));let u=n&&n[c];o=we.from(u?u.type.create(u.attrs,o):s.node(a).copy(o))}i.step(new Ut(e,e,new Me(r.append(o),t,t),!0))}function ms(i,e){let t=i.resolve(e),n=t.index();return F0(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function z_(i,e){e.content.size||i.type.compatibleContent(e.type);let t=i.contentMatchAt(i.childCount),{linebreakReplacement:n}=i.type.schema;for(let s=0;s<e.childCount;s++){let r=e.child(s),o=r.type==n?i.type.schema.nodes.text:r.type;if(t=t.matchType(o),!t||!i.type.allowsMarks(r.marks))return!1}return t.validEnd}function F0(i,e){return!!(i&&e&&!i.isLeaf&&z_(i,e))}function wo(i,e,t=-1){let n=i.resolve(e);for(let s=n.depth;;s--){let r,o,a=n.index(s);if(s==n.depth?(r=n.nodeBefore,o=n.nodeAfter):t>0?(r=n.node(s+1),a++,o=n.node(s).maybeChild(a)):(r=n.node(s).maybeChild(a-1),o=n.node(s+1)),r&&!r.isTextblock&&F0(r,o)&&n.node(s).canReplace(a,a+1))return e;if(s==0)break;e=t<0?n.before(s):n.after(s)}}function K_(i,e,t){let n=null,{linebreakReplacement:s}=i.doc.type.schema,r=i.doc.resolve(e-t),o=r.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",f=!!o.contentMatch.matchType(s);u&&!f?n=!1:!u&&f&&(n=!0)}let a=i.steps.length;if(n===!1){let u=i.doc.resolve(e+t);B0(i,u.node(),u.before(),a)}o.inlineContent&&yl(i,e+t-1,o,r.node().contentMatchAt(r.index()),n==null);let l=i.mapping.slice(a),c=l.map(e-t);if(i.step(new Ut(c,l.map(e+t,-1),Me.empty,!0)),n===!0){let u=i.doc.resolve(c);V0(i,u.node(),u.before(),i.steps.length)}return i}function Y_(i,e,t){let n=i.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let s=n.depth-1;s>=0;s--){let r=n.index(s);if(n.node(s).canReplaceWith(r,r,t))return n.before(s+1);if(r>0)return null}if(n.parentOffset==n.parent.content.size)for(let s=n.depth-1;s>=0;s--){let r=n.indexAfter(s);if(n.node(s).canReplaceWith(r,r,t))return n.after(s+1);if(r<n.node(s).childCount)return null}return null}function q_(i,e,t){let n=i.resolve(e);if(!t.content.size)return e;let s=t.content;for(let r=0;r<t.openStart;r++)s=s.firstChild.content;for(let r=1;r<=(t.openStart==0&&t.size?2:1);r++)for(let o=n.depth;o>=0;o--){let a=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(a>0?1:0),c=n.node(o),u=!1;if(r==1)u=c.canReplace(l,l,s);else{let f=c.contentMatchAt(l).findWrapping(s.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?n.pos:a<0?n.before(o+1):n.after(o+1)}return null}function Ao(i,e,t=e,n=Me.empty){if(e==t&&!n.size)return null;let s=i.resolve(e),r=i.resolve(t);return G0(s,r,n)?new Ut(e,t,n):new J_(s,r,n).fit()}function G0(i,e,t){return!t.openStart&&!t.openEnd&&i.start()==e.start()&&i.parent.canReplace(i.index(),e.index(),t.content)}class J_{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=we.empty;for(let s=0;s<=e.depth;s++){let r=e.node(s);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=we.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,s=this.close(e<0?this.$to:n.doc.resolve(e));if(!s)return null;let r=this.placed,o=n.depth,a=s.depth;for(;o&&a&&r.childCount==1;)r=r.firstChild.content,o--,a--;let l=new Me(r,o,a);return e>-1?new Vt(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Ut(n.pos,s.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,s=this.unplaced.openEnd;n<e;n++){let r=t.firstChild;if(t.childCount>1&&(s=0),r.type.spec.isolating&&s<=n){e=n;break}t=r.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let s,r=null;n?(r=Xo(this.unplaced.content,n-1).firstChild,s=r.content):s=this.unplaced.content;let o=s.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(t==1&&(o?c.matchType(o.type)||(f=c.fillBefore(we.from(o),!1)):r&&l.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:a,parent:r,inject:f};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:r,wrap:u};if(r&&c.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,s=Xo(e,t);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new Me(e,t+1,Math.max(n,s.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,s=Xo(e,t);if(s.childCount<=1&&t>0){let r=e.size-t<=t+s.size;this.unplaced=new Me(zs(e,t-1,1),t-1,r?t-1:n)}else this.unplaced=new Me(zs(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:s,wrap:r}){for(;this.depth>t;)this.closeFrontierNode();if(r)for(let h=0;h<r.length;h++)this.openFrontierNode(r[h]);let o=this.unplaced,a=n?n.content:o.content,l=o.openStart-e,c=0,u=[],{match:f,type:d}=this.frontier[t];if(s){for(let h=0;h<s.childCount;h++)u.push(s.child(h));f=f.matchFragment(s)}let p=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let h=a.child(c),m=f.matchType(h.type);if(!m)break;c++,(c>1||l==0||h.content.size)&&(f=m,u.push(H0(h.mark(d.allowedMarks(h.marks)),c==1?l:0,c==a.childCount?p:-1)))}let g=c==a.childCount;g||(p=-1),this.placed=Ks(this.placed,t,we.from(u)),this.frontier[t].match=f,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let h=0,m=a;h<p;h++){let y=m.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),m=y.content}this.unplaced=g?e==0?Me.empty:new Me(zs(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new Me(zs(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ea(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,s=this.$to.after(n);for(;n>1&&s==this.$to.end(--n);)++s;return s}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:s}=this.frontier[t],r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ea(e,t,s,n,r);if(o){for(let a=t-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=ea(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:r?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ks(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let s=e.node(n),r=s.type.contentMatch.fillBefore(s.content,!0,e.index(n));this.openFrontierNode(s.type,s.attrs,r)}return e}openFrontierNode(e,t=null,n){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Ks(this.placed,this.depth,we.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(we.empty,!0);t.childCount&&(this.placed=Ks(this.placed,this.frontier.length,t))}}function zs(i,e,t){return e==0?i.cutByIndex(t,i.childCount):i.replaceChild(0,i.firstChild.copy(zs(i.firstChild.content,e-1,t)))}function Ks(i,e,t){return e==0?i.append(t):i.replaceChild(i.childCount-1,i.lastChild.copy(Ks(i.lastChild.content,e-1,t)))}function Xo(i,e){for(let t=0;t<e;t++)i=i.firstChild.content;return i}function H0(i,e,t){if(e<=0)return i;let n=i.content;return e>1&&(n=n.replaceChild(0,H0(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=i.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(i.type.contentMatch.matchFragment(n).fillBefore(we.empty,!0)))),i.copy(n)}function ea(i,e,t,n,s){let r=i.node(e),o=s?i.indexAfter(e):i.index(e);if(o==r.childCount&&!t.compatibleContent(r.type))return null;let a=n.fillBefore(r.content,!0,o);return a&&!Q_(t,r.content,o)?a:null}function Q_(i,e,t){for(let n=t;n<e.childCount;n++)if(!i.allowsMarks(e.child(n).marks))return!0;return!1}function Z_(i){return i.spec.defining||i.spec.definingForContent}function X_(i,e,t,n){if(!n.size)return i.deleteRange(e,t);let s=i.doc.resolve(e),r=i.doc.resolve(t);if(G0(s,r,n))return i.step(new Ut(e,t,n));let o=j0(s,r);o[o.length-1]==0&&o.pop();let a=-(s.depth+1);o.unshift(a);for(let d=s.depth,p=s.pos-1;d>0;d--,p--){let g=s.node(d).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(d)>-1?a=d:s.before(d)==p&&o.splice(1,0,-d)}let l=o.indexOf(a),c=[],u=n.openStart;for(let d=n.content,p=0;;p++){let g=d.firstChild;if(c.push(g),p==n.openStart)break;d=g.content}for(let d=u-1;d>=0;d--){let p=c[d],g=Z_(p.type);if(g&&!p.sameMarkup(s.node(Math.abs(a)-1)))u=d;else if(g||!p.type.isTextblock)break}for(let d=n.openStart;d>=0;d--){let p=(d+u+1)%(n.openStart+1),g=c[p];if(g)for(let h=0;h<o.length;h++){let m=o[(h+l)%o.length],y=!0;m<0&&(y=!1,m=-m);let R=s.node(m-1),I=s.index(m-1);if(R.canReplaceWith(I,I,g.type,g.marks))return i.replace(s.before(m),y?r.after(m):t,new Me($0(n.content,0,n.openStart,p),p,n.openEnd))}}let f=i.steps.length;for(let d=o.length-1;d>=0&&(i.replace(e,t,n),!(i.steps.length>f));d--){let p=o[d];p<0||(e=s.before(p),t=r.after(p))}}function $0(i,e,t,n,s){if(e<t){let r=i.firstChild;i=i.replaceChild(0,r.copy($0(r.content,e+1,t,n,r)))}if(e>n){let r=s.contentMatchAt(0),o=r.fillBefore(i).append(i);i=o.append(r.matchFragment(o).fillBefore(we.empty,!0))}return i}function ey(i,e,t,n){if(!n.isInline&&e==t&&i.doc.resolve(e).parent.content.size){let s=Y_(i.doc,e,n.type);s!=null&&(e=t=s)}i.replaceRange(e,t,new Me(we.from(n),0,0))}function ty(i,e,t){let n=i.doc.resolve(e),s=i.doc.resolve(t),r=j0(n,s);for(let o=0;o<r.length;o++){let a=r[o],l=o==r.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return i.delete(n.start(a),s.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),s.indexAfter(a-1))))return i.delete(n.before(a),s.after(a))}for(let o=1;o<=n.depth&&o<=s.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&s.end(o)-t!=s.depth-o&&n.start(o-1)==s.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),s.index(o-1)))return i.delete(n.before(o),t);i.delete(e,t)}function j0(i,e){let t=[],n=Math.min(i.depth,e.depth);for(let s=n;s>=0;s--){let r=i.start(s);if(r<i.pos-(i.depth-s)||e.end(s)>e.pos+(e.depth-s)||i.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(r==e.start(s)||s==i.depth&&s==e.depth&&i.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==r-1)&&t.push(s)}return t}class Rs extends Xt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rt.fail("No node at attribute step's position");let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let s=t.type.create(n,null,t.marks);return Rt.fromReplace(e,this.pos,this.pos+1,new Me(we.from(s),0,t.isLeaf?0:1))}getMap(){return mn.empty}invert(e){return new Rs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rs(t.pos,t.attr,t.value)}}Xt.jsonID("attr",Rs);class dr extends Xt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Rt.ok(n)}getMap(){return mn.empty}invert(e){return new dr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new dr(t.attr,t.value)}}Xt.jsonID("docAttr",dr);let Ms=class extends Error{};Ms=function i(e){let t=Error.call(this,e);return t.__proto__=i.prototype,t};Ms.prototype=Object.create(Error.prototype);Ms.prototype.constructor=Ms;Ms.prototype.name="TransformError";class ny{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new oo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ms(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Me.empty){let s=Ao(this.doc,e,t,n);return s&&this.step(s),this}replaceWith(e,t,n){return this.replace(e,t,new Me(we.from(n),0,0))}delete(e,t){return this.replace(e,t,Me.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return X_(this,e,t,n),this}replaceRangeWith(e,t,n){return ey(this,e,t,n),this}deleteRange(e,t){return ty(this,e,t),this}lift(e,t){return V_(this,e,t),this}join(e,t=1){return K_(this,e,t),this}wrap(e,t){return G_(this,e,t),this}setBlockType(e,t=e,n,s=null){return H_(this,e,t,n,s),this}
vendor: 2,057 bytes, line 12
12setNodeMarkup(e,t,n=null,s){return j_(this,e,t,n,s),this}setNodeAttribute(e,t,n){return this.step(new Rs(e,t,n)),this}setDocAttribute(e,t){return this.step(new dr(e,t)),this}addNodeMark(e,t){return this.step(new Li(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof vt)t.isInSet(n.marks)&&this.step(new fs(e,t));else{let s=n.marks,r,o=[];for(;r=t.isInSet(s);)o.push(new fs(e,r)),s=r.removeFromSet(s);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,t=1,n){return W_(this,e,t,n),this}addMark(e,t,n){return x_(this,e,t,n),this}removeMark(e,t,n){return U_(this,e,t,n),this}clearIncompatible(e,t,n){return yl(this,e,t,n),this}}const ta=Object.create(null);class ot{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new iy(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Me.empty){let n=t.content.lastChild,s=null;for(let a=0;a<t.openEnd;a++)s=n,n=n.lastChild;let r=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],u=e.mapping.slice(r);e.replaceRange(u.map(l.pos),u.map(c.pos),a?Me.empty:t),a==0&&xc(e,r,(n?n.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,s=this.ranges;for(let r=0;r<s.length;r++){let{$from:o,$to:a}=s[r],l=e.mapping.slice(n),c=l.map(o.pos),u=l.map(a.pos);r?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),xc(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let s=e.parent.inlineContent?new Xe(e):Es(e.node(0),e.parent,e.pos,e.index(),t,n);if(s)return s;for(let r=e.depth-1;r>=0;r--){let o=t<0?Es(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Es(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}
vendor: 6,939 bytes, line 12
12static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Cn(e.node(0))}static atStart(e){return Es(e,e,0,0,1)||new Cn(e)}static atEnd(e){return Es(e,e,e.content.size,e.childCount,-1)||new Cn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=ta[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ta)throw new RangeError("Duplicate use of selection JSON ID "+e);return ta[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Xe.between(this.$anchor,this.$head).getBookmark()}}ot.prototype.visible=!0;class iy{constructor(e,t){this.$from=e,this.$to=t}}let kc=!1;function Nc(i){!kc&&!i.parent.inlineContent&&(kc=!0)}class Xe extends ot{constructor(e,t=e){Nc(e),Nc(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return ot.near(n);let s=e.resolve(t.map(this.anchor));return new Xe(s.parent.inlineContent?s:n,n)}replace(e,t=Me.empty){if(super.replace(e,t),t==Me.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Xe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new bo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Xe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let s=e.resolve(t);return new this(s,n==t?s:e.resolve(n))}static between(e,t,n){let s=e.pos-t.pos;if((!n||s)&&(n=s>=0?1:-1),!t.parent.inlineContent){let r=ot.findFrom(t,n,!0)||ot.findFrom(t,-n,!0);if(r)t=r.$head;else return ot.near(t,n)}return e.parent.inlineContent||(s==0?e=t:(e=(ot.findFrom(e,-n,!0)||ot.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=s<0&&(e=t))),new Xe(e,t)}}ot.jsonID("text",Xe);class bo{constructor(e,t){this.anchor=e,this.head=t}map(e){return new bo(e.map(this.anchor),e.map(this.head))}resolve(e){return Xe.between(e.resolve(this.anchor),e.resolve(this.head))}}class je extends ot{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:s}=t.mapResult(this.anchor),r=e.resolve(s);return n?ot.near(r):new je(r)}content(){return new Me(we.from(this.node),0,0)}eq(e){return e instanceof je&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Il(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new je(e.resolve(t.anchor))}static create(e,t){return new je(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}je.prototype.visible=!1;ot.jsonID("node",je);class Il{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new bo(n,n):new Il(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&je.isSelectable(n)?new je(t):ot.near(t)}}class Cn extends ot{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Me.empty){if(t==Me.empty){e.delete(0,e.doc.content.size);let n=ot.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Cn(e)}map(e){return new Cn(e)}eq(e){return e instanceof Cn}getBookmark(){return sy}}ot.jsonID("all",Cn);const sy={map(){return this},resolve(i){return new Cn(i)}};function Es(i,e,t,n,s,r=!1){if(e.inlineContent)return Xe.create(i,t);for(let o=n-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let a=e.child(o);if(a.isAtom){if(!r&&je.isSelectable(a))return je.create(i,t-(s<0?a.nodeSize:0))}else{let l=Es(i,a,t+s,s<0?a.childCount:0,s,r);if(l)return l}t+=a.nodeSize*s}return null}function xc(i,e,t){let n=i.steps.length-1;if(n<e)return;let s=i.steps[n];if(!(s instanceof Ut||s instanceof Vt))return;let r=i.mapping.maps[n],o;r.forEach((a,l,c,u)=>{o==null&&(o=u)}),i.setSelection(ot.near(i.doc.resolve(o),t))}const Uc=1,kr=2,Pc=4;class ry extends ny{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Uc)&~kr,this.storedMarks=null,this}get selectionSet(){return(this.updated&Uc)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=kr,this}ensureMarks(e){return vt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&kr)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~kr,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||vt.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let s=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let r=this.storedMarks;if(!r){let o=this.doc.resolve(t);r=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,s.text(e,r)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(ot.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Pc,this}get scrolledIntoView(){return(this.updated&Pc)>0}}function Vc(i,e){return!e||!i?i:i.bind(e)}class Ys{constructor(e,t,n){this.name=e,this.init=Vc(t.init,n),this.apply=Vc(t.apply,n)}}const oy=[new Ys("doc",{init(i){return i.doc||i.schema.topNodeType.createAndFill()},apply(i){return i.doc}}),new Ys("selection",{init(i,e){return i.selection||ot.atStart(e.doc)},apply(i){return i.selection}}),new Ys("storedMarks",{init(i){return i.storedMarks||null},apply(i,e,t,n){return n.selection.$cursor?i.storedMarks:null}}),new Ys("scrollToSelection",{init(){return 0},apply(i,e){return i.scrolledIntoView?e+1:e}})];
vendor: 5,082 bytes, line 12
12class na{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=oy.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ys(n.key,n.spec.state,n))})}}class Ls{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let s=this.config.plugins[n];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),s=null;for(;;){let r=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=s?s[o].n:0,c=s?s[o].state:this,u=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,c,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let f=0;f<this.config.plugins.length;f++)s.push(f<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),r=!0}s&&(s[o]={state:n,n:t.length})}}if(!r)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Ls(this.config),n=this.config.fields;for(let s=0;s<n.length;s++){let r=n[s];t[r.name]=r.apply(e,this[r.name],this,t)}return t}get tr(){return new ry(this)}static create(e){let t=new na(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Ls(t);for(let s=0;s<t.fields.length;s++)n[t.fields[s].name]=t.fields[s].init(e,n);return n}reconfigure(e){let t=new na(this.schema,e.plugins),n=t.fields,s=new Ls(t);for(let r=0;r<n.length;r++){let o=n[r].name;s[o]=this.hasOwnProperty(o)?this[o]:n[r].init(e,s)}return s}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[n],r=s.spec.state;r&&r.toJSON&&(t[n]=r.toJSON.call(s,this[s.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new na(e.schema,e.plugins),r=new Ls(s);return s.fields.forEach(o=>{if(o.name=="doc")r.doc=li.fromJSON(e.schema,t.doc);else if(o.name=="selection")r.selection=ot.fromJSON(r.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(r.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){r[o.name]=c.fromJSON.call(l,e,t[a],r);return}}r[o.name]=o.init(e,r)}}),r}}function W0(i,e,t){for(let n in i){let s=i[n];s instanceof Function?s=s.bind(e):n=="handleDOMEvents"&&(s=W0(s,e,{})),t[n]=s}return t}class Mn{constructor(e){this.spec=e,this.props={},e.props&&W0(e.props,this,this.props),this.key=e.key?e.key.key:z0("plugin")}getState(e){return e[this.key]}}const ia=Object.create(null);function z0(i){return i in ia?i+"$"+ ++ia[i]:(ia[i]=0,i+"$")}class Jn{constructor(e="key"){this.key=z0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ht=function(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e},ks=function(i){let e=i.assignedSlot||i.parentNode;return e&&e.nodeType==11?e.host:e};let Ua=null;const Zn=function(i,e,t){let n=Ua||(Ua=document.createRange());return n.setEnd(i,t==null?i.nodeValue.length:t),n.setStart(i,e||0),n},ay=function(){Ua=null},hs=function(i,e,t,n){return t&&(Bc(i,e,t,n,-1)||Bc(i,e,t,n,1))},ly=/^(img|br|input|textarea|hr)$/i;function Bc(i,e,t,n,s){for(var r;;){if(i==t&&e==n)return!0;if(e==(s<0?0:bn(i))){let o=i.parentNode;if(!o||o.nodeType!=1||Ir(i)||ly.test(i.nodeName)||i.contentEditable=="false")return!1;e=Ht(i)+(s<0?0:1),i=o}else if(i.nodeType==1){let o=i.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((r=o.pmViewDesc)===null||r===void 0)&&r.ignoreForSelection)e+=s;else return!1;else i=o,e=s<0?bn(i):0}else return!1}}function bn(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function cy(i,e){for(;;){if(i.nodeType==3&&e)return i;if(i.nodeType==1&&e>0){if(i.contentEditable=="false")return null;i=i.childNodes[e-1],e=bn(i)}else if(i.parentNode&&!Ir(i))e=Ht(i),i=i.parentNode;else return null}}function uy(i,e){for(;;){if(i.nodeType==3&&e<i.nodeValue.length)return i;if(i.nodeType==1&&e<i.childNodes.length){if(i.contentEditable=="false")return null;i=i.childNodes[e],e=0}else if(i.parentNode&&!Ir(i))e=Ht(i)+1,i=i.parentNode;else return null}}function dy(i,e,t){for(let n=e==0,s=e==bn(i);n||s;){if(i==t)return!0;let r=Ht(i);if(i=i.parentNode,!i)return!1;n=n&&r==0,s=s&&r==bn(i)}}function Ir(i){let e;for(let t=i;t&&!(e=t.pmViewDesc);
vendor: 4,376 bytes, line 12
12t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==i||e.contentDOM==i)}const Ro=function(i){return i.focusNode&&hs(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)};function $i(i,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=i,t.key=t.code=e,t}function fy(i){let e=i.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function hy(i,e,t){if(i.caretPositionFromPoint)try{let n=i.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(bn(n.offsetNode),n.offset)}}catch(n){}if(i.caretRangeFromPoint){let n=i.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(bn(n.startContainer),n.startOffset)}}}const Yn=typeof navigator!="undefined"?navigator:null,Fc=typeof document!="undefined"?document:null,Vi=Yn&&Yn.userAgent||"",Pa=/Edge\/(\d+)/.exec(Vi),K0=/MSIE \d/.exec(Vi),Va=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vi),an=!!(K0||Va||Pa),Mi=K0?document.documentMode:Va?+Va[1]:Pa?+Pa[1]:0,Rn=!an&&/gecko\/(\d+)/i.test(Vi);Rn&&+(/Firefox\/(\d+)/.exec(Vi)||[0,0])[1];const Ba=!an&&/Chrome\/(\d+)/.exec(Vi),Pt=!!Ba,Y0=Ba?+Ba[1]:0,Zt=!an&&!!Yn&&/Apple Computer/.test(Yn.vendor),Ns=Zt&&(/Mobile\/\w+/.test(Vi)||!!Yn&&Yn.maxTouchPoints>2),wn=Ns||(Yn?/Mac/.test(Yn.platform):!1),q0=Yn?/Win/.test(Yn.platform):!1,ti=/Android \d/.test(Vi),Er=!!Fc&&"webkitFontSmoothing"in Fc.documentElement.style,py=Er?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function gy(i){let e=i.defaultView&&i.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.documentElement.clientWidth,top:0,bottom:i.documentElement.clientHeight}}function Qn(i,e){return typeof i=="number"?i:i[e]}function my(i){let e=i.getBoundingClientRect(),t=e.width/i.offsetWidth||1,n=e.height/i.offsetHeight||1;return{left:e.left,right:e.left+i.clientWidth*t,top:e.top,bottom:e.top+i.clientHeight*n}}function Gc(i,e,t){let n=i.someProp("scrollThreshold")||0,s=i.someProp("scrollMargin")||5,r=i.dom.ownerDocument;for(let o=t||i.dom;o;){if(o.nodeType!=1){o=ks(o);continue}let a=o,l=a==r.body,c=l?gy(r):my(a),u=0,f=0;if(e.top<c.top+Qn(n,"top")?f=-(c.top-e.top+Qn(s,"top")):e.bottom>c.bottom-Qn(n,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Qn(s,"top")-c.top:e.bottom-c.bottom+Qn(s,"bottom")),e.left<c.left+Qn(n,"left")?u=-(c.left-e.left+Qn(s,"left")):e.right>c.right-Qn(n,"right")&&(u=e.right-c.right+Qn(s,"right")),u||f)if(l)r.defaultView.scrollBy(u,f);else{let p=a.scrollLeft,g=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let h=a.scrollLeft-p,m=a.scrollTop-g;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:ks(o)}}function vy(i){let e=i.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,s;for(let r=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=i.root.elementFromPoint(r,o);if(!a||a==i.dom||!i.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=t-20){n=a,s=l.top;break}}return{refDOM:n,refTop:s,stack:J0(i.dom)}}function J0(i){let e=[],t=i.ownerDocument;for(let n=i;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),i!=t);n=ks(n));return e}function Cy({refDOM:i,refTop:e,stack:t}){let n=i?i.getBoundingClientRect().top:0;Q0(t,n==0?0:n-e)}function Q0(i,e){for(let t=0;t<i.length;t++){let{dom:n,top:s,left:r}=i[t];n.scrollTop!=s+e&&(n.scrollTop=s+e),n.scrollLeft!=r&&(n.scrollLeft=r)}}let Cs=null;function _y(i){if(i.setActive)return i.setActive();if(Cs)return i.focus(Cs);let e=J0(i);i.focus(Cs==null?{get preventScroll(){return Cs={preventScroll:!0},!0}}:void 0),Cs||(Cs=!1,Q0(e,0))}function Z0(i,e){let t,n=2e8,s,r=0,o=e.top,a=e.top,l,c;for(let u=i.firstChild,f=0;u;u=u.nextSibling,f++){let d;if(u.nodeType==1)d=u.getClientRects();else if(u.nodeType==3)d=Zn(u).getClientRects();else continue;for(let p=0;p<d.length;p++){let g=d[p];if(g.top<=o&&g.bottom>=a){o=Math.max(g.bottom,o),a=Math.min(g.top,a);let h=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(h<n){t=u,n=h,s=h&&t.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,u.nodeType==1&&h&&(r=f+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!l&&g.left<=e.left&&g.right>=e.left&&(l=u,c={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!t&&(e.left>=g.right&&e.top>
vendor: 4,132 bytes, line 12
12=g.top||e.left>=g.left&&e.top>=g.bottom)&&(r=f+1)}}return!t&&l&&(t=l,s=c,n=0),t&&t.nodeType==3?yy(t,s):!t||n&&t.nodeType==1?{node:i,offset:r}:Z0(t,s)}function yy(i,e){let t=i.nodeValue.length,n=document.createRange(),s;for(let r=0;r<t;r++){n.setEnd(i,r+1),n.setStart(i,r);let o=vi(n,1);if(o.top!=o.bottom&&El(e,o)){s={node:i,offset:r+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),s||{node:i,offset:0}}function El(i,e){return i.left>=e.left-1&&i.left<=e.right+1&&i.top>=e.top-1&&i.top<=e.bottom+1}function Iy(i,e){let t=i.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<i.getBoundingClientRect().left?t:i}function Ey(i,e,t){let{node:n,offset:s}=Z0(e,t),r=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();r=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return i.docView.posFromDOM(n,s,r)}function Sy(i,e,t,n){let s=-1;for(let r=e,o=!1;r!=i.dom;){let a=i.docView.nearestDesc(r,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>n.left||l.top>n.top?s=a.posBefore:(!o&&l.right<n.left||l.bottom<n.top)&&(s=a.posAfter),o=!0),!a.contentDOM&&s<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;r=a.dom.parentNode}return s>-1?s:i.docView.posFromDOM(e,t,-1)}function X0(i,e,t){let n=i.childNodes.length;if(n&&t.top<t.bottom)for(let s=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),r=s;;){let o=i.childNodes[r];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(El(e,c))return X0(o,e,c)}}if((r=(r+1)%n)==s)break}return i}function Ty(i,e){let t=i.dom.ownerDocument,n,s=0,r=hy(t,e.left,e.top);r&&({node:n,offset:s}=r);let o=(i.root.elementFromPoint?i.root:t).elementFromPoint(e.left,e.top),a;if(!o||!i.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=i.dom.getBoundingClientRect();if(!El(e,c)||(o=X0(i.dom,e,c),!o))return null}if(Zt)for(let c=o;n&&c;c=ks(c))c.draggable&&(n=void 0);if(o=Iy(o,e),n){if(Rn&&n.nodeType==1&&(s=Math.min(s,n.childNodes.length),s<n.childNodes.length)){let u=n.childNodes[s],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&s++}let c;Er&&s&&n.nodeType==1&&(c=n.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,n==i.dom&&s==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=i.state.doc.content.size:(s==0||n.nodeType!=1||n.childNodes[s-1].nodeName!="BR")&&(a=Sy(i,n,s,e))}a==null&&(a=Ey(i,o,e));let l=i.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Hc(i){return i.top<i.bottom||i.left<i.right}function vi(i,e){let t=i.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(Hc(n))return n}return Array.prototype.find.call(t,Hc)||i.getBoundingClientRect()}const Ly=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ef(i,e,t){let{node:n,offset:s,atom:r}=i.docView.domFromPos(e,t<0?-1:1),o=Er||Rn;if(n.nodeType==3)if(o&&(Ly.test(n.nodeValue)||(t<0?!s:s==n.nodeValue.length))){let l=vi(Zn(n,s,s),t);if(Rn&&s&&/\s/.test(n.nodeValue[s-1])&&s<n.nodeValue.length){let c=vi(Zn(n,s-1,s-1),-1);if(c.top==l.top){let u=vi(Zn(n,s,s+1),-1);if(u.top!=l.top)return Hs(u,u.left<c.left)}}return l}else{let l=s,c=s,u=t<0?1:-1;return t<0&&!s?(c++,u=-1):t>=0&&s==n.nodeValue.length?(l--,u=1):t<0?l--:c++,Hs(vi(Zn(n,l,c),u),u<0)}if(!i.state.doc.resolve(e-(r||0)).parent.inlineContent){if(r==null&&s&&(t<0||s==bn(n))){let l=n.childNodes[s-1];if(l.nodeType==1)return sa(l.getBoundingClientRect(),!1)}if(r==null&&s<bn(n)){let l=n.childNodes[s];if(l.nodeType==1)return sa(l.getBoundingClientRect(),!0)}return sa(n.getBoundingClientRect(),t>=0)}if(r==null&&s&&(t<0||s==bn(n))){let l=n.childNodes[s-1],c=l.nodeType==3?Zn(l,bn(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Hs(vi(c,1),!1)}if(r==null&&s<bn(n)){let l=n.childNodes[s];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;
vendor: 6,476 bytes, line 12
12let c=l?l.nodeType==3?Zn(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return Hs(vi(c,-1),!0)}return Hs(vi(n.nodeType==3?Zn(n):n,-t),t>=0)}function Hs(i,e){if(i.width==0)return i;let t=e?i.left:i.right;return{top:i.top,bottom:i.bottom,left:t,right:t}}function sa(i,e){if(i.height==0)return i;let t=e?i.top:i.bottom;return{top:t,bottom:t,left:i.left,right:i.right}}function tf(i,e,t){let n=i.state,s=i.root.activeElement;n!=e&&i.updateState(e),s!=i.dom&&i.focus();try{return t()}finally{n!=e&&i.updateState(n),s!=i.dom&&s&&s.focus()}}function wy(i,e,t){let n=e.selection,s=t=="up"?n.$from:n.$to;return tf(i,e,()=>{let{node:r}=i.docView.domFromPos(s.pos,t=="up"?-1:1);for(;;){let a=i.docView.nearestDesc(r,!0);if(!a)break;if(a.node.isBlock){r=a.contentDOM||a.dom;break}r=a.dom.parentNode}let o=ef(i,s.pos,1);for(let a=r.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Zn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Ay=/[\u0590-\u08ac]/;function by(i,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let s=n.parentOffset,r=!s,o=s==n.parent.content.size,a=i.domSelection();return a?!Ay.test(n.parent.textContent)||!a.modify?t=="left"||t=="backward"?r:o:tf(i,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=i.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",t,"character");let p=n.depth?i.docView.domAfterPos(n.before()):i.dom,{focusNode:g,focusOffset:h}=i.domSelectionRange(),m=g&&!p.contains(g.nodeType==1?g:g.parentNode)||l==g&&c==h;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch(y){}return d!=null&&(a.caretBidiLevel=d),m}):n.pos==n.start()||n.pos==n.end()}let $c=null,jc=null,Wc=!1;function Ry(i,e,t){return $c==e&&jc==t?Wc:($c=e,jc=t,Wc=t=="up"||t=="down"?wy(i,e,t):by(i,e,t))}const On=0,zc=1,Qi=2,qn=3;class Sr{constructor(e,t,n,s){this.parent=e,this.children=t,this.dom=n,this.contentDOM=s,this.dirty=On,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let s=this.children[t];if(s==e)return n;n+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&!((o=r.pmViewDesc)&&o.parent==this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}else{let r,o;if(e==this.contentDOM)r=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.nextSibling}for(;r&&!((o=r.pmViewDesc)&&o.parent==this);)r=r.nextSibling;return r?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=t>Ht(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let r=e;;r=r.parentNode){if(r==this.dom){s=!1;break}if(r.previousSibling)break}if(s==null&&t==e.childNodes.length)for(let r=e;;r=r.parentNode){if(r==this.dom){s=!0;break}if(r.nextSibling)break}}return(s==null?n>0:s)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,s=e;s;s=s.parentNode){let r=this.getDesc(s),o;if(r&&(!t||r.node))if(n&&(o=r.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return r}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let s=e;s;s=s.parentNode){let r=this.getDesc(s);if(r)return r.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let s=this.children[t],r=n+s.size;if(n==e&&r!=n){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let a=s.children[o];if(a.size){s=a;break}}return s}if(e<r)return s.descAt(e-n-s.border);n=r}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,s=0;for(let r=0;n<this.children.length;n++){let o=this.children[n],a=r+o.size;if(a>e||o instanceof sf){s=e-r;break}r=a}if(s)return this.children[n].domFromPos(s-this.children[n].border,t);for(let r;n&&!(r=this.children[n-1]).size&&r instanceof nf&&r.side>=0;n--);if(t<=0){let r,o=!0;for(;r=n?this.children[n-1]:null,!(!r||r.dom.parentNode==this.contentDOM);n--,o=!1);return r&&t&&o&&!r.border&&!r.domAtom?r.domFromPos(r.size,t):{node:this.contentDOM,offset:r?Ht(r.dom)+1:0}}else{let r,o=!0;for(;r=n<this.children.length?this.children[n]:null,!(!r||r.dom.parentNode==this.contentDOM);n++,o=!1);return r&&o&&!r.border&&!r.domAtom?r.domFromPos(0,t):{node:this.contentDOM,offset:r?Ht(r.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,r=-1;for(let o=n,a=0;;a++){let l=this.children[a],c=o+l.size;if(s==-1&&e<=c){let u=o+l.border;if(e>=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,u);e=o;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){s=Ht(d.dom)+1;break}e-=d.size}s==-1&&(s=0)}if(s>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){r=Ht(f.dom);break}t+=f.size}r==-1&&(r=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:t,fromOffset:s,toOffset:r}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);
vendor: 4,414 bytes, lines 12-13
12if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,s=!1){let r=Math.min(e,t),o=Math.max(e,t);for(let p=0,g=0;p<this.children.length;p++){let h=this.children[p],m=g+h.size;if(r>g&&o<m)return h.setSelection(e-g-h.border,t-g-h.border,n,s);g=m}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),u=n.domSelectionRange(),f=!1;if((Rn||Zt)&&e==t){let{node:p,offset:g}=a;if(p.nodeType==3){if(f=!!(g&&p.nodeValue[g-1]==`
13`),f&&g==p.nodeValue.length)for(let h=p,m;h;h=h.parentNode){if(m=h.nextSibling){m.nodeName=="BR"&&(a=l={node:m.parentNode,offset:Ht(m)+1});break}let y=h.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let h=p.childNodes[g-1];f=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(Rn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(s=!0)}if(!(s||f&&Zt)&&hs(a.node,a.offset,u.anchorNode,u.anchorOffset)&&hs(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(f&&Rn)){c.collapse(a.node,a.offset);try{e!=t&&c.extend(l.node,l.offset),d=!0}catch(p){}}if(!d){if(e>t){let g=a;a=l,l=g}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,s=0;s<this.children.length;s++){let r=this.children[s],o=n+r.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let a=n+r.border,l=o-r.border;if(e>=a&&t<=l){this.dirty=e==n||t==o?Qi:zc,e==a&&t==l&&(r.contentLost||r.dom.parentNode!=this.contentDOM)?r.dirty=qn:r.markDirty(e-a,t-a);return}else r.dirty=r.dom==r.contentDOM&&r.dom.parentNode==this.contentDOM&&!r.children.length?Qi:qn}n=o}this.dirty=Qi}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Qi:zc;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class nf extends Sr{constructor(e,t,n,s){let r,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!r)return s;if(r.parent)return r.parent.posBeforeChild(r)})),!t.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return this.dirty==On&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Oy extends Sr{constructor(e,t,n,s){super(e,[],t,null),this.textDOM=n,this.text=s}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ps extends Sr{constructor(e,t,n,s,r){super(e,[],n,s),this.mark=t,this.spec=r}static create(e,t,n,s){let r=s.nodeViews[t.type.name],o=r&&r(t,s,n);return(!o||!o.dom)&&(o=gs.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new ps(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&qn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=qn&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=On){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=On}}slice(e,t,n){let s=ps.create(this.parent,this.mark,!0,n),r=this.children,o=this.size;t<o&&(r=Ga(r,t,o,n)),e>0&&(r=Ga(r,0,e,n));for(let a=0;a<r.length;a++)r[a].parent=s;return s.children=r,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ki extends Sr{constructor(e,t,n,s,r,o,a,l,c){super(e,[],r,o),this.node=t,this.outerDeco=n,this.innerDeco=s,this.nodeDOM=a}
vendor: 24,343 bytes, line 13
13static create(e,t,n,s,r,o){let a=r.nodeViews[t.type.name],l,c=a&&a(t,r,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,s),u=c&&c.dom,f=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=gs.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=af(u,n,t),c?l=new Dy(e,t,n,s,u,f||null,d,c,r,o+1):t.isText?new Oo(e,t,n,s,u,d,r):new ki(e,t,n,s,u,f||null,d,r,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>we.empty)}return e}matchesNode(e,t,n){return this.dirty==On&&e.eq(this.node)&&ao(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,s=t,r=e.composing?this.localCompositionInfo(e,t):null,o=r&&r.pos>-1?r:null,a=r&&r.pos<0,l=new ky(this,o&&o.node,e);Uy(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?vt.none:this.node.child(u).marks,n,e),l.placeWidget(c,e,s)},(c,u,f,d)=>{l.syncToMarks(c.marks,n,e);let p;l.findNodeMatch(c,u,f,d)||a&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(p=l.findIndexWithChild(r.node))>-1&&l.updateNodeAt(c,u,f,p,e)||l.updateNextNode(c,u,f,e,d,s)||l.addNode(c,u,f,e,s),s+=c.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Qi)&&(o&&this.protectLocalComposition(e,o),rf(this.contentDOM,this.children,e),Ns&&Py(this.dom))}localCompositionInfo(e,t){let{from:n,to:s}=e.state.selection;if(!(e.state.selection instanceof Xe)||n<t||s>t+this.node.content.size)return null;let r=e.input.compositionNode;if(!r||!this.dom.contains(r.parentNode))return null;if(this.node.inlineContent){let o=r.nodeValue,a=Vy(this.node.content,o,n-t,s-t);return a<0?null:{node:r,pos:a,text:o}}else return{node:r,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:s}){if(this.getDesc(t))return;let r=t;for(;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=void 0)}let o=new Oy(this,r,t,s);e.input.compositionNodes.push(o),this.children=Ga(this.children,n,n+s.length,e,o)}update(e,t,n,s){return this.dirty==qn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,s),!0)}updateInner(e,t,n,s){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=On}updateOuterDeco(e){if(ao(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=of(this.dom,this.nodeDOM,Fa(this.outerDeco,this.node,t),Fa(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Kc(i,e,t,n,s){af(n,e,i);let r=new ki(void 0,i,e,t,n,n,n,s,0);return r.contentDOM&&r.updateChildren(s,0),r}class Oo extends ki{constructor(e,t,n,s,r,o,a){super(e,t,n,s,r,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,s){return this.dirty==qn||this.dirty!=On&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=On||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=On,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let s=this.node.cut(e,t),r=document.createTextNode(s.text);return new Oo(this.parent,s,this.outerDeco,this.innerDeco,r,r,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=qn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class sf extends Sr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==On&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Dy extends ki{constructor(e,t,n,s,r,o,a,l,c,u){super(e,t,n,s,r,o,a,c,u),this.spec=l}update(e,t,n,s){if(this.dirty==qn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let r=this.spec.update(e,t,n);return r&&this.updateInner(e,t,n,s),r}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,s){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function rf(i,e,t){let n=i.firstChild,s=!1;for(let r=0;r<e.length;r++){let o=e[r],a=o.dom;if(a.parentNode==i){for(;a!=n;)n=Yc(n),s=!0;n=n.nextSibling}else s=!0,i.insertBefore(a,n);if(o instanceof ps){let l=n?n.previousSibling:i.lastChild;rf(o.contentDOM,o.children,t),n=l?l.nextSibling:i.firstChild}}for(;n;)n=Yc(n),s=!0;s&&t.trackWrites==i&&(t.trackWrites=null)}const nr=function(i){i&&(this.nodeName=i)};nr.prototype=Object.create(null);const Zi=[new nr];function Fa(i,e,t){if(i.length==0)return Zi;let n=t?Zi[0]:new nr,s=[n];for(let r=0;r<i.length;r++){let o=i[r].type.attrs;if(o){o.nodeName&&s.push(n=new nr(o.nodeName));for(let a in o){let l=o[a];l!=null&&(t&&s.length==1&&s.push(n=new nr(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return s}function of(i,e,t,n){if(t==Zi&&n==Zi)return e;let s=e;for(let r=0;r<n.length;r++){let o=n[r],a=t[r];if(r){let l;a&&a.nodeName==o.nodeName&&s!=i&&(l=s.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(s),a=Zi[0]),s=l}My(s,a||Zi[0],o)}return s}function My(i,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&i.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&i.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],s=t.class?t.class.split(" ").filter(Boolean):[];for(let r=0;r<n.length;r++)s.indexOf(n[r])==-1&&i.classList.remove(n[r]);for(let r=0;r<s.length;r++)n.indexOf(s[r])==-1&&i.classList.add(s[r]);i.classList.length==0&&i.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=n.exec(e.style);)i.style.removeProperty(s[1])}t.style&&(i.style.cssText+=t.style)}}function af(i,e,t){return of(i,i,Zi,Fa(e,t,i.nodeType!=1))}function ao(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(!i[t].type.eq(e[t].type))return!1;return!0}function Yc(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}class ky{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Ny(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let s=0,r=this.stack.length>>1,o=Math.min(r,e.length);for(;s<o&&(s==r-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<r;)this.destroyRest(),this.top.dirty=On,this.index=this.stack.pop(),this.top=this.stack.pop(),r--;for(;r<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[r])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ps.create(this.top,e[r],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,r++}}findNodeMatch(e,t,n,s){let r=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))r=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,t,n)&&!this.preMatch.matched.has(c)){r=a;break}}return r<0?!1:(this.destroyBetween(this.index,r),this.index++,!0)}updateNodeAt(e,t,n,s,r){let o=this.top.children[s];return o.dirty==qn&&o.dom==o.contentDOM&&(o.dirty=Qi),o.update(e,t,n,r)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==n)return s}return-1}e=t}}updateNextNode(e,t,n,s,r,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ki){let c=this.preMatch.matched.get(l);if(c!=null&&c!=r)return!1;let u=l.dom,f,d=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=qn&&ao(t,l.outerDeco));if(!d&&l.update(e,t,n,s))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,e,t,n,s,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Qi,f.updateChildren(s,o+1),f.dirty=On),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,s,r,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ao(n,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=ki.create(this.top,t,n,s,r,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,n,s,r){let o=ki.create(this.top,e,t,n,s,r);o.contentDOM&&o.updateChildren(s,r+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let r=new nf(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ps;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Oo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Zt||Pt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let s=new sf(this.top,[],n,null);t!=this.top?t.children.push(s):t.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Ny(i,e){let t=e,n=t.children.length,s=i.childCount,r=new Map,o=[];e:for(;s>0;){let a;for(;;)if(n){let c=t.children[n-1];if(c instanceof ps)t=c,n=c.children.length;else{a=c,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=i.child(s-1))break;--s,r.set(a,s),o.push(a)}}return{index:s,matched:r,matches:o.reverse()}}function xy(i,e){return i.type.side-e.type.side}function Uy(i,e,t,n){let s=e.locals(i),r=0;if(s.length==0){for(let c=0;c<i.childCount;c++){let u=i.child(c);n(u,s,e.forChild(r,u),c),r+=u.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let u,f;for(;o<s.length&&s[o].to==r;){let m=s[o++];m.widget&&(u?(f||(f=[u])).push(m):u=m)}if(u)if(f){f.sort(xy);for(let m=0;m<f.length;m++)t(f[m],c,!!l)}else t(u,c,!!l);let d,p;if(l)p=-1,d=l,l=null;else if(c<i.childCount)p=c,d=i.child(c++);else break;for(let m=0;m<a.length;m++)a[m].to<=r&&a.splice(m--,1);for(;o<s.length&&s[o].from<=r&&s[o].to>r;)a.push(s[o++]);let g=r+d.nodeSize;if(d.isText){let m=g;o<s.length&&s[o].from<m&&(m=s[o].from);for(let y=0;y<a.length;y++)a[y].to<m&&(m=a[y].to);m<g&&(l=d.cut(m-r),d=d.cut(0,m-r),g=m,p=-1)}else for(;o<s.length&&s[o].to<g;)o++;let h=d.isInline&&!d.isLeaf?a.filter(m=>!m.inline):a.slice();n(d,h,e.forChild(r,d),p),r=g}}function Py(i){if(i.nodeName=="UL"||i.nodeName=="OL"){let e=i.style.cssText;i.style.cssText=e+"; list-style: square !important",window.getComputedStyle(i).listStyle,i.style.cssText=e}}function Vy(i,e,t,n){for(let s=0,r=0;s<i.childCount&&r<=n;){let o=i.child(s++),a=r;if(r+=o.nodeSize,!o.isText)continue;let l=o.text;for(;s<i.childCount;){let c=i.child(s++);if(r+=c.nodeSize,!c.isText)break;l+=c.text}if(r>=t){if(r>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=t)return a+c;if(t==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function Ga(i,e,t,n,s){let r=[];for(let o=0,a=0;o<i.length;o++){let l=i[o],c=a,u=a+=l.size;c>=t||u<=e?r.push(l):(c<e&&r.push(l.slice(0,e-c,n)),s&&(r.push(s),s=void 0),u>t&&r.push(l.slice(t-c,l.size,n)))}return r}function Sl(i,e=null){let t=i.domSelectionRange(),n=i.state.doc;if(!t.focusNode)return null;let s=i.docView.nearestDesc(t.focusNode),r=s&&s.size==0,o=i.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=n.resolve(o),l,c;if(Ro(t)){for(l=o;s&&!s.node;)s=s.parent;let f=s.node;if(s&&f.isAtom&&je.isSelectable(f)&&s.parent&&!(f.isInline&&dy(t.focusNode,t.focusOffset,s.dom))){let d=s.posBefore;c=new je(o==d?a:n.resolve(d))}}else{if(t instanceof i.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=o,d=o;for(let p=0;p<t.rangeCount;p++){let g=t.getRangeAt(p);f=Math.min(f,i.docView.posFromDOM(g.startContainer,g.startOffset,1)),d=Math.max(d,i.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(f<0)return null;[l,o]=d==i.state.selection.anchor?[d,f]:[f,d],a=n.resolve(o)}else l=i.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let u=n.resolve(l);if(!c){let f=e=="pointer"||i.state.selection.head<a.pos&&!r?1:-1;c=Tl(i,u,a,f)}return c}function lf(i){return i.editable?i.hasFocus():uf(i)&&document.activeElement&&document.activeElement.contains(i.dom)}function ui(i,e=!1){let t=i.state.selection;if(cf(i,t),!!lf(i)){if(!e&&i.input.mouseDown&&i.input.mouseDown.allowDefault&&Pt){let n=i.domSelectionRange(),s=i.domObserver.currentSelection;if(n.anchorNode&&s.anchorNode&&hs(n.anchorNode,n.anchorOffset,s.anchorNode,s.anchorOffset)){i.input.mouseDown.delayedSelectionSync=!0,i.domObserver.setCurSelection();return}}if(i.domObserver.disconnectSelection(),i.cursorWrapper)Fy(i);else{let{anchor:n,head:s}=t,r,o;qc&&!(t instanceof Xe)&&(t.$from.parent.inlineContent||(r=Jc(i,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=Jc(i,t.to))),i.docView.setSelection(n,s,i,e),qc&&(r&&Qc(r),o&&Qc(o)),t.visible?i.dom.classList.remove("ProseMirror-hideselection"):(i.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&By(i))}i.domObserver.setCurSelection(),i.domObserver.connectSelection()}}const qc=Zt||Pt&&Y0<63;function Jc(i,e){let{node:t,offset:n}=i.docView.domFromPos(e,0),s=n<t.childNodes.length?t.childNodes[n]:null,r=n?t.childNodes[n-1]:null;if(Zt&&s&&s.contentEditable=="false")return ra(s);if((!s||s.contentEditable=="false")&&(!r||r.contentEditable=="false")){if(s)return ra(s);if(r)return ra(r)}}function ra(i){return i.contentEditable="true",Zt&&i.draggable&&(i.draggable=!1,i.wasDraggable=!0),i}function Qc(i){i.contentEditable="false",i.wasDraggable&&(i.draggable=!0,i.wasDraggable=null)}function By(i){let e=i.dom.ownerDocument;e.removeEventListener("selectionchange",i.input.hideSelectionGuard);let t=i.domSelectionRange(),n=t.anchorNode,s=t.anchorOffset;e.addEventListener("selectionchange",i.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=s)&&(e.removeEventListener("selectionchange",i.input.hideSelectionGuard),setTimeout(()=>{(!lf(i)||i.state.selection.visible)&&i.dom.classList.remove("ProseMirror-hideselection")},20))})}function Fy(i){let e=i.domSelection();if(!e)return;let t=i.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,Ht(t)+1):e.collapse(t,0),!n&&!i.state.selection.visible&&an&&Mi<=11&&(t.disabled=!0,t.disabled=!1)}function cf(i,e){if(e instanceof je){let t=i.docView.descAt(e.from);t!=i.lastSelectedViewDesc&&(Zc(i),t&&t.selectNode(),i.lastSelectedViewDesc=t)}else Zc(i)}function Zc(i){i.lastSelectedViewDesc&&(i.lastSelectedViewDesc.parent&&i.lastSelectedViewDesc.deselectNode(),i.lastSelectedViewDesc=void 0)}function Tl(i,e,t,n){return i.someProp("createSelectionBetween",s=>s(i,e,t))||Xe.between(e,t,n)}function Xc(i){return i.editable&&!i.hasFocus()?!1:uf(i)}function uf(i){let e=i.domSelectionRange();if(!e.anchorNode)return!1;try{return i.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(i.editable||i.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Gy(i){let e=i.docView.domFromPos(i.state.selection.anchor,0),t=i.domSelectionRange();return hs(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Ha(i,e){let{$anchor:t,$head:n}=i.selection,s=e>0?t.max(n):t.min(n),r=s.parent.inlineContent?s.depth?i.doc.resolve(e>0?s.after():s.before()):null:s;return r&&ot.findFrom(r,e)}function yi(i,e){return i.dispatch(i.state.tr.setSelection(e).scrollIntoView()),!0}function eu(i,e,t){let n=i.state.selection;if(n instanceof Xe)if(t.indexOf("s")>-1){let{$head:s}=n,r=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!r||r.isText||!r.isLeaf)return!1;let o=i.state.doc.resolve(s.pos+r.nodeSize*(e<0?-1:1));return yi(i,new Xe(n.$anchor,o))}else if(n.empty){if(i.endOfTextblock(e>0?"forward":"backward")){let s=Ha(i.state,e);return s&&s instanceof je?yi(i,s):!1}else if(!(wn&&t.indexOf("m")>-1)){let s=n.$head,r=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!r||r.isText)return!1;let a=e<0?s.pos-r.nodeSize:s.pos;return r.isAtom||(o=i.docView.descAt(a))&&!o.contentDOM?je.isSelectable(r)?yi(i,new je(e<0?i.state.doc.resolve(s.pos-r.nodeSize):s)):Er?yi(i,new Xe(i.state.doc.resolve(e<0?a:a+r.nodeSize))):!1:!1}}else return!1;else{if(n instanceof je&&n.node.isInline)return yi(i,new Xe(e>0?n.$to:n.$from));{let s=Ha(i.state,e);return s?yi(i,s):!1}}}function lo(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function ir(i,e){let t=i.pmViewDesc;return t&&t.size==0&&(e<0||i.nextSibling||i.nodeName!="BR")}function _s(i,e){return e<0?Hy(i):$y(i)}function Hy(i){let e=i.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let s,r,o=!1;for(Rn&&t.nodeType==1&&n<lo(t)&&ir(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let a=t.childNodes[n-1];if(ir(a,-1))s=t,r=--n;else if(a.nodeType==3)t=a,n=t.nodeValue.length;else break}}else{if(df(t))break;{let a=t.previousSibling;for(;a&&ir(a,-1);)s=t.parentNode,r=Ht(a),a=a.previousSibling;if(a)t=a,n=lo(t);else{if(t=t.parentNode,t==i.dom)break;n=0}}}o?$a(i,t,n):s&&$a(i,s,r)}function $y(i){let e=i.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let s=lo(t),r,o;for(;;)if(n<s){if(t.nodeType!=1)break;let a=t.childNodes[n];if(ir(a,1))r=t,o=++n;else break}else{if(df(t))break;{let a=t.nextSibling;for(;a&&ir(a,1);)r=a.parentNode,o=Ht(a)+1,a=a.nextSibling;if(a)t=a,n=0,s=lo(t);else{if(t=t.parentNode,t==i.dom)break;n=s=0}}}r&&$a(i,r,o)}function df(i){let e=i.pmViewDesc;return e&&e.node&&e.node.isBlock}function jy(i,e){for(;i&&e==i.childNodes.length&&!Ir(i);)e=Ht(i)+1,i=i.parentNode;for(;i&&e<i.childNodes.length;){let t=i.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;i=t,e=0}}function Wy(i,e){for(;i&&!e&&!Ir(i);)e=Ht(i),i=i.parentNode;for(;i&&e;){let t=i.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;i=t,e=i.childNodes.length}}function $a(i,e,t){if(e.nodeType!=3){let r,o;(o=jy(e,t))?(e=o,t=0):(r=Wy(e,t))&&(e=r,t=r.nodeValue.length)}let n=i.domSelection();if(!n)return;if(Ro(n)){let r=document.createRange();r.setEnd(e,t),r.setStart(e,t),n.removeAllRanges(),n.addRange(r)}else n.extend&&n.extend(e,t);i.domObserver.setCurSelection();let{state:s}=i;setTimeout(()=>{i.state==s&&ui(i)},50)}function tu(i,e){let t=i.state.doc.resolve(e);if(!(Pt||q0)&&t.parent.inlineContent){let s=i.coordsAtPos(e);if(e>t.start()){let r=i.coordsAtPos(e-1),o=(r.top+r.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(r.left-s.left)>1)return r.left<s.left?"ltr":"rtl"}if(e<t.end()){let r=i.coordsAtPos(e+1),o=(r.top+r.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(r.left-s.left)>1)return r.left>s.left?"ltr":"rtl"}}return getComputedStyle(i.dom).direction=="rtl"?"rtl":"ltr"}function nu(i,e,t){let n=i.state.selection;if(n instanceof Xe&&!n.empty||t.indexOf("s")>-1||wn&&t.indexOf("m")>-1)return!1;let{$from:s,$to:r}=n;if(!s.parent.inlineContent||i.endOfTextblock(e<0?"up":"down")){let o=Ha(i.state,e);if(o&&o instanceof je)return yi(i,o)}if(!s.parent.inlineContent){let o=e<0?s:r,a=n instanceof Cn?ot.near(o,e):ot.findFrom(o,e);return a?yi(i,a):!1}return!1}function iu(i,e){if(!(i.state.selection instanceof Xe))return!0;let{$head:t,$anchor:n,empty:s}=i.state.selection;if(!t.sameParent(n))return!0;if(!s)return!1;if(i.endOfTextblock(e>0?"forward":"backward"))return!0;let r=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(r&&!r.isText){let o=i.state.tr;return e<0?o.delete(t.pos-r.nodeSize,t.pos):o.delete(t.pos,t.pos+r.nodeSize),i.dispatch(o),!0}return!1}function su(i,e,t){i.domObserver.stop(),e.contentEditable=t,i.domObserver.start()}function zy(i){if(!Zt||i.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=i.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;su(i,n,"true"),setTimeout(()=>su(i,n,"false"),20)}return!1}function Ky(i){let e="";return i.ctrlKey&&(e+="c"),i.metaKey&&(e+="m"),i.altKey&&(e+="a"),i.shiftKey&&(e+="s"),e}function Yy(i,e){let t=e.keyCode,n=Ky(e);if(t==8||wn&&t==72&&n=="c")return iu(i,-1)||_s(i,-1);if(t==46&&!e.shiftKey||wn&&t==68&&n=="c")return iu(i,1)||_s(i,1);if(t==13||t==27)return!0;if(t==37||wn&&t==66&&n=="c"){let s=t==37?tu(i,i.state.selection.from)=="ltr"?-1:1:-1;return eu(i,s,n)||_s(i,s)}else if(t==39||wn&&t==70&&n=="c"){let s=t==39?tu(i,i.state.selection.from)=="ltr"?1:-1:1;return eu(i,s,n)||_s(i,s)}else{if(t==38||wn&&t==80&&n=="c")return nu(i,-1,n)||_s(i,-1);if(t==40||wn&&t==78&&n=="c")return zy(i)||nu(i,1,n)||_s(i,1);if(n==(wn?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ll(i,e){i.someProp("transformCopied",p=>{e=p(e,i)});let t=[],{content:n,openStart:s,openEnd:r}=e;for(;s>1&&r>1&&n.childCount==1&&n.firstChild.childCount==1;){s--,r--;let p=n.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let o=i.someProp("clipboardSerializer")||gs.fromSchema(i.state.schema),a=vf(),l=a.createElement("div");l.appendChild(o.serializeFragment(n,{document:a}));
vendor: 4,385 bytes, lines 13-16
13let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=mf[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let g=a.createElement(u[p]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${r}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=i.someProp("clipboardTextSerializer",p=>p(e,i))||e.content.textBetween(0,e.content.size,`
14
15`);return{dom:l,text:d,slice:e}}function ff(i,e,t,n,s){let r=s.parent.type.spec.code,o,a;if(!t&&!e)return null;let l=!!e&&(n||r||!t);if(l){if(i.someProp("transformPastedText",d=>{e=d(e,r||n,i)}),r)return a=new Me(we.from(i.state.schema.text(e.replace(/\r\n?/g,`
16`))),0,0),i.someProp("transformPasted",d=>{a=d(a,i,!0)}),a;let f=i.someProp("clipboardTextParser",d=>d(e,s,n,i));if(f)a=f;else{let d=s.marks(),{schema:p}=i.state,g=gs.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(h=>{let m=o.appendChild(document.createElement("p"));h&&m.appendChild(g.serializeNode(p.text(h,d)))})}}else i.someProp("transformPastedHTML",f=>{t=f(t,i)}),o=Zy(t),Er&&Xy(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(a||(a=(i.someProp("clipboardParser")||i.someProp("domParser")||Di.fromSchema(i.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:s,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!qy.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=eI(ru(a,+u[1],+u[2]),u[4]);else if(a=Me.maxOpen(Jy(a.content,s),!0),a.openStart||a.openEnd){let f=0,d=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;d<a.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);a=ru(a,f,d)}return i.someProp("transformPasted",f=>{a=f(a,i,l)}),a}const qy=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Jy(i,e){if(i.childCount<2)return i;for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.index(t)),r,o=[];if(i.forEach(a=>{if(!o)return;let l=s.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&r.length&&pf(l,r,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=gf(o[o.length-1],r.length));let u=hf(a,l);o.push(u),s=s.matchType(u.type),r=l}}),o)return we.from(o)}return i}function hf(i,e,t=0){for(let n=e.length-1;n>=t;n--)i=e[n].create(null,we.from(i));return i}function pf(i,e,t,n,s){if(s<i.length&&s<e.length&&i[s]==e[s]){let r=pf(i,e,t,n.lastChild,s+1);if(r)return n.copy(n.content.replaceChild(n.childCount-1,r));if(n.contentMatchAt(n.childCount).matchType(s==i.length-1?t.type:i[s+1]))return n.copy(n.content.append(we.from(hf(t,i,s+1))))}}function gf(i,e){if(e==0)return i;let t=i.content.replaceChild(i.childCount-1,gf(i.lastChild,e-1)),n=i.contentMatchAt(i.childCount).fillBefore(we.empty,!0);return i.copy(t.append(n))}function ja(i,e,t,n,s,r){let o=e<0?i.firstChild:i.lastChild,a=o.content;return i.childCount>1&&(r=0),s<n-1&&(a=ja(a,e,t,n,s+1,r)),s>=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,r<=s).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(we.empty,!0))),i.replaceChild(e<0?0:i.childCount-1,o.copy(a))}function ru(i,e,t){return e<i.openStart&&(i=new Me(ja(i.content,-1,e,i.openStart,0,i.openEnd),e,i.openEnd)),t<i.openEnd&&(i=new Me(ja(i.content,1,t,i.openEnd,0,0),i.openStart,t)),i}const mf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ou=null;function vf(){return ou||(ou=document.implementation.createHTMLDocument("title"))}let oa=null;function Qy(i){let e=window.trustedTypes;return e?(oa||(oa=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),oa.createHTML(i)):i}function Zy(i){let e=/^(\s*<meta [^>]*>)*/.exec(i);e&&(i=i.slice(e[0].length));let t=vf().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(i),s;if((s=n&&mf[n[1].toLowerCase()])&&(i=s.map(r=>"<"+r+">").join("")+i+s.map(r=>"</"+r+">").reverse().join("")),t.innerHTML=Qy(i),s)for(let r=0;r<s.length;r++)t=t.querySelector(s[r])||t;return t}function Xy(i){let e=i.querySelectorAll(Pt?"span:not([class]):not
16([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(i.ownerDocument.createTextNode(" "),n)}}function eI(i,e){if(!i.size)return i;let t=i.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch(a){return i}let{content:s,openStart:r,openEnd:o}=i;for(let a=n.length-2;a>=0;a-=2){let l=t.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;s=we.from(l.create(n[a+1],s)),r++,o++}return new Me(s,r,o)}const nn={},sn={},tI={touchstart:!0,touchmove:!0};class nI{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function iI(i){for(let e in nn){let t=nn[e];i.dom.addEventListener(e,i.input.eventHandlers[e]=n=>{rI(i,n)&&!wl(i,n)&&(i.editable||!(n.type in sn))&&t(i,n)},tI[e]?{passive:!0}:void 0)}Zt&&i.dom.addEventListener("input",()=>null),Wa(i)}function wi(i,e){i.input.lastSelectionOrigin=e,i.input.lastSelectionTime=Date.now()}function sI(i){i.domObserver.stop();for(let e in i.input.eventHandlers)i.dom.removeEventListener(e,i.input.eventHandlers[e]);clearTimeout(i.input.composingTimeout),clearTimeout(i.input.lastIOSEnterFallbackTimeout)}function Wa(i){i.someProp("handleDOMEvents",e=>{for(let t in e)i.input.eventHandlers[t]||i.dom.addEventListener(t,i.input.eventHandlers[t]=n=>wl(i,n))})}function wl(i,e){return i.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(i,e)||e.defaultPrevented:!1})}function rI(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=i.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function oI(i,e){!wl(i,e)&&nn[e.type]&&(i.editable||!(e.type in sn))&&nn[e.type](i,e)}sn.keydown=(i,e)=>{let t=e;if(i.input.shiftKey=t.keyCode==16||t.shiftKey,!_f(i,t)&&(i.input.lastKeyCode=t.keyCode,i.input.lastKeyCodeTime=Date.now(),!(ti&&Pt&&t.keyCode==13)))if(t.keyCode!=229&&i.domObserver.forceFlush(),Ns&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();i.input.lastIOSEnter=n,i.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{i.input.lastIOSEnter==n&&(i.someProp("handleKeyDown",s=>s(i,$i(13,"Enter"))),i.input.lastIOSEnter=0)},200)}else i.someProp("handleKeyDown",n=>n(i,t))||Yy(i,t)?t.preventDefault():wi(i,"key")};sn.keyup=(i,e)=>{e.keyCode==16&&(i.input.shiftKey=!1)};sn.keypress=(i,e)=>{let t=e;if(_f(i,t)||!t.charCode||t.ctrlKey&&!t.altKey||wn&&t.metaKey)return;if(i.someProp("handleKeyPress",s=>s(i,t))){t.preventDefault();return}let n=i.state.selection;if(!(n instanceof Xe)||!n.$from.sameParent(n.$to)){let s=String.fromCharCode(t.charCode),r=()=>i.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!i.someProp("handleTextInput",o=>o(i,n.$from.pos,n.$to.pos,s,r))&&i.dispatch(r()),t.preventDefault()}};function Do(i){return{left:i.clientX,top:i.clientY}}function aI(i,e){let t=e.x-i.clientX,n=e.y-i.clientY;return t*t+n*n<100}function Al(i,e,t,n,s){if(n==-1)return!1;let r=i.state.doc.resolve(n);for(let o=r.depth+1;o>0;o--)if(i.someProp(e,a=>o>r.depth?a(i,t,r.nodeAfter,r.before(o),s,!0):a(i,t,r.node(o),r.before(o),s,!1)))return!0;return!1}function Os(i,e,t){if(i.focused||i.focus(),i.state.selection.eq(e))return;let n=i.state.tr.setSelection(e);n.setMeta("pointer",!0),i.dispatch(n)}function lI(i,e){if(e==-1)return!1;let t=i.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&je.isSelectable(n)?(Os(i,new je(t)),!0):!1}function cI(i,e){if(e==-1)return!1;let t=i.state.selection,n,s;t instanceof je&&(n=t.node);let r=i.state.doc.resolve(e);for(let o=r.depth+1;o>0;o--){let a=o>r.depth?r.nodeAfter:r.node(o);if(je.isSelectable(a)){n&&t.$from.depth>0&&o>=t.$from.depth&&r.before(t.$from.depth+1)==t.$from.pos?s=r.before(t.$from.depth):s=r.before(o);break}}return s!=null?(Os(i,je.create(i.state.doc,s)),!0):!1}function uI(i,e,t,n,s){return Al(i,"handleClickOn",e,t,n)||i.someProp("handleClick",r=>r(i,e,n))||(s?cI(i,t):lI(i,t))}function dI(i,e,t,n){return Al(i,"handleDoubleClickOn",e,t,n)||i.someProp("handleDoubleClick",
vendor: 28,255 bytes, line 16
16s=>s(i,e,n))}function fI(i,e,t,n){return Al(i,"handleTripleClickOn",e,t,n)||i.someProp("handleTripleClick",s=>s(i,e,n))||hI(i,t,n)}function hI(i,e,t){if(t.button!=0)return!1;let n=i.state.doc;if(e==-1)return n.inlineContent?(Os(i,Xe.create(n,0,n.content.size)),!0):!1;let s=n.resolve(e);for(let r=s.depth+1;r>0;r--){let o=r>s.depth?s.nodeAfter:s.node(r),a=s.before(r);if(o.inlineContent)Os(i,Xe.create(n,a+1,a+1+o.content.size));else if(je.isSelectable(o))Os(i,je.create(n,a));else continue;return!0}}function bl(i){return co(i)}const Cf=wn?"metaKey":"ctrlKey";nn.mousedown=(i,e)=>{let t=e;i.input.shiftKey=t.shiftKey;let n=bl(i),s=Date.now(),r="singleClick";s-i.input.lastClick.time<500&&aI(t,i.input.lastClick)&&!t[Cf]&&i.input.lastClick.button==t.button&&(i.input.lastClick.type=="singleClick"?r="doubleClick":i.input.lastClick.type=="doubleClick"&&(r="tripleClick")),i.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:r,button:t.button};let o=i.posAtCoords(Do(t));o&&(r=="singleClick"?(i.input.mouseDown&&i.input.mouseDown.done(),i.input.mouseDown=new pI(i,o,t,!!n)):(r=="doubleClick"?dI:fI)(i,o.pos,o.inside,t)?t.preventDefault():wi(i,"pointer"))};class pI{constructor(e,t,n,s){this.view=e,this.pos=t,this.event=n,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Cf],this.allowDefault=n.shiftKey;let r,o;if(t.inside>-1)r=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);r=u.parent,o=u.depth?u.before():0}const a=s?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(n.button==0&&r.type.spec.draggable&&r.type.spec.selectable!==!1||c instanceof je&&c.from<=o&&c.to>o)&&(this.mightDrag={node:r,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Rn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),wi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ui(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Do(e))),this.updateAllowDefault(e),this.allowDefault||!t?wi(this.view,"pointer"):uI(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Zt&&this.mightDrag&&!this.mightDrag.node.isAtom||Pt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Os(this.view,ot.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):wi(this.view,"pointer")}move(e){this.updateAllowDefault(e),wi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}nn.touchstart=i=>{i.input.lastTouch=Date.now(),bl(i),wi(i,"pointer")};nn.touchmove=i=>{i.input.lastTouch=Date.now(),wi(i,"pointer")};nn.contextmenu=i=>bl(i);function _f(i,e){return i.composing?!0:Zt&&Math.abs(e.timeStamp-i.input.compositionEndedAt)<500?(i.input.compositionEndedAt=-2e8,!0):!1}const gI=ti?5e3:-1;sn.compositionstart=sn.compositionupdate=i=>{if(!i.composing){i.domObserver.flush();let{state:e}=i,t=e.selection.$to;if(e.selection instanceof Xe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||Pt&&q0&&mI(i)))i.markCursor=i.state.storedMarks||t.marks(),co(i,!0),i.markCursor=null;else if(co(i,!e.selection.empty),Rn&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=i.domSelectionRange();for(let s=n.focusNode,r=n.focusOffset;s&&s.nodeType==1&&r!=0;){let o=r<0?s.lastChild:s.childNodes[r-1];if(!o)break;if(o.nodeType==3){let a=i.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else s=o,r=-1}}i.input.composing=!0}yf(i,gI)};function mI(i){let{focusNode:e,focusOffset:t}=i.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}sn.compositionend=(i,e)=>{i.composing&&(i.input.composing=!1,i.input.compositionEndedAt=e.timeStamp,i.input.compositionPendingChanges=i.domObserver.pendingRecords().length?i.input.compositionID:0,i.input.compositionNode=null,i.input.compositionPendingChanges&&Promise.resolve().then(()=>i.domObserver.flush()),i.input.compositionID++,yf(i,20))};function yf(i,e){clearTimeout(i.input.composingTimeout),e>-1&&(i.input.composingTimeout=setTimeout(()=>co(i),e))}function If(i){for(i.composing&&(i.input.composing=!1,i.input.compositionEndedAt=CI());i.input.compositionNodes.length>0;)i.input.compositionNodes.pop().markParentsDirty()}function vI(i){let e=i.domSelectionRange();if(!e.focusNode)return null;let t=cy(e.focusNode,e.focusOffset),n=uy(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let s=n.pmViewDesc,r=i.domObserver.lastChangedTextNode;if(t==r||n==r)return r;if(!s||!s.isText(n.nodeValue))return n;if(i.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function CI(){let i=document.createEvent("Event");return i.initEvent("event",!0,!0),i.timeStamp}function co(i,e=!1){if(!(ti&&i.domObserver.flushingSoon>=0)){if(i.domObserver.forceFlush(),If(i),e||i.docView&&i.docView.dirty){let t=Sl(i),n=i.state.selection;return t&&!t.eq(n)?i.dispatch(i.state.tr.setSelection(t)):(i.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?i.dispatch(i.state.tr.deleteSelection()):i.updateState(i.state),!0}return!1}}function _I(i,e){if(!i.dom.parentNode)return;let t=i.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),s=document.createRange();s.selectNodeContents(e),i.dom.blur(),n.removeAllRanges(),n.addRange(s),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),i.focus()},50)}const fr=an&&Mi<15||Ns&&py<604;nn.copy=sn.cut=(i,e)=>{let t=e,n=i.state.selection,s=t.type=="cut";if(n.empty)return;let r=fr?null:t.clipboardData,o=n.content(),{dom:a,text:l}=Ll(i,o);r?(t.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.setData("text/plain",l)):_I(i,a),s&&i.dispatch(i.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yI(i){return i.openStart==0&&i.openEnd==0&&i.content.childCount==1?i.content.firstChild:null}function II(i,e){if(!i.dom.parentNode)return;let t=i.input.shiftKey||i.state.selection.$from.parent.type.spec.code,n=i.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let s=i.input.shiftKey&&i.input.lastKeyCode!=45;setTimeout(()=>{i.focus(),n.parentNode&&n.parentNode.removeChild(n),t?hr(i,n.value,null,s,e):hr(i,n.textContent,n.innerHTML,s,e)},50)}function hr(i,e,t,n,s){let r=ff(i,e,t,n,i.state.selection.$from);if(i.someProp("handlePaste",l=>l(i,s,r||Me.empty)))return!0;if(!r)return!1;let o=yI(r),a=o?i.state.tr.replaceSelectionWith(o,n):i.state.tr.replaceSelection(r);return i.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ef(i){let e=i.getData("text/plain")||i.getData("Text");if(e)return e;let t=i.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}sn.paste=(i,e)=>{let t=e;if(i.composing&&!ti)return;let n=fr?null:t.clipboardData,s=i.input.shiftKey&&i.input.lastKeyCode!=45;n&&hr(i,Ef(n),n.getData("text/html"),s,t)?t.preventDefault():II(i,t)};class Sf{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const EI=wn?"altKey":"ctrlKey";function Tf(i,e){let t=i.someProp("dragCopies",n=>!n(e));return t!=null?t:!e[EI]}nn.dragstart=(i,e)=>{let t=e,n=i.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let s=i.state.selection,r=s.empty?null:i.posAtCoords(Do(t)),o;if(!(r&&r.pos>=s.from&&r.pos<=(s instanceof je?s.to-1:s.to))){if(n&&n.mightDrag)o=je.create(i.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=i.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=i.docView&&(o=je.create(i.state.doc,f.posBefore))}}let a=(o||i.state.selection).content(),{dom:l,text:c,slice:u}=Ll(i,a);(!t.dataTransfer.files.length||!Pt||Y0>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fr?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",fr||t.dataTransfer.setData("text/plain",c),i.dragging=new Sf(u,Tf(i,t),o)};nn.dragend=i=>{let e=i.dragging;window.setTimeout(()=>{i.dragging==e&&(i.dragging=null)},50)};sn.dragover=sn.dragenter=(i,e)=>e.preventDefault();sn.drop=(i,e)=>{try{SI(i,e,i.dragging)}finally{i.dragging=null}};function SI(i,e,t){if(!e.dataTransfer)return;let n=i.posAtCoords(Do(e));if(!n)return;let s=i.state.doc.resolve(n.pos),r=t&&t.slice;r?i.someProp("transformPasted",p=>{r=p(r,i,!1)}):r=ff(i,Ef(e.dataTransfer),fr?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(t&&Tf(i,e));if(i.someProp("handleDrop",p=>p(i,e,r||Me.empty,o))){e.preventDefault();return}if(!r)return;e.preventDefault();let a=r?q_(i.state.doc,s.pos,r):s.pos;a==null&&(a=s.pos);let l=i.state.tr;if(o){let{node:p}=t;p?p.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=r.openStart==0&&r.openEnd==0&&r.content.childCount==1,f=l.doc;if(u?l.replaceRangeWith(c,c,r.content.firstChild):l.replaceRange(c,c,r),l.doc.eq(f))return;let d=l.doc.resolve(c);if(u&&je.isSelectable(r.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(r.content.firstChild))l.setSelection(new je(d));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((g,h,m,y)=>p=y),l.setSelection(Tl(i,d,l.doc.resolve(p)))}i.focus(),i.dispatch(l.setMeta("uiEvent","drop"))}nn.focus=i=>{i.input.lastFocus=Date.now(),i.focused||(i.domObserver.stop(),i.dom.classList.add("ProseMirror-focused"),i.domObserver.start(),i.focused=!0,setTimeout(()=>{i.docView&&i.hasFocus()&&!i.domObserver.currentSelection.eq(i.domSelectionRange())&&ui(i)},20))};nn.blur=(i,e)=>{let t=e;i.focused&&(i.domObserver.stop(),i.dom.classList.remove("ProseMirror-focused"),i.domObserver.start(),t.relatedTarget&&i.dom.contains(t.relatedTarget)&&i.domObserver.currentSelection.clear(),i.focused=!1)};nn.beforeinput=(i,e)=>{if(Pt&&ti&&e.inputType=="deleteContentBackward"){i.domObserver.flushSoon();let{domChangeCount:n}=i.input;setTimeout(()=>{if(i.input.domChangeCount!=n||(i.dom.blur(),i.focus(),i.someProp("handleKeyDown",r=>r(i,$i(8,"Backspace")))))return;let{$cursor:s}=i.state.selection;s&&s.pos>0&&i.dispatch(i.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let i in sn)nn[i]=sn[i];function pr(i,e){if(i==e)return!0;for(let t in i)if(i[t]!==e[t])return!1;for(let t in e)if(!(t in i))return!1;return!0}class uo{constructor(e,t){this.toDOM=e,this.spec=t||as,this.side=this.spec.side||0}map(e,t,n,s){let{pos:r,deleted:o}=e.mapResult(t.from+s,this.side<0?-1:1);return o?null:new vn(r-n,r-n,this)}valid(){return!0}eq(e){return this==e||e instanceof uo&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&pr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ni{constructor(e,t){this.attrs=e,this.spec=t||as}map(e,t,n,s){let r=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-n;return r>=o?null:new vn(r,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Ni&&pr(this.attrs,e.attrs)&&pr(this.spec,e.spec)}static is(e){return e.type instanceof Ni}destroy(){}}class Rl{constructor(e,t){this.attrs=e,this.spec=t||as}map(e,t,n,s){let r=e.mapResult(t.from+s,1);if(r.deleted)return null;let o=e.mapResult(t.to+s,-1);return o.deleted||o.pos<=r.pos?null:new vn(r.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:s}=e.content.findIndex(t.from),r;return s==t.from&&!(r=e.child(n)).isText&&s+r.nodeSize==t.to}eq(e){return this==e||e instanceof Rl&&pr(this.attrs,e.attrs)&&pr(this.spec,e.spec)}destroy(){}}class vn{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new vn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new vn(e,e,new uo(t,n))}static inline(e,t,n,s){return new vn(e,t,new Ni(n,s))}static node(e,t,n,s){return new vn(e,t,new Rl(n,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ni}get widget(){return this.type instanceof uo}}const Ss=[],as={};class At{constructor(e,t){this.local=e.length?e:Ss,this.children=t.length?t:Ss}static create(e,t){return t.length?fo(t,e,0,as):Kt}find(e,t,n){let s=[];return this.findInner(e==null?0:e,t==null?1e9:t,s,0,n),s}findInner(e,t,n,s,r){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!r||r(a.spec))&&n.push(a.copy(a.from+s,a.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,n,s+a,r)}}map(e,t,n){return this==Kt||e.maps.length==0?this:this.mapInner(e,t,0,0,n||as)}mapInner(e,t,n,s,r){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,s);l&&l.type.valid(t,l)?(o||(o=[])).push(l):r.onRemove&&r.onRemove(this.local[a].spec)}return this.children.length?TI(this.children,o||[],e,t,n,s,r):o?new At(o.sort(ls),Ss):Kt}add(e,t){return t.length?this==Kt?At.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let s,r=0;e.forEach((a,l)=>{let c=l+n,u;if(u=wf(t,a,c)){for(s||(s=this.children.slice());r<s.length&&s[r]<l;)r+=3;s[r]==l?s[r+2]=s[r+2].addInner(a,u,c+1):s.splice(r,0,l,l+a.nodeSize,fo(u,a,c+1,as)),r+=3}});let o=Lf(r?Af(t):t,-n);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new At(o.length?this.local.concat(o).sort(ls):this.local,s||this.children)}remove(e){return e.length==0||this==Kt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,s=this.local;for(let r=0;r<n.length;r+=3){let o,a=n[r]+t,l=n[r+1]+t;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(o||(o=[])).push(f));if(!o)continue;n==this.children&&(n=this.children.slice());let c=n[r+2].removeInner(o,a+1);c!=Kt?n[r+2]=c:(n.splice(r,3),r-=3)}if(s.length){for(let r=0,o;r<e.length;r++)if(o=e[r])for(let a=0;a<s.length;a++)s[a].eq(o,t)&&(s==this.local&&(s=this.local.slice()),s.splice(a--,1))}return n==this.children&&s==this.local?this:s.length||n.length?new At(s,n):Kt}forChild(e,t){if(this==Kt)return this;if(t.isLeaf)return At.empty;let n,s;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let r=e+1,o=r+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>r&&l.type instanceof Ni){let c=Math.max(r,l.from)-r,u=Math.min(o,l.to)-r;c<u&&(s||(s=[])).push(l.copy(c,u))}}if(s){let a=new At(s.sort(ls),Ss);return n?new Ei([a,n]):a}return n||Kt}eq(e){if(this==e)return!0;if(!(e instanceof At)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Ol(this.localsInner(e))}localsInner(e){if(this==Kt)return Ss;if(e.inlineContent||!this.local.some(Ni.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Ni||t.push(this.local[n]);return t}forEachSet(e){e(this)}}At.empty=new At([],[]);At.removeOverlap=Ol;const Kt=At.empty;class Ei{constructor(e){this.members=e}map(e,t){const n=this.members.map(s=>s.map(e,t,as));return Ei.from(n)}forChild(e,t){if(t.isLeaf)return At.empty;let n=[];for(let s=0;s<this.members.length;s++){let r=this.members[s].forChild(e,t);r!=Kt&&(r instanceof Ei?n=n.concat(r.members):n.push(r))}return Ei.from(n)}eq(e){if(!(e instanceof Ei)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let s=0;s<this.members.length;s++){let r=this.members[s].localsInner(e);if(r.length)if(!t)t=r;else{n&&(t=t.slice(),n=!1);for(let o=0;o<r.length;o++)t.push(r[o])}}return t?Ol(n?t:t.sort(ls)):Ss}static from(e){switch(e.length){case 0:return Kt;case 1:return e[0];default:return new Ei(e.every(t=>t instanceof At)?e:e.reduce((t,n)=>t.concat(n instanceof At?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function TI(i,e,t,n,s,r,o){let a=i.slice();for(let c=0,u=r;c<t.maps.length;c++){let f=0;t.maps[c].forEach((d,p,g,h)=>{let m=h-g-(p-d);for(let y=0;y<a.length;y+=3){let R=a[y+1];if(R<0||d>R+u-f)continue;let I=a[y]+u-f;p>=I?a[y+1]=d<=I?-2:-1:d>=u&&m&&(a[y]+=m,a[y+1]+=m)}f+=m}),u=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=t.map(i[c]+r),f=u-s;if(f<0||f>=n.content.size){l=!0;continue}let d=t.map(i[c+1]+r,-1),p=d-s,{index:g,offset:h}=n.content.findIndex(f),m=n.maybeChild(g);if(m&&h==f&&h+m.nodeSize==p){let y=a[c+2].mapInner(t,m,u+1,i[c]+r+1,o);y!=Kt?(a[c]=f,a[c+1]=p,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=LI(a,i,e,t,s,r,o),u=fo(c,n,0,o);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,d=0;f<u.children.length;f+=3){let p=u.children[f];for(;d<a.length&&a[d]<p;)d+=3;a.splice(d,0,u.children[f],u.children[f+1],u.children[f+2])}}return new At(e.sort(ls),a)}function Lf(i,e){if(!e||!i.length)return i;let t=[];for(let n=0;n<i.length;n++){let s=i[n];t.push(new vn(s.from+e,s.to+e,s.type))}return t}function LI(i,e,t,n,s,r,o){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(n,s,c);f?t.push(f):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<i.length;l+=3)i[l+1]==-1&&a(i[l+2],e[l]+r+1);return t}function wf(i,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,s=null;for(let r=0,o;r<i.length;r++)(o=i[r])&&o.from>t&&o.to<n&&((s||(s=[])).push(o),i[r]=null);return s}function Af(i){let e=[];for(let t=0;t<i.length;t++)i[t]!=null&&e.push(i[t]);return e}function fo(i,e,t,n){let s=[],r=!1;e.forEach((a,l)=>{let c=wf(i,a,l+t);if(c){r=!0;let u=fo(c,a,t+l+1,n);u!=Kt&&s.push(l,l+a.nodeSize,u)}});let o=Lf(r?Af(i):i,-t).sort(ls);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(n.onRemove&&n.onRemove(o[a].spec),o.splice(a--,1));return o.length||s.length?new At(o,s):Kt}function ls(i,e){return i.from-e.from||i.to-e.to}function Ol(i){let e=i;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let s=t+1;s<e.length;s++){let r=e[s];if(r.from==n.from){r.to!=n.to&&(e==i&&(e=i.slice()),e[s]=r.copy(r.from,n.to),au(e,s+1,r.copy(n.to,r.to)));continue}else{r.from<n.to&&(e==i&&(e=i.slice()),e[t]=n.copy(n.from,r.from),au(e,s,n.copy(r.from,n.to)));break}}}return e}function au(i,e,t){for(;e<i.length&&ls(t,i[e])>0;)e++;i.splice(e,0,t)}function aa(i){let e=[];return i.someProp("decorations",t=>{let n=t(i.state);n&&n!=Kt&&e.push(n)}),i.cursorWrapper&&e.push(At.create(i.state.doc,[i.cursorWrapper.deco])),Ei.from(e)}const wI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},AI=an&&Mi<=11;class bI{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class RI{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bI,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let s=0;s<n.length;s++)this.queue.push(n[s]);an&&Mi<=11&&n.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),AI&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,wI)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Xc(this.view)){if(this.suppressingSelectionUpdates)return ui(this.view);if(an&&Mi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&hs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let r=e.focusNode;r;r=ks(r))t.add(r);for(let r=e.anchorNode;r;r=ks(r))if(t.has(r)){n=r;break}let s=n&&this.view.docView.nearestDesc(n);if(s&&s.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Xc(e)&&!this.ignoreSelectionChange(n),r=-1,o=-1,a=!1,l=[];if(e.editable)for(let u=0;u<t.length;u++){let f=this.registerMutation(t[u],l);f&&(r=r<0?f.from:Math.min(f.from,r),o=o<0?f.to:Math.max(f.to,o),f.typeOver&&(a=!0))}if(Rn&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let p=d.parentNode;p&&p.nodeName=="LI"&&(!f||MI(e,f)!=p)&&d.remove()}}}else if((Pt||Zt)&&l.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let f=u.nextSibling;f&&f.nodeType==1&&f.contentEditable=="false"&&u.parentNode.removeChild(u)}}let c=null;r<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ro(n)&&(c=Sl(e))&&c.eq(ot.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ui(e),this.currentSelection.set(n),e.scrollToSelection()):(r>-1||s)&&(r>-1&&(e.docView.markDirty(r,o),OI(e)),this.handleDOMChange(r,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ui(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];t.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let s=e.previousSibling,r=e.nextSibling;if(an&&Mi<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:d}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(r=d)}let o=s&&s.parentNode==e.target?Ht(s)+1:0,a=n.localPosFromDOM(e.target,o,-1),l=r&&r.parentNode==e.target?Ht(r):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let lu=new WeakMap,cu=!1;function OI(i){if(!lu.has(i)&&(lu.set(i,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(i.dom).whiteSpace)!==-1)){if(i.requiresGeckoHackNode=Rn,cu)return;cu=!0}}function uu(i,e){let t=e.startContainer,n=e.startOffset,s=e.endContainer,r=e.endOffset,o=i.domAtPos(i.state.selection.anchor);return hs(o.node,o.offset,s,r)&&([t,n,s,r]=[s,r,t,n]),{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}}function DI(i,e){if(e.getComposedRanges){let s=e.getComposedRanges(i.root)[0];if(s)return uu(i,s)}let t;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return i.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),i.dom.removeEventListener("beforeinput",n,!0),t?uu(i,t):null}function MI(i,e){for(let t=e.parentNode;t&&t!=i.dom;t=t.parentNode){let n=i.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function kI(i,e,t){let{node:n,fromOffset:s,toOffset:r,from:o,to:a}=i.docView.parseRange(e,t),l=i.domSelectionRange(),c,u=l.anchorNode;if(u&&i.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Ro(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Pt&&i.input.lastKeyCode===8)for(let m=r;m>s;m--){let y=n.childNodes[m-1],R=y.pmViewDesc;if(y.nodeName=="BR"&&!R){r=m;break}if(!R||R.size)break}let f=i.state.doc,d=i.someProp("domParser")||Di.fromSchema(i.state.schema),p=f.resolve(o),g=null,h=d.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:r,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:NI,context:p});if(c&&c[0].pos!=null){let m=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=m),g={anchor:m+o,head:y+o}}return{doc:h,sel:g,from:o,to:a}}function NI(i){let e=i.pmViewDesc;if(e)return e.parseRule();if(i.nodeName=="BR"&&i.parentNode){if(Zt&&/^(ul|ol)$/i.test(i.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(i.parentNode.lastChild==i||Zt&&/^(tr|table)$/i.test(i.parentNode.nodeName))return{ignore:!0}}else if(i.nodeName=="IMG"&&i.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xI=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function UI(i,e,t,n,s){let r=i.input.compositionPendingChanges||(i.composing?i.input.compositionID:0);if(i.input.compositionPendingChanges=0,e<0){let A=i.input.lastSelectionTime>
vendor: 4,417 bytes, line 16
16Date.now()-50?i.input.lastSelectionOrigin:null,L=Sl(i,A);if(L&&!i.state.selection.eq(L)){if(Pt&&ti&&i.input.lastKeyCode===13&&Date.now()-100<i.input.lastKeyCodeTime&&i.someProp("handleKeyDown",M=>M(i,$i(13,"Enter"))))return;let E=i.state.tr.setSelection(L);A=="pointer"?E.setMeta("pointer",!0):A=="key"&&E.scrollIntoView(),r&&E.setMeta("composition",r),i.dispatch(E)}return}let o=i.state.doc.resolve(e),a=o.sharedDepth(t);e=o.before(a+1),t=i.state.doc.resolve(t).after(a+1);let l=i.state.selection,c=kI(i,e,t),u=i.state.doc,f=u.slice(c.from,c.to),d,p;i.input.lastKeyCode===8&&Date.now()-100<i.input.lastKeyCodeTime?(d=i.state.selection.to,p="end"):(d=i.state.selection.from,p="start"),i.input.lastKeyCode=null;let g=BI(f.content,c.doc.content,c.from,d,p);if(g&&i.input.domChangeCount++,(Ns&&i.input.lastIOSEnter>Date.now()-225||ti)&&s.some(A=>A.nodeType==1&&!xI.test(A.nodeName))&&(!g||g.endA>=g.endB)&&i.someProp("handleKeyDown",A=>A(i,$i(13,"Enter")))){i.input.lastIOSEnter=0;return}if(!g)if(n&&l instanceof Xe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!i.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))g={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let A=du(i,i.state.doc,c.sel);if(A&&!A.eq(i.state.selection)){let L=i.state.tr.setSelection(A);r&&L.setMeta("composition",r),i.dispatch(L)}}return}i.state.selection.from<i.state.selection.to&&g.start==g.endB&&i.state.selection instanceof Xe&&(g.start>i.state.selection.from&&g.start<=i.state.selection.from+2&&i.state.selection.from>=c.from?g.start=i.state.selection.from:g.endA<i.state.selection.to&&g.endA>=i.state.selection.to-2&&i.state.selection.to<=c.to&&(g.endB+=i.state.selection.to-g.endA,g.endA=i.state.selection.to)),an&&Mi<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>c.from&&c.doc.textBetween(g.start-c.from-1,g.start-c.from+1)=="  "&&(g.start--,g.endA--,g.endB--);let h=c.doc.resolveNoCache(g.start-c.from),m=c.doc.resolveNoCache(g.endB-c.from),y=u.resolve(g.start),R=h.sameParent(m)&&h.parent.inlineContent&&y.end()>=g.endA;if((Ns&&i.input.lastIOSEnter>Date.now()-225&&(!R||s.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!R&&h.pos<c.doc.content.size&&(!h.sameParent(m)||!h.parent.inlineContent)&&h.pos<m.pos&&!/\S/.test(c.doc.textBetween(h.pos,m.pos,"","")))&&i.someProp("handleKeyDown",A=>A(i,$i(13,"Enter")))){i.input.lastIOSEnter=0;return}if(i.state.selection.anchor>g.start&&VI(u,g.start,g.endA,h,m)&&i.someProp("handleKeyDown",A=>A(i,$i(8,"Backspace")))){ti&&Pt&&i.domObserver.suppressSelectionUpdates();return}Pt&&g.endB==g.start&&(i.input.lastChromeDelete=Date.now()),ti&&!R&&h.start()!=m.start()&&m.parentOffset==0&&h.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==g.endA&&(g.endB-=2,m=c.doc.resolveNoCache(g.endB-c.from),setTimeout(()=>{i.someProp("handleKeyDown",function(A){return A(i,$i(13,"Enter"))})},20));let I=g.start,T=g.endA,C=A=>{let L=A||i.state.tr.replace(I,T,c.doc.slice(g.start-c.from,g.endB-c.from));if(c.sel){let E=du(i,L.doc,c.sel);E&&!(Pt&&i.composing&&E.empty&&(g.start!=g.endB||i.input.lastChromeDelete<Date.now()-100)&&(E.head==I||E.head==L.mapping.map(T)-1)||an&&E.empty&&E.head==I)&&L.setSelection(E)}return r&&L.setMeta("composition",r),L.scrollIntoView()},_;if(R)if(h.pos==m.pos){an&&Mi<=11&&h.parentOffset==0&&(i.domObserver.suppressSelectionUpdates(),setTimeout(()=>ui(i),20));let A=C(i.state.tr.delete(I,T)),L=u.resolve(g.start).marksAcross(u.resolve(g.endA));L&&A.ensureMarks(L),i.dispatch(A)}else if(g.endA==g.endB&&(_=PI(h.parent.content.cut(h.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,g.endA-y.start())))){let A=C(i.state.tr);_.type=="add"?A.addMark(I,T,_.mark):A.removeMark(I,T,_.mark),i.dispatch(A)}else if(h.parent.child(h.index()).isText&&h.index()==m.index()-(m.textOffset?0:1)){let A=h.parent.textBetween(h.parentOffset,m.parentOffset),L=()=>C(i.state.tr.insertText(A,I,T));i.someProp("handleTextInput",E=>E(i,I,T,A,L))||i.dispatch(L())}else i.dispatch(C());else i.dispatch(C())}function du(i,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Tl(i,e.resolve(t.anchor),e.resolve(t.head))}function PI(i,e){let t=i.firstChild.marks,n=e.firstChild.marks,s=t,r=n,o,a,l;for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);for(let u=0;u<t.length;u++)r=t[u].removeFromSet(r);if(s.length==1&&r.length==0)a=s[0],o="add",l=u=>u.mark(a.addToSet(u.marks));else if(s.length==0&&r.length==1)a=r[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;
vendor: 5,279 bytes, line 16
16let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(we.from(c).eq(i))return{mark:a,type:o}}function VI(i,e,t,n,s){if(t-e<=s.pos-n.pos||la(n,!0,!1)<s.pos)return!1;let r=i.resolve(e);if(!n.parent.isTextblock){let a=r.nodeAfter;return a!=null&&t==e+a.nodeSize}if(r.parentOffset<r.parent.content.size||!r.parent.isTextblock)return!1;let o=i.resolve(la(r,!0,!0));return!o.parent.isTextblock||o.pos>t||la(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function la(i,e,t){let n=i.depth,s=e?i.end():i.pos;for(;n>0&&(e||i.indexAfter(n)==i.node(n).childCount);)n--,s++,e=!1;if(t){let r=i.node(n).maybeChild(i.indexAfter(n));for(;r&&!r.isLeaf;)r=r.firstChild,s++}return s}function BI(i,e,t,n,s){let r=i.findDiffStart(e,t);if(r==null)return null;let{a:o,b:a}=i.findDiffEnd(e,t+i.size,t+e.size);if(s=="end"){let l=Math.max(0,r-Math.min(o,a));n-=o+l-r}if(o<r&&i.size<e.size){let l=n<=r&&n>=o?r-n:0;r-=l,r&&r<e.size&&fu(e.textBetween(r-1,r+1))&&(r+=l?1:-1),a=r+(a-o),o=r}else if(a<r){let l=n<=r&&n>=a?r-n:0;r-=l,r&&r<i.size&&fu(i.textBetween(r-1,r+1))&&(r+=l?1:-1),o=r+(o-a),a=r}return{start:r,endA:o,endB:a}}function fu(i){if(i.length!=2)return!1;let e=i.charCodeAt(0),t=i.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class bf{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new nI,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(vu),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=gu(this),pu(this),this.nodeViews=mu(this),this.docView=Kc(this.state.doc,hu(this),aa(this),this.dom,this),this.domObserver=new RI(this,(n,s,r,o)=>UI(this,n,s,r,o)),this.domObserver.start(),iI(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wa(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vu),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let s=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(If(this),o=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=mu(this);GI(p,this.nodeViews)&&(this.nodeViews=p,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Wa(this),this.editable=gu(this),pu(this);let l=aa(this),c=hu(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",f=r||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(s.selection))&&(o=!0);let d=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&vy(this);if(o){this.domObserver.stop();let p=f&&(an||Pt)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&FI(s.selection,e.selection);if(f){let g=Pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=vI(this)),(r||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Kc(e.doc,c,l,this.dom,this)),g&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Gy(this))?ui(this,p):(cf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((n=this.dragging)===null||n===void 0)&&n.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&Cy(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof je){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Gc(this,t.getBoundingClientRect(),e)}else Gc(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,s=-1;if(this.state.doc.nodeAt(n.from)==n.node)s=n.from;
vendor: 15,401 bytes, lines 16-17
16else{let r=n.from+(this.state.doc.content.size-t.doc.content.size);(r>0&&this.state.doc.nodeAt(r))==n.node&&(s=r)}this.dragging=new Sf(e.slice,e.move,s<0?void 0:je.create(this.state.doc,s))}someProp(e,t){let n=this._props&&this._props[e],s;if(n!=null&&(s=t?t(n):n))return s;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(s=t?t(a):a))return s}let r=this.state.plugins;if(r)for(let o=0;o<r.length;o++){let a=r[o].props[e];if(a!=null&&(s=t?t(a):a))return s}}hasFocus(){if(an){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&_y(this.dom),ui(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ty(this,e)}coordsAtPos(e,t=1){return ef(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let s=this.docView.posFromDOM(e,t,n);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,t){return Ry(this,t||this.state,e)}pasteHTML(e,t){return hr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return hr(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ll(this,e)}destroy(){this.docView&&(sI(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],aa(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ay())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return oI(this,e)}domSelectionRange(){let e=this.domSelection();return e?Zt&&this.root.nodeType===11&&fy(this.dom.ownerDocument)==this.dom&&DI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}bf.prototype.dispatch=function(i){let e=this._props.dispatchTransaction;e?e.call(this,i):this.updateState(this.state.apply(i))};function hu(i){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(i.editable),i.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(i.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[vn.node(0,i.state.doc.content.size,e)]}function pu(i){if(i.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),i.cursorWrapper={dom:e,deco:vn.widget(i.state.selection.from,e,{raw:!0,marks:i.markCursor})}}else i.cursorWrapper=null}function gu(i){return!i.someProp("editable",e=>e(i.state)===!1)}function FI(i,e){let t=Math.min(i.$anchor.sharedDepth(i.head),e.$anchor.sharedDepth(e.head));return i.$anchor.start(t)!=e.$anchor.start(t)}function mu(i){let e=Object.create(null);function t(n){for(let s in n)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=n[s])}return i.someProp("nodeViews",t),i.someProp("markViews",t),e}function GI(i,e){let t=0,n=0;for(let s in i){if(i[s]!=e[s])return!0;t++}for(let s in e)n++;return t!=n}function vu(i){if(i.spec.state||i.spec.filterTransaction||i.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Pi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ho={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},HI=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),$I=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $t=0;$t<10;$t++)Pi[48+$t]=Pi[96+$t]=String($t);for(var $t=1;$t<=24;$t++)Pi[$t+111]="F"+$t;for(var $t=65;$t<=90;$t++)Pi[$t]=String.fromCharCode($t+32),ho[$t]=String.fromCharCode($t);for(var ca in Pi)ho.hasOwnProperty(ca)||(ho[ca]=Pi[ca]);function jI(i){var e=HI&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||$I&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?ho:Pi)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const WI=typeof navigator!="undefined"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zI=typeof navigator!="undefined"&&/Win/.test(navigator.platform);function KI(i){let e=i.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,s,r,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))WI?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(t="Alt-"+t),s&&(t="Ctrl-"+t),o&&(t="Meta-"+t),r&&(t="Shift-"+t),t}function YI(i){let e=Object.create(null);for(let t in i)e[KI(t)]=i[t];return e}function ua(i,e,t=!0){return e.altKey&&(i="Alt-"+i),e.ctrlKey&&(i="Ctrl-"+i),e.metaKey&&(i="Meta-"+i),t&&e.shiftKey&&(i="Shift-"+i),i}function qI(i){return new Mn({props:{handleKeyDown:JI(i)}})}function JI(i){let e=YI(i);return function(t,n){let s=jI(n),r,o=e[ua(s,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(s.length==1&&s!=" "){if(n.shiftKey){let a=e[ua(s,n,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(zI&&n.ctrlKey&&n.altKey)&&(r=Pi[n.keyCode])&&r!=s){let a=e[ua(r,n)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const Dl=(i,e)=>i.selection.empty?!1:(e&&e(i.tr.deleteSelection().scrollIntoView()),!0);function Rf(i,e){let{$cursor:t}=i.selection;return!t||(e?!e.endOfTextblock("backward",i):t.parentOffset>0)?null:t}const Of=(i,e,t)=>{let n=Rf(i,t);if(!n)return!1;let s=Ml(n);if(!s){let o=n.blockRange(),a=o&&Vs(o);return a==null?!1:(e&&e(i.tr.lift(o,a).scrollIntoView()),!0)}let r=s.nodeBefore;if(Bf(i,s,e,-1))return!0;if(n.parent.content.size==0&&(xs(r,"end")||je.isSelectable(r)))for(let o=n.depth;;o--){let a=Ao(i.doc,n.before(o),n.after(o),Me.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=i.tr.step(a);l.setSelection(xs(r,"end")?ot.findFrom(l.doc.resolve(l.mapping.map(s.pos,-1)),-1):je.create(l.doc,s.pos-r.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return r.isAtom&&s.depth==n.depth-1?(e&&e(i.tr.delete(s.pos-r.nodeSize,s.pos).scrollIntoView()),!0):!1},QI=(i,e,t)=>{let n=Rf(i,t);if(!n)return!1;let s=Ml(n);return s?Df(i,s,e):!1},ZI=(i,e,t)=>{let n=kf(i,t);if(!n)return!1;let s=kl(n);return s?Df(i,s,e):!1};function Df(i,e,t){let n=e.nodeBefore,s=n,r=e.pos-1;for(;!s.isTextblock;r--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Ao(i.doc,r,l,Me.empty);if(!c||c.from!=r||c instanceof Ut&&c.slice.size>=l-r)return!1;if(t){let u=i.tr.step(c);u.setSelection(Xe.create(u.doc,r)),t(u.scrollIntoView())}return!0}function xs(i,e,t=!1){for(let n=i;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const Mf=(i,e,t)=>{let{$head:n,empty:s}=i.selection,r=n;if(!s)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",i):n.parentOffset>0)return!1;r=Ml(n)}let o=r&&r.nodeBefore;return!o||!je.isSelectable(o)?!1:(e&&e(i.tr.setSelection(je.create(i.doc,r.pos-o.nodeSize)).scrollIntoView()),!0)};function Ml(i){if(!i.parent.type.spec.isolating)for(let e=i.depth-1;e>=0;e--){if(i.index(e)>0)return i.doc.resolve(i.before(e+1));if(i.node(e).type.spec.isolating)break}return null}function kf(i,e){let{$cursor:t}=i.selection;return!t||(e?!e.endOfTextblock("forward",i):t.parentOffset<t.parent.content.size)?null:t}const Nf=(i,e,t)=>{let n=kf(i,t);if(!n)return!1;let s=kl(n);if(!s)return!1;let r=s.nodeAfter;if(Bf(i,s,e,1))return!0;if(n.parent.content.size==0&&(xs(r,"start")||je.isSelectable(r))){let o=Ao(i.doc,n.before(),n.after(),Me.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=i.tr.step(o);a.setSelection(xs(r,"start")?ot.findFrom(a.doc.resolve(a.mapping.map(s.pos)),1):je.create(a.doc,a.mapping.map(s.pos))),e(a.scrollIntoView())}return!0}}return r.isAtom&&s.depth==n.depth-1?(e&&e(i.tr.delete(s.pos,s.pos+r.nodeSize).scrollIntoView()),!0):!1},xf=(i,e,t)=>{let{$head:n,empty:s}=i.selection,r=n;if(!s)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",i):n.parentOffset<n.parent.content.size)return!1;r=kl(n)}let o=r&&r.nodeAfter;return!o||!je.isSelectable(o)?!1:(e&&e(i.tr.setSelection(je.create(i.doc,r.pos)).scrollIntoView()),!0)};function kl(i){if(!i.parent.type.spec.isolating)for(let e=i.depth-1;e>=0;e--){let t=i.node(e);if(i.index(e)+1<t.childCount)return i.doc.resolve(i.after(e+1));if(t.type.spec.isolating)break}return null}const XI=(i,e)=>{let t=i.selection,n=t instanceof je,s;if(n){if(t.node.isTextblock||!ms(i.doc,t.from))return!1;s=t.from}else if(s=wo(i.doc,t.from,-1),s==null)return!1;if(e){let r=i.tr.join(s);n&&r.setSelection(je.create(r.doc,s-i.doc.resolve(s).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0},eE=(i,e)=>{let t=i.selection,n;if(t instanceof je){if(t.node.isTextblock||!ms(i.doc,t.to))return!1;n=t.to}else if(n=wo(i.doc,t.to,1),n==null)return!1;return e&&e(i.tr.join(n).scrollIntoView()),!0},tE=(i,e)=>{let{$from:t,$to:n}=i.selection,s=t.blockRange(n),r=s&&Vs(s);return r==null?!1:(e&&e(i.tr.lift(s,r).scrollIntoView()),!0)},Uf=(i,e)=>{let{$head:t,$anchor:n}=i.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(i.tr.insertText(`
17`).scrollIntoView()),!0)};function Nl(i){for(let e=0;e<i.edgeCount;e++){let{type:t}=i.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const nE=(i,e)=>{let{$head:t,$anchor:n}=i.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let s=t.node(-1),r=t.indexAfter(-1),o=Nl(s.contentMatchAt(r));if(!o||!s.canReplaceWith(r,r,o))return!1;if(e){let a=t.after(),l=i.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ot.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Pf=(i,e)=>{let t=i.selection,{$from:n,$to:s}=t;if(t instanceof Cn||n.parent.inlineContent||s.parent.inlineContent)return!1;let r=Nl(s.parent.contentMatchAt(s.indexAfter()));if(!r||!r.isTextblock)return!1;if(e){let o=(!n.parentOffset&&s.index()<s.parent.childCount?n:s).pos,a=i.tr.insert(o,r.createAndFill());a.setSelection(Xe.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},Vf=(i,e)=>{let{$cursor:t}=i.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let r=t.before();if(ci(i.doc,r))return e&&e(i.tr.split(r).scrollIntoView()),!0}let n=t.blockRange(),s=n&&Vs(n);return s==null?!1:(e&&e(i.tr.lift(n,s).scrollIntoView()),!0)};function iE(i){return(e,t)=>{let{$from:n,$to:s}=e.selection;if(e.selection instanceof je&&e.selection.node.isBlock)return!n.parentOffset||!ci(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let r=[],o,a,l=!1,c=!1;for(let p=n.depth;;p--)if(n.node(p).isBlock){l=n.end(p)==n.pos+(n.depth-p),c=n.start(p)==n.pos-(n.depth-p),a=Nl(n.node(p-1).contentMatchAt(n.indexAfter(p-1))),r.unshift(l&&a?{type:a}:null),o=p;break}else{if(p==1)return!1;r.unshift(null)}let u=e.tr;(e.selection instanceof Xe||e.selection instanceof Cn)&&u.deleteSelection();let f=u.mapping.map(n.pos),d=ci(u.doc,f,r.length,r);if(d||(r[0]=a?{type:a}:null,d=ci(u.doc,f,r.length,r)),!d)return!1;if(u.split(f,r.length,r),!l&&c&&n.node(o).type!=a){let p=u.mapping.map(n.before(o)),g=u.doc.resolve(p);a&&n.node(o-1).canReplaceWith(g.index(),g.index()+1,a)&&u.setNodeMarkup(u.mapping.map(n.before(o)),a)}return t&&t(u.scrollIntoView()),!0}}const sE=iE(),rE=(i,e)=>{let{$from:t,to:n}=i.selection,s,r=t.sharedDepth(n);return r==0?!1:(s=t.before(r),e&&e(i.tr.setSelection(je.create(i.doc,s))),!0)};function oE(i,e,t){let n=e.nodeBefore,s=e.nodeAfter,r=e.index();return!n||!s||!n.type.compatibleContent(s.type)?!1:!n.content.size&&e.parent.canReplace(r-1,r)?(t&&t(i.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(r,r+1)||!(s.isTextblock||ms(i.doc,e.pos))?!1:(t&&t(i.tr.join(e.pos).scrollIntoView()),!0)}function Bf(i,e,t,n){let s=e.nodeBefore,r=e.nodeAfter,o,a,l=s.type.spec.isolating||r.type.spec.isolating;if(!l&&oE(i,e,t))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=s.contentMatchAt(s.childCount)).findWrapping(r.type))&&a.matchType(o[0]||r.type).validEnd){if(t){let p=e.pos+r.nodeSize,g=we.empty;for(let y=o.length-1;y>=0;y--)g=we.from(o[y].create(null,g));g=we.from(s.copy(g));let h=i.tr.step(new Vt(e.pos-1,p,e.pos,p,new Me(g,1,0),o.length,!0)),m=h.doc.resolve(p+2*o.length);m.nodeAfter&&m.nodeAfter.type==s.type&&ms(h.doc,m.pos)&&h.join(m.pos),t(h.scrollIntoView())}return!0}let u=r.type.spec.isolating||n>0&&l?null:ot.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&Vs(f);if(d!=null&&d>=e.depth)return t&&t(i.tr.lift(f,d).scrollIntoView()),!0;if(c&&xs(r,"start",!0)&&xs(s,"end")){let p=s,g=[];for(;g.push(p),!p.isTextblock;)p=p.lastChild;let h=r,m=1;for(;!h.isTextblock;h=h.firstChild)m++;if(p.canReplace(p.childCount,p.childCount,h.content)){if(t){let y=we.empty;for(let I=g.length-1;I>=0;I--)y=we.from(g[I].copy(y));let R=i.tr.step(new Vt(e.pos-g.length,e.pos+r.nodeSize,e.pos+m,e.pos+r.nodeSize-m,new Me(y,g.length,0),0,!0));t(R.scrollIntoView())}return!0}}return!1}function Ff(i){return function(e,t){let n=e.selection,s=i<0?n.$from:n.$to,r=s.depth;for(;s.node(r).isInline;){if(!r)return!1;r--}return s.node(r).isTextblock?(t&&t(e.tr.setSelection(Xe.create(e.doc,i<0?s.start(r):s.end(r)))),!0):!1}}const aE=Ff(-1),lE=Ff(1);function cE(i,e=null){return function(t,n){let{$from:s,$to:r}=t.selection,o=s.blockRange(r),a=o&&P0(o,i,e);return a?(n&&n(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Cu(i,e=null){return function(t,n){let s=!1;for(let r=0;r<t.selection.ranges.length&&!s;r++){let{$from:{pos:o},$to:{pos:a}}=t.selection.ranges[r];t.doc.nodesBetween(o,a,(l,c)=>{if(s)return!1;if(!(!l.isTextblock||l.hasMarkup(i,e)))if(l.type==i)s=!0;else{let u=t.doc.resolve(c),f=u.index();s=u.parent.canReplaceWith(f,f+1,i)}})}if(!s)return!1;if(n){let r=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=t.selection.ranges[o];r.setBlockType(a,l,i,e)}n(r.scrollIntoView())}return!0}}function xl(...i){return function(e,t,n){for(let s=0;s<i.length;
vendor: 4,924 bytes, line 17
17s++)if(i[s](e,t,n))return!0;return!1}}xl(Dl,Of,Mf);xl(Dl,Nf,xf);xl(Uf,Pf,Vf,sE);typeof navigator!="undefined"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os!="undefined"&&os.platform&&os.platform()=="darwin";function uE(i,e=null){return function(t,n){let{$from:s,$to:r}=t.selection,o=s.blockRange(r);if(!o)return!1;let a=n?t.tr:null;return dE(a,o,i,e)?(n&&n(a.scrollIntoView()),!0):!1}}function dE(i,e,t,n=null){let s=!1,r=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);r=new so(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new so(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let a=P0(r,t,n,e);return a?(i&&fE(i,e,a,s,t),!0):!1}function fE(i,e,t,n,s){let r=we.empty;for(let u=t.length-1;u>=0;u--)r=we.from(t[u].type.create(t[u].attrs,r));i.step(new Vt(e.start-(n?2:0),e.end,e.start,e.end,new Me(r,0,0),t.length,!0));let o=0;for(let u=0;u<t.length;u++)t[u].type==s&&(o=u+1);let a=t.length-o,l=e.start+t.length-(n?2:0),c=e.parent;for(let u=e.startIndex,f=e.endIndex,d=!0;u<f;u++,d=!1)!d&&ci(i.doc,l,a)&&(i.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return i}function hE(i){return function(e,t){let{$from:n,$to:s}=e.selection,r=n.blockRange(s,o=>o.childCount>0&&o.firstChild.type==i);return r?t?n.node(r.depth-1).type==i?pE(e,t,i,r):gE(e,t,r):!0:!1}}function pE(i,e,t,n){let s=i.tr,r=n.end,o=n.$to.end(n.depth);r<o&&(s.step(new Vt(r-1,o,r,o,new Me(we.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new so(s.doc.resolve(n.$from.pos),s.doc.resolve(o),n.depth));const a=Vs(n);if(a==null)return!1;s.lift(n,a);let l=s.doc.resolve(s.mapping.map(r,-1)-1);return ms(s.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&s.join(l.pos),e(s.scrollIntoView()),!0}function gE(i,e,t){let n=i.tr,s=t.parent;for(let p=t.end,g=t.endIndex-1,h=t.startIndex;g>h;g--)p-=s.child(g).nodeSize,n.delete(p-1,p+1);let r=n.doc.resolve(t.start),o=r.nodeAfter;if(n.mapping.map(t.end)!=t.start+r.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==s.childCount,c=r.node(-1),u=r.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?we.empty:we.from(s))))return!1;let f=r.pos,d=f+o.nodeSize;return n.step(new Vt(f-(a?1:0),d+(l?1:0),f+1,d-1,new Me((a?we.empty:we.from(s.copy(we.empty))).append(l?we.empty:we.from(s.copy(we.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function mE(i){return function(e,t){let{$from:n,$to:s}=e.selection,r=n.blockRange(s,c=>c.childCount>0&&c.firstChild.type==i);if(!r)return!1;let o=r.startIndex;if(o==0)return!1;let a=r.parent,l=a.child(o-1);if(l.type!=i)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=we.from(c?i.create():null),f=new Me(we.from(i.create(null,we.from(a.type.create(null,u)))),c?3:1,0),d=r.start,p=r.end;t(e.tr.step(new Vt(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function Mo(i){const{state:e,transaction:t}=i;let{selection:n}=t,{doc:s}=t,{storedMarks:r}=t;return Z(F({},e),{apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return r},get selection(){return n},get doc(){return s},get tr(){return n=t.selection,s=t.doc,r=t.storedMarks,t}})}class ko{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:s}=t,{tr:r}=n,o=this.buildProps(r);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(o);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(r),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:s,state:r}=this,{view:o}=s,a=[],l=!!e,c=e||r.tr,u=()=>(!l&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),a.every(d=>d===!0)),f=Z(F({},Object.fromEntries(Object.entries(n).map(([d,p])=>[d,(...h)=>{const m=this.buildProps(c,t),y=p(...h)(m);return a.push(y),f}]))),{run:u});return f}createCan(e){const{rawCommands:t,state:n}=this,s=!1,r=e||n.tr,o=this.buildProps(r,s),a=Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...u)=>c(...u)(Z(F({},o),{dispatch:void 0}))]));return Z(F({},a),{chain:()=>this.createChain(r,s)})}buildProps(e,t=!0){const{rawCommands:n,editor:s,state:r}=this,{view:o}=s,a={tr:e,editor:s,view:o,state:Mo({state:r,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class vE{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];
17return n&&n.forEach(s=>s.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(s=>s!==t):delete this.callbacks[e]),this}once(e,t){const n=(...s)=>{this.off(e,n),t.apply(this,s)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}}function ke(i,e,t){return i.config[e]===void 0&&i.parent?ke(i.parent,e,t):typeof i.config[e]=="function"?i.config[e].bind(Z(F({},t),{parent:i.parent?ke(i.parent,e,t):null})):i.config[e]}function No(i){const e=i.filter(s=>s.type==="extension"),t=i.filter(s=>s.type==="node"),n=i.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function Gf(i){const e=[],{nodeExtensions:t,markExtensions:n}=No(i),s=[...t,...n],r={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:s},l=ke(o,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([d,p])=>{e.push({type:f,name:d,attribute:F(F({},r),p)})})})})}),s.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=ke(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const d=F(F({},r),f);typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:o.name,name:u,attribute:d})})}),e}function Bt(i,e){if(typeof i=="string"){if(!e.nodes[i])throw Error(`There is no node type named '${i}'. Maybe you forgot to add the extension?`);return e.nodes[i]}return i}function Ai(...i){return i.filter(e=>!!e).reduce((e,t)=>{const n=F({},e);return Object.entries(t).forEach(([s,r])=>{if(!n[s]){n[s]=r;return}if(s==="class"){const a=r?String(r).split(" "):[],l=n[s]?n[s].split(" "):[],c=a.filter(u=>!l.includes(u));n[s]=[...l,...c].join(" ")}else if(s==="style"){const a=r?r.split(";").map(u=>u.trim()).filter(Boolean):[],l=n[s]?n[s].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[f,d]=u.split(":").map(p=>p.trim());c.set(f,d)}),a.forEach(u=>{const[f,d]=u.split(":").map(p=>p.trim());c.set(f,d)}),n[s]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else n[s]=r}),n},{})}function za(i,e){return e.filter(t=>t.type===i.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(i.attrs)||{}:{[t.name]:i.attrs[t.name]}).reduce((t,n)=>Ai(t,n),{})}function Hf(i){return typeof i=="function"}function lt(i,e=void 0,...t){return Hf(i)?e?i.bind(e)(...t):i(...t):i}function CE(i={}){return Object.keys(i).length===0&&i.constructor===Object}function _E(i){return typeof i!="string"?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):i==="true"?!0:i==="false"?!1:i}function _u(i,e){return"style"in i?i:Z(F({},i),{getAttrs:t=>{const n=i.getAttrs?i.getAttrs(t):i.attrs;if(n===!1)return!1;const s=e.reduce((r,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(t):_E(t.getAttribute(o.name));return a==null?r:Z(F({},r),{[o.name]:a})},{});return F(F({},n),s)}})}function yu(i){return Object.fromEntries(Object.entries(i).filter(([e,t])=>e==="attrs"&&CE(t)?!1:t!=null))}function yE(i,e){var t;const n=Gf(i),{nodeExtensions:s,markExtensions:r}=No(i),o=(t=s.find(c=>ke(c,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(s.map(c=>{const u=n.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=i.reduce((y,R)=>{const I=ke(R,"extendNodeSchema",f);return F(F({},y),I?I(c):{})},{}),p=yu(Z(F({},d),{content:lt(ke(c,"content",f)),marks:lt(ke(c,"marks",f)),group:lt(ke(c,"group",f)),inline:lt(ke(c,"inline",f)),atom:lt(ke(c,"atom",f)),selectable:lt(ke(c,"selectable",f)),draggable:lt(ke(c,"draggable",f)),code:lt(ke(c,"code",f)),whitespace:lt(ke(c,"whitespace",f)),linebreakReplacement:lt(ke(c,"linebreakReplacement",f)),defining:lt(ke(c,"defining",f)),isolating:lt(ke(c,"isolating",f)),attrs:Object.fromEntries(u.map(y=>{var R;return[y.name,{default:(R=y==null?void 0:y.attribute)===null||R===void 0?void 0:R.default}]}))})),g=lt(ke(c,"parseHTML",f));g&&(p.parseDOM=g.map(y=>_u(y,u)));const h=ke(c,"renderHTML",f);h&&(p.toDOM=y=>h({node:y,HTMLAttributes:za(y,u)}));const m=ke(c,"renderText",f);return m&&(p.toText=m),[c.name,p]})),l=Object.fromEntries(r.map(c=>{const u=n.filter(m=>m.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=i.reduce((m,y)=>{const R=ke(y,"extendMarkSchema",f);return F(F({},m),R?R(c):{})},{}),p=yu(Z(F({},d),{inclusive:lt(ke(c,"inclusive",f)),excludes:lt(ke(c,"excludes",f)),group:lt(ke(c,"group",f)),spanning:lt(ke(c,"spanning",f)),code:lt(ke(c,"code",f)),attrs:Object.fromEntries(u.map(m=>{var y;return[m.name,{default:(y=m==null?void 0:m.attribute)===null||y===void 0?void 0:y.default}]}))})),g=lt(ke(c,"parseHTML",f));g&&(p.parseDOM=g.map(m=>_u(m,u)));const h=ke(c,"renderHTML",f);return h&&(p.toDOM=m=>h({mark:m,HTMLAttributes:za(m,u)})),[c.name,p]}));return new R0({topNode:o,nodes:a,marks:l})}
vendor: 4,138 bytes, lines 17-18
17function da(i,e){return e.nodes[i]||e.marks[i]||null}function Iu(i,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===i.name):e}function Ul(i,e){const t=gs.fromSchema(e).serializeFragment(i),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(t),s.innerHTML}const IE=(i,e=500)=>{let t="";const n=i.parentOffset;return i.parent.nodesBetween(Math.max(0,n-e),n,(s,r,o,a)=>{var l,c;const u=((c=(l=s.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:s,pos:r,parent:o,index:a}))||s.textContent||"%leaf%";t+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,n-r))}),t};function Pl(i){return Object.prototype.toString.call(i)==="[object RegExp]"}class EE{constructor(e){this.find=e.find,this.handler=e.handler}}const SE=(i,e)=>{if(Pl(e))return e.exec(i);const t=e(i);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=i,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith),n.push(t.replaceWith)),n};function Nr(i){var e;const{editor:t,from:n,to:s,text:r,rules:o,plugin:a}=i,{view:l}=t;if(l.composing)return!1;const c=l.state.doc.resolve(n);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let u=!1;const f=IE(c)+r;return o.forEach(d=>{if(u)return;const p=SE(f,d.find);if(!p)return;const g=l.state.tr,h=Mo({state:l.state,transaction:g}),m={from:n-(p[0].length-r.length),to:s},{commands:y,chain:R,can:I}=new ko({editor:t,state:h});d.handler({state:h,range:m,match:p,commands:y,chain:R,can:I})===null||!g.steps.length||(g.setMeta(a,{transform:g,from:n,to:s,text:r}),l.dispatch(g),u=!0)}),u}function TE(i){const{editor:e,rules:t}=i,n=new Mn({state:{init(){return null},apply(s,r,o){const a=s.getMeta(n);if(a)return a;const l=s.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=Ul(we.from(u),o.schema);const{from:f}=l,d=f+u.length;Nr({editor:e,from:f,to:d,text:u,rules:t,plugin:n})}),s.selectionSet||s.docChanged?null:r}},props:{handleTextInput(s,r,o,a){return Nr({editor:e,from:r,to:o,text:a,rules:t,plugin:n})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:r}=s.state.selection;r&&Nr({editor:e,from:r.pos,to:r.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(s,r){if(r.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Nr({editor:e,from:o.pos,to:o.pos,text:`
18`,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function LE(i){return Object.prototype.toString.call(i).slice(8,-1)}function xr(i){return LE(i)!=="Object"?!1:i.constructor===Object&&Object.getPrototypeOf(i)===Object.prototype}function xo(i,e){const t=F({},i);return xr(i)&&xr(e)&&Object.keys(e).forEach(n=>{xr(e[n])&&xr(i[n])?t[n]=xo(i[n],e[n]):t[n]=e[n]}),t}class po{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=F(F({},this.config),e),this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0,this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=lt(ke(this,"addOptions",{name:this.name}))),this.storage=lt(ke(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new po(e)}configure(e={}){const t=this.extend(Z(F({},this.config),{addOptions:()=>xo(this.options,e)}));return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new po(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0,t.options=lt(ke(t,"addOptions",{name:t.name})),t.storage=lt(ke(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===t.name);return l&&n.removeStoredMark(l),n.insertText(" ",s.pos),e.view.dispatch(n),!0}return!1}}function wE(i){return typeof i=="number"}const AE=(i,e,t)=>{if(Pl(e))return[...i.matchAll(e)];const n=e(i,t);return n?n.map(s=>{const r=[s.text];
18return r.index=s.index,r.input=i,r.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith),r.push(s.replaceWith)),r}):[]};function bE(i){const{editor:e,state:t,from:n,to:s,rule:r,pasteEvent:o,dropEvent:a}=i,{commands:l,chain:c,can:u}=new ko({editor:e,state:t}),f=[];return t.doc.nodesBetween(n,s,(p,g)=>{if(!p.isTextblock||p.type.spec.code)return;const h=Math.max(n,g),m=Math.min(s,g+p.content.size),y=p.textBetween(h-g,m-g,void 0,"");AE(y,r.find,o).forEach(I=>{if(I.index===void 0)return;const T=h+I.index+1,C=T+I[0].length,_={from:t.tr.mapping.map(T),to:t.tr.mapping.map(C)},A=r.handler({state:t,range:_,match:I,commands:l,chain:c,can:u,pasteEvent:o,dropEvent:a});f.push(A)})}),f.every(p=>p!==null)}let Ur=null;const RE=i=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",i),t};function OE(i){const{editor:e,rules:t}=i;let n=null,s=!1,r=!1,o=typeof ClipboardEvent!="undefined"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent!="undefined"?new DragEvent("drop"):null}catch(u){a=null}const l=({state:u,from:f,to:d,rule:p,pasteEvt:g})=>{const h=u.tr,m=Mo({state:u,transaction:h});if(!(!bE({editor:e,state:m,from:Math.max(f-1,0),to:d.b-1,rule:p,pasteEvent:g,dropEvent:a})||!h.steps.length)){try{a=typeof DragEvent!="undefined"?new DragEvent("drop"):null}catch(R){a=null}return o=typeof ClipboardEvent!="undefined"?new ClipboardEvent("paste"):null,h}};return t.map(u=>new Mn({view(f){const d=g=>{var h;n=!((h=f.dom.parentElement)===null||h===void 0)&&h.contains(g.target)?f.dom.parentElement:null,n&&(Ur=e)},p=()=>{Ur&&(Ur=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(r=n===f.dom.parentElement,a=d,!r){const p=Ur;p!=null&&p.isEditable&&setTimeout(()=>{const g=p.state.selection;g&&p.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(f,d)=>{var p;const g=(p=d.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return o=d,s=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(f,d,p)=>{const g=f[0],h=g.getMeta("uiEvent")==="paste"&&!s,m=g.getMeta("uiEvent")==="drop"&&!r,y=g.getMeta("applyPasteRules"),R=!!y;if(!h&&!m&&!R)return;if(R){let{text:C}=y;typeof C=="string"?C=C:C=Ul(we.from(C),p.schema);const{from:_}=y,A=_+C.length,L=RE(C);return l({rule:u,state:p,from:_,to:{b:A},pasteEvt:L})}const I=d.doc.content.findDiffStart(p.doc.content),T=d.doc.content.findDiffEnd(p.doc.content);if(!(!wE(I)||!T||I===T.b))return l({rule:u,state:p,from:I,to:T,pasteEvt:o})}}))}
18function DE(i){const e=i.filter((t,n)=>i.indexOf(t)!==n);return Array.from(new Set(e))}class ws{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ws.resolve(e),this.schema=yE(this.extensions,t),this.setupExtensions()}static resolve(e){const t=ws.sort(ws.flatten(e));return DE(t.map(s=>s.name)).length,t}static flatten(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},s=ke(t,"addExtensions",n);return s?[t,...this.flatten(s())]:t}).flat(10)}static sort(e){return e.sort((n,s)=>{const r=ke(n,"priority")||100,o=ke(s,"priority")||100;return r>o?-1:r<o?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:da(t.name,this.schema)},s=ke(t,"addCommands",n);return s?F(F({},e),s()):e},{})}get plugins(){const{editor:e}=this,t=ws.sort([...this.extensions].reverse()),n=[],s=[],r=t.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:da(o.name,this.schema)},l=[],c=ke(o,"addKeyboardShortcuts",a);let u={};if(o.type==="mark"&&ke(o,"exitable",a)&&(u.ArrowRight=()=>po.handleExit({editor:e,mark:o})),c){const h=Object.fromEntries(Object.entries(c()).map(([m,y])=>[m,()=>y({editor:e})]));u=F(F({},u),h)}const f=qI(u);l.push(f);const d=ke(o,"addInputRules",a);Iu(o,e.options.enableInputRules)&&d&&n.push(...d());const p=ke(o,"addPasteRules",a);Iu(o,e.options.enablePasteRules)&&p&&s.push(...p());const g=ke(o,"addProseMirrorPlugins",a);if(g){const h=g();l.push(...h)}return l}).flat();return[TE({editor:e,rules:n}),...OE({editor:e,rules:s}),...r]}get attributes(){return Gf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=No(this.extensions);return Object.fromEntries(t.filter(n=>!!ke(n,"addNodeView")).map(n=>{const s=this.attributes.filter(l=>l.type===n.name),r={name:n.name,options:n.options,storage:n.storage,editor:e,type:Bt(n.name,this.schema)},o=ke(n,"addNodeView",r);if(!o)return[];const a=(l,c,u,f,d)=>{const p=za(l,s);return o()({node:l,view:c,getPos:u,decorations:f,innerDecorations:d,editor:e,extension:n,HTMLAttributes:p})};return[n.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:da(e.name,this.schema)};e.type==="mark"&&(!((t=lt(ke(e,"keepOnSplit",n)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const s=ke(e,"onBeforeCreate",n),r=ke(e,"onCreate",n),o=ke(e,"onUpdate",n),a=ke(e,"onSelectionUpdate",n),l=ke(e,"onTransaction",n),c=ke(e,"onFocus",n),u=ke(e,"onBlur",n),f=ke(e,"onDestroy",n);s&&this.editor.on("beforeCreate",s),r&&this.editor.on("create",r),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class yn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=F(F({},this.config),e),this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0,this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=lt(ke(this,"addOptions",{name:this.name}))),this.storage=lt(ke(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yn(e)}configure(e={}){const t=this.extend(Z(F({},this.config),{addOptions:()=>xo(this.options,e)}));return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new yn(F(F({},this.config),e));return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0,t.options=lt(ke(t,"addOptions",{name:t.name})),t.storage=lt(ke(t,"addStorage",{name:t.name,options:t.options})),t}}function $f(i,e,t){const{from:n,to:s}=e,{blockSeparator:r=`
19
20`,textSerializers:o={}}=t||{};let a="";return i.nodesBetween(n,s,(l,c,u,f)=>{var d;l.isBlock&&c>n&&(a+=r);const p=o==null?void 0:o[l.type.name];if(p)return u&&(a+=p({node:l,pos:c,parent:u,index:f,range:e})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(n,c)-c,s-c))}),a}function jf(i){return Object.fromEntries(Object.entries(i.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}
vendor: 8,905 bytes, line 20
20const ME=yn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Mn({key:new Jn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:i}=this,{state:e,schema:t}=i,{doc:n,selection:s}=e,{ranges:r}=s,o=Math.min(...r.map(u=>u.$from.pos)),a=Math.max(...r.map(u=>u.$to.pos)),l=jf(t);return $f(n,{from:o,to:a},Z(F({},this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{}),{textSerializers:l}))}}})]}}),kE=()=>({editor:i,view:e})=>(requestAnimationFrame(()=>{var t;i.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),NE=(i=!1)=>({commands:e})=>e.setContent("",i),xE=()=>({state:i,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:s}=n;return t&&s.forEach(({$from:r,$to:o})=>{i.doc.nodesBetween(r.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,f=c.resolve(u.map(l)),d=c.resolve(u.map(l+a.nodeSize)),p=f.blockRange(d);if(!p)return;const g=Vs(p);if(a.type.isTextblock){const{defaultType:h}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,h)}(g||g===0)&&e.lift(p,g)})}),!0},UE=i=>e=>i(e),PE=()=>({state:i,dispatch:e})=>Pf(i,e),VE=(i,e)=>({editor:t,tr:n})=>{const{state:s}=t,r=s.doc.slice(i.from,i.to);n.deleteRange(i.from,i.to);const o=n.mapping.map(e);return n.insert(o,r.content),n.setSelection(new Xe(n.doc.resolve(Math.max(o-1,0)))),!0},BE=()=>({tr:i,dispatch:e})=>{const{selection:t}=i,n=t.$anchor.node();if(n.content.size>0)return!1;const s=i.selection.$anchor;for(let r=s.depth;r>0;r-=1)if(s.node(r).type===n.type){if(e){const a=s.before(r),l=s.after(r);i.delete(a,l).scrollIntoView()}return!0}return!1},FE=i=>({tr:e,state:t,dispatch:n})=>{const s=Bt(i,t.schema),r=e.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===s){if(n){const l=r.before(o),c=r.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},GE=i=>({tr:e,dispatch:t})=>{const{from:n,to:s}=i;return t&&e.delete(n,s),!0},HE=()=>({state:i,dispatch:e})=>Dl(i,e),$E=()=>({commands:i})=>i.keyboardShortcut("Enter"),jE=()=>({state:i,dispatch:e})=>nE(i,e);function go(i,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(s=>t.strict?e[s]===i[s]:Pl(e[s])?e[s].test(i[s]):e[s]===i[s]):!0}function Wf(i,e,t={}){return i.find(n=>n.type===e&&go(Object.fromEntries(Object.keys(t).map(s=>[s,n.attrs[s]])),t))}function Eu(i,e,t={}){return!!Wf(i,e,t)}function zf(i,e,t){var n;if(!i||!e)return;let s=i.parent.childAfter(i.parentOffset);if((!s.node||!s.node.marks.some(u=>u.type===e))&&(s=i.parent.childBefore(i.parentOffset)),!s.node||!s.node.marks.some(u=>u.type===e)||(t=t||((n=s.node.marks[0])===null||n===void 0?void 0:n.attrs),!Wf([...s.node.marks],e,t)))return;let o=s.index,a=i.start()+s.offset,l=o+1,c=a+s.node.nodeSize;for(;o>0&&Eu([...i.parent.child(o-1).marks],e,t);)o-=1,a-=i.parent.child(o).nodeSize;for(;l<i.parent.childCount&&Eu([...i.parent.child(l).marks],e,t);)c+=i.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Bi(i,e){if(typeof i=="string"){if(!e.marks[i])throw Error(`There is no mark type named '${i}'. Maybe you forgot to add the extension?`);return e.marks[i]}return i}const WE=(i,e={})=>({tr:t,state:n,dispatch:s})=>{const r=Bi(i,n.schema),{doc:o,selection:a}=t,{$from:l,from:c,to:u}=a;if(s){const f=zf(l,r,e);if(f&&f.from<=c&&f.to>=u){const d=Xe.create(o,f.from,f.to);t.setSelection(d)}}return!0},zE=i=>e=>{const t=typeof i=="function"?i(e):i;for(let n=0;n<t.length;n+=1)if(t[n](e))return!0;return!1};function Kf(i){return i instanceof Xe}function Xi(i=0,e=0,t=0){return Math.min(Math.max(i,e),t)}function Yf(i,e=null){if(!e)return null;const t=ot.atStart(i),n=ot.atEnd(i);if(e==="start"||e===!0)return t;if(e==="end")return n;const s=t.from,r=n.to;return e==="all"?Xe.create(i,Xi(0,s,r),Xi(i.content.size,s,r)):Xe.create(i,Xi(e,s,r),Xi(e,s,r))}function KE(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Vl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const YE=(i=null,e={})=>({editor:t,view:n,tr:s,dispatch:r})=>{e=F({scrollIntoView:!0},e);const o=()=>{(Vl()||KE())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&i===null||i===!1)return!0;if(r&&i===null&&!Kf(t.state.selection))return o(),!0;const a=Yf(s.doc,i)||t.state.selection,l=t.state.selection.eq(a);return r&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},qE=(i,e)=>t=>i.every((n,s)=>e(n,Z(F({},t),{index:s}))),JE=(i,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},i,e),qf=i=>{const e=i.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?i.removeChild(n):n.nodeType===1&&qf(n)}return i};function Pr(i){const e=`<body>${i}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return qf(t)}function gr(i,e,t){if(i instanceof li||i instanceof we)return i;t=F({slice:!0,parseOptions:{}},t);const n=typeof i=="object"&&i!==null,s=typeof i=="string";if(n)try{if(Array.isArray(i)&&i.length>0)return we.fromArray(i.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(i);return t.errorOnInvalidContent&&o.check(),o}catch(r){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return gr("",e,t)}if(s){if(t.errorOnInvalidContent){let o=!1,a="";const l=new R0({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Di.fromSchema(l).parseSlice(Pr(i),t.parseOptions):Di.fromSchema(l).parse(Pr(i),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const r=Di.fromSchema(e);return t.slice?r.parseSlice(Pr(i),t.parseOptions).content:r.parse(Pr(i),t.parseOptions)}return gr("",e,t)}function QE(i,e,t){const n=i.steps.length-1;if(n<e)return;const s=i.steps[n];if(!(s instanceof Ut||s instanceof Vt))return;const r=i.mapping.maps[n];let o=0;r.forEach((a,l,c,u)=>{o===0&&(o=u)}),i.setSelection(ot.near(i.doc.resolve(o),t))}const ZE=i=>!("type"in i),XE=(i,e,t)=>({tr:n,dispatch:s,editor:r})=>{var o;if(s){t=F({parseOptions:r.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1},t);let a;const l=m=>{r.emit("contentError",{editor:r,error:m,disableCollaboration:()=>{r.storage.collaboration&&(r.storage.collaboration.isDisabled=!0)}})},c=F({preserveWhitespace:"full"},t.parseOptions);if(!t.errorOnInvalidContent&&!r.options.enableContentCheck&&r.options.emitContentError)try{gr(e,r.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(m){l(m)}try{a=gr(e,r.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:r.options.enableContentCheck})}catch(m){return l(m),!1}let{from:u,to:f}=typeof i=="number"?{from:i,to:i}:{from:i.from,to:i.to},d=!0,p=!0;if((ZE(a)?a:[a]).forEach(m=>{m.check(),d=d?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),u===f&&p){const{parent:m}=n.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,f+=1)}let h;if(d){if(Array.isArray(e))h=e.map(m=>m.text||"").join("");else if(e instanceof we){let m="";e.forEach(y=>{y.text&&(m+=y.text)}),h=m}else typeof e=="object"&&e&&e.text?h=e.text:h=e;n.insertText(h,u,f)}else h=a,n.replaceWith(u,f,h);t.updateSelection&&QE(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:u,text:h}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:u,text:h})}return!0},e5=()=>({state:i,dispatch:e})=>XI(i,e),t5=()=>({state:i,dispatch:e})=>eE(i,e),n5=()=>({state:i,dispatch:e})=>Of(i,e),i5=()=>({state:i,dispatch:e})=>Nf(i,e),s5=()=>({state:i,dispatch:e,tr:t})=>{try{const n=wo(i.doc,i.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch(n){return!1}},r5=()=>({state:i,dispatch:e,tr:t})=>{try{const n=wo(i.doc,i.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch(n){return!1}},o5=()=>({state:i,dispatch:e})=>QI(i,e),a5=()=>({state:i,dispatch:e})=>ZI(i,e);function Jf(){return typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1}function l5(i){const e=i.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,s,r,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))Vl()||Jf()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(t=`Alt-${t}`),s&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}
20`),r&&(t=`Shift-${t}`),t}const c5=i=>({editor:e,view:t,tr:n,dispatch:s})=>{const r=l5(i).split(/-(?!$)/),o=r.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,a))});return l==null||l.steps.forEach(c=>{const u=c.map(n.mapping);u&&s&&n.maybeStep(u)}),!0};function mr(i,e,t={}){const{from:n,to:s,empty:r}=i.selection,o=e?Bt(e,i.schema):null,a=[];i.doc.nodesBetween(n,s,(f,d)=>{if(f.isText)return;const p=Math.max(n,d),g=Math.min(s,d+f.nodeSize);a.push({node:f,from:p,to:g})});const l=s-n,c=a.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>go(f.node.attrs,t,{strict:!1}));return r?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=l}const u5=(i,e={})=>({state:t,dispatch:n})=>{const s=Bt(i,t.schema);return mr(t,s,e)?tE(t,n):!1},d5=()=>({state:i,dispatch:e})=>Vf(i,e),f5=i=>({state:e,dispatch:t})=>{const n=Bt(i,e.schema);return hE(n)(e,t)},h5=()=>({state:i,dispatch:e})=>Uf(i,e);function Uo(i,e){return e.nodes[i]?"node":e.marks[i]?"mark":null}function Su(i,e){const t=typeof e=="string"?[e]:e;return Object.keys(i).reduce((n,s)=>(t.includes(s)||(n[s]=i[s]),n),{})}const p5=(i,e)=>({tr:t,state:n,dispatch:s})=>{let r=null,o=null;const a=Uo(typeof i=="string"?i:i.name,n.schema);return a?(a==="node"&&(r=Bt(i,n.schema)),a==="mark"&&(o=Bi(i,n.schema)),s&&t.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{r&&r===c.type&&t.setNodeMarkup(u,void 0,Su(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(f=>{o===f.type&&t.addMark(u,u+c.nodeSize,o.create(Su(f.attrs,e)))})})}),!0):!1},g5=()=>({tr:i,dispatch:e})=>(e&&i.scrollIntoView(),!0),m5=()=>({tr:i,dispatch:e})=>{if(e){const t=new Cn(i.doc);i.setSelection(t)}return!0},v5=()=>({state:i,dispatch:e})=>Mf(i,e),C5=()=>({state:i,dispatch:e})=>xf(i,e),_5=()=>({state:i,dispatch:e})=>rE(i,e),y5=()=>({state:i,dispatch:e})=>lE(i,e),I5=()=>({state:i,dispatch:e})=>aE(i,e);function Ka(i,e,t={},n={}){return gr(i,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}const E5=(i,e=!1,t={},n={})=>({editor:s,tr:r,dispatch:o,commands:a})=>{var l,c;const{doc:u}=r;if(t.preserveWhitespace!=="full"){const f=Ka(i,s.schema,t,{errorOnInvalidContent:(l=n.errorOnInvalidContent)!==null&&l!==void 0?l:s.options.enableContentCheck});return o&&r.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return o&&r.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},i,{parseOptions:t,errorOnInvalidContent:(c=n.errorOnInvalidContent)!==null&&c!==void 0?c:s.options.enableContentCheck})};function Qf(i,e){const t=Bi(e,i.schema),{from:n,to:s,empty:r}=i.selection,o=[];r?(i.storedMarks&&o.push(...i.storedMarks),o.push(...i.selection.$head.marks())):i.doc.nodesBetween(n,s,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===t.name);return a?F({},a.attrs):{}}function S5(i){for(let e=0;e<i.edgeCount;e+=1){const{type:t}=i.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function T5(i,e){for(let t=i.depth;t>0;t-=1){const n=i.node(t);if(e(n))return{pos:t>0?i.before(t):0,start:i.start(t),depth:t,node:n}}}function Bl(i){return e=>T5(e.$from,i)}function L5(i,e){const t={from:0,to:i.content.size};return $f(i,t,e)}function w5(i,e){const t=Bt(e,i.schema),{from:n,to:s}=i.selection,r=[];i.doc.nodesBetween(n,s,a=>{r.push(a)});const o=r.reverse().find(a=>a.type.name===t.name);return o?F({},o.attrs):{}}function A5(i,e){const t=Uo(typeof e=="string"?e:e.name,i.schema);return t==="node"?w5(i,e):t==="mark"?Qf(i,e):{}}function $r(i,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const s=i.find(r=>r.type===e&&r.name===n);return s?s.attribute.keepOnSplit:!1}))}function Ya(i,e,t={}){const{empty:n,ranges:s}=i.selection,r=e?Bi(e,i.schema):null;if(n)return!!(i.storedMarks||i.selection.$from.marks()).filter(f=>r?r.name===f.type.name:!0).find(f=>go(f.attrs,t,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:f,$to:d})=>{const p=f.pos,g=d.pos;i.doc.nodesBetween(p,g,(h,m)=>{if(!h.isText&&!h.marks.length)return;const y=Math.max(p,m),R=Math.min(g,m+h.nodeSize),I=R-y;o+=I,a.push(...h.marks.map(T=>({mark:T,from:y,to:R})))})}),o===0)return!1;const l=a.filter(f=>r?r.name===f.mark.type.name:!0).filter(f=>go(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=a.filter(f=>r?f.mark.type!==r&&f.mark.type.excludes(r):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+c:l)>=o}function b5(i,e,t={}){if(!e)return mr(i,null,t)||Ya(i,null,t);const n=Uo(e,i.schema);return n==="node"?mr(i,e,t):n==="mark"?Ya(i,e,t):!1}function Tu(i,e){const{nodeExtensions:t}=No(e),n=t.find(o=>o.name===i);if(!n)return!1;const s={name:n.name,options:n.options,storage:n.storage},r=lt(ke(n,"group",s));return typeof r!="string"?!1:r.split(" ").includes("list")}function Po(i,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(i.type.name==="hardBreak")return!0;
vendor: 8,372 bytes, line 20
20if(i.isText)return/^\s*$/m.test((n=i.text)!==null&&n!==void 0?n:"")}if(i.isText)return!i.text;if(i.isAtom||i.isLeaf)return!1;if(i.content.childCount===0)return!0;if(e){let s=!0;return i.content.forEach(r=>{s!==!1&&(Po(r,{ignoreWhitespace:t,checkChildren:e})||(s=!1))}),s}return!1}function R5(i,e,t){var n;const{selection:s}=e;let r=null;if(Kf(s)&&(r=s.$cursor),r){const a=(n=i.storedMarks)!==null&&n!==void 0?n:r.marks();return!!t.isInSet(a)||!a.some(l=>l.type.excludes(t))}const{ranges:o}=s;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?i.doc.inlineContent&&i.doc.type.allowsMarkType(t):!1;return i.doc.nodesBetween(a.pos,l.pos,(u,f,d)=>{if(c)return!1;if(u.isInline){const p=!d||d.type.allowsMarkType(t),g=!!t.isInSet(u.marks)||!u.marks.some(h=>h.type.excludes(t));c=p&&g}return!c}),c})}const O5=(i,e={})=>({tr:t,state:n,dispatch:s})=>{const{selection:r}=t,{empty:o,ranges:a}=r,l=Bi(i,n.schema);if(s)if(o){const c=Qf(n,l);t.addStoredMark(l.create(F(F({},c),e)))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;n.doc.nodesBetween(u,f,(d,p)=>{const g=Math.max(p,u),h=Math.min(p+d.nodeSize,f);d.marks.find(y=>y.type===l)?d.marks.forEach(y=>{l===y.type&&t.addMark(g,h,l.create(F(F({},y.attrs),e)))}):t.addMark(g,h,l.create(e))})});return R5(n,t,l)},D5=(i,e)=>({tr:t})=>(t.setMeta(i,e),!0),M5=(i,e={})=>({state:t,dispatch:n,chain:s})=>{const r=Bt(i,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),r.isTextblock?s().command(({commands:a})=>Cu(r,F(F({},o),e))(t)?!0:a.clearNodes()).command(({state:a})=>Cu(r,F(F({},o),e))(a,n)).run():!1},k5=i=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,s=Xi(i,0,n.content.size),r=je.create(n,s);e.setSelection(r)}return!0},N5=i=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:s,to:r}=typeof i=="number"?{from:i,to:i}:i,o=Xe.atStart(n).from,a=Xe.atEnd(n).to,l=Xi(s,o,a),c=Xi(r,o,a),u=Xe.create(n,l,c);e.setSelection(u)}return!0},x5=i=>({state:e,dispatch:t})=>{const n=Bt(i,e.schema);return mE(n)(e,t)};function Lu(i,e){const t=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();if(t){const n=t.filter(s=>e==null?void 0:e.includes(s.type.name));i.tr.ensureMarks(n)}}const U5=({keepMarks:i=!0}={})=>({tr:e,state:t,dispatch:n,editor:s})=>{const{selection:r,doc:o}=e,{$from:a,$to:l}=r,c=s.extensionManager.attributes,u=$r(c,a.node().type.name,a.node().attrs);if(r instanceof je&&r.node.isBlock)return!a.parentOffset||!ci(o,a.pos)?!1:(n&&(i&&Lu(t,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:S5(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&d?[{type:d,attrs:u}]:void 0,g=ci(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!g&&ci(e.doc,e.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(g=!0,p=d?[{type:d,attrs:u}]:void 0),n){if(g&&(r instanceof Xe&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const h=e.mapping.map(a.before()),m=e.doc.resolve(h);a.node(-1).canReplaceWith(m.index(),m.index()+1,d)&&e.setNodeMarkup(e.mapping.map(a.before()),d)}i&&Lu(t,s.extensionManager.splittableMarks),e.scrollIntoView()}return g},P5=(i,e={})=>({tr:t,state:n,dispatch:s,editor:r})=>{var o;const a=Bt(i,n.schema),{$from:l,$to:c}=n.selection,u=n.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const d=r.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(s){let y=we.empty;const R=l.index(-1)?1:l.index(-2)?2:3;for(let L=l.depth-R;L>=l.depth-3;L-=1)y=we.from(l.node(L).copy(y));const I=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,T=F(F({},$r(d,l.node().type.name,l.node().attrs)),e),C=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;y=y.append(we.from(a.createAndFill(null,C)||void 0));const _=l.before(l.depth-(R-1));t.replace(_,l.after(-I),new Me(y,4-R,0));let A=-1;t.doc.nodesBetween(_,t.doc.content.size,(L,E)=>{if(A>-1)return!1;L.isTextblock&&L.content.size===0&&(A=E+1)}),A>-1&&t.setSelection(Xe.near(t.doc.resolve(A))),t.scrollIntoView()}return!0}const p=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,g=F(F({},$r(d,f.type.name,f.attrs)),e),h=F(F({},$r(d,l.node().type.name,l.node().attrs)),e);t.delete(l.pos,c.pos);const m=p?[{type:a,attrs:g},{type:p,attrs:h}]:[{type:a,attrs:g}];if(!ci(t.doc,l.pos,2))return!1;if(s){const{selection:y,storedMarks:R}=n,{splittableMarks:I}=r.extensionManager,T=R||y.$to.parentOffset&&y.$from.marks();if(t.split(l.pos,2,m).scrollIntoView(),!T||!s)return!0;const C=T.filter(_=>I.includes(_.type.name));t.ensureMarks(C)}return!0},fa=(i,e)=>{const t=Bl(o=>o.type===e)(i.selection);if(!t)return!0;const n=i.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const s=i.doc.nodeAt(n);return t.node.type===(s==null?void 0:s.type)&&ms(i.doc,t.pos)&&i.join(t.pos),!0},ha=(i,e)=>{const t=Bl(o=>o.type===e)(i.selection);if(!t)return!0;const n=i.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const s=i.doc.nodeAt(n);return t.node.type===(s==null?void 0:s.type)&&ms(i.doc,n)&&i.join(n),!0},V5=(i,e,t,n={})=>({editor:s,tr:r,state:o,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:d}=s.extensionManager,p=Bt(i,o.schema),g=Bt(e,o.schema),{selection:h,storedMarks:m}=o,{$from:y,$to:R}=h,I=y.blockRange(R),T=m||h.$to.parentOffset&&h.$from.marks();if(!I)return!1;const C=Bl(_=>Tu(_.type.name,f))(h);if(I.depth>=1&&C&&I.depth-C.depth<=1){if(C.node.type===p)return c.liftListItem(g);if(Tu(C.node.type.name,f)&&p.validContent(C.node.content)&&a)return l().command(()=>(r.setNodeMarkup(C.pos,p),!0)).command(()=>fa(r,p)).command(()=>ha(r,p)).run()}return!t||!T||!a?l().command(()=>u().wrapInList(p,n)?!0:c.clearNodes()).wrapInList(p,n).command(()=>fa(r,p)).command(()=>ha(r,p)).run():l().command(()=>{const _=u().wrapInList(p,n),A=T.filter(L=>d.includes(L.type.name));return r.ensureMarks(A),_?!0:c.clearNodes()}).wrapInList(p,n).command(()=>fa(r,p)).command(()=>ha(r,p)).run()},B5=(i,e={},t={})=>({state:n,commands:s})=>{const{extendEmptyMarkRange:r=!1}=t,o=Bi(i,n.schema);return Ya(n,o,e)?s.unsetMark(o,{extendEmptyMarkRange:r}):s.setMark(o,e)},F5=(i,e,t={})=>({state:n,commands:s})=>{const r=Bt(i,n.schema),o=Bt(e,n.schema),a=mr(n,r,t);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?s.setNode(o,l):s.setNode(r,F(F({},l),t))},G5=(i,e={})=>({state:t,commands:n})=>{const s=Bt(i,t.schema);return mr(t,s,e)?n.lift(s):n.wrapIn(s,e)},H5=()=>({state:i,dispatch:e})=>{const t=i.plugins;for(let n=0;n<t.length;n+=1){const s=t[n];let r;if(s.spec.isInputRules&&(r=s.getState(i))){if(e){const o=i.tr,a=r.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(r.text){const l=o.doc.resolve(r.from).marks();o.replaceWith(r.from,r.to,i.schema.text(r.text,l))}else o.delete(r.from,r.to)}return!0}}return!1},$5=()=>({tr:i,dispatch:e})=>{const{selection:t}=i,{empty:n,ranges:s}=t;return n||e&&s.forEach(r=>{i.removeMark(r.$from.pos,r.$to.pos)}),!0},j5=(i,e={})=>({tr:t,state:n,dispatch:s})=>{var r;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=t,l=Bi(i,n.schema),{$from:c,empty:u,ranges:f}=a;if(!s)return!0;if(u&&o){let{from:d,to:p}=a;const g=(r=c.marks().find(m=>m.type===l))===null||r===void 0?void 0:r.attrs,h=zf(c,l,g);h&&(d=h.from,p=h.to),t.removeMark(d,p,l)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,l)});return t.removeStoredMark(l),!0},W5=(i,e={})=>({tr:t,state:n,dispatch:s})=>{let r=null,o=null;const a=Uo(typeof i=="string"?i:i.name,n.schema);return a?(a==="node"&&(r=Bt(i,n.schema)),a==="mark"&&(o=Bi(i,n.schema)),s&&t.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let f,d,p,g;t.selection.empty?n.doc.nodesBetween(c,u,(h,m)=>{r&&r===h.type&&(p=Math.max(m,c),g=Math.min(m+h.nodeSize,u),f=m,d=h)}):n.doc.nodesBetween(c,u,(h,m)=>{m<c&&r&&r===h.type&&(p=Math.max(m,c),g=Math.min(m+h.nodeSize,u),f=m,d=h),m>=c&&m<=u&&(r&&r===h.type&&t.setNodeMarkup(m,void 0,F(F({},h.attrs),e)),o&&h.marks.length&&h.marks.forEach(y=>{if(o===y.type){const R=Math.max(m,c),I=Math.min(m+h.nodeSize,u);t.addMark(R,I,o.create(F(F({},y.attrs),e)))}}))}
20),d&&(f!==void 0&&t.setNodeMarkup(f,void 0,F(F({},d.attrs),e)),o&&d.marks.length&&d.marks.forEach(h=>{o===h.type&&t.addMark(p,g,o.create(F(F({},h.attrs),e)))}))}),!0):!1},z5=(i,e={})=>({state:t,dispatch:n})=>{const s=Bt(i,t.schema);return cE(s,e)(t,n)},K5=(i,e={})=>({state:t,dispatch:n})=>{const s=Bt(i,t.schema);return uE(s,e)(t,n)};var Y5=Object.freeze({__proto__:null,blur:kE,clearContent:NE,clearNodes:xE,command:UE,createParagraphNear:PE,cut:VE,deleteCurrentNode:BE,deleteNode:FE,deleteRange:GE,deleteSelection:HE,enter:$E,exitCode:jE,extendMarkRange:WE,first:zE,focus:YE,forEach:qE,insertContent:JE,insertContentAt:XE,joinBackward:n5,joinDown:t5,joinForward:i5,joinItemBackward:s5,joinItemForward:r5,joinTextblockBackward:o5,joinTextblockForward:a5,joinUp:e5,keyboardShortcut:c5,lift:u5,liftEmptyBlock:d5,liftListItem:f5,newlineInCode:h5,resetAttributes:p5,scrollIntoView:g5,selectAll:m5,selectNodeBackward:v5,selectNodeForward:C5,selectParentNode:_5,selectTextblockEnd:y5,selectTextblockStart:I5,setContent:E5,setMark:O5,setMeta:D5,setNode:M5,setNodeSelection:k5,setTextSelection:N5,sinkListItem:x5,splitBlock:U5,splitListItem:P5,toggleList:V5,toggleMark:B5,toggleNode:F5,toggleWrap:G5,undoInputRule:H5,unsetAllMarks:$5,unsetMark:j5,updateAttributes:W5,wrapIn:z5,wrapInList:K5});const q5=yn.create({name:"commands",addCommands(){return F({},Y5)}}),J5=yn.create({name:"drop",addProseMirrorPlugins(){return[new Mn({key:new Jn("tiptapDrop"),props:{handleDrop:(i,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}}),Q5=yn.create({name:"editable",addProseMirrorPlugins(){return[new Mn({key:new Jn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Z5=new Jn("focusEvents"),X5=yn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:i}=this;return[new Mn({key:Z5,props:{handleDOMEvents:{focus:(e,t)=>{i.isFocused=!0;const n=i.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{i.isFocused=!1;const n=i.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),eS=yn.create({name:"keymap",addKeyboardShortcuts(){const i=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:d,parent:p}=f,g=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,h=g.parent.type.spec.isolating,m=f.pos-f.parentOffset,y=h&&g.parent.childCount===1?m===f.pos:ot.atStart(c).from===d;return!u||!p.type.isTextblock||p.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:i,"Mod-Backspace":i,"Shift-Backspace":i,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s=F({},n),r=Z(F({},n),{"Ctrl-h":i,"Alt-Backspace":i,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()});return Vl()||Jf()?r:s},addProseMirrorPlugins(){return[new Mn({key:new Jn("clearDocument"),appendTransaction:(i,e,t)=>{if(i.some(h=>h.getMeta("composition")))return;const n=i.some(h=>h.docChanged)&&!e.doc.eq(t.doc),s=i.some(h=>h.getMeta("preventClearDocument"));if(!n||s)return;const{empty:r,from:o,to:a}=e.selection,l=ot.atStart(e.doc).from,c=ot.atEnd(e.doc).to;if(r||!(o===l&&a===c)||!Po(t.doc))return;const d=t.tr,p=Mo({state:t,transaction:d}),{commands:g}=new ko({editor:this.editor,state:p});if(g.clearNodes(),!!d.steps.length)return d}})]}}),tS=yn.create({name:"paste",addProseMirrorPlugins(){return[new Mn({key:new Jn("tiptapPaste"),props:{handlePaste:(i,e,t)=>
vendor: 9,847 bytes, lines 20-94
20{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),nS=yn.create({name:"tabindex",addProseMirrorPlugins(){return[new Mn({key:new Jn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class ji{get name(){return this.node.type.name}constructor(e,t,n=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0)return;t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new ji(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new ji(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new ji(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,n)=>{const s=t.isBlock&&!t.isTextblock,r=t.isAtom&&!t.isText,o=this.pos+n+(r?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!s&&a.depth<=this.depth)return;const l=new ji(a,this.editor,s,s?t:null);s&&(l.actualDepth=this.depth+1),e.push(new ji(a,this.editor,s,s?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,s=this.parent;for(;s&&!n;){if(s.node.type.name===e)if(Object.keys(t).length>0){const r=s.node.attrs,o=Object.keys(t);for(let a=0;a<o.length;a+=1){const l=o[a];if(r[l]!==t[l])break}}else n=s;s=s.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let s=[];if(!this.children||this.children.length===0)return s;const r=Object.keys(t);return this.children.forEach(o=>{n&&s.length>0||(o.node.type.name===e&&r.every(l=>t[l]===o.node.attrs[l])&&s.push(o),!(n&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,t,n))))}),s}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,F(F({},this.node.attrs),e)),this.editor.view.dispatch(t)}}const iS=`.ProseMirror {
21  position: relative;
22}
23
24.ProseMirror {
25  word-wrap: break-word;
26  white-space: pre-wrap;
27  white-space: break-spaces;
28  -webkit-font-variant-ligatures: none;
29  font-variant-ligatures: none;
30  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
31}
32
33.ProseMirror [contenteditable="false"] {
34  white-space: normal;
35}
36
37.ProseMirror [contenteditable="false"] [contenteditable="true"] {
38  white-space: pre-wrap;
39}
40
41.ProseMirror pre {
42  white-space: pre-wrap;
43}
44
45img.ProseMirror-separator {
46  display: inline !important;
47  border: none !important;
48  margin: 0 !important;
49  width: 0 !important;
50  height: 0 !important;
51}
52
53.ProseMirror-gapcursor {
54  display: none;
55  pointer-events: none;
56  position: absolute;
57  margin: 0;
58}
59
60.ProseMirror-gapcursor:after {
61  content: "";
62  display: block;
63  position: absolute;
64  top: -2px;
65  width: 20px;
66  border-top: 1px solid black;
67  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
68}
69
70@keyframes ProseMirror-cursor-blink {
71  to {
72    visibility: hidden;
73  }
74}
75
76.ProseMirror-hideselection *::selection {
77  background: transparent;
78}
79
80.ProseMirror-hideselection *::-moz-selection {
81  background: transparent;
82}
83
84.ProseMirror-hideselection * {
85  caret-color: transparent;
86}
87
88.ProseMirror-focused .ProseMirror-gapcursor {
89  display: block;
90}
91
92.tippy-box[data-animation=fade][data-state=hidden] {
93  opacity: 0
94}`;function sS(i,e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=i,document.getElementsByTagName("head")[0].appendChild(s),s}class rS extends vE{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:n,moved:s})=>this.options.onDrop(t,n,s)),this.on("paste",({event:t,slice:n})=>this.options.onPaste(t,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=sS(iS,this.options.injectNonce))}setOptions(e={}){this.options=F(F({},this.options),e),!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=Hf(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],s=this.state.reconfigure({plugins:n});return this.view.updateState(s),s}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(r=>{const o=typeof r=="string"?`${r}$`:r.key;n=n.filter(a=>!a.key.startsWith(o))}),t.length===n.length)return;const s=this.state.reconfigure({plugins:n});return this.view.updateState(s),s}createExtensionManager(){var e,t;const s=[...this.options.enableCoreExtensions?[Q5,ME.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),q5,X5,eS,nS,J5,tS].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new ws(s,this)}createCommandManager(){this.commandManager=new ko({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=Ka(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),t=Ka(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=Yf(t,this.options.autofocus);this.view=new bf(this.options.element,Z(F({},this.options.editorProps),{attributes:F({role:"textbox"},(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes),dispatchTransaction:this.dispatchTransaction.bind(this),state:Ls.create({doc:t,selection:n||void 0})}));const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.createNodeViews(),this.prependClass();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);
94this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=e.getMeta("focus"),r=e.getMeta("blur");s&&this.emit("focus",{editor:this,event:s.event,transaction:e}),r&&this.emit("blur",{editor:this,event:r.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return A5(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,s=typeof e=="string"?t:e;return b5(this.state,n,s)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ul(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
95
96`,textSerializers:n={}}=e||{};return L5(this.state.doc,{blockSeparator:t,textSerializers:F(F({},jf(this.schema)),n)})}get isEmpty(){return Po(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new ji(t,this)}get $doc(){return this.$pos(0)}}function oS(i){return new EE({find:i.find,handler:({state:e,range:t,match:n})=>{const s=lt(i.getAttributes,void 0,n)||{},{tr:r}=e,o=t.from;let a=t.to;const l=i.type.create(s);if(n[1]){const c=n[0].lastIndexOf(n[1]);let u=o+c;u>a?u=a:a=u+n[1].length;const f=n[0][n[0].length-1];r.insertText(f,o+n[0].length-1),r.replaceWith(u,a,l)}else if(n[0]){const c=i.type.isInline?o:o-1;r.insert(c,i.type.create(s)).delete(r.mapping.map(o),r.mapping.map(a))}r.scrollIntoView()}})}class di{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=F(F({},this.config),e),this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0,this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=lt(ke(this,"addOptions",{name:this.name}))),this.storage=lt(ke(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new di(e)}configure(e={}){const t=this.extend(Z(F({},this.config),{addOptions:()=>xo(this.options,e)}));return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new di(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0,t.options=lt(ke(t,"addOptions",{name:t.name})),t.storage=lt(ke(t,"addStorage",{name:t.name,options:t.options})),t}}function aS(i){return i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const lS=di.create({name:"doc",topNode:!0,content:"block+"}),cS=di.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:i}){return["p",Ai(this.options.HTMLAttributes,i),0]},addCommands(){return{setParagraph:()=>({commands:i})=>i.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uS=yn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Mn({key:new Jn("placeholder"),props:{decorations:({doc:i,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,s=[];if(!t)return null;const r=this.editor.isEmpty;return i.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&Po(o);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];r&&u.push(this.options.emptyEditorClass);const f=vn.node(a,a+o.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});s.push(f)}return this.options.includeChildren}),At.create(i,s)}}})]}}),dS=di.create({name:"text",group:"inline"});function fS(i){var e;const{char:t,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:r,startOfLine:o,$position:a}=i,l=n&&!s,c=aS(t),u=new RegExp(`\\s${c}$`),f=o?"^":"",d=s?"":c,p=l?new RegExp(`${f}${c}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${c}[^\\s${d}]*`,"gm"),g=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!g)return null;const h=a.pos-g.length,m=Array.from(g.matchAll(p)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const y=m.input.slice(Math.max(0,m.index-1),m.index),R=new RegExp(`^[${r==null?void 0:r.join("")}\0]?$`).test(y);if(r!==null&&!R)return null;const I=h+m.index;let T=I+m[0].length;return l&&u.test(g.slice(T-1,T+1))&&(m[0]+=" ",T+=1),I<a.pos&&T>=a.pos?{range:{from:I,to:T},query:m[0].slice(t.length),text:m[0]}:null}const hS=new Jn("suggestion");function pS({pluginKey:i=hS,editor:e,char:t="@",allowSpaces:n=!1,allowToIncludeChar:s=!1,allowedPrefixes:r=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:d=()=>[],render:p=()=>({}),allow:g=()=>!0,findSuggestionMatch:h=fS}){let m;const y=p==null?void 0:p(),R=new Mn({key:i,view(){return{update:(I,T)=>ye(this,null,function*(){var C,_,A,L,E,M,B;const b=(C=this.key)===null||C===void 0?void 0:C.getState(T),k=(_=this.key)===null||_===void 0?void 0:_.getState(I.state),U=b.active&&k.active&&b.range.from!==k.range.from,O=!b.active&&k.active,D=b.active&&!k.active,J=!O&&!D&&b.query!==k.query,ee=O||U&&J,se=J||U,ue=D||U&&J;if(!ee&&!se&&!ue)return;const oe=ue&&!ee?b:k,W=I.dom.querySelector(`[data-decoration-id="${oe.decorationId}"]`);m={editor:e,range:oe.range,query:oe.query,text:oe.text,items:[],command:V=>f({editor:e,range:oe.range,props:V}),decorationNode:W,clientRect:W?()=>{var V;const{decorationId:S}=(V=this.key)===null||V===void 0?void 0:V.getState(e.state),x=I.dom.querySelector(`[data-decoration-id="${S}"]`);return(x==null?void 0:x.getBoundingClientRect())||null}:null},ee&&((A=y==null?void 0:y.onBeforeStart)===null||A===void 0||A.call(y,m)),se&&((L=y==null?void 0:y.onBeforeUpdate)===null||L===void 0||L.call(y,m)),(se||ee)&&(m.items=yield d({editor:e,query:oe.query})),ue&&((E=y==null?void 0:y.onExit)===null||E===void 0||E.call(y,m)),se&&((M=y==null?void 0:y.onUpdate)===null||M===void 0||M.call(y,m)),ee&&((B=y==null?void 0:y.onStart)===null||B===void 0||B.call(y,m))}),destroy:()=>{var I;m&&((I=y==null?void 0:y.onExit)===null||I===void 0||I.call(y,m))}}}
96,state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(I,T,C,_){const{isEditable:A}=e,{composing:L}=e.view,{selection:E}=I,{empty:M,from:B}=E,b=F({},T);if(b.composing=L,A&&(M||e.view.composing)){(B<T.range.from||B>T.range.to)&&!L&&!T.composing&&(b.active=!1);const k=h({char:t,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:r,startOfLine:o,$position:E.$from}),U=`id_${Math.floor(Math.random()*4294967295)}`;k&&g({editor:e,state:_,range:k.range,isActive:T.active})?(b.active=!0,b.decorationId=T.decorationId?T.decorationId:U,b.range=k.range,b.query=k.query,b.text=k.text):b.active=!1}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}},props:{handleKeyDown(I,T){var C;const{active:_,range:A}=R.getState(I.state);return _&&((C=y==null?void 0:y.onKeyDown)===null||C===void 0?void 0:C.call(y,{view:I,event:T,range:A}))||!1},decorations(I){const{active:T,range:C,decorationId:_,query:A}=R.getState(I);if(!T)return null;const L=!(A!=null&&A.length),E=[l];return L&&E.push(u),At.create(I.doc,[vn.inline(C.from,C.to,{nodeName:a,class:E.join(" "),"data-decoration-id":_,"data-decoration-content":c})])}}});return R}function gS({editor:i,overrideSuggestionOptions:e,extensionName:t,char:n="@"}){const s=new Jn;return F({editor:i,char:n,pluginKey:s,command:({editor:r,range:o,props:a})=>{var l,c,u;const f=r.view.state.selection.$to.nodeAfter;((l=f==null?void 0:f.text)===null||l===void 0?void 0:l.startsWith(" "))&&(o.to+=1),r.chain().focus().insertContentAt(o,[{type:t,attrs:Z(F({},a),{mentionSuggestionChar:n})},{type:"text",text:" "}]).run(),(u=(c=r.view.dom.ownerDocument.defaultView)===null||c===void 0?void 0:c.getSelection())===null||u===void 0||u.collapseToEnd()},allow:({state:r,range:o})=>{const a=r.doc.resolve(o.from),l=r.schema.nodes[t];return!!a.parent.type.contentMatch.matchType(l)}},e)}function Zf(i){return(i.options.suggestions.length?i.options.suggestions:[i.options.suggestion]).map(e=>gS({editor:i.editor,overrideSuggestionOptions:e,extensionName:i.name,char:e.char}))}function wu(i,e){const t=Zf(i),n=t.find(s=>s.char===e);return n||(t.length?t[0]:null)}const mS=di.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:i,suggestion:e}){var t,n;return`${(t=e==null?void 0:e.char)!==null&&t!==void 0?t:"@"}${(n=i.attrs.label)!==null&&n!==void 0?n:i.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:i,node:e,suggestion:t}){var n,s;return["span",Ai(this.HTMLAttributes,i.HTMLAttributes),`${(n=t==null?void 0:t.char)!==null&&n!==void 0?n:"@"}${(s=e.attrs.label)!==null&&s!==void 0?s:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:i=>i.getAttribute("data-id"),renderHTML:i=>i.id?{"data-id":i.id}:{}},label:{default:null,parseHTML:i=>i.getAttribute("data-label"),renderHTML:i=>i.label?{"data-label":i.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:i=>i.getAttribute("data-mention-suggestion-char"),renderHTML:i=>({"data-mention-suggestion-char":i.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:i,HTMLAttributes:e}){const t=wu(this,i.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return["span",Ai({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:i,suggestion:t})];const n=F({},this.options);n.HTMLAttributes=Ai({"data-type":this.name},this.options.HTMLAttributes,e);const s=this.options.renderHTML({options:n,node:i,suggestion:t});return typeof s=="string"?["span",Ai({"data-type":this.name},this.options.HTMLAttributes,e),s]:s},renderText({node:i}){const e={options:this.options,node:i,suggestion:wu(this,i.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?this.options.renderLabel(e):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:i,state:e})=>{let t=!1;const{selection:n}=e,{empty:s,anchor:r}=n;if(!s)return!1;e.doc.nodesBetween(r-1,r,(l,c)=>
96{if(l.type.name===this.name)return t=!0,i.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",c,c+l.nodeSize),!1});let o=new li,a=0;return e.doc.nodesBetween(r-1,r,(l,c)=>{if(l.type.name===this.name)return t=!0,o=l,a=c,!1}),t&&i.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,a,a+o.nodeSize),t})}},addProseMirrorPlugins(){return Zf(this).map(pS)}}),vS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Au=di.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:i}){return["img",Ai(this.options.HTMLAttributes,i)]},addCommands(){return{setImage:i=>({commands:e})=>e.insertContent({type:this.name,attrs:i})}}
96,addInputRules(){return[oS({find:vS,type:this.type,getAttributes:i=>{const[,,e,t,n]=i;return{src:t,alt:e,title:n}}})]}}),CS=Au.extend({name:"custom-image",addAttributes(){return Wr(Wr({},Au.config.addAttributes()),{},{class:{default:"image",rendered:!1}})},addCommands(){return{setImage:i=>e=>{var t,{tr:n,commands:s}=e;return((t=n.selection)===null||t===void 0||(t=t.node)===null||t===void 0||(t=t.type)===null||t===void 0?void 0:t.name)=="custom-image"?s.updateAttributes("custom-image",i):s.insertContent({type:this.name,attrs:i})}}},renderHTML(i){var e,{node:t,HTMLAttributes:n}=i;return n.class=((e=t.attrs.class)!==null&&e!==void 0&&e.includes("custom-image-")?"":"custom-image-")+t.attrs.class,["img",n]}});var pa="",qa=[],es=[],on=[],cs=0,Si=!1,Ja,_S={userID:Fe.TYPES.MSG_AT_ALL,nick:"所有人",isAll:!0,avatar:"https://web.sdk.qcloud.com/im/assets/images/at.svg"};Ee.watch(be.CONV,{currentConversationID:i=>{if(i!==pa){var e;pa=i,(e=pa)!==null&&e!==void 0&&e.startsWith("GROUP")?Si=!0:(Si=!1,qa=[],es=[],on=[])}}});Ee.watch(be.CUSTOM,{memberList:i=>{Si&&Array.isArray(i)&&(qa=i,es=[_S,...qa].filter(e=>e.userID!==rl&&e.userID!==Fe.chat.getLoginUser()),on=es)}});var yS=()=>({allowedPrefixes:null,items:i=>{var e;if(Si){var t=(e=es)===null||e===void 0?void 0:e.filter(n=>{var s,r,o,a;return(n==null||(s=n.nick)===null||s===void 0||(s=s.toLowerCase())===null||s===void 0?void 0:s.startsWith(i==null||(r=i.query)===null||r===void 0?void 0:r.toLowerCase()))||(n==null||(o=n.userID)===null||o===void 0||(o=o.toLowerCase())===null||o===void 0?void 0:o.startsWith(i==null||(a=i.query)===null||a===void 0?void 0:a.toLowerCase()))});return on=t!=null&&t.length?t:es,nt.setShowMemberList(on),on}},render:()=>({onStart:i=>{if(Si&&(nt.toggleAtList(!0),!!(i!=null&&i.clientRect))){var e=i==null?void 0:i.clientRect();e!=null&&e.left&&e!==null&&e!==void 0&&e.top&&!Kn&&nt.handleAtListPosition({left:e==null?void 0:e.left,top:e==null?void 0:e.top}),Ja=i.command}},onUpdate(i){if(Si&&i!=null&&i.clientRect){var e=i==null?void 0:i.clientRect();e!=null&&e.left&&e!==null&&e!==void 0&&e.top&&!Kn&&nt.handleAtListPosition({left:e==null?void 0:e.left,top:e==null?void 0:e.top})}},onKeyDown(i){if(Si){if(i.event.key==="Enter"){var e,t;(e=i.event)===null||e===void 0||e.stopPropagation(),(t=i.event)===null||t===void 0||t.preventDefault()}return i.event.key==="Escape"?(nt.toggleAtList(!1),on=es,!0):(i==null?void 0:i.event.key)==="ArrowUp"?(IS(),!0):(i==null?void 0:i.event.key)==="ArrowDown"?(ES(),!0):(i==null?void 0:i.event.key)==="Enter"?(SS(),!0):!1}},onExit(){Si&&(nt.toggleAtList(!1),on=es,nt.handleAtListPosition({left:0,top:0}))}})}),IS=()=>{var i,e,t;(i=on)!==null&&i!==void 0&&i.length&&(cs=(cs+((e=on)===null||e===void 0?void 0:e.length)-1)%((t=on)===null||t===void 0?void 0:t.length),nt.setCurrentSelectIndex(cs))},ES=()=>{var i,e;(i=on)!==null&&i!==void 0&&i.length&&(cs=(cs+1)%((e=on)===null||e===void 0?void 0:e.length),nt.setCurrentSelectIndex(cs))},SS=()=>{Xf(cs)},Xf=i=>{var e;if((e=on)!==null&&e!==void 0&&e.length){var t=on[i];t&&Ja&&Ja({id:t==null?void 0:t.userID,label:(t==null?void 0:t.nick)||(t==null?void 0:t.userID)})}};nt.selectItem=Xf;var bu=navigator.userAgent;function TS(){return Bu?/Safari\//.test(bu)||/IOS 11_[0-3]\D/.test(bu)?0:1:2}function LS(i,e){var t=TS(),n;e||(e=i);var s=()=>{if(t!==0)if(t===1)document.body.scrollTop=document.body.scrollHeight;else{var r;(r=e)===null||r===void 0||r.scrollIntoView(!1)}};i.addEventListener("focus",()=>{var r=setTimeout(()=>{s(),clearTimeout(r)},300);n=setTimeout(s,1e3)}),i.addEventListener("blur",()=>{if(clearTimeout(n),t&&Bu)var r=setTimeout(()=>{document.body.scrollIntoView(),clearTimeout(r)})})}const wS=di.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:i}){return["br",Ai(this.options.HTMLAttributes,i)]},renderText(){return`
97`},addCommands(){return{setHardBreak:()=>({commands:i,chain:e,state:t,editor:n})=>i.first([()=>i.exitCode(),()=>i.command(()=>{const{selection:s,storedMarks:r}=t;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=n.extensionManager,l=r||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>
97{if(u&&l&&o){const f=l.filter(d=>a.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),AS=ge({__name:"message-input-editor-pc",props:{placeholder:{type:String,default:"this is placeholder"},replayOrReferenceMessage:{type:Object,default:()=>({})},isMuted:{type:Boolean,default:!0},muteText:{type:String,default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableDragUpload:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0}},emits:["sendMessage","onTyping","onAt"],setup(i,{expose:e,emit:t}){const n=i,s=t,{placeholder:r,enableAt:o,enableDragUpload:a,enableTyping:l}=$e(n),c=P(!0),u=P(!0),f=P(!1),d=P(""),p=P(),g=P();let h=null;const m=new Map,y=yn.create({addKeyboardShortcuts(){return{Enter:()=>!0}}});function R($){d.value!==$&&(d.value&&bs.setStore(d.value,H(),bs.generateAbstract(ee()),p.value),x(),$&&bs.getStore($,z)),d.value=$}function I($){p.value=$}et(()=>{if(h=Se.value?new rS({element:g.value,extensions:[lS,cS,dS,wS,y,uS.configure({emptyEditorClass:"is-editor-empty",placeholder:r.value}),mS.configure({HTMLAttributes:{class:"mention"},deleteTriggerWithBackspace:!0,suggestion:o.value&&yS()}),CS.configure({inline:!0,allowBase64:!0})],autofocus:!!Se.value,editable:!0,injectCSS:!1,editorProps:{transformPastedText(){return""}},onUpdate({editor:$,transaction:Q}){var Ce,Ie;!l.value||!f.value||(u.value=!$.isFocused,((Ie=(Ce=Q==null?void 0:Q.doc)==null?void 0:Ce.content)==null?void 0:Ie.size)>2?c.value=!1:c.value=!0)},onFocus(){var $;if(!Se.value&&(($=document==null?void 0:document.getElementById("app"))!=null&&$.style)){const Q=document.body.scrollHeight-window.innerHeight;document.getElementById("app").style.marginBottom=`${Q}px`,document.getElementById("app").style.height=`calc(100% - ${Q}px)`}!l.value||!f.value||(u.value=!0)},onBlur(){var $;!Se.value&&(($=document==null?void 0:document.getElementById("app"))!=null&&$.style)&&(document.getElementById("app").style.marginBottom="",document.getElementById("app").style.height="100%"),!(!l.value||!f.value)&&(u.value=!0)}}):null,!Se.value){const $=document.querySelector(".message-input-toolbar")||g.value;LS(g.value,$)}
97Ee.watch(be.CONV,{currentConversationID:R}),Ee.watch(be.CHAT,{quoteMessage:I}),uni.$on("send-text-message",$=>{s("sendMessage",$)}),uni.$on("insert-emoji",$=>{V($)}),uni.$on("insert-text",$=>{var Q;(Q=h==null?void 0:h.commands)==null||Q.insertContent($)})}),st(()=>{Ee.unwatch(be.CONV,{currentConversationID:R}),Ee.unwatch(be.CHAT,{quoteMessage:I}),uni.$off("send-text-message"),uni.$off("insert-emoji"),uni.$off("insert-text"),m.clear()});function T($){var Q;Se.value&&($==null||$.preventDefault(),$==null||$.stopPropagation(),$.keyCode===13&&$.ctrlKey?(Q=h==null?void 0:h.commands)==null||Q.insertContent("<p></p>"):$.keyCode===13&&s("sendMessage"))}function C($){var Q;Se.value||($.data==="@"&&s("onAt",!0),c.value=!((Q=g.value)!=null&&Q.childNodes))}function _(){!Se.value&&(u.value=!0)}function A(){!Se.value&&(u.value=!1)}function L($){var Ce,Ie,_e,K;if(Se.value){(Ce=h==null?void 0:h.commands)==null||Ce.focus(),(Ie=h==null?void 0:h.commands)==null||Ie.insertContent({type:"mention",attrs:{id:$.id,label:$.label.replace(/^@/,"")}}),(_e=h==null?void 0:h.commands)==null||_e.scrollIntoView();return}const Q=document.createElement("span");Q.innerHTML=$.label,Q.className="mention",Q.id=$.id,(K=g.value)==null||K.appendChild(Q)}function E($){Se.value&&b($,"drop")}function M($){$.clipboardData&&(Se.value&&$.clipboardData.files.length?b($,"paste"):(B($),Oe(g.value)))}function B($){var Ie,_e;$.preventDefault();const Q=(Ie=$.clipboardData)==null?void 0:Ie.getData("text/html"),Ce=((_e=$.clipboardData)==null?void 0:_e.getData("text/plain"))||"";if(!Q){const K=Wu(Ce);de(K)}}function b($,Q){return ye(this,null,function*(){var Ce,Ie,_e;if($.preventDefault(),$.stopPropagation(),!(!a.value&&Q==="drop")&&(Q==="drop"&&$.dataTransfer||Q==="paste"&&$.clipboardData)){const K=Q==="drop"?(Ce=$==null?void 0:$.dataTransfer)==null?void 0:Ce.files:(Ie=$==null?void 0:$.clipboardData)==null?void 0:Ie.files;for(let ce=0;ce<K.length;ce++){const Le=K[ce],Ue=Le.type.startsWith("image/"),St=Ue?URL.createObjectURL(Le):yield O(Le);(_e=h==null?void 0:h.commands)==null||_e.insertContent({type:"custom-image",attrs:{src:St,alt:Le==null?void 0:Le.name,class:Ue?"normal":"file"}}),m.set(St,Le),ce===K.length-1&&setTimeout(()=>{var te,De;(te=h==null?void 0:h.commands)==null||te.focus("end"),(De=h==null?void 0:h.commands)==null||De.scrollIntoView()},10)}}})}const k=new Map,U=($,Q)=>new Promise((Ce,Ie)=>{if(k.has(Q))Ce(k.get(Q));else{const _e=new Image;_e.crossOrigin="anonymous",_e.onload=()=>{k.set(Q,_e),Ce(_e)},_e.onerror=Ie,_e.src=$}}),O=$=>ye(this,null,function*(){const{name:Q,type:Ce}=$,Ie=document.createElement("canvas"),_e=160,K=50;Ie.style.width=_e+"px",Ie.style.height=K+"px";const ce=window.devicePixelRatio;Ie.width=Math.floor(_e*ce),Ie.height=Math.floor(K*ce);const Le=Ie.getContext("2d");if(!Le)return"";Le.scale(ce,ce);const{iconSrc:Ue,iconType:St}=D(Ce),te=yield U(Ue,St);Le==null||Le.drawImage(te,10,10,30,30);const De=J(Q);return Le.fillText(De,45,22),Ie.toDataURL()}),D=$=>{const Q="https://web.sdk.qcloud.com/component/TUIKit/assets/file-",Ce=["image","pdf","text","ppt","presentation","sheet","zip","word","video","unknown"];let Ie="",_e="";return Ce.forEach(K=>{$.includes(K)&&(Ie=Q+K+".svg",_e=K)}),{iconSrc:Ie||Q+"unknown.svg",iconType:_e||"unknown"}},J=$=>{if(!$)return $;let Q="",Ce=0;for(let Ie=0;Ie<($==null?void 0:$.length);Ie++){if(Ce>16){Q+="...";break}Q+=$[Ie],/[a-z]|[0-9]|[,;.!@#-+/\\$%^*()<>?:"'{}~]/i.test($[Ie])?Ce+=1:Ce+=2}return Q};function ee(){return Se.value?se():W()}function se(){var Ce,Ie;const $=h==null?void 0:h.getJSON(),Q=[];if(ue($,Q),Q.length>0&&Q[Q.length-1]&&Q[Q.length-1].type==="text"&&((Ie=(Ce=Q[Q.length-1].payload)==null?void 0:Ce.text)!=null&&Ie.endsWith(`
98`))){const _e=Q[Q.length-1].payload.text||"";Q[Q.length-1].payload.text=_e==null?void 0:_e.substring(0,_e.lastIndexOf(`
99`))}return Q}function ue($,Q){var Ce;if(!(!$||!$.type))if($.type!=="text"&&$.type!=="custom-image"&&$.type!=="mention"){($.type==="paragraph"||$.type==="hardBreak")&&oe($,Q),(Ce=$.content)!=null&&Ce.length&&$.content.forEach(Ie=>{ue(Ie,Q)});return}else oe($,Q)}function oe($,Q){var Ce,Ie,_e,K,ce,Le,Ue,St,te,De,ut,Ke,un,jt,dn,kn,Nn,$n,xn,rn,wt,en;if($.type==="hardBreak")Q.length>0&&Q[Q.length-1]&&((Ce=Q[Q.length-1])==null?void 0:Ce.type)==="text"?Q[Q.length-1].payload.text+=`
100`:Q.push({type:"text",payload:{text:`
101`}});else if($.type==="paragraph")Q.length>0&&Q[Q.length-1]&&((Ie=Q[Q.length-1])==null?void 0:Ie.type)==="text"&&(Q[Q.length-1].payload.text+=`
102`);else if($.type==="text"||$.type==="custom-image"&&((K=(_e=$==null?void 0:$.attrs)==null?void 0:_e.class)!=null&&K.includes("emoji"))){const Tn=$.type==="text"?$==null?void 0:$.text:(ce=$==null?void 0:$.attrs)==null?void 0:ce.alt;Q.length>0&&Q[Q.length-1]&&((Le=Q[Q.length-1])==null?void 0:Le.type)==="text"?Q[Q.length-1].payload.text+=Tn:Q.push({type:"text",payload:{text:Tn}})}else if($.type==="custom-image"&&((St=(Ue=$==null?void 0:$.attrs)==null?void 0:Ue.class)!=null&&St.includes("normal")))Q.push({type:"image",payload:{file:m==null?void 0:m.get((te=$==null?void 0:$.attrs)==null?void 0:te.src)}});else if($.type==="custom-image"&&((ut=(De=$==null?void 0:$.attrs)==null?void 0:De.class)!=null&&ut.includes("file"))){const Tn=m==null?void 0:m.get((Ke=$==null?void 0:$.attrs)==null?void 0:Ke.src);Q.push({type:(un=Tn==null?void 0:Tn.type)!=null&&un.includes("video")?"video":"file",payload:{file:Tn}})}else if($.type==="mention"){const Tn="@"+((jt=$==null?void 0:$.attrs)==null?void 0:jt.label);Q.length>0&&Q[Q.length-1]&&((dn=Q[Q.length-1])==null?void 0:dn.type)==="text"?Q[Q.length-1].payload.text+=Tn:Q.push({type:"text",payload:{text:Tn}}),(Nn=(kn=Q[Q.length-1])==null?void 0:kn.payload)!=null&&Nn.atUserList?(wt=(xn=($n=Q[Q.length-1])==null?void 0:$n.payload)==null?void 0:xn.atUserList)==null||wt.push((rn=$==null?void 0:$.attrs)==null?void 0:rn.id):Q[Q.length-1].payload.atUserList=[(en=$==null?void 0:$.attrs)==null?void 0:en.id]}}function W(){var Ie,_e,K;const $=g.value;let Q="";const Ce=[];try{for(const ce of $==null?void 0:$.childNodes)(ce.nodeName==="#text"||ce.nodeName==="SPAN"||(Ie=ce.classList)!=null&&Ie.contains("custom-image-emoji")||(_e=ce.classList)!=null&&_e.contains("mention"))&&(Q+=ce.nodeValue||ce.alt||ce.innerHTML||"",(K=ce.classList)!=null&&K.contains("mention")&&ce.id&&!(Ce!=null&&
102Ce.includes(ce.id))&&Ce.push(ce.id))}catch(ce){if(ce instanceof Error)throw ce}return[{type:"text",payload:{text:Q,atUserList:Ce}}]}function V($){var Q,Ce,Ie,_e,K;if(Se.value)(Q=h==null?void 0:h.commands)==null||Q.insertContent({type:"custom-image",attrs:{src:$==null?void 0:$.url,alt:$==null?void 0:$.emoji.key,title:$==null?void 0:$.emoji.key,class:"emoji"}});else{const ce=document.createElement("img");ce==null||ce.setAttribute("src",$==null?void 0:$.url),ce==null||ce.setAttribute("class","custom-image custom-image-emoji"),ce==null||ce.setAttribute("alt",$==null?void 0:$.emoji.key),ce==null||ce.setAttribute("title",$==null?void 0:$.emoji.key),ce==null||ce.setAttribute("width","20px"),ce==null||ce.setAttribute("height","20px"),(Ce=g.value)==null||Ce.appendChild(ce);const Le=document.createElement("span");Le.contentEditable="true",(Ie=g.value)==null||Ie.appendChild(Le)}Se.value&&((_e=h==null?void 0:h.commands)==null||_e.focus(),(K=h==null?void 0:h.commands)==null||K.scrollIntoView())}function S(){var $,Q;Se.value?($=h==null?void 0:h.commands)==null||$.blur():(Q=g.value)==null||Q.blur()}function x(){var $;($=h==null?void 0:h.commands)==null||$.clearContent(!0),u.value=!0,c.value=!0,!Se.value&&(g.value.innerHTML="")}function H(){var $;return Se.value?h==null?void 0:h.getHTML():($=g.value)==null?void 0:$.innerHTML}function z($){var Q;Se.value?(Q=h==null?void 0:h.commands)==null||Q.setContent($):g.value.innerHTML=$}function de($){const Q=window.getSelection();if(Q&&Q.rangeCount){const Ce=Q.getRangeAt(0);$.forEach(Ie=>{const _e=[];if(Ie.type==="image")_e.push(Te(Ie.emojiKey||"",Ie.content));else{const K=Ie.content.split(/\n/g);K.forEach((ce,Le)=>{_e.push(he(ce)),Le!==K.length-1&&_e.push(document.createElement("br"))})}_e.forEach(K=>{if(Ce.insertNode(K),Ce.setStartAfter(K),Ie.type==="image"&&!Se.value){const ce=document.createElement("span");ce.contentEditable="true",Ce.insertNode(ce),Ce.setStartAfter(ce)}})}),Ce.collapse(!1),Q.removeAllRanges(),Q.addRange(Ce)}}function he($){return document.createTextNode($)}function Te($,Q){const Ce=document.createElement("img");return Ce.src=Q,Ce.alt=$||"",Ce.classList.add("custom-image","custom-image-emoji"),Ce.width=20,Ce.height=20,Ce}function Oe($){const Q=window.getSelection();if(Q&&Q.rangeCount>0){const Ce=Q.getRangeAt(0),Ie=document.createRange(),K=document.createTextNode("​");Ie.setStart(Ce.startContainer,Ce.startOffset),Ie.insertNode(K);const ce=Ie.getBoundingClientRect();K.parentNode&&K.parentNode.removeChild(K),$.scrollTop=ce.top-$.getBoundingClientRect().top}}return Ye(()=>[c.value,u.value],($,Q)=>{$!==Q&&s("onTyping",c.value,u.value)},{immediate:!0,deep:!0}),e({getEditorContent:ee,addEmoji:V,resetEditor:x,insertAt:L,setEditorContent:z,getEditorHTML:H,insertEditorContent:de,blur:S}),($,Q)=>(w(),G("div",{class:fe(["message-input-editor-container",!v(Se)&&"message-input-editor-container-h5"])},[i.isMuted?(w(),G("div",{key:0,class:"message-input-mute"},ae(i.muteText),1)):X("",!0),!i.isMuted&&i.enableInput?(w(),G("div",{key:1,ref_key:"editorDom",ref:g,class:"message-input-editor-area",contenteditable:!v(Se),onKeydown:yh(T,["enter"]),onDrop:E,onPaste:M,onInput:C,onBlur:_,onFocus:A},null,40,["contenteditable"])):X("",!0)],2))}}),bS=ve(AS,[["__scopeId","data-v-0aacbeff"]]),RS=ge({__name:"message-input-button",props:{enableSend:{type:Boolean,default:!0},className:{type:String,default:""},hoverText:{type:String,default:pe.t("TUIChat.按Enter发送,Ctrl+Enter换行")}},emits:["sendMessage"],setup(i,{emit:e}){const t=i,n=P(Ot.getChatType()!==ct.TUIChat.TYPE.ROOM),s=e,r=()=>{s("sendMessage")};return(o,a)=>{const l=mo;return w(),G("div",{class:fe(["message-input-button",!v(Se)&&"message-input-button-h5"])},[t.enableSend?(w(),ne(l,{key:0,class:fe(["message-input-button-cont",t.className,!v(Se)&&"h5"]),"data-type":"text",disabled:!1,onClick:r},{default:re(()=>[n.value?(w(),G("p",{key:0,class:"message-input-button-hover"},ae(v(pe).t("TUIChat.按Enter发送,Ctrl+Enter换行")),1)):X("",!0),o.$slots.default?Ve(o.$slots,"default",{key:1},void 0,!0):(w(),G("div",{key:2,class:"default-content"},ae(v(pe).t("发送")),1))]),_:3},8,["class"])):X("",!0)],2)}}}),Ru=ve(RS,[["__scopeId","data-v-71df4d84"]]),OS={options:{styleIsolation:"shared"}},DS=ge(Z(F({},OS),{__name:"index",props:{placeholder:{default:"this is placeholder"},isMuted:{type:Boolean,default:!0},muteText:{default:""},enableInput:{type:Boolean,default:!0},enableAt:{type:Boolean,default:!0},enableTyping:{type:Boolean,default:!0},replyOrReference:{default:()=>({})},inputToolbarDisplayType:{default:"none"},enableDragUpload:{type:Boolean,default:!0}},emits:["changeToolbarDisplayType"],setup(i,{expose:e,emit:t}){const n=t,s=i,r=P(),o=P(),a=P(),l=P(!1),c=P("editor"),u=Ot.getFeatureConfig();P(u.InputVoice);const f=P(u.InputEmoji||u.InputStickers),d=P(u.InputImage||u.InputVideo||u.InputEvaluation||u.InputQuickReplies),p=P(!1),g=P(!1);et(()=>{Ee.watch(be.CONV,{currentConversation:M}),Ee.watch(be.CHAT,{quoteMessage:B})}),st(()=>{Ee.unwatch(be.CONV,{currentConversation:M}),Ee.unwatch(be.CHAT,{quoteMessage:B})});const h=ie(()=>s.inputToolbarDisplayType==="tools"),m=ie(()=>({}));Ye(()=>s.inputToolbarDisplayType,k=>{k!=="none"&&y("editor")});function y(k){c.value=k}function R(k){n("changeToolbarDisplayType",k)}const I=(k,U)=>{p.value=U,g.value=k,t_(k,U)},T=k=>{var U;(U=o==null?void 0:o.value)==null||U.toggleAtList(k)},C=()=>{Se.value||n("changeToolbarDisplayType","none")},_=k=>{var U,O;(U=r==null?void 0:r.value)!=null&&U.addEmoji&&((O=r==null?void 0:r.value)==null||O.addEmoji(k))},A=(k,U)=>{var O,D;(O=r==null?void 0:r.value)!=null&&O.insertAt&&((D=r==null?void 0:r.value)==null||D.insertAt(k,U))},L=()=>{var k,U;(k=r==null?void 0:r.value)!=null&&k.blur&&((U=r==null?void 0:r.value)==null||U.blur())},E=k=>{var U,O;(U=r==null?void 0:r.value)==null||U.resetEditor(),(O=r==null?void 0:r.value)==null||O.setEditorContent(k)};function M(k){var U;a.value=k,l.value=((U=a.value)==null?void 0:U.type)===Fe.TYPES.CONV_GROUP}function B(k){k!=null&&k.message&&(k==null?void 0:k.type)==="quote"&&y("editor")}const b=k=>ye(this,null,function*(){var D,J;const U=(D=r.value)==null?void 0:D.getEditorContent();if(!U||!a.value)return;const O=k?[{type:"text",payload:{text:k}}]:U.map(ee=>(ee.type==="text"&&(ee.payload.text=Ku(ee.payload.text)),ee));yield f0(O,a.value),(J=r.value)==null||J.resetEditor()});return e({insertEmoji:_,reEdit:E,insertAt:A}),(k,U)=>(w(),G("div",{class:fe(["message-input",!v(Se)&&"message-input-h5"]),style:Ze(m.value)},[v(Se)?(w(),G(ze,{key:1},[Y(bS,{ref_key:"editor",ref:r,placeholder:s.placeholder,isMuted:s.isMuted,muteText:s.muteText,enableInput:s.enableInput,enableAt:s.enableAt,enableTyping:s.enableTyping,enableDragUpload:s.enableDragUpload,onSendMessage:b,onOnTyping:I,onOnAt:T},null,8,["placeholder","isMuted","muteText","enableInput","enableAt","enableTyping","enableDragUpload"]),s.isMuted?X("",!0):(w(),ne(Ru,{key:0,onSendMessage:b})),s.enableAt?(w(),ne(_c,{key:1,ref_key:"messageInputAtRef",ref:o,onInsertAt:A,onOnAtListOpen:L},null,512)):X("",!0)],64)):(w(),G("div",{key:0,class:"audio-main-content-line"},[_t(Y(i_,{ref_key:"editor",ref:r,class:"message-input-editor",placeholder:s.placeholder,isMuted:s.isMuted,muteText:s.muteText,enableInput:s.enableInput,enableAt:s.enableAt,enableTyping:s.enableTyping,isGroup:l.value,onOnTyping:I,onOnAt:T,onOnFocus:C},null,8,["placeholder","isMuted","muteText","enableInput","enableAt","enableTyping","isGroup"]),[[yt,c.value==="editor"]]),s.enableAt?(w(),ne(_c,{key:0,ref_key:"messageInputAtRef",ref:o,onInsertAt:A,onOnAtListOpen:L},null,512)):X("",!0),f.value?(w(),ne(dt,{key:1,class:"icon icon-face input-item",file:v(l_),size:"23px",hotAreaSize:"3px",onOnClick:U[0]||(U[0]=O=>R("emojiPicker"))},null,8,["file"])):X("",!0),d.value&&!v(Se)&&g.value?(w(),ne(dt,{key:2,class:fe(["icon icon-more",["icon icon-more input-item",h.value&&"icon-more-active"]]),file:v(c_),size:"23px",hotAreaSize:"3px",onOnClick:U[1]||(U[1]=O=>R("tools"))},null,8,["class","file"])):X("",!0),!s.isMuted&&!g.value?(w(),ne(Ru,{key:3,class:"input-item",onSendMessage:b})):X("",!0)])),q("div",null,[Y(a_,{style:{minWidth:0},displayType:c.value},null,8,["displayType"])])],6))}})),MS=ve(DS,[["__scopeId","data-v-12cad968"]]),kS="data:image/svg+xml,%3csvg%20width='80'%20height='80'%20viewBox='0%200%2080%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;
102&%23231;&%23187;&%23132;'%3e%3ccircle%20id='&%23230;&%23164;&%23173;&%23229;&%23156;&%23134;&%23229;&%23189;&%23162;'%20cx='40'%20cy='40'%20r='38'%20stroke='%23444444'%20stroke-width='4'/%3e%3cpath%20id='&%23232;&%23183;&%23175;&%23229;&%23190;&%23132;'%20d='M22.0393%2054.5694C25.1584%2049.9724%2029.3723%2046.8567%2034.5689%2045.3912L34.5713%2045.3906C37.381%2044.6019%2039.8194%2044.5066%2041.2294%2044.5448L43.1752%2044.5974V46.544V53.6663L57.7786%2038.3558L43.2517%2023.0584V30.4668V32.3974L41.3223%2032.4655C34.455%2032.7081%2029.5325%2034.9563%2026.3318%2038.9079C25.0376%2040.5119%2024.0004%2042.4338%2023.2662%2044.6457L22.0393%2054.5694ZM22.0393%2054.5694C21.9839%2053.499%2021.9695%2052.0473%2022.1147%2050.3923C22.2993%2048.3257%2022.6869%2046.3923%2023.2661%2044.6461L22.0393%2054.5694Z'%20stroke='%23444444'%20stroke-width='4'/%3e%3c/g%3e%3c/svg%3e",NS="data:image/svg+xml,%3csvg%20width='80'%20height='80'%20viewBox='0%200%2080%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;'%3e%3cpath%20id='&%23232;&%23183;&%23175;&%23229;&%23190;&%23132;'%20d='M21.7586%2047.8445C24.2492%2044.3734%2027.5657%2042.0119%2031.6213%2040.8833L31.6233%2040.8827C33.8865%2040.2558%2035.8501%2040.18%2036.9868%2040.2104L38.6862%2040.2558V41.9558V47.2029L50.0059%2035.4911L38.7474%2023.7914V29.2632V30.9495L37.0622%2031.0082C31.5917%2031.1989%2027.6967%2032.965%2025.1719%2036.041C24.1502%2037.2907%2023.3303%2038.7892%2022.7494%2040.5163L21.7586%2047.8445ZM21.7586%2047.8445C21.733%2047.0661%2021.7407%2046.0942%2021.837%2045.0106C21.9836%2043.392%2022.291%2041.8801%2022.7493%2040.5166L21.7586%2047.8445Z'%20stroke='%23444444'%20stroke-width='3.49206'/%3e%3cpath%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M43.5636%2047.6924C43.5636%2047.1401%2044.0113%2046.6924%2044.5636%2046.6924H59C59.5522%2046.6924%2060%2047.1401%2060%2047.6924V49.7949C60%2050.3472%2059.5522%2050.7949%2059%2050.7949H44.5636C44.0113%2050.7949%2043.5636%2050.3472%2043.5636%2049.7949V47.6924Z'%20fill='%23444444'/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;_2'%20x='20.1455'%20y='54.8975'%20width='39.8545'%20height='4.10256'%20rx='1'%20fill='%23444444'/%3e%3ccircle%20id='&%23230;&%23164;&%23173;&%23229;&%23156;&%23134;&%23229;&%23189;&%23162;'%20cx='40'%20cy='40'%20r='38'%20stroke='%23444444'%20stroke-width='4'/%3e%3c/g%3e%3c/svg%3e",xS="data:image/svg+xml,%3csvg%20width='56'%20height='57'%20viewBox='0%200%2056%2057'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%204'%3e%3ccircle%20id='&%23230;&%23164;&%23173;&%23229;&%23156;&%23134;&%23229;&%23189;&%23162;&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%2027'%20cx='28'%20cy='28.8535'%20r='26'%20stroke='%23444444'%20stroke-width='4'/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%208'%20x='15'%20y='27.8535'%20width='26'%20height='4'%20rx='1'%20fill='%23444444'/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%208_2'%20x='26'%20y='42.8535'%20width='26'%20height='4'%20rx='1'%20transform='rotate(-90%2026%2042.8535)'%20fill='%23444444'/%3e%3c/g%3e%3c/svg%3e",US=ge({__name:"index",emits:["oneByOneForwardMessage","mergeForwardMessage","toggleMultipleSelectMode"],setup(i,{emit:e}){const t=e,n=P(gn?"25px":"30px");function s(){t("oneByOneForwardMessage")}function r(){t("mergeForwardMessage")}function o(){t("toggleMultipleSelectMode")}return(a,l)=>(w(),G("div",{class:fe({"mulitple-select-panel":!0,"mulitple-select-panel-mobile":v(gn)})},[q("div",{class:"forward-button",onClick:s},[Y(dt,{file:v(kS),size:n.value},null,8,["file","size"]),q("span",{class:fe({"forward-button-text":!0,"forward-button-text-mobile":v(gn)})},ae(v(pe).t("TUIChat.逐条转发")),3)]),q("div",{class:"forward-button",onClick:r},[Y(dt,{file:v(NS),size:n.value},null,8,["file","size"]),q("span",{class:fe({"forward-button-text":!0,"forward-button-text-mobile":v(gn)})},ae(v(pe).t("TUIChat.合并转发")),3)]),q("div",{class:"forward-button",onClick:o},[Y(dt,{class:"cancel-button-icon",file:v(xS),size:n.value},null,8,["file","size"]),q("span",{class:fe({"forward-button-text":!0,"forward-button-text-mobile":v(gn)})},ae(v(pe).t("TUIChat.取消")),3)])],2))}}),PS=ve(US,[["__scopeId","data-v-3e7c871c"]]),VS=ge({__name:"index",props:{iconFile:{type:String,required:!0},title:{type:String,default:""},needDialog:{type:Boolean,default:!0},iconWidth:{type:String,default:"20px"},iconHeight:{type:String,default:"20px"},needBottomPopup:{type:Boolean,default:!1}},emits:["onIconClick","onDialogClose","onDialogShow"],setup(i,{expose:e,emit:t}){const n=i,s=t,r=P(Ot.getTheme()==="dark"),o=P(!1),a=P(),l=P(),c=()=>
102{s("onIconClick",l),Se.value&&Vu.listen({domRefs:a.value,handler:u}),n.needDialog&&f(!o.value)},u=()=>{o.value=!1,s("onDialogClose",l)},f=p=>{if(o.value!==p)switch(o.value=p,p){case!0:s("onDialogShow",l);break;case!1:s("onDialogClose",l)}},d=()=>{o.value=!1};return e({toggleDialogDisplay:f}),(p,g)=>(w(),G("div",{ref_key:"toolbarItemRef",ref:a,class:fe(["toolbar-item-container",!v(Se)&&"toolbar-item-container-h5",v(He)&&"toolbar-item-container-uni"])},[q("div",{class:fe(["toolbar-item-container-icon",v(He)&&"toolbar-item-container-uni-icon"]),onClick:c},[Y(dt,{file:n.iconFile,class:"icon",width:n.iconWidth,height:n.iconHeight},null,8,["file","width","height"])],2),v(He)?(w(),G("div",{key:0,class:fe(["toolbar-item-container-uni-title"])},ae(n.title),1)):X("",!0),_t(q("div",{ref_key:"dialogRef",ref:l,class:fe(["toolbar-item-container-dialog",r.value&&"toolbar-item-container-dialog-dark",!v(Se)&&"toolbar-item-container-h5-dialog",v(He)&&"toolbar-item-container-uni-dialog"])},[n.needBottomPopup&&!v(Se)?(w(),ne(h0,{key:0,class:"toolbar-bottom-popup",show:o.value,onTouchmove:g[0]||(g[0]=It(()=>{},["stop","prevent"])),onOnClose:d},{default:re(()=>[Ve(p.$slots,"default",{},void 0,!0)]),_:3},8,["show"])):Ve(p.$slots,"default",{key:1},void 0,!0)],2),[[yt,o.value]])],2))}}),xi=ve(VS,[["__scopeId","data-v-1ca3a597"]]),BS="data:image/svg+xml,%3csvg%20width='16'%20height='14'%20viewBox='0%200%2016%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%209'%20opacity='0.795169'%3e%3ccircle%20id='&%23230;&%23164;&%23173;&%23229;&%23156;&%23134;&%23229;&%23189;&%23162;'%20cx='5.5'%20cy='4.5'%20r='1'%20stroke='%23232832'%20style='stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20x='0.5'%20y='0.5'%20width='15'%20height='13'%20rx='1.75'%20stroke='%23232832'%20style='stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'/%3e%3cg%20id='&%23232;&%23183;&%23175;&%23229;&%23190;&%23132;%202'%3e%3cmask%20id='path-3-inside-1_2613_41437'%20fill='white'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%2011L5.42403%208.9433C5.50934%208.87092%205.63487%208.87221%205.71867%208.94633L7.88124%2010.8592C7.97058%2010.9382%208.10606%2010.9338%208.19006%2010.8491L13%206'/%3e%3c/mask%3e%3cpath%20d='M2.35303%2010.2375C1.93191%2010.5948%201.88017%2011.2258%202.23748%2011.647C2.59479%2012.0681%203.22584%2012.1198%203.64697%2011.7625L2.35303%2010.2375ZM13.71%206.70423C14.0989%206.31213%2014.0963%205.67897%2013.7042%205.29003C13.3121%204.90109%2012.679%204.90366%2012.29%205.29577L13.71%206.70423ZM7.88124%2010.8592L7.2187%2011.6082L7.88124%2010.8592ZM8.19006%2010.8491L8.90003%2011.5534L8.19006%2010.8491ZM5.42403%208.9433L6.071%209.70582L5.42403%208.9433ZM5.71867%208.94633L6.38121%208.19731L5.71867%208.94633ZM3.64697%2011.7625L6.071%209.70582L4.77706%208.18078L2.35303%2010.2375L3.64697%2011.7625ZM5.05613%209.69536L7.2187%2011.6082L8.54378%2010.1102L6.38121%208.19731L5.05613%209.69536ZM8.90003%2011.5534L13.71%206.70423L12.29%205.29577L7.48009%2010.1449L8.90003%2011.5534ZM7.2187%2011.6082C7.7051%2012.0385%208.44272%2012.0144%208.90003%2011.5534L7.48009%2010.1449C7.76941%209.85322%208.23606%209.83799%208.54378%2010.1102L7.2187%2011.6082ZM6.071%209.70582C5.77716%209.95513%205.34477%209.95068%205.05613%209.69536L6.38121%208.19731C5.92497%207.79374%205.24152%207.78671%204.77706%208.18078L6.071%209.70582Z'%20fill='%23232832'%20style='fill:%23232832;fill:color(display-p3%200.1360%200.1574%200.1949);fill-opacity:1;'%20mask='url(%23path-3-inside-1_2613_41437)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",FS="data:image/svg+xml,%3csvg%20width='16'%20height='14'%20viewBox='0%200%2016%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%209'%20opacity='0.795169'%3e%3ccircle%20id='&%23230;&%23164;&%23173;&%23229;&%23156;&%23134;&%23229;&%23189;&%23162;'%20cx='5.5'%20cy='4.5'%20r='1'%20stroke='%23D5E0F2'%20style='stroke:%23D5E0F2;'/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20x='0.5'%20y='0.5'%20width='15'%20height='13'%20rx='1.75'%20stroke='%23D5E0F2'%20style='stroke:%23D5E0F2;'/%3e%3cg%20id='&%23232;&%23183;&%23175;&%23229;&%23190;&%23132;%202'%3e%3cmask%20id='path-3-inside-1_2613_41437'%20fill='white'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3%2011L5.42403%208.9433C5.50934%208.87092%205.63487%208.87221%205.71867%208.94633L7.88124%2010.8592C7.97058%2010.9382%208.10606%2010.9338%208.19006%2010.8491L13%206'/%3e%3c/mask%3e%3cpath%20d='M2.35303%2010.2375C1.93191%2010.5948%201.88017%2011.2258%202.23748%2011.647C2.59479%2012.0681%203.22584%2012.1198%203.64697%2011.7625L2.35303%2010.2375ZM13.71%206.70423C14.0989%206.312
10213%2014.0963%205.67897%2013.7042%205.29003C13.3121%204.90109%2012.679%204.90366%2012.29%205.29577L13.71%206.70423ZM7.88124%2010.8592L7.2187%2011.6082L7.88124%2010.8592ZM8.19006%2010.8491L8.90003%2011.5534L8.19006%2010.8491ZM5.42403%208.9433L6.071%209.70582L5.42403%208.9433ZM5.71867%208.94633L6.38121%208.19731L5.71867%208.94633ZM3.64697%2011.7625L6.071%209.70582L4.77706%208.18078L2.35303%2010.2375L3.64697%2011.7625ZM5.05613%209.69536L7.2187%2011.6082L8.54378%2010.1102L6.38121%208.19731L5.05613%209.69536ZM8.90003%2011.5534L13.71%206.70423L12.29%205.29577L7.48009%2010.1449L8.90003%2011.5534ZM7.2187%2011.6082C7.7051%2012.0385%208.44272%2012.0144%208.90003%2011.5534L7.48009%2010.1449C7.76941%209.85322%208.23606%209.83799%208.54378%2010.1102L7.2187%2011.6082ZM6.071%209.70582C5.77716%209.95513%205.34477%209.95068%205.05613%209.69536L6.38121%208.19731C5.92497%207.79374%205.24152%207.78671%204.77706%208.18078L6.071%209.70582Z'%20fill='%23D5E0F2'%20style='fill:%23D5E0F2;'%20mask='url(%23path-3-inside-1_2613_41437)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",GS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='25.14306640625'%20height='22.428573608398438'%20viewBox='0%200%2025.14306640625%2022.428573608398438'%3e%3cellipse%20cx='7.0712890625'%20cy='7.5000762939453125'%20rx='1.5'%20ry='1.5'%20fill='%23323038'%20fill-opacity='1'/%3e%3cpath%20d='M20.1069850625,10.535905593945312L22.8275260625,12.867798293945313L24.3150500625,11.132354493945313L21.4970780625,8.716948983945313Q20.8736320625,8.182568493945313,20.0527300625,8.201648893945313Q19.2318290625,8.220729233945313,18.6338860625,8.783498253945313L11.5104932625,15.487868793945314L7.9099216625,12.607410393945312Q7.3229617625,12.137843893945313,6.5712890625,12.137843893945313Q5.8196153625,12.137843893945313,5.2326571625,12.607410193945313L0.8573519025,16.107654593945313L2.2852262225,17.892497993945312L6.5712890625,14.463646893945313L10.1794605625,17.350184393945312Q10.8044462625,17.85017399394531,11.6041740625,17.818021793945313Q12.4038960625,17.785869593945314,12.9867310625,17.23732279394531L20.1069850625,10.535905593945312Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3cpath%20d='M-0.00006956874999985985,4.571435425195313L-0.00006956874999985985,17.857147825195312Q-0.00006956874999985985,19.750693825195313,1.33887052125,21.089635825195312Q2.67781129125,22.428577825195312,4.57135863125,22.428577825195312L20.57137253125,22.428577825195312Q22.46491253125,22.428577825195312,23.80385053125,21.089645825195312Q25.14278953125,19.750714825195313,25.14279953125,17.85717482519531L25.14287953125,4.571462825195312Q25.14289053125,2.6779052951953126,23.80394753125,1.3389562351953126Q22.46500553125,0.000006425195312687038,20.57144953125,0.000006425195312687038L4.57135913125,0.000006725195312640153Q2.67781156125,0.000006725195312640153,1.33887088125,1.3389471751953126Q-0.00006956874999985985,2.6778876751953127,-0.00006956874999985985,4.571435425195313ZM4.57135863125,20.14286182519531C3.30899373125,20.14286182519531,2.28564453125,19.11951282519531,2.28564453125,17.857147825195312L2.28564453125,4.571435225195312C2.28564453125,3.3090700251953127,3.30899373125,2.2857208251953125,4.57135893125,2.2857208251953125L20.57144953125,2.2857208251953125C21.83382053125,2.2857208251953125,22.85717153125,3.3090783251953124,22.85716453125,4.571448825195313L22.85708453125,17.857161825195313C22.85707653125,19.119521825195314,21.83373053125,20.14286182519531,20.57137153125,20.14286182519531L4.57135863125,20.14286182519531Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/svg%3e",eh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='25.142578125'%20height='23.428497314453125'%20viewBox='0%200%2025.142578125%2023.428497314453125'%3e%3cpath%20d='M12.570939993749999,8.914306640625Q14.55916879375,8.914306640625,15.96505169375,10.320207640625Q17.37090109375,11.726093340624999,17.370883893749998,13.71432014
1020625Q17.37088299375,15.702542340625001,15.96505169375,17.108432740625Q14.559185993749999,18.514339440625,12.570939993749999,18.514333740625Q10.58271119375,18.514331840624997,9.17682739375,17.108432740625Q7.770978655135,15.702547040625,7.77099609375,13.714320140625Q7.77099609375,11.726096140625,9.17682739375,10.320207640625Q10.58269599375,8.9143028259277,12.570939993749999,8.914306640625ZM12.570939993749999,11.200020740625Q11.52950359375,11.200020740625,10.79317759375,11.936418540625Q10.05677819375,12.672838440625,10.05671019375,13.714320140625Q10.05671019375,14.755785940625,10.79317759375,15.492221840625Q11.52957109375,16.228634340625,12.570939993749999,16.228620040625Q13.612373793749999,16.228620040625,14.34870199375,15.492221840625Q15.085102593750001,14.755802140625,15.085169293749999,13.714320140625Q15.085169293749999,12.672853740625,14.34870199375,11.936418540625Q13.61230849375,11.200005540625,12.570939993749999,11.200020740625Z'%20fill='%23323038'%20fill-opacity='1'/%3e%3cg%20transform='matrix(-1,0,0,-1,33.140625,8)'%3e%3cpath%20d='M14.2845984,1.7142859000000001L14.2845984,4.58937144Q14.2845984,5.2838486,14.5473635,5.9080329Q14.8085871,6.5285547,15.3021493,7.0141165Q15.79102457,7.495316,16.41129772,7.7483003Q17.02811998,7.999877,17.7127587,8L23.427455899999998,8Q24.1121998,8,24.7291222,7.7484744Q25.349578899999997,7.4955077,25.838984500000002,7.0137863Q26.3323116,6.528204199999999,26.5933995,5.9077798Q26.8560275,5.2836929999999995,26.8560275,4.58937132L26.8560235,1.7142859000000001L14.2845984,1.7142859000000001ZM24.235578099999998,5.3848059Q24.5697484,5.0558819,24.5703125,4.59094387L24.5703125,4L16.5703125,4L16.5703125,4.58937144Q16.5703125,5.0553266,16.9051339,5.3847208Q17.23986918,5.7142005000000005,17.7131697,5.7142856L23.4274554,5.7142856Q23.9008427,5.7142856,24.235578099999998,5.3848059Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/g%3e%3cpath%20d='M-0.00006986874999981296,8.57135893125L-0.00006986874999981296,18.85707153125Q-0.00006986874999981296,20.750619531250003,1.33887088125,22.08956053125Q2.67781222125,23.42850153125,4.57135893125,23.42850153125L20.57135553125,23.42850153125Q22.46489953125,23.42850153125,23.80384253125,22.08956153125Q25.14278553125,20.750622531250002,25.14278553125,18.85707553125L25.14278553125,8.57135913125Q25.14278553125,6.67781222125,23.80384453125,5.33887088125Q22.46490253125,3.99993013125,20.57135953125,3.99993013125L4.57135913125,3.99993013125Q2.67781132125,3.99993013125,1.33887076125,5.33887064125Q-0.00006956874999985985,6.67781100125,-0.00006986874999981296,8.57135893125ZM4.57135863125,21.14278553125C3.30899373125,21.14278553125,2.28564453125,20.11943753125,2.28564453125,18.85707153125L2.28564453125,8.57135863125C2.28564453125,7.30899373125,3.30899373125,6.28564453125,4.57135893125,6.28564453125L20.57135753125,6.28564453125C21.83372153125,6.28564453125,22.85707053125,7.30899373125,22.85707053125,8.57135893125L22.85707053125,18.85707153125C22.85707053125,20.11943753125,21.83372153125,21.14278553125,20.57135553125,21.14278553125L4.57135863125,21.14278553125Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/svg%3e",HS=ge({__name:"index",props:{imageSourceType:{type:String,default:"album"}},setup(i){const e=i,t=P(),n=P(),r={web_album:{icon:Ot.getTheme()==="dark"?FS:BS,title:pe.t("Toolbar.图片")},uni_album:{icon:GS,title:pe.t("Toolbar.图片")},uni_camera:{icon:eh,title:pe.t("Toolbar.拍照")}};Ee.watch(be.CONV,{currentConversation:u=>{n.value=u}});const o=ie(()=>He.value?e.imageSourceType==="camera"?r.uni_camera:r.uni_album:r.web_album),a=()=>{var u,f,d,p;He.value||Se.value?al&&((u=nt)!=null&&u.chooseMedia)?(f=nt)==null||f.chooseMedia({count:1,mediaType:["image"],sizeType:["original","compressed"],sourceType:[e.imageSourceType],success:function(g){c(g)}}):(d=nt)==null||d.chooseImage({count:1,sourceType:[e.imageSourceType],success:function(g){c(g)}}):(p=t.value)!=null&&p.click&&t.value.click()},l=u=>{var f,d;((d=(f=u==null?void 0:u.target)==null?void 0:f.files)==null?void 0:d.length)<=0||(c(u==null?void 0:u.target),u.target.value="")},c=u=>{var g,h,m,y,R;if(!u)return;const f={to:((h=(g=n==null?void 0:n.value)==null?void 0:g.groupProfile)==null?void 0:h.groupID)||((y=(m=n==null?void 0:n.value)==null?void 0:m.userProfile)==null?void 0:y.userID),conversationType:(R=n==null?void 0:n.value)==null?void 0:R.type,payload:{file:u},needReadReceipt:Ui()},d={conversation:n.value,payload:f.payload,messageType:Fe.TYPES.MSG_IMAGE},p={offlinePushInfo:Wn.create(d)};bt.sendImageMessage(f,p)};return(u,f)=>{const d=tl;return w(),ne(xi,{iconFile:o.value.icon,title:o.value.title,iconWidth:v(He)?"32px":"20px",iconHeight:v(He)?"25px":"18px",needDialog:!1,onOnIconClick:a},{default:re(()=>[v(He)?X("",!0):(w(),G("div",{key:0,class:fe(["image-upload",!v(Se)&&"image-upload-h5"])},[Y(d,{ref_key:"inputRef",ref:t,type:"file","data-type":"image",accept:"image/gif,image/jpeg,image/jpg,image/png,image/bmp,image/webp",title:v(pe).t("Toolbar.图片"),onChange:l},null,8,["title"])],2))]),_:1},8,["iconFile","title","iconWidth","iconHeight"])}}}),ga=ve(HS,[["__scopeId","data-v-8671ab53"]]),$S="data:image/svg+xml,%3csvg%20width='16'%20height='14'%20viewBox='0%200%2016%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;
102&%23231;&%23187;&%23132;%209&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;'%20opacity='0.795169'%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20x='0.5'%20y='0.5'%20width='15'%20height='13'%20rx='1.75'%20stroke='%23232832'%20style='stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'%20/%3e%3cpath%20id='&%23228;&%23184;&%23137;&%23232;&%23167;&%23146;&%23229;&%23189;&%23162;'%20d='M10.0282%207L6.5%209.1169L6.5%204.8831L10.0282%207Z'%20stroke='%23232832'%20style='stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'%20/%3e%3c/g%3e%3c/svg%3e",jS="data:image/svg+xml,%3csvg%20width='16'%20height='14'%20viewBox='0%200%2016%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%209&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;'%20opacity='0.795169'%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20x='0.5'%20y='0.5'%20width='15'%20height='13'%20rx='1.75'%20stroke='%23D5E0F2'%20style='stroke:%23D5E0F2;'%20/%3e%3cpath%20id='&%23228;&%23184;&%23137;&%23232;&%23167;&%23146;&%23229;&%23189;&%23162;'%20d='M10.0282%207L6.5%209.1169L6.5%204.8831L10.0282%207Z'%20stroke='%23D5E0F2'%20style='stroke:%23D5E0F2;'%20/%3e%3c/g%3e%3c/svg%3e",Ou="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='26.31298828125'%20height='22.857147216796875'%20viewBox='0%200%2026.31298828125%2022.857147216796875'%3e%3cellipse%20cx='19.741559624671936'%20cy='6.4573341608047485'%20rx='1.428571343421936'%20ry='1.428571343421936'%20fill='%23323038'%20fill-opacity='1'/%3e%3cg%20transform='matrix(0,1,-1,0,12.598953247070312,1.1155548095703125)'%3e%3cpath%20d='M6.80474211875,12.598883628320312L13.82151411875,12.598883628320312Q14.64161491875,12.598883628320312,15.33339021875,12.167265428320313Q15.97748621875,11.765395628320313,16.33811321875,11.094513428320312Q16.69873821875,10.423632428320312,16.67861121875,9.664715728320314Q16.65699421875,8.849620628320313,16.204586218750002,8.165595728320312L13.82750701875,4.571539628320313L6.79874941875,4.571539428320312L4.42166911875,8.165595928320313Q3.96926061875,8.849621328320312,3.94764371875,9.664716028320314Q3.92751681875,10.423632128320312,4.28814341875,11.094514328320312Q4.6487706187499995,11.765397528320314,5.29286667875,12.167266328320313Q5.98464184875,12.598883628320312,6.80474211875,12.598883628320312ZM12.59884261875,6.8572540283203125L13.37280371875,8.027454628320312L13.40605111875,8.077723828320313L13.82151411875,8.705888428320312L14.29812811875,9.426511328320313C14.54937741875,9.806391228320312,14.27696421875,10.313169028320313,13.82151411875,10.313169028320313L6.80474211875,10.313169028320313C6.34929144875,10.313169028320313,6.07687785875,9.806391228320312,6.32812738875,9.426511328320313L7.2202046187499995,8.077723828320313L7.25345231875,8.027454628320312L8.02741361875,6.8572540283203125L12.59884261875,6.8572540283203125Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/g%3e%3cpath%20d='M5.74162935,18.285720825195312Q5.74162935,20.179267825195314,7.08056957,21.51820782519531Q8.41951135,22.857150825195312,10.31305865,22.857150825195312L21.74162875,22.857150825195312Q23.635175750000002,22.857150825195312,24.97411775,21.518209825195314Q26.31305875,20.179267825195314,26.31305875,18.285720825195312L26.31305875,4.571435425195313Q26.31305875,2.6778887851953126,24.97411575,1.3389465851953126Q23.63517375,0.000006425195312687038,21.74162875,0.000006725195312640153L10.31305835,0.000006425195312687038Q8.41951081,0.000006425195312687038,7.08057004,1.3389471151953125Q5.74162935,2.6778876151953126,5.74162965,4.571435725195313L5.74162935,18.285720825195312ZM10.31305865,20.571435825195312C9.05069305,20.571435825195312,8.02734375,19.54808582519531,8.02734375,18.285720825195312L8.02734375,4.571435425195313C8.02734375,3.3090701251953125,9.05069305,2.2857208251953125,10.31305835,2.2857208251953125L21.74162875,2.2857208251953125C23.00399375,2.2857208251953125,24.02734375,3.3090701251953125,24.02734375,4.571435425195313L24.02734375,18.285720825195312C24.02734375,19.54808582519531,23.00399375,20.571435825195312,21.74162875,20.571435825195312L10.31305865,20.571435825195312Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/svg%3e",WS=ge({__name:"index",props:{videoSourceType:{type:String,default:"album"}},setup(i){const e=i,t=P(),n=P();Ee.watch(be.CONV,{currentConversation:c=>{n.value=c}});const s=()=>
102{if(He.value)switch(e.videoSourceType){case"album":return Ou;case"camera":return eh;default:return Ou}else return Ot.getTheme()==="dark"?jS:$S},r=()=>He.value&&e.videoSourceType==="camera"?pe.t("Toolbar.录制"):pe.t("Toolbar.视频"),o=()=>{var c,u,f,d,p;He.value||Se?al&&((c=nt)!=null&&c.chooseMedia)?(u=nt)==null||u.chooseMedia({mediaType:["video"],count:1,sourceType:[e.videoSourceType],maxDuration:60,success:function(g){l(g)}}):(f=nt)==null||f.chooseVideo({count:1,sourceType:[e.videoSourceType],compressed:!1,success:function(g){l(g)}}):(d=t==null?void 0:t.value)!=null&&d.click&&((p=t==null?void 0:t.value)==null||p.click())},a=c=>{var u,f;((f=(u=c==null?void 0:c.target)==null?void 0:u.files)==null?void 0:f.length)<=0||(l(c==null?void 0:c.target),c.target.value="")},l=c=>{var p,g,h,m,y;if(!c)return;const u={to:((g=(p=n==null?void 0:n.value)==null?void 0:p.groupProfile)==null?void 0:g.groupID)||((m=(h=n==null?void 0:n.value)==null?void 0:h.userProfile)==null?void 0:m.userID),conversationType:(y=n==null?void 0:n.value)==null?void 0:y.type,payload:{file:c},needReadReceipt:Ui()},f={conversation:n.value,payload:u.payload,messageType:Fe.TYPES.MSG_VIDEO},d={offlinePushInfo:Wn.create(f)};bt.sendVideoMessage(u,d)};return(c,u)=>{const f=tl;return w(),ne(xi,{iconFile:s(),title:r(),needDialog:!1,iconWidth:v(He)?"32px":"20px",iconHeight:v(He)?"25px":"18px",onOnIconClick:o},{default:re(()=>[q("div",{class:fe(["video-upload",!v(Se)&&"video-upload-h5"])},[Y(f,{ref_key:"inputRef",ref:t,type:"file","data-type":"video",accept:"video/*",title:v(pe).t("Toolbar.视频"),onChange:a},null,8,["title"])],2)]),_:1},8,["iconFile","title","iconWidth","iconHeight"])}}}),ma=ve(WS,[["__scopeId","data-v-149b30fd"]]),zS="data:image/svg+xml,%3csvg%20width='16'%20height='14'%20viewBox='0%200%2016%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%209&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%202'%20opacity='0.795169'%3e%3cpath%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20d='M0.5%202.25C0.5%201.2835%201.2835%200.5%202.25%200.5H6.54211C6.62301%200.5%206.70271%200.519631%206.77435%200.557208L8.63621%201.53374C8.85115%201.64647%209.09023%201.70536%209.33293%201.70536H13.75C14.7165%201.70536%2015.5%202.48886%2015.5%203.45536V11.75C15.5%2012.7165%2014.7165%2013.5%2013.75%2013.5H2.25C1.2835%2013.5%200.5%2012.7165%200.5%2011.75V2.25Z'%20stroke='%23232832'%20style='stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'%20/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;_2'%20x='0.5'%20y='3.5'%20width='15'%20height='10'%20rx='1.75'%20stroke='%23232832'%20style='fill-opacity:1;stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'%20/%3e%3c/g%3e%3c/svg%3e",KS="data:image/svg+xml,%3csvg%20width='16'%20height='14'%20viewBox='0%200%2016%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;%209&%23229;&%23164;&%23135;&%23228;&%23187;&%23189;%202'%20opacity='0.795169'%3e%3cpath%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;'%20d='M0.5%202.25C0.5%201.2835%201.2835%200.5%202.25%200.5H6.54211C6.62301%200.5%206.70271%200.519631%206.77435%200.557208L8.63621%201.53374C8.85115%201.64647%209.09023%201.70536%209.33293%201.70536H13.75C14.7165%201.70536%2015.5%202.48886%2015.5%203.45536V11.75C15.5%2012.7165%2014.7165%2013.5%2013.75%2013.5H2.25C1.2835%2013.5%200.5%2012.7165%200.5%2011.75V2.25Z'%20stroke='%23D5E0F2'%20style='stroke:%23D5E0F2;'%20/%3e%3crect%20id='&%23231;&%23159;&%23169;&%23229;&%23189;&%23162;_2'%20x='0.5'%20y='3.5'%20width='15'%20height='10'%20rx='1.75'%20stroke='%23D5E0F2'%20style='fill-opacity:1;stroke:%23D5E0F2;'%20/%3e%3c/g%3e%3c/svg%3e",YS="/assets/file-uni-BSMimtbC.svg",qS=ge({__name:"index",setup(i){const e=Ot.getTheme()==="dark"?KS:zS,t=He.value?YS:e,n=P(),s=P();Ee.watch(be.CONV,{currentConversation:l=>{s.value=l}});const r=()=>{var l,c;He.value||Se.value?uni.chooseFile({count:1,extension:[".zip",".doc",".docx",".pdf",".ppt",".pptx",".txt",".xls",".xlsx"],success:function(u){a(u)}}):(l=n==null?void 0:n.value)!=null&&l.click&&((c=n==null?void 0:n.value)==null||c.click())},o=l=>{const c=l.target;c!=null&&c.files&&c.files.length>0&&(a(c.files),c.value="")},a=l=>{var d,p,g,h,m;const c={to:((p=(d=s==null?void 0:s.value)==null?void 0:d.groupProfile)==null?void 0:p.groupID)||((h=(g=s==null?void 0:s.value)==null?void 0:g.userProfile)==null?void 0:h.userID),conversationType:(m=s==null?void 0:s.value)==null?void 0:m.type,payload:{file:l},needReadReceipt:Ui()},u={conversation:s.value,payload:c.payload,messageType:Fe.TYPES.MSG_FILE},f={offlinePushInfo:Wn.create(u)};bt.sendFileMessage(c,f)};return(l,c)=>{const u=tl;return w(),ne(xi,{iconFile:v(t),title:v(pe).t("Toolbar.文件"),iconWidth:v(He)?"32px":"20px",iconHeight:v(He)?"25px":"18px",needDialog:!1,onOnIconClick:r},{default:re(()=>[q("div",{class:fe(["file-upload",!v(Se)&&"file-upload-h5"])}
102,[Y(u,{ref_key:"inputRef",ref:n,type:"file","data-type":"file",accept:"*",title:v(pe).t("Toolbar.文件"),onChange:o},null,8,["title"])],2)]),_:1},8,["iconFile","title","iconWidth","iconHeight"])}}}),Du=ve(qS,[["__scopeId","data-v-7f67be86"]]),JS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='26.182886123657227'%20height='27.428571701049805'%20viewBox='0%200%2026.182886123657227%2027.428571701049805'%3e%3cpath%20d='M22.310266,9.2000008C22.310266,14.457143,16.824553,21.028572,13.167411,21.028572C9.5102682,21.028572,4.0245538,14.457143,4.0245538,9.2000008C4.0245538,3.942858,8.1179504,0,13.167411,0C18.216871,0,22.310266,3.942858,22.310266,9.2000008ZM14.855087,18.028486Q16.127222,17.164938,17.321096,15.663267Q18.563715,14.100285,19.289804,12.378094Q20.024553,10.635363,20.024553,9.2000017Q20.024553,6.2390757,18.021875,4.2505274Q16.0431,2.2857144,13.167411,2.2857144Q10.291722,2.2857144,8.3129473,4.2505274Q6.3102684,6.2390747,6.3102684,9.2000008Q6.3102679,10.63536,7.
1020450163,12.378092Q7.7711062,14.100286,9.0137253,15.663267Q10.207601,17.16494,11.479735,18.028488Q12.532108,18.742859,13.167411,18.742857Q13.802716,18.742857,14.855087,18.028486ZM16.56144,12.537024Q17.967325,11.131136,17.967325,9.1429129Q17.967327,7.1546893,16.56144,5.7488003Q15.155552,4.3429132,13.167327,4.3429132Q11.179102,4.3429132,9.7732134,5.7488003Q8.3673267,7.1546869,8.3673267,9.1429129Q8.3673267,11.131139,9.7732134,12.537024Q11.179104,13.942913,13.167327,13.942913Q15.15555,13.942913,16.56144,12.537024ZM14.945194,7.3650446Q15.681612,8.1014624,15.681612,9.1429129Q15.681612,10.184363,14.945194,10.920781Q14.208776,11.657198,13.167327,11.657198Q12.125876,11.657198,11.389459,10.920781Q10.653042,10.184364,10.653042,9.1429129Q10.653042,8.1014624,11.389459,7.3650446Q12.125876,6.6286273,13.167327,6.6286273Q14.208778,6.6286273,14.945194,7.3650446ZM22.360771,17.714287L20.898716,17.714287C20.267534,17.714287,19.755859,18.22596,19.755859,18.857141C19.755859,19.488325,20.267534,20,20.898716,20L22.360771,20L23.884626,25.142857L13.402065,25.142857L9.6176062,23.520996C9.4051056,23.429926,9.1700611,23.405413,8.9433594,23.450754L2.3030133,24.778809L3.7054694,20L5.1674595,20C5.7986417,20,6.3103166,19.488325,6.3103166,18.857141C6.3103166,18.22596,5.7986417,17.714287,5.1674595,17.714287L3.7054694,17.714287Q2.9675887,17.714287,2.3689885,18.145731Q1.7703888,18.577179,1.5370505,19.277193L0.13462611,24.056013Q-0.28168383,25.304728,0.58942521,26.291504Q1.460549,27.278299,2.7512555,27.020159L9.0435266,25.761719L12.501675,27.243792Q12.932903,27.428572,13.402065,27.428572L23.884626,27.428572Q25.054667,27.428585,25.73884,26.479353Q26.423035,25.530115,26.053013,24.420061L24.529158,19.277205Q24.295866,18.577162,23.697266,18.145716Q23.09865,17.714287,22.360771,17.714287Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/svg%3e",Mu=ge({__name:"index",setup(i){const e=P(),t=P(),n=P(!1),s=Dh();Ee.watch(be.CONV,{currentConversation:l=>{e.value=l}});const r=l=>{var p,g,h;const c={};l&&(c.groupId=l),((p=s.coords)==null?void 0:p.latitude)!=null&&(c.lat=s.coords.latitude),((g=s.coords)==null?void 0:g.longitude)!=null&&(c.lng=s.coords.longitude);const u=Fu[bi.location]||"/location",f=Gu.fillPathParams(u,c),d=((h=f.search)==null?void 0:h.replace(/^\?/,""))||"";return`${Jt.getHost()}${f.pathname}${d?`?${d}`:""}`},o=(l,c)=>ye(this,null,function*(){const u=l.groupId||c,f=Number(l.latitude),d=Number(l.longitude);!u||!Number.isFinite(f)||!Number.isFinite(d)||(yield bt.sendCustomMessage({to:u,conversationType:Fe.TYPES.CONV_GROUP,payload:{data:JSON.stringify({businessID:"CUSTOM_LOCATION_MSG",desc:l.desc||"",longitude:d,latitude:f,mapChannel:l.mapChannel||"GOOGLE_MAP"}),description:"",extension:""}}))}),a=()=>ye(this,null,function*(){var c,u;const l=(c=e.value)==null?void 0:c.groupProfile.groupID;if(Jt.isAliMini){const f=yield ns.open(bi.appWebView,{url:encodeURIComponent(r(l))});f&&(yield o(f,l));return}Se.value?(n.value=!0,yield new Promise(f=>setTimeout(f,0)),(u=t.value)==null||u.open(l)):ns.open(bi.location,{groupId:l})});return(l,c)=>(w(),G(ze,null,[Y(xi,{iconFile:v(JS),title:v(pe).t("Toolbar.位置"),iconWidth:v(He)?"32px":"20px",iconHeight:v(He)?"25px":"18px",needDialog:!1,onOnIconClick:a},null,8,["iconFile","title","iconWidth","iconHeight"]),n.value?(w(),ne(qh,{key:0,ref_key:"locationDialogRef",ref:t},null,512)):X("",!0)],64))}}),th="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.795169'%3e%3ccircle%20cx='8'%20cy='8'%20r='7.5'%20stroke='%23232832'%20style='stroke:%23232832;stroke:color(display-p3%200.1360%200.1574%200.1949);stroke-opacity:1;'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%205C5.55228%205%206%205.44772%206%206C6%206.55228%205.55228%207%205%207C4.44772%207%204%206.55228%204%206C4%205.44772%204.44772%205%205%205Z'%20fill='%23232832'%20style='fill:%23232832;fill:color(display-p3%200.1360%200.1574%200.1949);fill-opacity:1;'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%205C11.5523%205%2012%205.44772%2012%206C12%206.55228%2011.5523%207%2011%207C10.4477%207%2010%206.55228%2010%206C10%205.44772%2010.4477%205%2011%205Z'%20fill='%23232832'%20style='fill:%23232832;fill:color(display-p3%200.1360%200.1574%200.1949);fill-opacity:1;'/%3e%3c/g%3e%3c/svg%3e",nh="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.795169'%3e%3ccircle%20cx='8'%20cy='8'%20r='7.5'%20stroke='%23D5E0F2'%20style='stroke:%23D5E0F2;'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%205C5.55228%205%206%205.44772%206%206C6%206.55228%205.55228%207%205%207C4.44772%207%204%206.55228%204%206C4%205.44772%204.44772%205%205%205Z'%20fill='%23D5E0F2'%20style='fill:%23D5E0F2;'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%205C11.5523%205%2012%205.44772%2012%206C12%206.55228%2011.5523%207%2011%207C10.4477%207%2010%206.55228%2010%206C10%205.44772%2010.4477%205%2011%205Z'%20fill='%23D5E0F2'%20style='fill:%23D5E0F2;'/%3e%3c/g%3e%3c/svg%3e",QS=ge({__name:"emoji-picker-dialog",emits:["insertEmoji","onClose","sendMessage"],setup(i,{emit:e}){var R;const t=Ot.getTheme()==="dark"?nh:th,n=e,s=P(0),r=P(),o=P(),a=P(),l=Ot.getFeatureConfig(),c=P(y()),u=P(c==null?void 0:c.value[0]),f=P((R=c==null?void 0:c.value[0])==null?void 0:R.list);et(()=>{Ee.watch(be.CONV,{currentConversation:m})}),st(()=>{Ee.unwatch(be.CONV,{currentConversation:m})});const d=I=>{var T;s.value=I,u.value=c==null?void 0:c.value[I],f.value=(T=c==null?void 0:c.value[I])==null?void 0:T.list,He.value||a!=null&&a.value&&(
102a.value.scrollTop=0)},p=(I,T)=>{var _,A,L;const C={emoji:{key:I,name:jh(I)},type:(_=u==null?void 0:u.value)==null?void 0:_.type};switch((A=u==null?void 0:u.value)==null?void 0:A.type){case jn.BASIC:C.url=((L=u==null?void 0:u.value)==null?void 0:L.url)+Kl[I],He.value?uni.$emit("insert-emoji",C):n("insertEmoji",C);break;case jn.BIG:g(T,u.value);break;case jn.CUSTOM:g(T,u.value);break}Se&&n("onClose")},g=(I,T)=>{var _,A,L,E,M;const C={to:((A=(_=r==null?void 0:r.value)==null?void 0:_.groupProfile)==null?void 0:A.groupID)||((E=(L=r==null?void 0:r.value)==null?void 0:L.userProfile)==null?void 0:E.userID),conversationType:(M=r==null?void 0:r.value)==null?void 0:M.type,payload:{index:T.emojiGroupID,data:T.list[I]},needReadReceipt:Ui()};bt.sendFaceMessage(C)};function h(){uni.$emit("send-message-in-emoji-picker")}function m(I){r.value=I,c.value=y()}function y(){return $h.filter(I=>{if(I.type===jn.BASIC)return l.InputEmoji;if(I.type===jn.BIG||I.type===jn.CUSTOM)return l.InputStickers})}return(I,T)=>(w(),G("div",{ref_key:"emojiPickerDialog",ref:o,class:fe({"emoji-picker":!0,"emoji-picker-h5":!v(Se)})}
102,[q("ul",{ref_key:"emojiPickerListRef",ref:a,class:fe(["emoji-picker-list",!v(Se)&&"emoji-picker-h5-list"])},[(w(!0),G(ze,null,pt(f.value,(C,_)=>(w(),G("li",{key:_,class:"emoji-picker-list-item",onClick:A=>p(C,_)},[u.value.type===v(jn).BASIC?(w(),G("img",{key:0,class:"emoji",src:u.value.url+v(Kl)[C]},null,8,["src"])):u.value.type===v(jn).BIG?(w(),G("img",{key:1,class:"emoji-big",src:u.value.url+C+"@2x.png"},null,8,["src"])):(w(),G("img",{key:2,class:"emoji-custom emoji-big",src:u.value.url+C},null,8,["src"]))],8,["onClick"]))),128))],2),q("ul",{class:"emoji-picker-tab"},[(w(!0),G(ze,null,pt(c.value,(C,_)=>(w(),G("li",{key:_,class:"emoji-picker-tab-item",onClick:A=>d(_)},[C.type===v(jn).BASIC?(w(),ne(dt,{key:0,class:"icon",file:v(t)},null,8,["file"])):C.type===v(jn).BIG?(w(),G("img",{key:1,class:"icon-big",src:C.url+C.list[0]+"@2x.png"},null,8,["src"])):(w(),G("img",{key:2,class:"icon-custom icon-big",src:C.url+C.list[0]},null,8,["src"]))],8,["onClick"]))),128)),v(He)?(w(),G("li",{key:0,class:"send-btn",onClick:h}," 发送 ")):X("",!0)])],2))}}),ih=ve(QS,[["__scopeId","data-v-6ea8796b"]]),ZS=ge({__name:"index",emits:["sendMessage","toggleComponent","insertEmoji","dialogShowInH5","dialogCloseInH5","changeToolbarDisplayType"],setup(i,{expose:e,emit:t}){const n=Ot.getTheme()==="dark"?nh:th,s=t,r=P(),o=P();Ee.watch(be.CONV,{currentConversation:d=>{r.value=d}});const a=d=>{Kn&&(s("changeToolbarDisplayType","emojiPicker"),s("dialogShowInH5",d.value))},l=d=>{Kn&&(s("changeToolbarDisplayType","none"),s("dialogCloseInH5",d.value))},c=d=>{s("insertEmoji",d)},u=()=>{s("sendMessage")},f=()=>{var d;(d=o.value)==null||d.toggleDialogDisplay(!1)};return e({closeEmojiPicker:f}),(d,p)=>(w(),ne(xi,{ref_key:"container",ref:o,iconFile:v(n),title:v(pe).t("Toolbar.表情"),onOnDialogShow:a,onOnDialogClose:l},{default:re(()=>[Y(ih,{onInsertEmoji:c,onSendMessage:u,onOnClose:f})]),_:1},8,["iconFile","title"]))}}),XS=ve(ZS,[["__scopeId","data-v-7b401015"]]),e4=ge({__name:"index",props:{type:{type:String,default:""},currentConversation:{type:Object,default:()=>({})},isGroup:{type:Boolean,default:!1}},emits:["submit","cancel"],setup(i,{expose:e,emit:t}){const n=i,s=t,r=P(!1),o=P(""),a=P([]),l=P(0),c=P([]),u=P(0),f=P(""),d={voiceCall:pe.t("TUIChat.发起群语音"),videoCall:pe.t("TUIChat.发起群视频")},p=ie(()=>d[n.type]?d[n.type]:"");il.getUserProfile().then(T=>{var C;(C=T==null?void 0:T.data)!=null&&C.userID&&(f.value=T.data.userID)});const g=P(Fe.chat.getLoginUser());Ee.watch(be.GRP,{currentGroup:T=>{l.value=(T==null?void 0:T.memberCount)>0?(T==null?void 0:T.memberCount)-1:0,u.value=l.value,o.value=T==null?void 0:T.groupID},currentGroupMemberList:T=>{a.value=T==null?void 0:T.filter(C=>(C==null?void 0:C.userID)!==g.value&&(C==null?void 0:C.userID)!==rl),c.value=a.value}});const h=()=>ye(this,null,function*(){try{yield ts.getGroupMemberList({groupID:o.value,count:50})}catch(T){}}),m=T=>ye(this,null,function*(){var C,_;try{const A=yield ts.getGroupMemberProfile({groupID:o.value,userIDList:[T]}),L=(_=(C=A==null?void 0:A.data)==null?void 0:C.memberList)==null?void 0:_.filter(E=>(E==null?void 0:E.userID)!==f.value);T.trim()?(c.value=L,u.value=L==null?void 0:L.length):(c.value=a.value,u.value=l.value)}catch(A){c.value=a.value,u.value=l.value}}),y=T=>{const C=[];T==null||T.forEach(_=>{_!=null&&_.userID&&C.push(_.userID)}),n.type==="voiceCall"?s("submit",{userIDList:C,groupID:o.value,type:1}):n.type==="videoCall"&&s("submit",{userIDList:C,groupID:o.value,type:2}),c.value=a.value,I(!1)},R=()=>{c.value=a.value,s("cancel"),I(!1)},I=T=>{r.value=T};return e({toggleShow:I}),(T,C)=>(w(),ne(Bh,{show:r.value,isH5:!v(Se),isHeaderShow:!1,isFooterShow:!1,background:!1,"onUpdate:show":I},{default:re(()=>[Y($u,{isSearch:!0,title:p.value,list:c.value,isH5:!v(Se),isRadio:!1,total:u.value,onSearch:m,onSubmit:y,onCancel:R,onGetMore:h},null,8,["title","list","isH5","total"])]),_:1},8,["show","isH5"]))}}),t4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='none'%20version='1.1'%20width='20.975963592529297'%20height='26.624818801879883'%20viewBox='0%200%2020.975963592529297%2026.624818801879883'%3e%3cpath%20d='M11.540995,16.063654L9.4914455,11.964367Q9.2870121,11.555485,9.4209623,11.11841Q9.5549107,10.68133,9.9533434,10.457209L9.9714451,10.447025Q11.486147,9.5949802,12.052278,7.9518728Q12.618403,6.3087721,11.950007,4.7045403L11.107934,2.6834528Q10.580053,1.4164802,9.4931927,0.68027365Q8.30867,-0.122086,6.9220638,0.021910297Q3.8704803,0.33881217,2.1339796,1.9381809Q0.356756,3.5750587,0.072793148,6.4146624Q-0.3616932,10.759525,1.7971594,15.9
10266115Q3.7561884,20.690781,6.6876192,23.622225Q9.3868351,26.321447,13.454142,26.5972Q15.174004,26.713795,16.794064,26.338127Q18.400013,25.96574,19.558224,25.193584Q22.579569,23.179327,19.162119,17.824287Q18.292606,16.461784,16.703056,16.04232Q15.179722,15.640329,13.71463,16.291481L13.027365,16.596931Q12.608603,16.783043,12.177266,16.62829Q11.745929,16.473537,11.540995,16.063654ZM17.22695,5.5803638Q17.561386,7.5135641,16.862907,9.1479139C16.846212,9.1869926,16.831701,9.2269735,16.81945,9.2676659C16.815744,9.2799978,16.812239,9.2923918,16.80895,9.3048391C16.746063,9.5426044,16.761559,9.7943077,16.853132,10.022564C16.965988,10.303875,17.18597,10.528833,17.464687,10.647952C17.503769,10.664652,17.543749,10.67916,17.58444,10.691409C17.610514,10.699255,17.636854,10.706167,17.663412,10.712131C18.201006,10.83285,18.748196,10.55282,18.964727,10.046168Q19.928892,7.7901254,19.479214,5.1907377Q19.039474,2.6487784,17.547544,0.69246924C17.401525,0.50100154,17.198753,0.36054724,16.96818,0.29114944C16.948103,0.28510678,16.927866,0.27961767,16.907484,0.27468857C16.572836,0.1937459,16.219528,0.26798514,15.94576,0.47677305C15.754292,0.62279463,15.613839,0.8255617,15.544439,1.0561396C15.538397,1.0762165,15.532907,1.0964557,15.527978,1.1168352C15.447034,1.451484,15.521275,1.8047909,15.730064,2.0785594Q16.882597,3.5897999,17.22695,5.5803638ZM7.2355747,10.44865Q6.8337216,11.759882,7.4470201,12.986535L9.4965734,17.085825Q10.111368,18.31547,11.405383,18.779732Q12.699396,19.243992,13.955682,18.685644L14.642944,18.380194Q15.373606,18.055456,16.119843,18.252375Q16.846121,18.444038,17.235329,19.053913Q19.447493,22.520308,18.290327,23.291767Q17.478329,23.833103,16.277739,24.1115Q14.98914,24.410301,13.608753,24.316721Q10.396842,24.098957,8.3038664,22.005983Q5.6936202,19.395731,3.9085674,15.090647Q1.9698727,10.415018,2.3471649,6.6421008Q2.5446317,4.6674328,3.6824753,3.6194463Q4.861043,2.5339506,7.1581621,2.2953985Q7.7163587,2.2374315,8.2113161,2.5727029Q8.7327862,2.92593
10207,8.9980249,3.5625367L9.840106,5.5836234Q10.174304,6.3857393,9.8912401,7.2072921Q9.6081753,8.0288439,8.8508234,8.4548683L8.8327255,8.4650469Q7.6374269,9.1374235,7.2355747,10.44865Z'%20fill-rule='evenodd'%20fill='%23323038'%20fill-opacity='1'/%3e%3c/svg%3e",n4={options:{styleIsolation:"shared"}},i4=ge(Z(F({},n4),{__name:"index",props:{displayType:{}},emits:["changeToolbarDisplayType","insertEmoji"],setup(i,{emit:e}){const t=e,n=i,s=P(),r=P(!1),o=P(""),a=P(),l=P(),c=P([]),u=P(!1),f=Ot.getFeatureConfig(),d=ie(()=>f.InputFile&&!Jt.isAliMini),p=P(8),g=P(0),h=ie(()=>({})),m=()=>{f.InputImage&&f.InputVideo?p.value-=4:(f.InputImage||f.InputVideo)&&(p.value-=2),g.value=p.value,p.value-=c.value.length,p.value===1?u.value=f.InputEvaluation&&f.InputQuickReplies:p.value<1&&(u.value=f.InputEvaluation||f.InputQuickReplies)};et(()=>{Ee.watch(be.CONV,{currentConversation:y})}),st(()=>{Ee.unwatch(be.CONV,{currentConversation:y})});const y=b=>{var U;const k=b==null?void 0:b.conversationID;k&&k!==((U=s.value)==null?void 0:U.conversationID)&&(I(),m(),s.value=Ee.getData(be.CONV,"currentConversation"),r.value=k.startsWith(Fe.TYPES.CONV_GROUP))},R=b=>{t("insertEmoji",b)},I=()=>{const b=Ot.getChatType(),k={chatType:b};b===ct.TUIChat.TYPE.CUSTOMER_SERVICE&&(k.filterVoice=!0,k.filterVideo=!0,ol("customerService")),c.value=[...Fn.getExtensionList(ct.TUIChat.EXTENSION.INPUT_MORE.EXT_ID,k)].filter(U=>{var O,D,J;return((O=U==null?void 0:U.data)==null?void 0:O.name)==="search"?f.MessageSearch:((D=U==null?void 0:U.data)==null?void 0:D.name)==="voiceCall"?f.VoiceCall&&!Jt.isAliMini:((J=U==null?void 0:U.data)==null?void 0:J.name)==="videoCall"?f.VideoCall&&!Jt.isAliMini:!0}).map(U=>{var O,D;return((O=U==null?void 0:U.data)==null?void 0:O.name)==="voiceCall"?Z(F({},U),{text:pe.t("Toolbar.语音通话"),icon:Se.value?U.icon:t4}):((D=U==null?void 0:U.data)==null?void 0:D.name)==="videoCall"?Z(F({},U),{text:pe.t("Toolbar.视频通话")}):U}),T(c.value)};function T(b){b.forEach(k=>{var O;const U=(O=k==null?void 0:k.data)==null?void 0:O.name;U==="voiceCall"?Vr.reportFeature(203,"voice-call"):U==="videoCall"?Vr.reportFeature(203,"video-call"):U==="quickRoom"&&Vr.reportFeature(204)})}const C=P(),_=b=>{var U,O,D;const k=c.value.find(J=>{var ee,se;return((ee=J==null?void 0:J.data)==null?void 0:ee.name)===((se=b==null?void 0:b.data)==null?void 0:se.name)});switch((U=k==null?void 0:k.data)==null?void 0:U.name){case"voiceCall":C.value=hc.AUDIO_CALL,A(k,1);break;case"videoCall":C.value=hc.VIDEO_CALL,A(k,2);break;case"search":(D=(O=k==null?void 0:k.listener)==null?void 0:O.onClicked)==null||D.call(O);break}},A=(b,k)=>{var U,O,D,J,ee,se,ue;o.value=(U=b==null?void 0:b.data)==null?void 0:U.name,((O=s==null?void 0:s.value)==null?void 0:O.type)===Fe.TYPES.CONV_C2C?(se=(D=b==null?void 0:b.listener)==null?void 0:D.onClicked)==null||se.call(D,{userIDList:[(ee=(J=s==null?void 0:s.value)==null?void 0:J.conversationID)==null?void 0:ee.slice(3)],type:k,callParams:{offlinePushInfo:Wn.getOfflinePushInfo(Ki.CALL)},version:"v3"}):r.value&&(l.value=b,(ue=a==null?void 0:a.value)!=null&&ue.toggleShow&&a.value.toggleShow(!0))},L=b=>b==null?void 0:b.icon,E=b=>b==null?void 0:b.text,M=b=>{if(!C.value)return;const k=`${b.groupID}_${(Math.random()*1e3).toString().slice(0,3)}`;We.groupCall({userIDList:b.userIDList,groupID:b.groupID,roomID:0,strRoomID:k,type:C.value}),C.value=void 0,l.value=void 0},B=()=>{l.value=null};return(b,k)=>{const U=Eh,O=Ih;return w(),G("div",{class:fe(["message-input-toolbar",!v(Se)&&"message-input-toolbar-h5",v(He)&&"message-input-toolbar-uni"]),style:Ze(h.value)},[v(Se)?(w(),G("div",{key:0,class:fe(["message-input-toolbar-list",!v(Se)&&"message-input-toolbar-h5-list"])},[Y(v(XS),{onInsertEmoji:R}),v(f).InputImage?(w(),ne(ga,{key:0,imageSourceType:"album"})):X("",!0),d.value?(w(),ne(Du,{key:1})):X("",!0),v(f).InputVideo?(w(),ne(ma,{key:2,videoSourceType:"album"})):X("",!0),v(f).Location?(w(),ne(Mu,{key:3})):X("",!0),(w(!0),G(ze,null,pt(c.value,D=>(w(),ne(xi,{key:D.text,iconFile:L(D),title:E(D),iconWidth:v(Se)?"20px":"25px",iconHeight:v(Se)?"20px":"25px",needDialog:!1,onOnIconClick:J=>_(D)},null,8,["iconFile","title","iconWidth","iconHeight","onOnIconClick"]))),128))],2)):(w(),G(ze,{key:1},[n.displayType==="emojiPicker"?(w(),G("div",{key:0},[Y(ih)])):(w(),G("div",{key:1},[Y(O,{class:fe(["message-input-toolbar-swiper"]),"indicator-dots":u.value,autoplay:!1,circular:!1},{default:re(()=>[Y(U,{class:fe(["message-input-toolbar-list","message-input-toolbar-h5-list","message-input-toolbar-uni-list"])},{default:re(()=>[v(f).InputImage?(w(),ne(ga,{key:0,imageSourceType:"camera"})):X("",!0),v(f).InputImage?(w(),ne(ga,{key:1,imageSourceType:"album"})):X("",!0),v(f).InputVideo?(w(),ne(ma,{key:2,videoSourceType:"album"})):X("",!0),v(f).InputVideo&&!v(Jt).isAliMini?(w(),ne(ma,{key:3,videoSourceType:"camera"})):X("",!0),d.value?(w(),ne(Du,{key:4})):X("",!0),v(f).Location?(w(),ne(Mu,{key:5})):X("",!0),c.value.length>0?(w(!0),G(ze,{key:6},pt(c.value.slice(0,g.value),(D,J)=>(w(),G("div",{key:J},[D?(w(),ne(xi,{key:0,iconFile:L(D),title:E(D),iconWidth:"25px",iconHeight:"25px",needDialog:!1,onOnIconClick:ee=>_(D)},null,8,["iconFile","title","onOnIconClick"])):X("",!0)]))),128)):X("",!0)]),_:1}),p.value<=1?(w(),ne(U,{key:0,class:fe(["message-input-toolbar-list","message-input-toolbar-h5-list","message-input-toolbar-uni-list"])},{default:re(()=>[(w(!0),G(ze,null,pt(c.value.slice(g.value),(D,J)=>(w(),G("div",{key:J},[D?(w(),ne(xi,{key:0,iconFile:L(D),title:E(D),iconWidth:"25px",iconHeight:"25px",needDialog:!1,onOnIconClick:ee=>_(D)},null,8,["iconFile","title","onOnIconClick"])):X("",!0)]))),128))]),_:1})):X("",!0)]),_:1},8,["indicator-dots"])]))],64)),Y(e4,{ref_key:"userSelectorRef",ref:
102a,type:o.value,currentConversation:s.value,isGroup:r.value,onSubmit:M,onCancel:B},null,8,["type","currentConversation","isGroup"])],6)}}})),s4=ve(i4,[["__scopeId","data-v-97dfa785"]]),r4=ge({__name:"index",props:{orderDetail:{}},emits:["to-order-detail"],setup(i,{emit:e}){const t=i,n=e,s=ie(()=>{var o,a,l;return`${(o=t.orderDetail)==null?void 0:o.sessionTime} ${(a=t.orderDetail)==null?void 0:a.ticketDetail} *${(l=t.orderDetail)==null?void 0:l.qty}`}),r=()=>{n("to-order-detail")};return(o,a)=>{const l=fi;return o.orderDetail?(w(),ne(l,{key:0,class:"order-card-container"},{default:re(()=>[Y(l,{class:"order-card"},{default:re(()=>[Y(l,{class:"show-img"},{default:re(()=>[q("img",{src:o.orderDetail.posterUrl},null,8,["src"])]),_:1}),Y(l,{class:"show-info"},{default:re(()=>[Y(l,{class:"show-name"},{default:re(()=>[qe(ae(o.orderDetail.showName),1)]),_:1}),Y(l,{class:"show-desc"},{default:re(()=>[qe(ae(s.value),1)]),_:1})]),_:1}),Y(l,{class:"action-btn",onClick:r},{default:re(()=>[qe(ae(v(pe).t("TUIChat.查看订单")),1)]),_:1})]),_:1})]),_:1})):X("",!0)}}}),o4=ve(r4,[["__scopeId","data-v-95d41a76"]]),a4="/assets/call-CXU0B7ie.png",l4=ge({__name:"index",emits:["closeChat","onMinimized"],setup(i,{expose:e,emit:t}){const n=t,s=P(""),r=P(),o=P(!1),a=P(!1),l=P(),c=P(),u=P(!1),f=P("none"),d=P(),p=P(),g=P([]),h=Ot.getFeatureConfig(),m=P(""),y=P(""),R=P(),I=P(),T=sl(),{groupCustomInfo:C,groupUsers:_}=nl(T),A=P(),L=ie(()=>_.value[s.value]),E=ie(()=>{var te;return(te=R.value)==null?void 0:te.sellerId}),M=ie(()=>{var te;return(te=Object.values(L.value||{}).find(De=>De.userType===Hu.SELLER))==null?void 0:te.nickname}),{openCustomerService:B}=Zh();We.hideFeatureButton(oi.Camera);const b=te=>{te!=null&&te.length&&T.updateImUserInfo(s.value)},k=P(!1),U=P(null),O=ie(()=>{var te;return V.value?[{text:pe.t("Toolbar.语音通话"),icon:a4,onClick:()=>{E.value&&Jt.showModal({title:"",content:`${pe.t("TUIChat.确认拨打")}"${M.value||""}"${pe.t("TUIChat.语音吗")}`,confirmText:pe.t("TUIChat.确定"),showCancel:!0,success:({confirm:De})=>{De&&We.groupCall({userIDList:[E.value],groupID:s.value,type:Ju.audio})}})}},{text:pe.t("Toolbar.服务评价"),hidden:(te=R.value)==null?void 0:te.evaluate,onClick:()=>ye(this,null,function*(){var De;if(Se.value){k.value=!0,yield new Promise(ut=>setTimeout(ut,0)),(De=U.value)==null||De.open({groupId:r.value,sellerId:E.value});return}ns.open(bi.evaluation,{groupId:r.value,sellerId:E.value})})},{text:pe.t("Toolbar.申请平台介入"),onClick:J}]:[]}),D=te=>{te.groupId===r.value&&(R.value.evaluate=!0)},J=()=>{B()},ee=P(!1);xu(te=>{T.login().then(()=>{const{conversationID:De=""}=te;s.value=De.replace("GROUP",""),!(!De.startsWith("C2C")&&!De.startsWith("GROUP"))&&(S(),x(),se(De))}).catch(De=>{})}),Uu(()=>{const te=c.value||Mh().query;T.login().then(()=>{se(te)}).catch(De=>{})}),Pu(()=>{he()});const se=te=>{ee.value||(ee.value=!0,jr.switchConversation(te).finally(()=>{T.markConversationReadAndSync(te)}))},ue=te=>{se(te),c.value=te,s.value=te==null?void 0:te.replace(Fe.TYPES.CONV_GROUP,""),S(),te&&x(),f.value="none"};et(()=>{Ee.watch(be.CONV,{currentConversation:Ue}),Ee.watch(be.GRP,{currentGroupMemberList:b}),uni.$on("evaluation-submitted",D)}),st(()=>{Ee.unwatch(be.CONV,{currentConversation:Ue}),Ee.unwatch(be.GRP,{currentGroupMemberList:b}),uni.$off("evaluation-submitted"),he()}),Nu(()=>{Ee.unwatch(be.CONV,{currentConversation:Ue}),Ee.unwatch(be.GRP,{currentGroupMemberList:b}),uni.$off("evaluation-submitted"),he()});const oe=ie(()=>He.value?f.value!=="none":!0),W=ie(()=>pe.t("TUIChat.会话已结束如遇问题请")),V=ie(()=>A.value===kh.ORDER),S=()=>ye(this,null,function*(){if(!s.value)return;if(C.value[s.value]){y.value=C.value[s.value].groupName,m.value=C.value[s.value].faceImgUrl,r.value=C.value[s.value].id,A.value=C.value[s.value].bizType;return}const{data:te}=yield Nh({imGroupIds:[s.value]});te!=null&&te.length&&(y.value=te[0].groupName,m.value=te[0].faceImgUrl,r.value=te[0].id)}),x=()=>ye(this,null,function*(){const te=yield xh(s.value);R.value=te.data;const De=yield Uh();I.value=De.data}),H=P(),z=()=>{H.value.open()},de=()=>{var te;ns.open(bi.orderDetail,{orderId:(te=R.value)==null?void 0:te.orderId,from:"im"})},he=()=>{ee.value=!1,jr.switchConversation("")},Te=()=>{ns.back(),he()},Oe=te=>{var De;(De=d.value)==null||De.insertEmoji(te)},$=te=>{var De,ut;(ut=(De=d.value)==null?void 0:De.insertAt)==null||ut.call(De,te,!0)},Q=(te,De)=>{var ut,Ke,un;if(!(!te||!De))switch(De){case"reference":break;case"reply":break;case"reedit":(ut=te==null?void 0:te.payload)!=null&&ut.text&&((un=d==null?void 0:d.value)==null||un.reEdit((Ke=te==null?void 0:te.payload)==null?void 0:Ke.text));break}};function Ce(te){f.value=f.value===te?"none":te,f.value!=="none"&&He.value&&uni.$emit("scroll-to-bottom")}function Ie(){var te;(te=p.value)==null||te.scrollToLatestMessage()}function _e(te){u.value=te===void 0?!u.value:te}function K(){var te;(te=p.value)==null||te.mergeForwardMessage()}function ce(){var te;(te=p.value)==null||te.oneByOneForwardMessage()}function Le(te){(te==null?void 0:te.operationType)>0?(g.value=[],a.value=!0,l.value=te==null?void 0:te.operationType):(a.value=!1,l.value=void 0)}function Ue(te){if(Le(te),!te||c.value===(te==null?void 0:te.conversationID))return;o.value=!1;let De=Fe.TYPES.CONV_C2C;const ut=te.conversationID;if(ut.startsWith(Fe.TYPES.CONV_GROUP)&&(De=Fe.TYPES.CONV_GROUP,o.value=!0,s.value=ut.replace(Fe.TYPES.CONV_GROUP,"")),g.value=[],u.value=!1,Ot.setChatType(De),Fn.notifyEvent(ct.TUIChat.EVENT.CHAT_STATE_CHANGED,ct.TUIChat.EVENT_SUB_KEY.CHAT_OPENED,{groupID:s.value}),Fn.callService({serviceName:ct.TUICustomerServicePlugin.SERVICE.NAME,method:ct.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION,params:{conversationID:ut}}),Ot.getChatType()===ct.TUIChat.TYPE.ROOM&&Ot.getFeatureConfig(ct.TUIChat.FEATURE.InputVoice)===!0){Ot.setTheme("light"),c.value="";return}Ot.getChatType()===ct.TUIChat.TYPE.GROUP&&(g.value=Fn.getExtensionList(ct.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID)),Ee.update(be.CUSTOM,"activeConversation",ut),c.value=ut}function St(te,De){n("onMinimized",{oldMinimizedStatus:te,newMinimizedStatus:De})}return e({pcDialogSwitchChat:ue}),(te,De)=>
102{const ut=fi;return w(),G(ze,null,[q("div",{class:"chat"},[v(Jt).isAliMini?X("",!0):(w(),ne(v(yr),{key:0,"allowed-minimized":v(Se),onMinimized:St},null,8,["allowed-minimized"])),q("div",{class:fe(["tui-chat",!v(Se)&&"tui-chat-h5"])},[c.value?X("",!0):(w(),G("div",{key:0,class:fe(["tui-chat-default",!v(Se)&&"tui-chat-h5-default"])},[Ve(te.$slots,"default",{},void 0,!0)],2)),c.value?(w(),G("div",{key:1,class:fe(["tui-chat",!v(Se)&&"tui-chat-h5"])},[Y(tv,{displayName:y.value,avatar:m.value,class:fe(["tui-chat-header",!v(Se)&&"tui-chat-H5-header",v(He)&&"tui-chat-uniapp-header",v(Se)&&"pc"]),"header-extension-list":g.value,onCloseChat:Te},null,8,["displayName","avatar","class","header-extension-list"]),Y(X3,{onToggleMultipleSelectMode:_e}),V.value?(w(),ne(o4,{key:0,orderDetail:R.value,onToOrderDetail:de},null,8,["orderDetail"])):X("",!0),Y(e_,{ref_key:"messageListRef",ref:p,class:fe(["tui-chat-message-list",!v(Se)&&"tui-chat-h5-message-list",v(Se)&&"pc"]),"is-group":o.value,"group-i-d":s.value,"user-info":L.value,"is-not-in-group":a.value,"is-multiple-select-mode":u.value,"shortcut-menus":O.value,announcement:I.value,onHandleEditor:Q,onCloseInputToolBar:De[0]||(De[0]=()=>Ce("none")),onToggleMultipleSelectMode:_e,onOnAvatarLongPress:$,onOnAnnouncementClick:z},null,8,["class","is-group","group-i-d","user-info","is-not-in-group","is-multiple-select-mode","shortcut-menus","announcement"]),k.value?(w(),ne(Jh,{key:1,ref_key:"evaluationRef",ref:U,onSubmit:D},null,512)):X("",!0),a.value?(w(),G("div",{key:2,class:fe({"tui-chat-leave-group":!0,"tui-chat-leave-group-mobile":!v(Se),pc:v(Se)})},[q("div",{class:"tui-chat-leave-group-text"},[qe(ae(W.value)+" ",1),q("span",{onClick:J},ae(v(pe).t("TUIChat.联系客服")),1)])],2)):u.value?(w(),ne(PS,{key:3,onOneByOneForwardMessage:ce,onMergeForwardMessage:K,onToggleMultipleSelectMode:_e})):(w(),G(ze,{key:4},[oe.value?(w(),ne(s4,{key:0,class:fe(["tui-chat-message-input-toolbar",!v(Se)&&"tui-chat-h5-message-input-toolbar",v(He)&&"tui-chat-uni-message-input-toolbar",v(Se)&&"pc"]),"display-type":f.value,onInsertEmoji:Oe,onChangeToolbarDisplayType:Ce,onScrollToLatestMessage:Ie},null,8,["class","display-type"])):X("",!0),Y(MS,{ref_key:"messageInputRef",ref:d,class:fe(["tui-chat-message-input",!v(Se)&&"tui-chat-h5-message-input",v(He)&&"tui-chat-uni-message-input",v(al)&&"tui-chat-wx-message-input",v(Se)&&"pc"]),"enable-at":v(h).InputMention,"is-muted":!1,"mute-text":v(pe).t("TUIChat.您已被管理员禁言"),placeholder:v(pe).t("TUIChat.请输入消息"),"input-toolbar-display-type":f.value,onChangeToolbarDisplayType:Ce},null,8,["class","enable-at","mute-text","placeholder","input-toolbar-display-type"])],64))],2)):X("",!0)],2)]),Y(Qh,{ref_key:"announcementDialog",ref:H,"show-title":!0,"show-cancel":!1,"show-confirm":!0,"confirm-text":v(pe).t("TUIChat.确定")},{title:re(()=>{var Ke;return[(Ke=I.value)!=null&&Ke.title?(w(),ne(ut,{key:0,class:"announcement-title"},{default:re(()=>[Y(ut,{class:"center"},{default:re(()=>[qe(ae(I.value.title),1)]),_:1})]),_:1})):X("",!0)]}),default:re(()=>[Y(ut,{class:"announcement-content"},{default:re(()=>{var Ke;return[qe(ae((Ke=I.value)==null?void 0:Ke.content),1)]}),_:1})]),_:1},8,["confirm-text"])],64)}}}),B4=ve(l4,[["__scopeId","data-v-6a453315"]]);export{B4 as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.