Files
yusheng-admin/dist/static/js/demo-DDf_ewnH.js

160 lines
1.2 MiB
JavaScript
Raw Normal View History

2025-10-23 11:06:41 +08:00
var H4=Object.getPrototypeOf;var K4=Reflect.get;var Mf=(ai,ce)=>(ce=Symbol[ai])?ce:Symbol.for("Symbol."+ai),Y4=ai=>{throw TypeError(ai)},XN=Math.pow;var Uf=(ai,ce,Ai)=>K4(H4(ai),Ai,ce);var C=(ai,ce,Ai)=>new Promise((Qe,Pt)=>{var Lt=mi=>{try{Ze(Ai.next(mi))}catch(Wi){Pt(Wi)}},bi=mi=>{try{Ze(Ai.throw(mi))}catch(Wi){Pt(Wi)}},Ze=mi=>mi.done?Qe(mi.value):Promise.resolve(mi.value).then(Lt,bi);Ze((Ai=Ai.apply(ai,ce)).next())}),q4=function(ai,ce){this[0]=ai,this[1]=ce};var vd=ai=>{var ce=ai[Mf("asyncIterator")],Ai=!1,Qe,Pt={};return ce==null?(ce=ai[Mf("iterator")](),Qe=Lt=>Pt[Lt]=bi=>ce[Lt](bi)):(ce=ce.call(ai),Qe=Lt=>Pt[Lt]=bi=>{if(Ai){if(Ai=!1,Lt==="throw")throw bi;return bi}return Ai=!0,{done:!1,value:new q4(new Promise(Ze=>{var mi=ce[Lt](bi);mi instanceof Object||Y4("Object expected"),Ze(mi)}),1)}}),Pt[Mf("iterator")]=()=>Pt,Qe("next"),"throw"in ce?Qe("throw"):Pt.throw=Lt=>{throw Lt},"return"in ce&&Qe("return"),Pt};import{fJ as xf,fK as z4,d as X4,n as Rs,t as J4,x as Q4,am as Z4,o as vs,c as Cs,e as Gi,P as $4,Q as tH,T as eH,f as JN,U as iH,_ as nH}from"./index-CRmU-Qpi.js";var Ih={exports:{}},rH=Ih.exports,QN;function oH(){return QN||(QN=1,function(ai,ce){(function(Ai,Qe){ai.exports=Qe()})(rH,function(){function Ai(t,e){return e.forEach(function(i){i&&typeof i!="string"&&!Array.isArray(i)&&Object.keys(i).forEach(function(n){if(n!=="default"&&!(n in t)){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}})}),Object.freeze(t)}var Qe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof xf!="undefined"?xf:typeof self!="undefined"?self:{};function Pt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lt=function(t){try{return!!t()}catch(e){return!0}},bi=!Lt(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),Ze=bi,mi=Function.prototype,Wi=mi.call,Gn=Ze&&mi.bind.bind(Wi,Wi),de=Ze?Gn:function(t){return function(){return Wi.apply(t,arguments)}},$e=de({}.isPrototypeOf),Lo=function(t){return t&&t.Math===Math&&t},ie=Lo(typeof globalThis=="object"&&globalThis)||Lo(typeof window=="object"&&window)||Lo(typeof self=="object"&&self)||Lo(typeof Qe=="object"&&Qe)||Lo(typeof Qe=="object"&&Qe)||function(){return this}()||Function("return this")(),Ah=bi,yd=Function.prototype,ci=yd.apply,be=yd.call,fi=typeof Reflect=="object"&&Reflect.apply||(Ah?be.bind(ci):function(){return be.apply(ci,arguments)}),ar=de,Vf=ar({}.toString),Ha=ar("".slice),cr=function(t){return Ha(Vf(t),8,-1)},tD=cr,eD=de,Ka=function(t){if(tD(t)==="Function")return eD(t)},bh=typeof document=="object"&&document.all,Be=bh===void 0&&bh!==void 0?function(t){return typeof t=="function"||t===bh}:function(t){return typeof t=="function"},Id={},wi=!Lt(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),iD=bi,Ad=Function.prototype.call,Ye=iD?Ad.bind(Ad):function(){return Ad.apply(Ad,arguments)},bd={},Ff={}.propertyIsEnumerable,Bf=Object.getOwnPropertyDescriptor,nD=Bf&&!Ff.call({1:2},1);bd.f=nD?function(t){var e=Bf(this,t);return!!e&&e.enumerable}:Ff;var Zr,wd,$r=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},rD=Lt,oD=cr,wh=Object,sD=de("".split),Od=rD(function(){return!wh("z").propertyIsEnumerable(0)})?function(t){return oD(t)==="String"?sD(t,""):wh(t)}:wh,Nd=function(t){return t==null},aD=Nd,cD=TypeError,ko=function(t){if(aD(t))throw new cD("Can't call method on "+t);return t},dD=Od,lD=ko,to=function(t){return dD(lD(t))},uD=Be,gi=function(t){return typeof t=="object"?t!==null:uD(t)},sn={},Oh=sn,Nh=ie,hD=Be,jf=function(t){return hD(t)?t:void 0},Si=function(t,e){return arguments.length<2?jf(Oh[t])||jf(Nh[t]):Oh[t]&&Oh[t][e]||Nh[t]&&Nh[t][e]},Gf=ie.navigator,Wf=Gf&&Gf.userAgent,Pr=Wf?String(Wf):"",Hf=ie,Dh=Pr,Kf=Hf.process,Yf=Hf.Deno,qf=Kf&&Kf.versions||Yf&&Yf.version,zf=qf&&qf.v8;zf&&(wd=(Zr=zf.split("."))[0]>0&&Zr[0]<4?1:+(Zr[0]+Zr[1])),!wd&&Dh&&(!(Zr=Dh.match(/Edge\/(\d+)/))||Zr[1]>=74)&&(Zr=Dh.match(/Chrome\/(\d+)/))&&(wd=+Zr[1]);v
\v\f\r    \u2028\u2029\uFEFF`,eF=ko,iF=Ki,k_=gv,Sv=de("".replace),nF=RegExp("^["+k_+"]+"),rF=RegExp("(^|[^"+k_+"])["+k_+"]+$"),M_=function(t){return function(e){var i=iF(eF(e));return 1&t&&(i=Sv(i,nF,"")),2&t&&(i=Sv(i,rF,"$1")),i}},oF={start:M_(1),end:M_(2),trim:M_(3)},sF=eS.PROPER,aF=Lt,Tv=gv,cF=oF.trim;Nt({target:"String",proto:!0,forced:function(t){return aF(function(){return!!Tv[t]()||"…"[t]()!=="…"||sF&&Tv[t].name!==t})}("trim")},{trim:function(){return cF(this)}});var dF=Sn("String","trim"),lF=$e,uF=dF,U_=String.prototype,hF=function(t){var e=t.trim;return typeof t=="string"||t===U_||lF(U_,t)&&e===U_.trim?uF:e},ni=Pt(hF),Rv={exports:{}};(function(t){const e={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};e.localCName=e.generateIdentifier(),e.splitLines=function(i){return i.trim().split(`
`).map(n=>n.trim())},e.splitSections=function(i){return i.split(`
m=`).map((n,r)=>(r>0?"m="+n:n).trim()+`\r
`)},e.getDescription=function(i){const n=e.splitSections(i);return n&&n[0]},e.getMediaSections=function(i){const n=e.splitSections(i);return n.shift(),n},e.matchPrefix=function(i,n){return e.splitLines(i).filter(r=>r.indexOf(n)===0)},e.parseCandidate=function(i){let n;n=i.indexOf("a=candidate:")===0?i.substring(12).split(" "):i.substring(10).split(" ");const r={foundation:n[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]};for(let o=8;o<n.length;o+=2)switch(n[o]){case"raddr":r.relatedAddress=n[o+1];break;case"rport":r.relatedPort=parseInt(n[o+1],10);break;case"tcptype":r.tcpType=n[o+1];break;case"ufrag":r.ufrag=n[o+1],r.usernameFragment=n[o+1];break;default:r[n[o]]===void 0&&(r[n[o]]=n[o+1])}return r},e.writeCandidate=function(i){const n=[];n.push(i.foundation);const r=i.component;r==="rtp"?n.push(1):r==="rtcp"?n.push(2):n.push(r),n.push(i.protocol.toUpperCase()),n.push(i.priority),n.push(i.address||i.ip),n.push(i.port);const o=i.type;return n.push("typ"),n.push(o),o!=="host"&&i.relatedAddress&&i.relatedPort&&(n.push("raddr"),n.push(i.relatedAddress),n.push("rport"),n.push(i.relatedPort)),i.tcpType&&i.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(i.tcpType)),(i.usernameFragment||i.ufrag)&&(n.push("ufrag"),n.push(i.usernameFragment||i.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(i){return i.substring(14).split(" ")},e.parseRtpMap=function(i){let n=i.substring(9).split(" ");const r={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),r.name=n[0],r.clockRate=parseInt(n[1],10),r.channels=n.length===3?parseInt(n[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(i){let n=i.payloadType;i.preferredPayloadType!==void 0&&(n=i.preferredPayloadType);const r=i.channels||i.numChannels||1;return"a=rtpmap:"+n+" "+i.name+"/"+i.clockRate+(r!==1?"/"+r:"")+`\r
`},e.parseExtmap=function(i){const n=i.substring(9).split(" ");return{id:parseInt(n[0],10),direction:n[0].indexOf("/")>0?n[0].split("/")[1]:"sendrecv",uri:n[1],attributes:n.slice(2).join(" ")}},e.writeExtmap=function(i){return"a=extmap:"+(i.id||i.preferredId)+(i.direction&&i.direction!=="sendrecv"?"/"+i.direction:"")+" "+i.uri+(i.attributes?" "+i.attributes:"")+`\r
`},e.parseFmtp=function(i){const n={};let r;const o=i.substring(i.indexOf(" ")+1).split(";");for(let s=0;s<o.length;s++)r=o[s].trim().split("="),n[r[0].trim()]=r[1];return n},e.writeFmtp=function(i){let n="",r=i.payloadType;if(i.preferredPayloadType!==void 0&&(r=i.preferredPayloadType),i.parameters&&Object.keys(i.parameters).length){const o=[];Object.keys(i.parameters).forEach(s=>{i.parameters[s]!==void 0?o.push(s+"="+i.parameters[s]):o.push(s)}),n+="a=fmtp:"+r+" "+o.join(";")+`\r
`}return n},e.parseRtcpFb=function(i){const n=i.substring(i.indexOf(" ")+1).split(" ");return{type:n.shift(),parameter:n.join(" ")}},e.writeRtcpFb=function(i){let n="",r=i.payloadType;return i.preferredPayloadType!==void 0&&(r=i.preferredPayloadType),i.rtcpFeedback&&i.rtcpFeedback.length&&i.rtcpFeedback.forEach(o=>{n+="a=rtcp-fb:"+r+" "+o.type+(o.parameter&&o.parameter.length?" "+o.parameter:"")+`\r
`}),n},e.parseSsrcMedia=function(i){const n=i.indexOf(" "),r={ssrc:parseInt(i.substring(7,n),10)},o=i.indexOf(":",n);return o>-1?(r.attribute=i.substring(n+1,o),r.value=i.substring(o+1)):r.attribute=i.substring(n+1),r},e.parseSsrcGroup=function(i){const n=i.substring(13).split(" ");return{semantics:n.shift(),ssrcs:n.map(r=>parseInt(r,10))}},e.getMid=function(i){const n=e.matchPrefix(i,"a=mid:")[0];if(n)return n.substring(6)},e.parseFingerprint=function(i){const n=i.substring(14).split(" ");return{algorithm:n[0].toLowerCase(),value:n[1].toUpperCase()}},e.getDtlsParameters=function(i,n){return{role:"auto",fingerprints:e.matchPrefix(i+n,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(i,n){let r="a=setup:"+n+`\r
`;return i.fingerprints.forEach(o=>{r+="a=fingerprint:"+o.algorithm+" "+o.value+`\r
`}),r},e.parseCryptoLine=function(i){const n=i.substring(9).split(" ");return{tag:parseInt(n[0],10),cryptoSuite:n[1],keyParams:n[2],sessionParams:n.slice(3)}},e.writeCryptoLine=function(i){return"a=crypto:"+i.tag+" "+i.cryptoSuite+" "+(typeof i.keyParams=="object"?e.writeCryptoKeyParams(i.keyParams):i.keyParams)+(i.sessionParams?" "+i.sessionParams.join(" "):"")+`\r
`},e.parseCryptoKeyParams=function(i){if(i.indexOf("inline:")!==0)return null;const n=i.substring(7).split("|");return{keyMethod:"inline",keySalt:n[0],lifeTime:n[1],mkiValue:n[2]?n[2].split(":")[0]:void 0,mkiLength:n[2]?n[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(i){return i.keyMethod+":"+i.keySalt+(i.lifeTime?"|"+i.lifeTime:"")+(i.mkiValue&&i.mkiLength?"|"+i.mkiValue+":"+i.mkiLength:"")},e.getCryptoParameters=function(i,n){return e.matchPrefix(i+n,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(i,n){const r=e.matchPrefix(i+n,"a=ice-ufrag:")[0],o=e.matchPrefix(i+n,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substring(12),password:o.substring(10)}:null},e.writeIceParameters=function(i){let n="a=ice-ufrag:"+i.usernameFragment+`\r
a=ice-pwd:`+i.password+`\r
`;return i.iceLite&&(n+=`a=ice-lite\r
`),n},e.parseRtpParameters=function(i){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=e.splitLines(i)[0].split(" ");n.profile=r[2];for(let s=3;s<r.length;s++){const a=r[s],c=e.matchPrefix(i,"a=rtpmap:"+a+" ")[0];if(c){const d=e.parseRtpMap(c),l=e.matchPrefix(i,"a=fmtp:"+a+" ");switch(d.parameters=l.length?e.parseFmtp(l[0]):{},d.rtcpFeedback=e.matchPrefix(i,"a=rtcp-fb:"+a+" ").map(e.parseRtcpFb),n.codecs.push(d),d.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(d.name.toUpperCase())}}}e.matchPrefix(i,"a=extmap:").forEach(s=>{n.headerExtensions.push(e.parseExtmap(s))});const o=e.matchPrefix(i,"a=rtcp-fb:* ").map(e.parseRtcpFb);return n.codecs.forEach(s=>{o.forEach(a=>{s.rtcpFeedback.find(c=>c.type===a.type&&c.parameter===a.parameter)||s.rtcpFeedback.push(a)})}),n},e.writeRtpDescription=function(i,n){let r="";r+="m="+i+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r
`,r+=`c=IN IP4 0.0.0.0\r
`,r+=`a=rtcp:9 IN IP4 0.0.0.0\r
`,n.codecs.forEach(s=>{r+=e.writeRtpMap(s),r+=e.writeFmtp(s),r+=e.writeRtcpFb(s)});let o=0;return n.codecs.forEach(s=>{s.maxptime>o&&(o=s.maxptime)}),o>0&&(r+="a=maxptime:"+o+`\r
`),n.headerExtensions&&n.headerExtensions.forEach(s=>{r+=e.writeExtmap(s)}),r},e.parseRtpEncodingParameters=function(i){const n=[],r=e.parseRtpParameters(i),o=r.fecMechanisms.indexOf("RED")!==-1,s=r.fecMechanisms.indexOf("ULPFEC")!==-1,a=e.matchPrefix(i,"a=ssrc:").map(h=>e.parseSsrcMedia(h)).filter(h=>h.attribute==="cname"),c=a.length>0&&a[0].ssrc;let d;const l=e.matchPrefix(i,"a=ssrc-group:FID").map(h=>h.substring(17).split(" ").map(p=>parseInt(p,10)));l.length>0&&l[0].length>1&&l[0][0]===c&&(d=l[0][1]),r.codecs.forEach(h=>{if(h.name.toUpperCase()==="RTX"&&h.parameters.apt){let p={ssrc:c,codecPayloadType:parseInt(h.parameters.apt,10)};c&&d&&(p.rtx={ssrc:d}),n.push(p),o&&(p=JSON.parse(JSON.stringify(p)),p.fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(p))}}),n.length===0&&c&&n.push({ssrc:c});let u=e.matchPrefix(i,"b=");return u.length&&(u=u[0].indexOf("b=TIAS:")===0?parseInt(u[0].substring(7),10):u[0].indexOf("b=AS:")===0?1e3*parseInt(u[0].substring(5),10)*.95-16e3:void 0,n.forEach(h=>{h.maxBitrate=u})),n},e.parseRtcpParameters=function(i){const n={},r=e.matchPrefix(i,"a=ssrc:").map(a=>e.parseSsrcMedia(a)).filter(a=>a.attribute==="cname")[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);const o=e.matchPrefix(i,"a=rtcp-rsize");n.reducedSize=o.length>0,n.compound=o.length===0;const s=e.matchPrefix(i,"a=rtcp-mux");return n.mux=s.length>0,n},e.writeRtcpParameters=function(i){let n="";return i.reducedSize&&(n+=`a=rtcp-rsize\r
`),i.mux&&(n+=`a=rtcp-mux\r
`),i.ssrc!==void 0&&i.cname&&(n+="a=ssrc:"+i.ssrc+" cname:"+i.cname+`\r
`),n},e.parseMsid=function(i){let n;const r=e.matchPrefix(i,"a=msid:");if(r.length===1)return n=r[0].substring(7).split(" "),{stream:n[0],track:n[1]};const o=e.matchPrefix(i,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");return o.length>0?(n=o[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},e.parseSctpDescription=function(i){const n=e.parseMLine(i),r=e.matchPrefix(i,"a=max-message-size:");let o;r.length>0&&(o=parseInt(r[0].substring(19),10)),isNaN(o)&&(o=65536);const s=e.matchPrefix(i,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:n.fmt,maxMessageSize:o};const a=e.matchPrefix(i,"a=sctpmap:");if(a.length>0){const c=a[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:o}}},e.writeSctpDescription=function(i,n){let r=[];return r=i.protocol!=="DTLS/SCTP"?["m="+i.kind+" 9 "+i.protocol+" "+n.protocol+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctp-port:"+n.port+`\r
`]:["m="+i.kind+" 9 "+i.protocol+" "+n.port+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctpmap:"+n.port+" "+n.protocol+` 65535\r
`],n.maxMessageSize!==void 0&&r.push("a=max-message-size:"+n.maxMessageSize+`\r
`),r.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(i,n,r){let o;const s=n!==void 0?n:2;return o=i||e.generateSessionId(),`v=0\r
o=`+(r||"thisisadapterortc")+" "+o+" "+s+` IN IP4 127.0.0.1\r
s=-\r
t=0 0\r
`},e.getDirection=function(i,n){const r=e.splitLines(i);for(let o=0;o<r.length;o++)switch(r[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[o].substring(2)}return n?e.getDirection(n):"sendrecv"},e.getKind=function(i){return e.splitLines(i)[0].split(" ")[0].substring(2)},e.isRejected=function(i){return i.split(" ",2)[1]==="0"},e.parseMLine=function(i){const n=e.splitLines(i)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},e.parseOLine=function(i){const n=e.matchPrefix(i,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},e.isValidSDP=function(i){if(typeof i!="string"||i.length===0)return!1;const n=e.splitLines(i);for(let r=0;r<n.length;r++)if(n[r].length<2||n[r].charAt(1)!=="=")return!1;return!0},t.exports=e})(Rv);var vv=Rv.exports,Xs=Pt(vv),pF=Ai({__proto__:null,default:Xs},[vv]);function yl(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(i){if(typeof i=="object"&&i.candidate&&i.candidate.indexOf("a=")===0&&((i=JSON.parse(JSON.stringify(i))).candidate=i.candidate.substr(2)),i.candidate&&i.candidate.length){const n=new e(i),r=Xs.parseCandidate(i.candidate),o=Object.assign(n,r);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new e(i)},t.RTCIceCandidate.prototype=e.prototype,Ko(t,"icecandidate",i=>(i.candidate&&Object.defineProperty(i,"candidate",{value:new t.RTCIceCandidate(i.candidate),writable:"false"}),i))}function x_(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||Ko(t,"icecandidate",e=>{if(e.candidate){const i=Xs.parseCandidate(e.candidate.candidate);i.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[i.priority>>24])}return e})}function Il(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});const i=function(a){if(!a||!a.sdp)return!1;const c=Xs.splitSections(a.sdp);return c.shift(),c.some(d=>{const l=Xs.parseMLine(d);return l&&l.kind==="application"&&l.protocol.indexOf("SCTP")!==-1})},n=function(a){const c=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(c===null||c.length<2)return-1;const d=parseInt(c[1],10);return d!=d?-1:d},r=function(a){let c=65536;return e.browser==="firefox"&&(c=e.version<57?a===-1?16384:2147483637:e.version<60?e.version===57?65535:65536:2147483637),c},o=function(a,c){let d=65536;e.browser==="firefox"&&e.version===57&&(d=65535);const l=Xs.matchPrefix(a.sdp,"a=max-message-size:");return l.length>0?d=parseInt(l[0].substr(19),10):e.browser==="firefox"&&c!==-1&&(d=2147483637),d},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:a}=this.getConfiguration();a==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(i(arguments[0])){const a=n(arguments[0]),c=r(a),d=o(arguments[0],a);let l;l=c===0&&d===0?Number.POSITIVE_INFINITY:c===0||d===0?Math.max(c,d):Math.min(c,d);const u={};Object.defineProperty(u,"maxMessageSize",{get:()=>l}),this._sctp=u}return s.apply(this,arguments)}}function Al(t){if(!t.RTCPeerConnection||!("createDataChannel"in t.RTCPeerConnection.prototype))return;function e(n,r){const o=n.send;n.send=function(){const s=arguments[0],a=s.length||s.size||s.byteLength;if(n.readyState==="open"&&r.sctp&&a>r.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+r.sctp.maxMessageSize+" bytes)");return o.apply(n,arguments)}}const i=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const n=i.apply(this,arguments);return e(n,this
a=extmap-allow-mixed`)!==-1){const r=n.sdp.split(`
`).filter(o=>ni(o).call(o)!=="a=extmap-allow-mixed").join(`
`);t.RTCSessionDescription&&n instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:n.type,sdp:r}):n.sdp=r}return i.apply(this,arguments)}}function bl(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const i=t.RTCPeerConnection.prototype.addIceCandidate;i&&i.length!==0&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?K.resolve():i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),K.resolve())})}function wl(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const i=t.RTCPeerConnection.prototype.setLocalDescription;i&&i.length!==0&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let n=arguments[0]||{};if(typeof n!="object"||n.type&&n.sdp)return i.apply(this,arguments);if(n={type:n.type,sdp:n.sdp},!n.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":n.type="offer";break;default:n.type="answer"}return n.sdp||n.type!=="offer"&&n.type!=="answer"?i.apply(this,[n]):(n.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(r=>i.apply(this,[r]))})}var _F=Object.freeze({__proto__:null,removeExtmapAllowMixed:F_,shimAddIceCandidateNullOrEmpty:bl,shimConnectionState:V_,shimMaxMessageSize:Il,shimParameterlessSetLocalDescription:wl,shimRTCIceCandidate:yl,shimRTCIceCandidateRelayProtocol:x_,shimSendThrowTypeError:Al});(function(){let{window:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const i=UR,n=function(o){const s={browser:null,version:null};if(o===void 0||!o.navigator)return s.browser="Not a browser.",s;const{navigator:a}=o;if(a.mozGetUserMedia)s.browser="firefox",s.version=Cl(a.userAgent,/Firefox\/(\d+)\./,1);else if(a.webkitGetUserMedia||o.isSecureContext===!1&&o.webkitRTCPeerConnection)s.browser="chrome",s.version=Cl(a.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!o.RTCPeerConnection||!a.userAgent.match(/AppleWebKit\/(\d+)\./))return s.browser="Not a supported browser.",s;s.browser="safari",s.version=Cl(a.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=o.RTCRtpTransceiver&&"currentDirection"in o.RTCRtpTransceiver.prototype}return s}(t),r={browserDetails:n,commonShim:_F,extractVersion:Cl,disableLog:$V,disableWarnings:tF,sdp:pF};switch(n.browser){case"chrome":if(!JR||!P_||!e.shimChrome)return i("Chrome shim is not included in this adapter release."),r;if(n.version===null)return i("Chrome shim can not determine version, not shimming."),r;i("adapter.js shimming chrome."),r.browserShim=JR,bl(t,n),wl(t),jR(t,n),GR(t),P_(t,n),WR(t),zR(t,n),HR(t),KR(t),YR(t),XR(t,n),yl(t),x_(t),V_(t),Il(t,n),Al(t),F_(t,n);break;case"firefox":if(!av||!L_||!e.shimFirefox)return i("Firefox shim is not included in this adapter release."),r;i("adapter.js shimming firefox."),r.browserShim=av,bl(t,n),wl(t),QR(t,n),L_(t,n),ZR(t),ev(t),$R(t),tv(t),iv(t),nv(t),rv(t),ov(t),sv(t),yl(t),V_(t),Il(t,n),Al(t);break;case"safari":if(!fv||!e.shimSafari)return i("Safari shim is not included in this adapter release."),r;i("adapter.js shimming safari."),r.browserShim=fv,bl(t,n),wl(t),pv(t),Ev(t),lv(t),cv(t),dv(t),_v(t),uv(t),mv(t),yl(t),x_(t),Il(t,n),Al(t),F_(t,n);break;default:i("Unsupported browser!")}})({window:typeof window=="undefined"?void 0:window});var B_=ie;Nt({global:!0,forced:B_.globalThis!==B_},{globalThis:B_});var Cv=Pt(ie),j_={exports:{}};(function(t,e){(function(i,n){var r="function",o="undefined",s="object",a="string",c="major",d="model",l="name",u="type",h="vendor",p="version",g="architecture",m="console",f="mobile",T="tablet",R="smarttv",A="wearable",N="embedded",O="Amazon",w="Apple",L="ASUS",M="BlackBerry",j="Browser",H="Chrome",ht="Firefox",lt="Google",rt="Huawei",Kt="LG",Ft="Microsoft",Ii="Motorola",U="Opera",B="Samsung",X="Sharp",x="Sony",E="Xiaomi",I="Zebra",b="Facebook",F="Chromium OS",ct="Mac OS",Wt=" Browser",ye=
`).forEach(function(p){var g,m;h=p.indexOf(":"),l=ni(g=p.substring(0,h)).call(g).toLowerCase(),u=ni(m=p.substring(h+1)).call(m),!l||d[l]&&vG[l]||(l==="set-cookie"?d[l]?d[l].push(u):d[l]=[u]:d[l]=d[l]?d[l]+", "+u:u)}),d})(e),i);else if(W.isObject(e)&&W.isIterable(e)){let c,d,l={};for(const u of e){if(!W.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?W.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,i)}else e!=null&&o(i,e,n);var a;return this}get(e,i){if(e=Cc(e)){const n=W.findKey(this,e);if(n){const r=this[n];if(!i)return r;if(i===!0)return function(o){const s=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let c;for(;c=a.exec(o);)s[c[1]]=c[2];return s}(r);if(W.isFunction(i))return i.call(this,r,n);if(W.isRegExp(i))return i.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,i){if(e=Cc(e)){const n=W.findKey(this,e);return!(!n||this[n]===void 0||i&&!_E(0,this[n],n,i))}return!1}delete(e,i){const n=this;let r=!1;function o(s){if(s=Cc(s)){const a=W.findKey(n,s);!a||i&&!_E(0,n[a],a,i)||(delete n[a],r=!0)}}return W.isArray(e)?e.forEach(o):o(e),r}clear(e){const i=Object.keys(this);let n=i.length,r=!1;for(;n--;){const o=i[n];e&&!_E(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const i=this,n={};return W.forEach(this,(r,o)=>{var s;const a=W.findKey(n,o);if(a)return i[a]=Yl(r),void delete i[o];const c=e?function(d){return ni(d).call(d).toLowerCase().replace(/([a-z\d])(\w*)/g,(l,u,h)=>u.toUpperCase()+h)}(o):ni(s=String(o)).call(s);c!==o&&delete i[o],i[c]=Yl(r),n[c]=!0}),this}concat(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this.constructor.concat(this,...i)}toJSON(e){const i=Object.create(null);return W.forEach(this,(n,r)=>{n!=null&&n!==!1&&(i[r]=e&&W.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(e=>{let[i,n]=e;return i+": "+n}).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const i=new this(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach(s=>i.set(s)),i}static accessor(e){const i=(this[yy]=this[yy]={accessors:{}}).accessors,n=this.prototype;function r(o){const s=Cc(o);i[s]||(function(a,c){const d=W.toCamelCase(" "+c);["get","set","has"].forEach(l=>{Object.defineProperty(a,l+d,{value:function(u,h,p){return this[l].call(this,c,u,h,p)},configurable:!0})})}(n,o),i[s]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}}ql.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.reduceDescriptors(ql.prototype,(t,e)=>{let{value:i}=t,n=e[0].toUpperCase()+e.slice(1);return{get:()=>i,set(r){this[n]=r}}}),W.freezeMethods(ql);var zn=ql;function EE(t,e){const i=this||pE,n=e||i,r=zn.from(n.headers);let o=n.data;return W.forEach(t,function(s){o=s.call(i,o,r.normalize(),e?e.status:void 0)}),r.normalize(),o}function Iy(t){return!(!t||!t.__CANCEL__)}function ia(t,e,i){Ut.call(this,t==null?"canceled":t,Ut.ERR_CANCELED,e,i),this.name="CanceledError"}function Ay(t,e,i){const n=i.config.validateStatus;i.status&&n&&!n(i.status)?e(new Ut("Request failed with status code "+i.status,[Ut.ERR_BAD_REQUEST,Ut.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}W.inherits(ia,Ut,{__CANCEL__:!0});const zl=function(t,e){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3,n=0;const r=function(o,s){o=o||10;const a=new Array(o),c=new Array(o);let d,l=0,u=0;return s=s!==void 0?s:1e3,function(h){const p=Date.now(),g=c[u];d||(d=p),a[l]=h,c[l]=p;let m=u,f=0;for(;m!==l;)f+=a[m++],m%=o;if(l=(l+1)%o,l===u&&(u=(u+1)%o),p-d<s)return;const T=g&&p-g;return T?Math.round(1e3*f/T):void 0}}(50,250);return function(o,s){let a,c,d=0,l=1e3/s;const u=function(h){d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Date.now(),a=null,c&&(clearTimeout(c),c=null),o.apply(null,h)};return[function(){const h=Date.now(),p=h-d;for(var g=arguments.length,m=new Array(g),f=0;f<g;f++)m[f]=arguments[f];p>=l?u(m,h):(a=m,c||(c=setTimeout(()=>{c=null,u(a)},l-p)))},()=>a&&u(a)]}(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-n,d=r(c);n=s,t({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:d||void 0,estimated:d&&a&&s<=a?(a-s)/d:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0})},i)},by=(t,e)=>{const i=t!=null;return[n=>e[0]({lengthComputable:i,total:t,loaded:n}),e[1]]},wy=t=>function(){for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return W.asap(()=>t(...i))};var CG=Oi.hasStandardBrowserEnv?((t,e)=>i=>(i=new vl(i,Oi.origin),t.protocol===i.protocol&&t.host===i.host&&(e||t.port===i.port)))(new vl(Oi.origin),Oi.navigator&&/(msie|trident)/i.test(Oi.navigator.userAgent)):()=>!0,yG=Oi.hasStandardBrowserEnv?{write(t,e,i,n,r,o){const s=[t+"="+encodeURIComponent(e)];W.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),W.isString(n)&&s.push("path="+n),W.isString(r)&&s.push("domain="+r),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Oy(t,e,i){let n=!function(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}(e);return t&&(n||i==0)?function(r,o){return o?r.replace(/\/?\/$/,"")+"/"+o.replace(/^\/+/,""):r}(t,e):e}function Ny(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),i.push.apply(i,n)}return i}const Dy=t=>t instanceof zn?function(e){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Ny(Object(n),!0).forEach(function(r){S(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)
`+o.map(jy).join(`
`):" "+jy(o[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n},adapters:RE};function vE(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ia(null,t)}function Wy(t){return vE(t),t.headers=zn.from(t.headers),t.data=EE.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Gy.getAdapter(t.adapter||pE.adapter)(t).then(function(e){return vE(t),e.data=EE.call(t,t.transformResponse,e),e.headers=zn.from(e.headers),e},function(e){return Iy(e)||(vE(t),e&&e.response&&(e.response.data=EE.call(t,t.transformResponse,e.response),e.response.headers=zn.from(e.response.headers))),K.reject(e)})}const Hy="1.9.0",$l={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{$l[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const Ky={};$l.transitional=function(t,e,i){function n(r,o){return"[Axios v"+Hy+"] Transitional option '"+r+"'"+o+(i?". "+i:"")}return(r,o,s)=>{if(t===!1)throw new Ut(n(o," has been removed"+(e?" in "+e:"")),Ut.ERR_DEPRECATED);return e&&!Ky[o]&&(Ky[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,s)}},$l.spelling=function(t){return(e,i)=>(console.warn("".concat(i," is likely a misspelling of ").concat(t)),!0)};var tu={assertOptions:function(t,e,i){if(typeof t!="object")throw new Ut("options must be an object",Ut.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const o=n[r],s=e[o];if(s){const a=t[o],c=a===void 0||s(a,o,t);if(c!==!0)throw new Ut("option "+o+" must be "+c,Ut.ERR_BAD_OPTION_VALUE)}else if(i!==!0)throw new Ut("Unknown option "+o,Ut.ERR_BAD_OPTION)}},validators:$l};const pr=tu.validators;let eu=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Xv,response:new Xv}}request(t,e){return C(this,null,function*(){try{return yield this._request(t,e)}catch(i){if(i instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const r=n.stack?n.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+=`
`+r):i.stack=r}catch(o){}}throw i}})}_request(t,e){typeof t=="string"?(e=e||{}).url=t:e=t||{},e=Xo(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:r}=e;i!==void 0&&tu.assertOptions(i,{silentJSONParsing:pr.transitional(pr.boolean),forcedJSONParsing:pr.transitional(pr.boolean),clarifyTimeoutError:pr.transitional(pr.boolean)},!1),n!=null&&(W.isFunction(n)?e.paramsSerializer={serialize:n}:tu.assertOptions(n,{encode:pr.function,serialize:pr.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),tu.assertOptions(e,{baseUrl:pr.spelling("baseURL"),withXsrfToken:pr.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&W.merge(r.common,r[e.method]);r&&W.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=zn.concat(o,r);const s=[];let a=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(a=a&&p.synchronous,s.unshift(p.fulfilled,p.rejected))});const c=[];let d;this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let l,u=0;if(!a){const p=[Wy.bind(this),void 0];for(p.unshift.apply(p,s),p.push.apply(p,c),l=p.length,d=K.resolve(e);u<l;)d=d.then(p[u++],p[u++]);return d}l=s.length;let h=e;for(u=0;u<l;){const p=s[u++],g=s[u++];try{h=p(h)}catch(m){g.call(this,m);break}}try{d=Wy.call(this,h)}catch(p){return K.reject(p)}for(u=0,l=c.length;u<l;)d=d.then(c[u++],c[u++]);return d}getUri(t){return zv(Oy((t=Xo(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(t){eu.prototype[t]=function(e,i){return this.request(Xo(i||{},{method:t,url:e,data:(i||{}).data}))}}),W.forEach(["post","put","patch"],function(t){function e(i){return function(n,r,o){return this.request(Xo(o||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}eu.prototype[t]=e(),eu.prototype[t+"Form"]=e(!0)});var iu=eu;class CE{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let i;this.promise=new K(function(r){i=r});const n=this;this.promise.then(r=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](r);n._listeners=null}),this.promise.then=r=>{let o;const s=new K(a=>{n.subscribe(a),o=a}).then(r);return s.cancel=function(){n.unsubscribe(o)},s},e(function(r,o,s){n.reason||(n.reason=new ia(r,o,s),i(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const i=this._listeners.indexOf(e);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const e=new AbortController,i=n=>{e.abort(n)};return this.subscribe(i),e.signal.unsubscribe=()=>this.unsubscribe(i),e.signal}static source(){let e;return{token:new CE(function(n){e=n}),cancel:e}}}var UG=CE;const yE={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,
data: `).concat(JSON.stringify(this.data)):this.message}print(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"error",e=arguments.length>1?arguments[1]:void 0;return t==="error"&&(e||console).error(this.toString()),t==="warning"&&(e||console).warn(this.toString()),this}throw(t){throw this.print("error",t),this}};function Fr(t,e){if(typeof t!="boolean")throw new k(v.INVALID_PARAMS,"Invalid ".concat(e,": The value is of the boolean type."))}function Ae(t,e,i){if(!G(i).call(i,t))throw new k(v.INVALID_PARAMS,"".concat(e," can only be set as ").concat(JSON.stringify(i)))}function xt(t,e){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e4;if(t<i||t>n||(!(arguments.length>4&&arguments[4]!==void 0)||arguments[4])&&!function(r){return typeof r=="number"&&r%1==0}(t))throw new k(v.INVALID_PARAMS,"invalid ".concat(e,": the value range is [").concat(i,", ").concat(n,"]. integer only"))}function DE(t,e){if(typeof t!="number"){if(!(t.min||t.max||t.ideal||t.exact))throw new k(v.INVALID_PARAMS,"".concat(e," is not a valid ConstrainLong"));t.min!==void 0&&xt(t.min,"".concat(e,".min"),0,1/0),t.max!==void 0&&xt(t.max,"".concat(e,".max"),1,1/0),t.exact!==void 0&&xt(t.exact,"".concat(e,".exact"),1,1/0),t.ideal!==void 0&&xt(t.ideal,"".concat(e,".ideal"),1,1/0)}else xt(t,e,1,1/0)}function Me(t,e){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:255,r=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(t==null)throw new k(v.INVALID_PARAMS,"".concat(e||"param"," cannot be empty"));if(!oI(t,i,n,r))throw new k(v.INVALID_PARAMS,"Invalid ".concat(e||"string param",": Length of the string: [").concat(i,",").concat(n,"].").concat(r?" ASCII characters only.":""))}function Br(t,e){if(!Array.isArray(t))throw new k(v.INVALID_PARAMS,"".concat(e," should be an array"))}function re(t){return t==null}function oI(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:255,n=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];return typeof t=="string"&&t.length<=i&&t.length>=e&&(!n||function(r){if(typeof r!="string")return!1;for(let o=0;o<r.length;o+=1){const s=r.charCodeAt(o);if(s<0||s>255)return!1}return!0}(t))}var wc=function(t){return t.COVERED="COVERED",t.POSITION="POSITION",t.SIZE="SIZE",t.STYLE="STYLE",t}(wc||{}),PE=function(t){return t.UNMOUNTED="UNMOUNTED",t.INVALID_HTML_ELEMENT="INVALID_HTML_ELEMENT",t}(PE||{});const sI=new class{constructor(){st(this,"_clientSize",null),st(this,"getClientWidth",()=>document.documentElement?document.documentElement.clientWidth:document.body.clientWidth),st(this,"getClientHeight",()=>document.documentElement?document.documentElement.clientHeight:document.body.clientHeight),st(this,"getStyle",t=>window.getComputedStyle(t,null)),st(this,"checkCssVisibleProperty",t=>{var e;let i=!0;const n=this.getStyle(t),{display:r,visibility:o,opacity:s,filter:a}=n;return(r==="none"||G(e=["hidden","collapse"]).call(e,o)||Number(s)<.1)&&(i=!1),!!i&&(a&&a.split(" ").filter(c=>{var d;const l=c.split("(")[0];return G(d=["brightness","blur","opacity"]).call(d,l)}).map(c=>{const[d,l]=c.split(/\(|\)/);return[d,Number(l.match(/^[0-9\.]+/))]}).forEach(c=>{const[d,l]=c;switch(d){case"brightness":(l<.1||l>3)&&(i=!1);break;case"blur":l>3&&(i=!1);break;case"opacity":l<.1&&(i=!1)}}),i)}),st(this,"checkPropertyUpToAllParentNodes",(t,e)=>{let i=!0,n=!0;const r=s=>e(s);let o=t;for(;o&&n;)r(o)||(i=!1,n=!1),o=o.parentElement,o||(n=!1);return i}),st(this,"checkActualCssVisibleIncludeInherit",t=>this.checkPropertyUpToAllParentNodes(t,this.checkCssVisibleProperty)),st(this,"getSizeAboutClient",t=>{const{width:e,height:i,left:n,right:r,top:o,bottom:s}=t.getBoundingClientRect(),a=this.getClientWidth(),c=this.getClientHeight();return{width:e,height:i,left:n,right:r,top:o,bottom:s,clientWidth:a,clientHeight:c,clientMin:Math.min(a,c)}}),st(this,"checkActualSize",()=>{const{width:t,height:e,clientMin:i}=this._clientSize;retu
`,a="".concat("\r").concat(s),c=" ";let d;function l(x){return x>="0"&&x<="9"}function u(x){return x>="!"&&x<="~"}function h(x){return u(x)||x>="€"&&x<="ÿ"}function p(x){return x==="!"||x>="#"&&x<="'"||x>="*"&&x<="+"||x>="-"&&x<="."||x>="0"&&x<="9"||x>="A"&&x<="Z"||x>="^"&&x<="~"}function g(x){return x>="1"&&x<="9"}function m(x){return x>="A"&&x<="Z"||x>="a"&&x<="z"}function f(x){return x==="d"||x==="h"||x==="m"||x==="s"}function T(x){return x>""&&x<" "||x>"\v"&&x<"\f"||x>""&&x<"ÿ"}function R(x){return m(x)||l(x)||x==="+"||x==="/"}function A(x){return l(x)||m(x)||x==="+"||x==="/"||x==="-"||x==="_"}function N(x){return m(x)||l(x)||x==="+"||x==="/"}function O(x,E){var I=Object.keys(x);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(x);E&&(b=b.filter(function(F){return Object.getOwnPropertyDescriptor(x,F).enumerable})),I.push.apply(I,b)}return I}function w(x){for(var E=1;E<arguments.length;E++){var I=arguments[E]!=null?arguments[E]:{};E%2?O(Object(I),!0).forEach(function(b){L(x,b,I[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(I)):O(Object(I)).forEach(function(b){Object.defineProperty(x,b,Object.getOwnPropertyDescriptor(I,b))})}return x}function L(x,E,I){return E in x?Object.defineProperty(x,E,{value:I,enumerable:!0,configurable:!0,writable:!0}):x[E]=I,x}(function(x){x.VERSION="v",x.ORIGIN="o",x.SESSION_NAME="s",x.INFORMATION="i",x.URI="u",x.EMAIL="e",x.PHONE="p",x.CONNECTION="c",x.BANDWIDTH="b",x.TIME="t",x.REPEAT="r",x.ZONE_ADJUSTMENTS="z",x.KEY="k",x.ATTRIBUTE="a",x.MEDIA="m"})(d||(d={}));class M{consumeText(E,I){let b=I;for(;b<E.length;){const F=E[b];if(F==="\0"||F==="\r"||F===s)break;b+=1}if(b-I==0)throw new Error("Invalid text, at ".concat(E));return b}consumeUnicastAddress(E,I,b){return this.consumeTill(E,I,c)}consumeOneOrMore(E,I,b){let F=I;for(;b(E[F]);)F++;if(F-I==0)throw new Error("Invalid rule at ".concat(I,"."));return F}consumeSpace(E,I){if(E[I]===c)return I+1;throw new Error("Invalid space at ".concat(I,"."))}consumeIP4Address(E,I){let b=I;for(let F=0;F<4;F++)if(b=this.consumeDecimalUChar(E,b),F!==3){if(E[b]!==".")throw new Error("Invalid IP4 address.");b++}return b}consumeDecimalUChar(E,I){let b=I;for(let ct=0;ct<3&&l(E[b]);ct++,b++);if(b-I==0)throw new Error("Invalid decimal uchar.");const F=parseInt(E.slice(I,b));if(F>=0&&F<=255)return b;throw new Error("Invalid decimal uchar")}consumeIP6Address(E,I){let b=this.consumeHexpart(E,I);return E[b]===":"&&(b+=1,b=this.consumeIP4Address(E,b)),b}consumeHexpart(E,I){let b=I;if(E[b]===":"&&E[b+1]===":"){b+=2;try{b=this.consumeHexseq(E,b)}catch(F){}return b}if(b=this.consumeHexseq(E,b),E[b]===":"&&E[b+1]===":"){b+=2;try{b=this.consumeHexseq(E,b)}catch(F){}return b}return b}consumeHexseq(E,I){let b=I;for(;b=this.consumeHex4(E,b),E[b]===":"&&E[b+1]!==":";)b+=1;return b}consumeHex4(E,I){let b=0;for(;b<4;b++)if(!((F=E[I+b])>="0"&&F<="9"||F>="a"&&F<="f"||F>="A"&&F<="F")){if(b===0)throw new Error("Invalid hex 4");break}var F;return I+b}consumeFQDN(E,I){let b=I;for(;l(E[b])||m(E[b])||E[b]==="-"||E[b]===".";)b+=1;if(b-I<4)throw new Error("Invalid FQDN");return b}consumeExtnAddr(E,I){return this.consumeOneOrMore(E,I,h)}consumeMulticastAddress(E,I,b){switch(b){case"IP4":case"ip4":return this.consumeIP4MulticastAddress(E,I);case"IP6":case"ip6":return this.consumeIP6MulticastAddress(E,I);default:try{return this.consumeFQDN(E,I)}catch(F){return this.consumeExtnAddr(E,I)}}}consumeIP6MulticastAddress(E,I){const b=this.consumeHexpart(E,I);return E[b]==="/"?this.consumeInteger(E,b+1):b}consumeIP4MulticastAddress(E,I){let b=I+3;const F=E.slice(I,b),ct=parseInt(F);if(ct<224||ct>239)throw new Error("Invalid IP4 multicast address, IPv4 multicast addresses may be in the range 224.0.0.0 to 239.255.255.255.");for(let Wt=0;Wt<3;Wt++){if(E[b]!==".")throw new Error("Invalid IP4 multicast address.");b+=1,b=this.consumeDecimalUChar(E,b)}return E[b]==="/"&&(b+=1),b=this.consumeTTL(E,b),E[b]==="/"&&(b=this.consumeInteger(E,b)),b}consumeInteger(E,I){if(!g(E[I]))throw new Error("Invalid integer.");for(I+=1;l(E[I]);)I+=1;re
Please refer to the Agora document to migrate the newer API, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`):_.warning(`We have detected a media autoplay failed event, and found out that you haven't implemented AgoraRTC.onAutoplayFailed callback yet.
It will cause audio/video element not playing automatically on some browsers without user interaction, possibly hurting user experiences.
Please refer to the Agora document to properly handle autoplay failed event, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`),nn.emit("autoplay-failed")}}function tA(t,e,i,n){if(!t)return;const r=Z.getBaseInfoBySessionId(t);if(!r)return;const o=r.info,s=Date.now(),a=Qt(Qt({},o),{},{vid:o.vid===void 0?0:Number(o.vid),lts:s,elapse:s-r.startTime,cbRegistered:nn.onAutoplayFailed||nn.onAudioAutoplayFailed?1:-1,errorMsg:i,mediaType:e,trackId:n,extend:void 0});Z.send({type:Jt.AUTOPLAY_FAILED,data:a},!0)}const p3=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","error"],Ri=new class{constructor(){D(this,"onAutoplayFailed",void 0),D(this,"elementMap",new Map),D(this,"elementStateMap",new Map),D(this,"elementsNeedToResume",[]),D(this,"sinkIdMap",new Map),D(this,"autoResumeAfterInterruption",t=>{Array.from(this.elementMap.entries()).forEach(e=>{let[i,n]=e;const r=this.elementStateMap.get(i),o=n.srcObject.getAudioTracks()[0],s=o&&o.readyState;if(_.debug("resume after interrupted, ele: ".concat(r," audio: ").concat(s," ").concat(t)),s==="live"){if(t)return n.pause(),void n.play();if(Mt.curState==="running")return na()?(n.pause(),void n.play()):void(r&&r==="paused"&&n.play())}})}),D(this,"autoResumeAfterInterruptionOnIOS15_16",()=>{Array.from(this.elementMap.entries()).forEach(t=>{let[e,i]=t;const n=i.srcObject.getAudioTracks()[0];n&&n.readyState==="live"&&(_.debug("auto resume after interruption inside autoResumeAfterInterruptionOnIOS15"),i.pause(),i.play())})}),this.autoResumeAudioElement(),Mt.on(Ve.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Mt.on(Ve.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16),Mt.on(Ve.STATE_CHANGE,()=>{li()&&Mt.prevState==="suspended"&&Mt.curState==="running"&&this.autoResumeAfterInterruption()})}setSinkID(t,e){return C(this,null,function*(){const i=this.elementMap.get(t);if(this.sinkIdMap.set(t,e),i)try{yield i.setSinkId(e)}catch(n){throw new k(v.PERMISSION_DENIED,"can not set sink id: "+n.toString())}})}play(t,e,i,n){if(this.elementMap.has(e))return;const r=document.createElement("audio");r.autoplay=!0,r.srcObject=new MediaStream([t]),this.bindAudioElementEvents(e,r),this.elementMap.set(e,r),this.elementStateMap.set(e,ii.INIT),this.setVolume(e,i);const o=this.sinkIdMap.get(e);if(o)try{r.setSinkId(o).catch(a=>{_.warning("[".concat(e,"] set sink id failed"),a.toString())})}catch(a){_.warning("[".concat(e,"] set sink id failed"),a.toString())}const s=r.play();s&&s.then&&s.catch(a=>{n&&tA(n,"audio",a.message,e),_.warning("audio element play warning",a.toString()),this.elementMap.has(e)&&a.name==="NotAllowedError"&&(_.warning("detected audio element autoplay failed"),this.elementsNeedToResume.push(r),du(()=>{this.onAutoplayFailed&&this.onAutoplayFailed(),$I()}))})}updateTrack(t,e){const i=this.elementMap.get(t);i&&(i.srcObject=new MediaStream([e]))}isPlaying(t){return this.elementMap.has(t)&&this.elementStateMap.get(t)==="playing"}setVolume(t,e){const i=this.elementMap.get(t);i&&(e=Math.max(0,Math.min(100,e)),i.volume=e/100)}stop(t){const e=this.elementMap.get(t);if(this.sinkIdMap.delete(t),!e)return;const i=this.elementsNeedToResume.indexOf(e);this.elementsNeedToResume.splice(i,1),e.srcObject=null,e.remove(),this.elementMap.delete(t),this.elementStateMap.delete(t)}bindAudioElementEvents(t,e){p3.forEach(i=>{e.addEventListener(i,n=>{const r=this.elementStateMap.get(t),o=n.type==="pause"?"paused":n.type;if(_.debug("[".concat(t,"] audio-element-status change ").concat(r," => ").concat(o)),n.type==="error"){const s=e==null?void 0:e.error;s&&_.error("[".concat(t,"] media error, code: ").concat(s.code,", message: ").concat(s.message))}this.elementStateMap.set(t,o)})})}getPlayerState(t){return this.elementStateMap.get(t)||"uninit"}autoResumeAudioElement(){const t=()=>{this.elementsNeedToResume.forEach(e=>{e.play().then(i=>{_.debug("Auto resume audio element success")}).catch(i=>{_.warning("Auto resume audio element failed!",i)})}),this.elementsNeedToResume=[]};new K(e=>{document.body?e():window.addEventList
Probably you are making pipeline like this:
videoTrack1.pipe(processor).pipe(videoTrack2.processorDestination).`);e.track&&e.track!==this.inputTrack&&(this.videoContext.chained=!0,this.inputTrack=e.track,this.emit(ui.ON_TRACK,e.track))}reset(){this.inputTrack=void 0,this.videoContext.chained=!1,this.emit(ui.ON_TRACK,void 0)}}class iA extends $t{set chained(e){this._chained=e}get chained(){return this._chained}constructor(e,i){super(),D(this,"constraintsMap",new Map),D(this,"statsRegistry",[]),D(this,"usageRegistry",[]),D(this,"trackId",void 0),D(this,"direction",void 0),D(this,"_chained",!1),this.trackId=e,this.direction=i}getConstraints(){return C(this,null,function*(){return yield We(this,Zi.REQUEST_CONSTRAINTS)})}requestApplyConstraints(e,i){return C(this,null,function*(){var n;return _.info("processor ".concat(i.name," requestApplyConstraints for ").concat(this.trackId)),e&&this.constraintsMap.set(i,e),Bt(this,Zi.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ui(n=this.constraintsMap).call(n)))})}requestRevertConstraints(e){return C(this,null,function*(){var i;if(this.constraintsMap.has(e))return _.info("processor ".concat(e.name," requestRevertConstraints for ").concat(this.trackId)),this.constraintsMap.delete(e),Bt(this,Zi.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ui(i=this.constraintsMap).call(i)))})}registerStats(e,i,n){this.statsRegistry.find(r=>r.processorID===e.ID&&r.processorName===e.name&&r.type===i)||this.statsRegistry.push({processorName:e.name,processorID:e.ID,type:i,cb:n})}unregisterStats(e,i){const n=this.statsRegistry.findIndex(r=>r.processorID===e.ID&&r.processorName===e.name&&r.type===i);n!==-1&&this.statsRegistry.splice(n,1)}gatherStats(){const e=[];for(const{processorID:i,processorName:n,type:r,cb:o}of this.statsRegistry)try{const s=o();e.push({processorID:i,processorName:n,type:r,stats:s})}catch(s){_.error(new k(v.UNEXPECTED_ERROR,s.message))}return e}registerUsage(e,i){this.usageRegistry.find(n=>n.processorID===e.ID&&n.processorName===e.name)||this.usageRegistry.push({processorID:e.ID,processorName:e.name,cb:i})}unregisterUsage(e){const i=this.usageRegistry.findIndex(n=>n.processorID===e.ID&&n.processorName===e.name);i!==-1&&this.usageRegistry.splice(i,1)}gatherUsage(){return C(this,null,function*(){const e=[];if(!this.chained)return[];for(const{cb:i}of this.usageRegistry)try{let n=i();n instanceof K&&(n=yield n),e.push(Qt(Qt({},n),{},{direction:this.direction}))}catch(n){_.error("gather extension usage error",n)}return e})}getDirection(){return this.direction}}class nA extends $t{constructor(e){super(),D(this,"name","AudioProcessorDestination"),D(this,"ID","0"),D(this,"inputTrack",void 0),D(this,"inputNode",void 0),D(this,"audioProcessorContext",void 0),D(this,"_source",void 0),this.audioProcessorContext=e}get kind(){return"audio"}get enabled(){return!0}pipe(){throw new k(v.NOT_SUPPORTED,"AudioProcessorDestination cannot pipe to any other Processor")}unpipe(){throw new k(v.NOT_SUPPORTED,"AudioProcessor cannot unpipe to any other Processor")}enable(){}disable(){}reset(){this.inputTrack=void 0,this.inputNode=void 0,this.audioProcessorContext.chained=!1,this.emit(ui.ON_TRACK,void 0),this.emit(ui.ON_NODE,void 0)}updateInput(e){if(e.context!==this.audioProcessorContext)throw new Error(`ProcessorContext passed to AudioTrack.processorDestination doesn't match it's belonging AudioTrack's context.
Probably you are making pipeline like this: audioTrack1.pipe(processor).pipe(audioTrack2.processorDestination).`);e.track&&this.inputTrack!==e.track&&(this.audioProcessorContext.chained=!0,this.inputTrack=e.track,this.emit(ui.ON_TRACK,this.inputTrack)),e.node&&this.inputNode!==e.node&&(this.audioProcessorContext.chained=!0,this.inputNode=e.node,this.emit(ui.ON_NODE,this.inputNode))}}class rA extends $t{set chained(e){this._chained=e}get chained(){return this._chained}constructor(e,i,n){super(),D(this,"constraintsMap",new Map),D(this,"statsRegistry",[]),D(this,"audioContext",void 0),D(this,"trackId",void 0),D(this,"direction",void 0),D(this,"usageRegistry",[]),D(this,"_chained",!1),this.audioContext=e,this.trackId=i,this.direction=n}getConstraints(){return C(this,null,function*(){return We(this,Zi.REQUEST_CONSTRAINTS)})}getAudioContext(){return this.audioContext}requestApplyConstraints(e,i){return C(this,null,function*(){var n;return _.info("processor ".concat(i.name," requestApplyConstraints for ").concat(this.trackId)),e&&this.constraintsMap.set(i,e),Bt(this,Zi.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ui(n=this.constraintsMap).call(n)))})}requestRevertConstraints(e){return C(this,null,function*(){var i;if(this.constraintsMap.has(e))return this.constraintsMap.delete(e),Bt(this,Zi.REQUEST_UPDATE_CONSTRAINTS,Array.from(Ui(i=this.constraintsMap).call(i)))})}registerStats(e,i,n){this.statsRegistry.find(r=>r.processorID===e.ID&&r.processorName===e.name&&r.type===i)||this.statsRegistry.push({processorName:e.name,processorID:e.ID,type:i,cb:n})}unregisterStats(e,i){const n=this.statsRegistry.findIndex(r=>r.processorID===e.ID&&r.processorName===e.name&&r.type===i);n!==-1&&this.statsRegistry.splice(n,1)}gatherStats(){const e=[];for(const{processorID:i,processorName:n,type:r,cb:o}of this.statsRegistry)try{const s=o();e.push({processorID:i,processorName:n,type:r,stats:s})}catch(s){_.error(new k(v.UNEXPECTED_ERROR,s.message))}return e}registerUsage(e,i){this.usageRegistry.find(n=>n.processorID===e.ID&&n.processorName===e.name)||this.usageRegistry.push({processorID:e.ID,processorName:e.name,cb:i})}unregisterUsage(e){const i=this.usageRegistry.findIndex(n=>n.processorID===e.ID&&n.processorName===e.name);i!==-1&&this.usageRegistry.splice(i,1)}gatherUsage(){return C(this,null,function*(){const e=[];if(!this.chained)return[];for(const{cb:i}of this.usageRegistry)try{let n=i();n instanceof K&&(n=yield n),e.push(Qt(Qt({},n),{},{direction:this.direction}))}catch(n){_.error("gather extension usage error",n)}return e})}getDirection(){return this.direction}}class cm extends $t{get isPlayed(){return!0}get isFreeze(){return!1}constructor(){super(),D(this,"context",void 0),D(this,"processSourceNode",void 0),D(this,"outputTrack",void 0),D(this,"processedNode",void 0),D(this,"clonedTrack",void 0),D(this,"outputNode",void 0),this.outputNode=new _3}setVolume(){}createOutputTrack(){throw new k(v.NOT_SUPPORTED,"can not create output MediaStreamTrack when WebAudio disabled")}getOriginVolumeLevel(){return 0}getAccurateVolumeLevel(){return 0}stopGetAudioBuffer(){}startGetAudioBuffer(){}play(){}stop(){}destroy(){}updateTrack(){}updateOriginTrack(){}createMediaStreamSourceNode(){}}class _3{disconnect(){}connect(){}}function oA(t){return new K((e,i)=>{let n=!1;const r=document.createElement("video");r.setAttribute("autoplay",""),r.setAttribute("muted",""),r.muted=!0,r.autoplay=!0,r.setAttribute("playsinline",""),r.setAttribute("style","position: fixed; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(r);const o=li()?"canplay":"playing";r.addEventListener(o,()=>{const s=r.videoWidth,a=r.videoHeight;!s&&ne()||(n=!0,r.srcObject=null,r.remove(),e([s,a]))}),r.srcObject=new MediaStream([t]),r.play().catch(lu),setTimeout(()=>{n||(r.srcObject=null,r.remove(),e([r.videoWidth,r.videoHeight]))},4e3)})}function Ru(t){const e={};t.facingMode&&(e.facingMode=t.facingMode),t.cameraId&&(e.deviceId={exact:t.cameraId});const i=Nn(t.encoderConfig);return i.width!=null&&(e.width=i.width),i.height!=null&&(e.height=i.height),!nI()&&i.frameRate&&(e.frameRate
`),t),e==="offer"?r=>{Aw(r,"answer",i==="local"?"remote":"local",n)}:void 0}function bw(t){const e=y("COMPATIBLE_SDP_EXTENSION");return!!(Array.isArray(e)&&e.length>0)&&e.some(i=>G(t).call(t,i))}function ww(t,e){try{var i;return((i=t.fmtp)===null||i===void 0?void 0:i.parameters.apt)===e.payloadType.toString()}catch(n){return!1}}function Ow(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),i.push.apply(i,n)}return i}function ji(t,e){return typeof y(t)===e?y(t):void 0}function EW(){try{const t=y("EXPERIMENTS")||{};return typeof t=="string"||Array.isArray(t)?{}:function(e){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Ow(Object(n),!0).forEach(function(r){S(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ow(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}({},t)}catch(t){return _.debug("handle gateway attributes failed: ",t),{}}}const Nw={};function vo(t){(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_.debug("install service ".concat(t.name)),Nw[t.name]=t}function Kr(t){const e=Nw[t];if(!e)throw new k(v.INVALID_OPERATION,"".concat(t," not found, please use AgoraRTC.use(").concat(t,"Service) to load it first"));return e}function Dw(t,e){return Kr("DataStream").create(t,e)}function Wu(){return Kr("InterceptFrame").create()}function Pw(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),i.push.apply(i,n)}return i}function Rr(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?Pw(Object(i),!0).forEach(function(n){S(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Pw(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}const Mm=new Map;class mW extends $t{get state(){return this._state}set state(e){if(e===this._state)return;const i=this._state;this._state=e,e==="DISCONNECTED"&&this._disconnectedReason?this.emit(De.CONNECTION_STATE_CHANGE,e,i,this._disconnectedReason):this.emit(De.CONNECTION_STATE_CHANGE,e,i)}get joinGatewayStartTime(){return this._joinGatewayStartTime}set joinGatewayStartTime(e){_.debug("[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(e)),this._joinGatewayStartTime=e}constructor(e,i){var n,r,o;super(),S(this,"store",void 0),S(this,"joinInfo",void 0),S(this,"key",void 0),S(this,"ntpOffset",0),S(this,"signal",void 0),S(this,"role",void 0),S(this,"inChannelInfo",{joinAt:null,duration:0}),S(this,"spec",void 0),S(this,"_state","DISCONNECTED"),S(this,"_statsCollector",void 0),S(this,"_disconnectedReason",void 0),S(this,"isSignalRecover",!1),S(this,"hasChangeBGPAddress",!1),S(this,"trafficStatsInterval",void 0),S(this,"networkQualityInterval",void 0),S(this,"_joinGatewayStartTime",0),S(this,"_signalTimeout",!1),S(this,"_clientRoleOptions",void 0),S(this,"_isProactiveJoin",!1),this.store=e,this.spec=i,this.signal=this.store.useP2P?(n={spec:Rr(Rr({},i),{},{retryConfig:i.websocketRetryConfig}),store:e},(r=(o=Kr("P2PChannel")).createSubmodule)===null||r===void 0?void 0:r.call(o,n)):new pW(Rr(Rr({},i),{},{retryConfig:i.websocketRetryConfig}),e),this._statsCollector=i.statsCollector,this.role=i.role||"audience",this._clientRoleOptions=i.clientRoleOptions,this.handleSignalEvents()}join(e,i,n){return C(this,null,function*(){this.store.joinGatewayStart(),e.cloudProxyServer!=="disabled"&&(this.hasChangeBGPAddress=!0);const r=Date.now();let o=Mm.get(e.cname);if(o||(o=new Map,Mm.set(e.cname,o)),this._isProactiveJoin=!0,o.has(e.uid)){const d=new P(v.UID_CONFLICT);throw Z.joinGateway(e.sid,{lts:r,succ:!1,ec:d.code,addr:null,uid:e.uid,cid:e.cid,firstSuccess:this._isProactiveJoin,isProxy:!!e.proxyServer,signalChannel:"0",preload:e.preload}),d}o.set(
`)},O=function(U,B,X){return B instanceof Blob?(X=X!==void 0?X+"":typeof B.name=="string"?B.name:"blob",B.name===X&&Object.prototype.toString.call(B)!=="[object Blob]"||(B=new File([B],X)),[String(U),B]):[String(U),String(B)]},w=function(U,B){if(U.length<B)throw new TypeError(B+" argument required, but only "+U.length+" present.")},L=typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:this,M=L.FormData,j=L.XMLHttpRequest&&L.XMLHttpRequest.prototype.send,H=L.Request&&L.fetch,ht=L.navigator&&L.navigator.sendBeacon,lt=L.Element&&L.Element.prototype,rt=L.Symbol&&Symbol.toStringTag;rt&&(Blob.prototype[rt]||(Blob.prototype[rt]="Blob"),"File"in L&&!File.prototype[rt]&&(File.prototype[rt]="File"));try{new File([],"")}catch(U){L.File=function(B,X,x){return B=new Blob(B,x||{}),Object.defineProperties(B,{name:{value:X},lastModified:{value:+(x&&x.lastModified!==void 0?new Date(x.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),rt&&Object.defineProperty(B,rt,{value:"File"}),B}}var Kt=function(U){return U.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},Ft=function(U){this.i=[];var B=this;U&&A(U.elements,function(X){if(X.name&&!X.disabled&&X.type!=="submit"&&X.type!=="button"&&!X.matches("form fieldset[disabled] *"))if(X.type==="file"){var x=X.files&&X.files.length?X.files:[new File([],"",{type:"application/octet-stream"})];A(x,function(E){B.append(X.name,E)})}else X.type==="select-multiple"||X.type==="select-one"?A(X.options,function(E){!E.disabled&&E.selected&&B.append(X.name,E.value)}):X.type==="checkbox"||X.type==="radio"?X.checked&&B.append(X.name,X.value):(x=X.type==="textarea"?N(X.value):X.value,B.append(X.name,x))})};if((t=Ft.prototype).append=function(U,B,X){w(arguments,2),this.i.push(O(U,B,X))},t.delete=function(U){w(arguments,1);var B=[];U=String(U),A(this.i,function(X){X[0]!==U&&B.push(X)}),this.i=B},t.entries=function U(){var B,X=this;return R(U,function(x){if(x.h==1&&(B=0),x.h!=3)return B<X.i.length?x=p(x,X.i[B]):(x.h=0,x=void 0),x;B++,x.h=2})},t.forEach=function(U,B){w(arguments,1);for(var X=a(this),x=X.next();!x.done;x=X.next()){var E=a(x.value);x=E.next().value,E=E.next().value,U.call(B,E,x,this)}},t.get=function(U){w(arguments,1);var B=this.i;U=String(U);for(var X=0;X<B.length;X++)if(B[X][0]===U)return B[X][1];return null},t.getAll=function(U){w(arguments,1);var B=[];return U=String(U),A(this.i,function(X){X[0]===U&&B.push(X[1])}),B},t.has=function(U){w(arguments,1),U=String(U);for(var B=0;B<this.i.length;B++)if(this.i[B][0]===U)return!0;return!1},t.keys=function U(){var B,X,x,E,I=this;return R(U,function(b){if(b.h==1&&(B=a(I),X=B.next()),b.h!=3)return X.done?void(b.h=0):(x=X.value,E=a(x),p(b,E.next().value));X=B.next(),b.h=2})},t.set=function(U,B,X){w(arguments,2),U=String(U);var x=[],E=O(U,B,X),I=!0;A(this.i,function(b){b[0]===U?I&&(I=!x.push(E)):x.push(b)}),I&&x.push(E),this.i=x},t.values=function U(){var B,X,x,E,I=this;return R(U,function(b){if(b.h==1&&(B=a(I),X=B.next()),b.h!=3)return X.done?void(b.h=0):(x=X.value,(E=a(x)).next(),p(b,E.next().value));X=B.next(),b.h=2})},Ft.prototype._asNative=function(){for(var U=new M,B=a(this),X=B.next();!X.done;X=B.next()){var x=a(X.value);X=x.next().value,x=x.next().value,U.append(X,x)}return U},Ft.prototype._blob=function(){var U="----formdata-polyfill-"+Math.random(),B=[],X="--"+U+`\r
Content-Disposition: form-data; name="`;return this.forEach(function(x,E){return typeof x=="string"?B.push(X+Kt(N(E))+`"\r
\r
`+N(x)+`\r
`):B.push(X+Kt(N(E))+'"; filename="'+Kt(x.name)+`"\r
Content-Type: `+(x.type||"application/octet-stream")+`\r
\r
`,x,`\r
`)}),B.push("--"+U+"--"),new Blob(B,{type:"multipart/form-data; boundary="+U})},Ft.prototype[Symbol.iterator]=function(){return this.entries()},Ft.prototype.toString=function(){return"[object FormData]"},lt&&!lt.matches&&(lt.matches=lt.matchesSelector||lt.mozMatchesSelector||lt.msMatchesSelector||lt.oMatchesSelector||lt.webkitMatchesSelector||function(U){for(var B=(U=(this.document||this.ownerDocument).querySelectorAll(U)).length;0<=--B&&U.item(B)!==this;);return-1<B}),rt&&(Ft.prototype[rt]="FormData"),j){var Ii=L.XMLHttpRequest.prototype.setRequestHeader;L.XMLHttpRequest.prototype.setRequestHeader=function(U,B){Ii.call(this,U,B),U.toLowerCase()==="content-type"&&(this.B=!0)},L.XMLHttpRequest.prototype.send=function(U){U instanceof Ft?(U=U._blob(),this.B||this.setRequestHeader("Content-Type",U.type),j.call(this,U)):j.call(this,U)}}H&&(L.fetch=function(U,B){return B&&B.body&&B.body instanceof Ft&&(B.body=B.body._blob()),H.call(this,U,B)}),ht&&(L.navigator.sendBeacon=function(U,B){return B instanceof Ft&&(B=B._asNative()),ht.call(this,U,B)}),L.FormData=Ft}})();const qc=()=>{const t=y("AREAS");return t.length===0&&t.push(At.GLOBAL),Tn(t).call(t,(e,i,n)=>{const r=Lw(i);return r?n===0?r:"".concat(e,",").concat(r):e},"")},Lw=t=>t===At.OVERSEA?"".concat(ze.ASIA,",").concat(ze.EUROPE,",").concat(ze.AFRICA,",").concat(ze.NORTH_AMERICA,",").concat(ze.SOUTH_AMERICA,",").concat(ze.OCEANIA):ze[t],fW=t=>{const e={CODE:"",WEBCS_DOMAIN:[],WEBCS_DOMAIN_BACKUP_LIST:[],PROXY_CS:[],CDS_AP:[],ACCOUNT_REGISTER:[],UAP_AP:[],EVENT_REPORT_DOMAIN:[],EVENT_REPORT_BACKUP_DOMAIN:[],LOG_UPLOAD_SERVER:[],PROXY_SERVER_TYPE3:[]};return t.map(i=>{const n=Uu[i],r=Object.keys(n);r&&r.map(o=>{o!=="CODE"&&(e[o]=e[o].concat(n[o]))})}),e},Ku={GLOBAL:{ASIA:[At.CHINA,At.JAPAN,At.INDIA,At.KOREA,At.HKMC],EUROPE:[],NORTH_AMERICA:[At.US],SOUTH_AMERICA:[],OCEANIA:[],AFRICA:[]}},Yu=Object.keys(Ku[At.GLOBAL]),xm=[At.CHINA,At.NORTH_AMERICA,At.EUROPE,At.ASIA,At.JAPAN,At.INDIA,At.OCEANIA,At.SOUTH_AMERICA,At.AFRICA,At.KOREA,At.HKMC,At.US],gW=function(t,e){let i=[];if(G(t).call(t,At.GLOBAL)){const o=[At.GLOBAL,At.OVERSEA],s=Object.keys(Uu);if(e===At.GLOBAL)throw new P(v.INVALID_PARAMS,"GLOBAL is an invalid excludedArea value");if(e===At.CHINA)i=[At.OVERSEA];else if(r=e,G(Yu).call(Yu,r)){const a=(n=e,Ku[At.GLOBAL][n]||[]),c=[...o,e,...a];i=s.filter(d=>!G(c).call(c,d))}else if(function(a){let c=!1;return Yu.forEach(d=>{var l;G(l=Ku[At.GLOBAL][d]).call(l,a)&&(c=!0)}),c}(e)){const a=function(d){let l;return Yu.forEach(u=>{var h;G(h=Ku[At.GLOBAL][u]).call(h,d)&&(l=u)}),l}(e),c=[...o,a,e];i=s.filter(d=>!G(c).call(c,d))}else i=t;i=function(a){const c=[];return xm.forEach(d=>{G(a).call(a,d)&&c.push(d)}),c.concat(a.filter(d=>!G(xm).call(xm,d)))}(i)}else i=t;var n,r;return i};function kw(t){var e,i;if(!t&&G(e=y("AREAS")).call(e,At.EXTENSIONS))return _.debug("update area from ap : reset"),void Vm(A3,!0);if(!G(i=y("AREAS")).call(i,At.GLOBAL)||!t)return;let n=Uu.EXTENSIONS;n&&(n={CODE:Lw(At.EXTENSIONS),WEBCS_DOMAIN:["ap-web-1-".concat(t,".agora.io")],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-".concat(t,".ap.sd-rtn.com")],PROXY_CS:["proxy-ap-web-".concat(t,".agora.io")],CDS_AP:["cds-ap-web-1-".concat(t,".agora.io"),"cds-ap-web-2-".concat(t,".ap.sd-rtn.com")],ACCOUNT_REGISTER:["sua-ap-web-1-".concat(t,".agora.io"),"sua-ap-web-2-".concat(t,".ap.sd-rtn.com")],UAP_AP:["uap-ap-web-1-".concat(t,".agora.io"),"uap-ap-web-2-".concat(t,".ap.sd-rtn.com")],EVENT_REPORT_DOMAIN:["statscollector-1-".concat(t,".agora.io")],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-".concat(t,".agora.io")],LOG_UPLOAD_SERVER:["logservice-".concat(t,".agora.io")],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy-".concat(t,".agora.io")]},_.debug("update area from ap success: ".concat(t,",config is "),n),kt("AREAS",[At.EXTENSIONS],!0),Object.keys(n).map(r=>{r==="LOG_UPLOAD_SERVER"||r==="EVENT_REPORT_DOMAIN"||r==="EVENT_REPORT_BACKUP_DOMAIN"||r==="PROXY_SERVER_TYPE3"?kt(r,n[r][0]):kt(r,n[r])}))}function Vm(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const i=Z.reportApiInvoke(null,{name:_e.SET_AREA,options:t,tag:oe.
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=ice-lite`.concat(u?`
a=extmap-allow-mixed`:"",`
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`)));var u;this._rtpCapabilities=d;const h=this.rtpCapabilities.send,p=this.localCapabilities.send;for(const g of l.mediaDescriptions){if(g.attributes.iceUfrag=this._iceParameters.iceUfrag,g.attributes.icePwd=this._iceParameters.icePwd,g.attributes.fingerprints=this._dtlsParameters.fingerprints,g.attributes.candidates=this._candidates,g.attributes.setup=this.setup,g.media.mediaType==="application"&&(g.attributes.sctpPort="5000"),g.media.mediaType==="video"){if(h.videoCodecs.length===0){const m=p.videoCodecs.filter(f=>{var T,R;return(T=f.rtpMap)===null||T===void 0?void 0:G(R=T.encodingName.toLowerCase()).call(R,"vp8")})||[p.videoCodecs[0]];g.media.fmts=m.map(f=>f.payloadType.toString(10)),g.attributes.payloads=m,g.attributes.extmaps=[]}else if(g.media.fmts=h.videoCodecs.map(m=>m.payloadType.toString(10)),g.attributes.payloads=h.videoCodecs,g.attributes.extmaps=h.videoExtensions,y("PRELOAD_MEDIA_COUNT")>0){const{ssrcs:m,ssrcGroups:f}=as([{ssrcId:Qw,rtx:y("USE_SUB_RTX")?40001:void 0}],this.cname);g.attributes.ssrcs=m,g.attributes.ssrcGroups=f}}if(g.media.mediaType==="audio"){if(h.audioCodecs.length===0){const m=p.audioCodecs.filter(f=>{var T,R;return(T=f.rtpMap)===null||T===void 0?void 0:G(R=T.encodingName.toLowerCase()).call(R,"opus")})||[p.audioCodecs[0]];g.media.fmts=m.map(f=>f.payloadType.toString(10)),g.attributes.payloads=m,g.attributes.extmaps=[]}else if(g.media.fmts=h.audioCodecs.map(m=>m.payloadType.toString(10)),g.attributes.payloads=h.audioCodecs,g.attributes.extmaps=h.audioExtensions,wa(g),y("PRELOAD_MEDIA_COUNT")>0){const{ssrcs:m,ssrcGroups:f}=as([{ssrcId:2e4}],this.cname);g.attributes.ssrcs=m,g.attributes.ssrcGroups=f}}}return this.sessionDesc=l,this.currentMidIndex=l.mediaDescriptions.length-1,this.sessionDesc}updateCandidates(d){const l=this._originCandidates.filter(h=>h.transport==="udp"),u=[];if(l.forEach(h=>{u.push(Jw(Jw({},h),{},{foundation:"tcpcandidate",priority:Number(h.priority)-1+"",transport:"tcp",port:Number(h.port)+90+""}))}),l.length!==0){switch(d){case Xe.TCP_RELAY:this._candidates=u;break;case Xe.UDP_TCP_RELAY:case Xe.RELAY:this._candidates=[...l,...u];break;default:this._candidates=l}for(const h of this.sessionDesc.mediaDescriptions)h.attributes.candidates=this.candidates}}restartICE(d){d=te(d),this._iceParameters=d,this.sessionDesc.mediaDescriptions.forEach(l=>{l.attributes.iceUfrag=d.iceUfrag,l.attributes.icePwd=d.icePwd})}predictReceivingMids(d){const l=[];for(let u=0;u<d;u++)l.push((this.currentMidIndex+u+1).toString(10));return l}findAvailableMediaIndex(d,l){return this.sessionDesc.mediaDescriptions.findIndex(u=>{const h=u.media.mediaType===d&&u.media.port!=="0"&&(u.attributes.direction==="sendonly"||u.attributes.direction==="sendrecv")&&u.attributes.ssrcs.length===0;if(ne()){if(h){const p=this.firefoxSsrcMidMap.get(l[0].ssrcId);return!(p||u.attributes.mid!=="0"&&u.attributes.mid!=="1")||!(!p||p!==u.attributes.mid)}return!1}return h})}createOrRecycleDataChannel(){for(const u of this.sessionDesc.mediaDescriptions)if(u.media.mediaType==="application")return{mediaDesc:u,needExchangeSDP:!1};this.currentMidIndex+=1;const d="".concat(this.currentMidIndex),l={media:{mediaType:"application",port:Jc,protos:["UDP","DTLS","SCTP"],fmts:["webrtc-datachannel"]},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:[],fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[],rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,mid:"".concat(d),sctpPort:"5000"}};return this.sessionDesc.mediaDescriptions.push(l),{mediaDesc:l,needExchangeSDP:!0}}createOrRecycleRecvMedia(d,l,u,h,p,g){const m=d._mediaStreamTrack.kind,f=this.rtpCapabilities.recv,T=Kc(m,f,this.localCapabilities.send,m===q.VIDEO?h:p),R=m===q.VIDEO?f.videoExtensions:f.audioExtensions;this.currentMidIndex+=1;const A="".concat(this.currentMidIndex);let N={media:{
sendFps `).concat(ht,", bwe ").concat(lt,", switch from ").concat(j.adaptationConfig.scale," to ").concat(rt.scale," ")),j.adaptationConfig=Km(Km({},j.adaptationConfig),rt),N(rt))}},y("CHECK_LOCAL_STATS_INTERVAL")),M=Km({},T);zu.set(f,{timer:L,adaptationConfig:M,originConfig:T,adaptationFunc:N}),_.debug("[".concat(f,"] start adaptation, originConfig: ").concat(JSON.stringify(T),", degradationPreference: ").concat(A))})(this.id+a.mid,c,this,m,f=>{i&&this.updateAdaptation(i,f)},this.getLocalVideoStats.bind(this))}if(e._encoderConfig){var l;const{bitrateMax:m,frameRate:f,scaleResolutionDownBy:T}=e._encoderConfig;m&&(s.maxBitrate=1e3*m),(G(l=e._hints).call(l,Vt.LOW_STREAM)||e.isUseScaleResolutionDownBy)&&(f&&(s.maxFramerate=Bi(f)),T&&T>=1&&(s.scaleResolutionDownBy=T))}const{maxFramerate:u}=y("ENCODER_CONFIG_LIMIT");if(u&&typeof u=="number"&&(s.maxFramerate=s.maxFramerate?Math.min(s.maxFramerate,u):u),y("DSCP_TYPE")&&Vr()){var h;const m=y("DSCP_TYPE");G(h=["very-low","low","medium","high"]).call(h,m)&&(s.networkPriority=m)}const p=i.getParameters(),g=(r=p.encodings)===null||r===void 0?void 0:r[0];ne()&&!g&&(o.encodings=[s]),g&&Object.assign(g,s),Object.assign(p,o),_.debug("[".concat(e.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(p.encodings))),yield i.setParameters(p),yield function(m,f,T){return C(this,null,function*(){try{var R;if(!Ct().supportSetRtpSenderParameters||!function(L){return L==="vp9"||L==="av1"}(m)||!y("ENABLE_SVC"))return;const A={},N={},O=f.getParameters(),w=(R=O.encodings)===null||R===void 0?void 0:R[0];N.scalabilityMode=Vu(T),w&&Object.assign(w,N),Object.assign(O,A),yield f.setParameters(O),_.debug("[updateAdaptation] updateRtpSenderEncodings scalabilityMode success: ".concat(JSON.stringify(O.encodings)))}catch(A){_.debug("[updateAdaptation] updateRtpSenderEncodings scalabilityMode failed",A)}})}(this.store.codec,i,y("SVC_MODE"))})}updateAdaptation(e,i){return C(this,null,function*(){var n,r;if(!e)return _.debug("[updateAdaptation] no rtpSender found");if(!Ct().supportSetRtpSenderParameters)return _.debug("[updateAdaptation] Browser not support set rtp-sender parameters");const o={},{bitrateMax:s,frameRate:a,scaleResolutionDownBy:c}=i;s&&(o.maxBitrate=1e3*s),a&&(o.maxFramerate=Bi(a)),c&&c>=1&&G(n=["vp8","vp9"]).call(n,this.store.codec)&&(o.scaleResolutionDownBy=c);const d=e.getParameters(),l=(r=d.encodings)===null||r===void 0?void 0:r[0];l&&Object.assign(l,o),Object.assign(d,{});try{yield e.setParameters(d),_.debug("[updateAdaptation] updateRtpSenderEncodings: ".concat(JSON.stringify(d.encodings)))}catch(u){!("transport"in e)||e.transport&&e.transport.state==="connected"?this.peerConnectionState!=="connected"?_.debug("[updateAdaptation] peerConnection not connected}"):_.debug("[updateAdaptation] updateRtpSenderEncodings failed",u):_.debug("[updateAdaptation] rtpSender transport not connected}")}})}applySendEncodings(e,i){return C(this,null,function*(){try{if(!Ct().supportSetRtpSenderParameters||e.length!==i.length)return;for(let n=0;n<e.length;n++){const r=e[n],o=i[n];o instanceof Yt&&!this.isVP8Simulcast(o)&&(yield this.updateRtpSenderEncodings(o,r.sender))}}catch(n){_.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}})}mungSendOfferSDP(e,i,n){const r=Ni(e);return i.forEach((o,s)=>{const a=n[s],c=r.mediaDescriptions.find(d=>d.attributes.mid===a);c&&(ba(c,o),vw(c,o,this.store.codec))}),mo(r)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=e=>{var i;(i=this.onFirstAudioReceived)===null||i===void 0||i.call(this,e)},this.statsFilter.onFirstVideoReceived=e=>{var i;(i=this.onFirstVideoReceived)===null||i===void 0||i.call(this,e)},this.statsFilter.onFirstAudioDecoded=e=>{var i;(i=this.onFirstAudioDecoded)===null||i===void 0||i.call(this,e)},this.statsFilter.onFirstVideoDecoded=(e,i,n)=>{var r;(r=this.onFirstVideoDecoded)===null||r===void 0||r.call(this,e,i,n)},this.statsFilter.onSelectedLocalCandidateChanged=(e,i)=>{var n;(n=this.onSelectedLocalCandidateChanged)===null||n===void 0||n.call(this,e,i)},this.statsFilter.onSelectedRemoteCandidateChange
`),e),i==="offer"?o=>{this.logSDPExchange(o,"answer",n==="local"?"remote":"local",r)}:void 0}getRemoteSSRC(e){return C(this,null,function*(){if(!this.remoteSDP)return;const i=this.remoteSDP.getSSRC(e);return i&&i.length!==0?i[0].ssrcId:void 0})}setConfiguration(e){if(Ct().supportPCSetConfiguration){const i=ys.resolvePCConfiguration(e);this.peerConnection.setConfiguration(i)}}},Q(St.prototype,"updateRemoteRTPCapabilities",[vi],Object.getOwnPropertyDescriptor(St.prototype,"updateRemoteRTPCapabilities"),St.prototype),Q(St.prototype,"connect",[vi],Object.getOwnPropertyDescriptor(St.prototype,"connect"),St.prototype),Q(St.prototype,"updateRemoteConnect",[vi],Object.getOwnPropertyDescriptor(St.prototype,"updateRemoteConnect"),St.prototype),Q(St.prototype,"createDataChannels",[vi],Object.getOwnPropertyDescriptor(St.prototype,"createDataChannels"),St.prototype),Q(St.prototype,"receive",[vi],Object.getOwnPropertyDescriptor(St.prototype,"receive"),St.prototype),Q(St.prototype,"batchReceive",[vi],Object.getOwnPropertyDescriptor(St.prototype,"batchReceive"),St.prototype),Q(St.prototype,"stopReceiving",[vi],Object.getOwnPropertyDescriptor(St.prototype,"stopReceiving"),St.prototype),Q(St.prototype,"muteRemote",[vi],Object.getOwnPropertyDescriptor(St.prototype,"muteRemote"),St.prototype),Q(St.prototype,"unmuteRemote",[vi],Object.getOwnPropertyDescriptor(St.prototype,"unmuteRemote"),St.prototype),Q(St.prototype,"muteLocal",[vi],Object.getOwnPropertyDescriptor(St.prototype,"muteLocal"),St.prototype),Q(St.prototype,"unmuteLocal",[vi],Object.getOwnPropertyDescriptor(St.prototype,"unmuteLocal"),St.prototype),Q(St.prototype,"close",[vi],Object.getOwnPropertyDescriptor(St.prototype,"close"),St.prototype),Q(St.prototype,"updateEncoderConfig",[vi],Object.getOwnPropertyDescriptor(St.prototype,"updateEncoderConfig"),St.prototype),Q(St.prototype,"updateSendParameters",[vi],Object.getOwnPropertyDescriptor(St.prototype,"updateSendParameters"),St.prototype),Q(St.prototype,"replaceTrack",[vi],Object.getOwnPropertyDescriptor(St.prototype,"replaceTrack"),St.prototype),Q(St.prototype,"updateAdaptation",[vi],Object.getOwnPropertyDescriptor(St.prototype,"updateAdaptation"),St.prototype),Q(St.prototype,"getRemoteSSRC",[vi],Object.getOwnPropertyDescriptor(St.prototype,"getRemoteSSRC"),St.prototype),St);function vi(t,e,i){const n=t[e];if(typeof n!="function")throw new Error("Cannot use mutex on object property.");return i.value=function(){return C(this,arguments,function*(){const r=this.mutex,o=yield r.lock("From P2PConnection.".concat(e));try{for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];return yield n.apply(this,a)}finally{o()}})},i}function Xm(t,e){let i=document.createElement("video"),n=document.createElement("canvas");i.setAttribute("style","display:none"),n.setAttribute("style","display:none"),i.setAttribute("muted",""),i.muted=!0,i.setAttribute("autoplay",""),i.autoplay=!0,i.setAttribute("playsinline",""),n.width=Bi(e.width),n.height=Bi(e.height);const r=Bi(e.framerate||15);document.body.append(i),document.body.append(n);let o=t._mediaStreamTrack;i.srcObject=new MediaStream([o]),i.play();const s=n.getContext("2d");if(!s)throw new P(v.UNEXPECTED_ERROR,"can not get canvas context");const a=Ct(),c=n.captureStream(a.supportRequestFrame?0:r).getVideoTracks()[0];c.canvas||(c.canvas=n),n.startCapture=()=>{if(!i)return n.stopCapture&&n.stopCapture();if(i.paused&&i.play(),i.videoHeight>2&&i.videoWidth>2){const l=i.videoWidth,u=i.videoHeight/l,h=n.width*u;Math.abs(h-n.height)>=2&&(_.debug("adjust low stream resolution","".concat(n.width,"x").concat(n.height," -> ").concat(n.width,"x").concat(h)),n.height=h)}s.drawImage(i,0,0,n.width,n.height),c.requestFrame&&c.requestFrame(),o!==t._mediaStreamTrack&&(o=t._mediaStreamTrack,i.srcObject=new MediaStream([o]))},n.stopCapture=om(()=>n.startCapture&&n.startCapture(),r);const d=c.stop;return c.stop=()=>{d.call(c),i&&(i.remove(),i.srcObject=null,i=null),n&&(n.width=0,n.remove(),n.stopCapture&&n.stopCapture(),n.startCapture=void 0,n.stopCapture=void 0,n=null),_.debug("clean low stream renderer")
STM9ztkT3uYslTT2PuKmZfPzhH6kVdO7PTjGCOZnAsyb3oTtWat0KcxQ4jxvqQV+
HvYl3iI1Yd4vl2c3qRMJPLtRDfNxa2Mcxgq7e9aEUibzdd0st+OJAy3tOj/Y0aVy
xQiYDz3vqa6bP29adwIDAQAB`),w=new Uint8Array(new ArrayBuffer(O.length));for(let L=0;L<O.length;L+=1)w[L]=O.charCodeAt(L);return w}(),T=yield window.crypto.subtle.importKey("spki",f,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),R=LE(m),A=yield window.crypto.subtle.encrypt({name:"RSA-OAEP"},T,R);return function(N){let O="";for(let w=0;w<N.length;w+=1)O+=String.fromCharCode(N[w]);return window.btoa(O)}(new Uint8Array(A))}))(this._encryptionSecret),!this._joinAndNotLeaveYet)throw new P(v.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this._encryptionSalt&&(u.aessalt=this._encryptionSalt)}if(this._encryptDataStream&&(this._encryptionMode==="aes-128-gcm2"||this._encryptionMode==="aes-256-gcm2"))if(this._encryptionSalt&&this._encryptionSecret)if(window.crypto.subtle){const m=new TextEncoder,f=y("USE_PURE_ENCRYPTION_MASTER_KEY")?m.encode(u.appId+this._encryptionSecret+this._encryptionSecret):m.encode(u.appId+u.cname+this._encryptionSecret);this._encryptDataStreamIv=yield function(T,R,A){return C(this,null,function*(){const N=yield window.crypto.subtle.importKey("raw",R,"PBKDF2",!1,["deriveBits","deriveKey"]),O=T==="aes-128-gcm2"?128:256,w=yield window.crypto.subtle.deriveBits({name:"PBKDF2",iterations:PI,hash:"SHA-256",salt:A},N,O+KG);return new Uint8Array(w).subarray(O/8)})}(this._encryptionMode,f,Qo(this._encryptionSalt)),this._encryptDataStreamKey=yield function(T,R,A){return C(this,null,function*(){const N=yield window.crypto.subtle.importKey("raw",R,"PBKDF2",!1,["deriveBits","deriveKey"]),O=T==="aes-128-gcm2"?128:256;return yield window.crypto.subtle.deriveKey({name:"PBKDF2",iterations:PI,hash:"SHA-256",salt:A},N,{name:"AES-GCM",length:O},!0,["encrypt","decrypt"])})}(this._encryptionMode,f,Qo(this._encryptionSalt))}else a?_.warning("[".concat(this._clientId,"] encrypt datastream must be running in a secure context, fallback to plain data stream")):_.warning("[".concat(this._clientId,"] current browser do not support WebCrypto ,fallback to plain data stream")),this._encryptDataStream=!1;else this._encryptDataStream=!1,_.debug("[".concat(this._clientId,"] no salt / secret, cannot support encrypt data stream, fallback to plain data stream"));this._startSession(this._sessionId,{channel:e,appId:t,stringUid:u.stringUid});const h=this._sessionId;setTimeout(()=>{this.connectionState==="CONNECTING"&&h===this._sessionId&&Z.joinChannelTimeout(this._sessionId,5)},5e3);try{var p;let m;const f=u.cloudProxyServer;if(G(p=["proxy3","proxy4","proxy5"]).call(p,f)){const O=y("PROXY_SERVER_TYPE3");Array.isArray(O)?u.proxyServer=O[0]:u.proxyServer=O}if(Z.setProxyServer(u.proxyServer),_.setProxyServer(u.proxyServer),this.store.requestAPStart(),c){if(_.debug("[".concat(this._clientId,"] get serverInfo Success from Preload Cache ").concat(u.stringUid?", ".concat(u.stringUid," => ").concat(c.intUid):""," ")),u.stringUid&&!u.uid&&(u.uid=c.intUid),m={gatewayInfo:c.ap.gatewayInfo},y("JOIN_WITH_FALLBACK_MEDIA_PROXY")&&u.turnServer.mode==="auto")if(c.ap.proxyInfo.addresses.length===0)_.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers");else{const O=(yield pw(c.ap.proxyInfo,c.ap.gatewayInfo.uid)).map(w=>({turnServerURL:w.address,tcpport:w.tcpport||He.tcpport,udpport:w.udpport||He.udpport,username:w.username||He.username,password:w.password||He.password,forceturn:!1,security:!0}));u.turnServer={mode:"manual",servers:O}}v0(c,u.stringUid)}else{if(u.stringUid&&!u.uid){let O;[O,m]=yield K.all([jw(u.stringUid,u,this._axiosCancelSource.token,this._config.httpRetryConfig||ge,this.store),Bw(u,this._axiosCancelSource.token,this._config.httpRetryConfig||ge,!0,this.store)]),_.debug("[".concat(this._clientId,"] getUserAccount Success ").concat(u.stringUid," => ").concat(O)),u.uid=O,m.gatewayInfo.uid=O,m.gatewayInfo.res.uid=O}else m=yield Bw(u,this._axiosCancelSource.token,this._config.httpRetryConfig||ge,!0,this.store);if(!this._joinAndNotLeaveYet)throw new P(v.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"))}this.store.requestAPEnd(),setTimeout(()=>{this._configDistribute.start
The secret must contain at least 1 lowercase alphabetical character,
The secret must contain at least 1 uppercase alphabetical character,
The secret must contain at least 1 numeric character,
The secret must contain at least one special character,
The secret must be eight characters or longer.
`),this._encryptionMode=t,this._encryptionSecret=e,i&&(this._encryptionSalt=Eo(i))}renewToken(t){return C(this,null,function*(){if(Me(t,"token",1,2047),!this._key||!this._joinInfo)throw new P(v.INVALID_OPERATION,"renewToken should not be called before user join");const e=this._key;this._key=t,this._joinInfo&&(this._joinInfo.token=t);const i=yield this._renewTokenMutex.lock();try{if(y("USE_NEW_TOKEN")){_.debug("[".concat(this._clientId,"] start renew token with ticket from unilbs"));const n=yield IW(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||ge);_.debug("[".concat(this._clientId,"] get ticket from unilbs success")),yield this._gateway.renewToken({token:t,ticket:n})}else _.debug("[".concat(this._clientId,"] start renew token without ticket")),yield this._gateway.renewToken({token:t});_.debug("[".concat(this._clientId,"] renewToken success"))}catch(n){throw this._key=e,this._joinInfo.token=e,_.error("[".concat(this._clientId,"] renewToken failed"),n.toString()),n}finally{i()}})}enableAudioVolumeIndicator(){this._audioVolumeIndicationInterval?_.warning("you have already enabled audio volume indicator!"):this._audioVolumeIndicationInterval=window.setInterval(()=>{const t=this._p2pChannel.getAudioLevels();this.safeEmit(_t.VOLUME_INDICATOR,t)},y("AUDIO_VOLUME_INDICATION_INTERVAL")||2e3)}getRTCStats(){const t=this._statsCollector.getRTCStats(),e=this._gateway.getInChannelInfo();return t.Duration=Math.round(e.duration/1e3),t}startLiveStreaming(t,e){return C(this,null,function*(){if(!e){if(this.codec!=="h264")throw new P(v.LIVE_STREAMING_INVALID_RAW_STREAM,"raw streaming is only support h264");if(!this._p2pChannel.hasLocalMedia())throw new P(v.LIVE_STREAMING_INVALID_RAW_STREAM,"can not find stream to raw streaming")}if(this._liveRawStreamingClient&&this._liveRawStreamingClient.hasUrl(t)||this._liveTranscodeStreamingClient&&this._liveTranscodeStreamingClient.hasUrl(t))throw new P(v.LIVE_STREAMING_TASK_CONFLICT);const i=e?Gr.TRANSCODE:Gr.RAW;return this._createLiveStreamingClient(i).startLiveStreamingTask(t,i)})}setLiveTranscoding(t){return this._createLiveStreamingClient(Gr.TRANSCODE).setTranscodingConfig(t)}stopLiveStreaming(t){return C(this,null,function*(){const e=[this._liveRawStreamingClient,this._liveTranscodeStreamingClient].filter(i=>i&&i.hasUrl(t));if(!e.length)throw new P(v.INVALID_PARAMS,"can not find live streaming url to stop");yield K.all(e.map(i=>i&&i.stopLiveStreamingTask(t)))})}startChannelMediaRelay(t){return C(this,null,function*(){zw(t),yield this._createChannelMediaRelayClient().startChannelMediaRelay(t)})}updateChannelMediaRelay(t){return C(this,null,function*(){zw(t),yield this._createChannelMediaRelayClient().updateChannelMediaRelay(t)})}stopChannelMediaRelay(){return C(this,null,function*(){yield this._createChannelMediaRelayClient().stopChannelMediaRelay(),this._statsCollector.onStatsChanged&&(this._statsCollector.onStatsChanged=void 0)})}sendAudioMetadata(t){this._p2pChannel instanceof Zc&&this._p2pChannel.addAudioMetadata(t)}sendStreamMessage(e){return C(this,arguments,function*(t){var i;let n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!this._joinInfo)throw new P(v.INVALID_OPERATION,"can not send data stream, not joined");if((typeof t=="string"||t instanceof Uint8Array)&&(t={payload:t}),typeof t.payload=="string"){const o=new TextEncoder;t.payload=o.encode(t.payload)}let r=!1;if(this._encryptDataStream&&this._encryptDataStreamIv&&this._encryptDataStreamKey&&window.crypto.subtle&&G(i=["aes-128-gcm2","aes-256-gcm2"]).call(i,this._encryptionMode)&&(r=!0,t.payload=yield function(o,s,a){return C(this,null,function*(){var c;const d=Tn(c=Array.from(a)).call(c,(f,T)=>f+T,0),l={serverTs:0,seq:YG++,length:a.length,checkSum:d},u=new Uint8Array(gI(d,2)),h=new ArrayBuffer(ca),p=new DataView(h);p.setUint32(0,l.serverTs),p.setUint16(4,l.seq),p.setUint16(6,l.length),p.setUint16(8,l.checkSum);const g=16-a.length%16;a=pI(a,new Uint8Array(g));const m=yield window.crypto.subtle.encrypt({name:"AES-GCM",iv:o,tagLength:DI,additionalData:u},s,a);return pI(new Uint8Array(
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`):Ni(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`),this._rtpCapabilities=r,this._candidates=n,this._iceParameters=e,this._dtlsParameters=i,this._localCapabilities=o;const u=s===pi.RECEIVE_ONLY?this.rtpCapabilities.send:this.rtpCapabilities.recv,h=s===pi.RECEIVE_ONLY?this._localCapabilities.recv:this._localCapabilities.send,p=s===pi.RECEIVE_ONLY?r.send.videoCodecs:Kc(q.VIDEO,u,h,c),g=s===pi.RECEIVE_ONLY?r.send.audioCodecs:Kc(q.AUDIO,u,h,d);for(const m of l.mediaDescriptions)m.attributes.iceUfrag=e.iceUfrag,m.attributes.icePwd=e.icePwd,m.attributes.fingerprints=i.fingerprints,m.attributes.candidates=n,m.attributes.setup=this.setup,m.media.mediaType==="application"&&(m.attributes.sctpPort="5000"),m.media.mediaType==="video"&&(m.media.fmts=p.map(f=>f.payloadType.toString(10)),m.attributes.payloads=p,m.attributes.extmaps=u.videoExtensions),m.media.mediaType==="audio"&&(m.media.fmts=g.map(f=>f.payloadType.toString(10)),m.attributes.payloads=g,m.attributes.extmaps=u.audioExtensions,wa(m));this.sessionDesc=l,this.currentMidIndex=l.mediaDescriptions.length-1}toString(){return mo(this.sessionDesc)}hasMid(t){return Array.isArray(t)?t.every(e=>this.hasMid(e)):this.sessionDesc.mediaDescriptions.some(e=>e.attributes.mid===t)}send(t,e,i,n,r){i=i.replace(/ /g,"-");const{ssrcs:o,ssrcGroups:s}=as(e,this.cname,y("SYNC_GROUP")?i:void 0),a=this.findPreloadMediaDesc(o);if(a){if(ne()&&this.firefoxSsrcMidMap.set(o[0].ssrcId,a.attributes.mid),r&&(r.twcc||r.remb)){const c=this.sessionDesc.mediaDescriptions.indexOf(a);return this.sessionDesc.mediaDescriptions[c]=this.mungSendMediaDesc(a,r),{mid:a.attributes.mid,needExchangeSDP:!0}}return{mid:a.attributes.mid,needExchangeSDP:!1}}{const c=this.findAvailableMediaIndex(t,o,n);let d;return c===-1?(d=this.createOrRecycleSendMedia(t,o,s,"sendonly",n,r),this.updateBundleMids()):(d=te(this.sessionDesc.mediaDescriptions[c]),d.attributes.direction="sendonly",d.attributes.ssrcs=o,d.attributes.ssrcGroups=s,this.sessionDesc.mediaDescriptions[c]=this.mungSendMediaDesc(d,r)),ne()&&this.firefoxSsrcMidMap.set(o[0].ssrcId,d.attributes.mid),{needExchangeSDP:!0,mid:d.attributes.mid}}}stopSending(t){const e=this.sessionDesc.mediaDescriptions.filter(i=>i.attributes.mid&&t.indexOf(i.attributes.mid)!==-1);if(e.length!==t.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");e.forEach(i=>{i.attributes.ssrcs=[]}),this.updateBundleMids()}receive(t,e,i){const n=[];return t.forEach(r=>{const o=r._mediaStreamTrack.kind,s=this.findAvailableRecvMediaIndex(o);let a,c=!1;s===-1?(c=!0,a=this.createOrRecycleRecvMedia(r,[],"recvonly",e,i),this.updateBundleMids()):(a=te(this.sessionDesc.mediaDescriptions[s]),a.attributes.direction="recvonly"),n.push({mid:a.attributes.mid,needCreateTransceiver:c})}),n}stopReceiving(t){const e=this.sessionDesc.mediaDescriptions.filter(i=>t.indexOf(i.attributes.mid)!==-1);if(e.length!==t.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");e.forEach(i=>{i.media.port="0",i.attributes.direction="inactive"}),this.updateBundleMids()}addRemoteCandidate(t){const{foundation:e,protocol:i,address:n,port:r,type:o,relatedAddress:s,relatedPort:a,priority:c}=new RTCIceCandidate(t),d={foundation:e!=null?e:"",componentId:"1",transport:i!=null?i:"",priority:c?c+"":"",connectionAddress:n!=null?n:"",port:r?r+"":"",type:o?o+"":"",relAddr:s!=null?s:"",relPort:a?a+"":"",extension:{}};this.candidates.some(l=>l.priority===d.priority&&l.connectionAddress===d.connectionAddress&&l.port===d.port)||(this._candidates.push(d),this.sessionDesc.mediaDescriptions.forEach(l=>{l.attributes.candidates=this.candidates}))}clearRemoteCandidate(){this._candidates=[],this.sessionDesc.mediaDescriptions[0].attributes.candidates=this._candidates}createOrRecycleRecvMedia(t,e,i,n,r){const o=t._mediaStreamTrack.kind,s=this.rtpCapabilities.recv,a=Kc(o,s,this.localCapabilities.send,o===q.AUDIO?r:n),c=o===q.VIDEO?s.videoExtensions:s.audioExtensions,d="".concat(++this.currentMidIndex);let l={media:{mediaType:o,port:"9",protos:["UDP","TLS","RTP","SAVPF"],fmts:a.map(h=>h.payloadType.to
`),e),i==="offer"?o=>{this.logSDPExchange(o,"answer",n==="local"?"remote":"local",r)}:void 0}muteLocal(e){return C(this,null,function*(){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");const i=this.peerConnection.getTransceivers().filter(s=>s.mid&&e.indexOf(s.mid)!==-1);if(i.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length.");i.map(s=>{s.direction="inactive"});const n=yield this.peerConnection.createOffer(),r=this.logSDPExchange(n.sdp||"","offer","local","muteLocal");yield this.peerConnection.setLocalDescription(n),this.remoteSDP.muteRemote(e);const o=this.remoteSDP.toString();r==null||r(o),yield this.setRemoteDescription({type:"answer",sdp:o})}catch(i){throw new k(v.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(i.toString()))}})}unmuteLocal(e){return C(this,null,function*(){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");const i=this.peerConnection.getTransceivers().filter(s=>s.mid&&e.indexOf(s.mid)!==-1);if(i.length!==e.length)throw new Error("Transceivers' length doesn't match mids' length.");i.map(s=>C(this,null,function*(){s.direction="sendonly"}));const n=yield this.peerConnection.createOffer(),r=this.logSDPExchange(n.sdp||"","offer","local","unmuteLocal");yield this.peerConnection.setLocalDescription(n),this.remoteSDP.unmuteRemote(e);const o=this.remoteSDP.toString();r==null||r(o),yield this.setRemoteDescription({type:"answer",sdp:o})}catch(i){throw new k(v.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(i.toString()))}})}getRemoteSSRC(e,i){return C(this,null,function*(){var n;if(i=i!=null?i:(n=this.currentRemoteDescription)===null||n===void 0?void 0:n.sdp){var r;const o=(r=Ni(i).mediaDescriptions.find(s=>s.attributes.mid===e))===null||r===void 0?void 0:r.attributes.ssrcs;return o==null?void 0:o[0].ssrcId}})}setRemoteDescription(e){return C(this,null,function*(){var i;yield this.peerConnection.setRemoteDescription(e),G(i=["connected","completed"]).call(i,this.peerConnection.iceConnectionState)||(this.isReady=!0,this.addRemoteCandidate())})}mungReceiveAnswerSDP(e,i,n){const r=Ni(e),o=r.mediaDescriptions.find(s=>s.attributes.mid===i);return o&&n===q.AUDIO&&o.media.mediaType==="audio"&&wa(o),mo(r)}},Q(qt.prototype,"establish",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"establish"),qt.prototype),Q(qt.prototype,"connect",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"connect"),qt.prototype),Q(qt.prototype,"receive",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"receive"),qt.prototype),Q(qt.prototype,"mockReceive",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"mockReceive"),qt.prototype),Q(qt.prototype,"stopReceiving",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"stopReceiving"),qt.prototype),Q(qt.prototype,"restartICE",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"restartICE"),qt.prototype),Q(qt.prototype,"close",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"close"),qt.prototype),Q(qt.prototype,"updateEncoderConfig",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"updateEncoderConfig"),qt.prototype),Q(qt.prototype,"updateSendParameters",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"updateSendParameters"),qt.prototype),Q(qt.prototype,"replaceTrack",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"replaceTrack"),qt.prototype),Q(qt.prototype,"muteLocal",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"muteLocal"),qt.prototype),Q(qt.prototype,"unmuteLocal",[Bn],Object.getOwnPropertyDescriptor(qt.prototype,"unmuteLocal"),qt.prototype),qt);function Bn(t,e,i){const n=t[e];if(typeof n!="function")throw new Error("Cannot use mutex on object property.");return i.value=function(){return C(this,arguments,function*(){const r=this.mutex,o=yield r.lock("From P2PConnection.".concat(e));try{for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];return yield n.apply(this,a)}finally{o()}})},i}let nr=function(t){return t.SEND_ONLY="SEND_ONLY",t.RECEIVE_ONLY="RECEIVE_ONLY",t}({});var LN,kN,MN,UN,xN,
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
a=ice-lite
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:audio
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:video
`);this.rtpCapabilities=o,this.candidates=r,this._originCandidates=te(r),this.iceParameters=i,this.dtlsParameters=n,this.setup=s,this.localCapabilities=a,this.cname=d;for(let u=0;u<l.mediaDescriptions.length;u++){const h=l.mediaDescriptions[u];if(h.attributes.iceUfrag=i.iceUfrag,h.attributes.icePwd=i.icePwd,h.attributes.fingerprints=n.fingerprints,h.attributes.candidates=r,h.attributes.setup=s,h.media.mediaType==="video"){h.media.fmts=o.videoCodecs.map(g=>g.payloadType.toString(10));let p=o.videoCodecs.filter(g=>{var m,f;return(m=g.rtpMap)===null||m===void 0?void 0:G(f=m.encodingName.toLowerCase()).call(f,c)});p.length===0&&(p=o.videoCodecs),h.attributes.payloads=p,h.attributes.extmaps=o.videoExtensions}h.media.mediaType==="audio"&&(h.media.fmts=o.audioCodecs.map(p=>p.payloadType.toString(10)),h.attributes.payloads=o.audioCodecs,h.attributes.extmaps=o.audioExtensions),l.mediaDescriptions[u]=this.mungMediaDesc(h)}this.sessionDesc=l,this.currentMidIndex=l.mediaDescriptions.length-1}toString(){return mo(this.sessionDesc)}send(e,i,n){const{ssrcs:r,ssrcGroups:o}=as(i,this.cname),s=this.sessionDesc.mediaDescriptions.find(d=>e===q.VIDEO?d.media.mediaType==="video":d.media.mediaType==="audio"),a=r[0].attributes.label,c=r[0].attributes.mslabel;return s.attributes.ssrcs=s.attributes.ssrcs.concat(r),s.attributes.ssrcGroups=s.attributes.ssrcGroups.concat(o),{id:a,mslabel:c}}batchSend(e){return e.map(i=>{let{kind:n,ssrcMsg:r}=i;return this.send(n,r,void 0)})}stopSending(e){this.sessionDesc.mediaDescriptions.forEach(i=>{const n=[],r=[],o=[];i.attributes.ssrcs.forEach(s=>{G(e).call(e,s.attributes.label||"")?o.push(s):n.push(s)}),i.attributes.ssrcGroups.forEach(s=>{var a;G(a=o.map(c=>c.ssrcId)).call(a,s.ssrcIds[0])||r.push(s)}),i.attributes.ssrcs=n,i.attributes.ssrcGroups=r})}mute(e){const i=this.sessionDesc.mediaDescriptions.find(n=>n.attributes.mid===e);if(!i)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.mute."));i.attributes.direction="inactive"}unmute(e){const i=this.sessionDesc.mediaDescriptions.find(n=>n.attributes.mid===e);if(!i)throw new Error("mediaDescription not found with ".concat(e," in remote SDP when calling RemoteSDP.unmute."));i.attributes.direction="sendonly"}receive(e,i,n){e.forEach((r,o)=>{const s=r._mediaStreamTrack,a=this.sessionDesc.mediaDescriptions.findIndex(d=>d.attributes.mid===s.kind),c=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[a],r);this.sessionDesc.mediaDescriptions[a]=c})}stopReceiving(e){}updateCandidates(e){const i=this._originCandidates.filter(r=>r.transport==="udp"),n=[];if(i.forEach(r=>{n.push(YN(YN({},r),{},{foundation:"tcpcandidate",priority:Number(r.priority)-1+"",transport:"tcp",port:Number(r.port)+90+""}))}),i.length!==0){switch(e){case Xe.TCP_RELAY:this.candidates=n;break;case Xe.UDP_TCP_RELAY:case Xe.RELAY:this.candidates=[...i,...n];break;default:this.candidates=i}for(const r of this.sessionDesc.mediaDescriptions)r.attributes.candidates=this.candidates}}restartICE(e){e=te(e),this.iceParameters=e,this.sessionDesc.mediaDescriptions.forEach(i=>{i.attributes.iceUfrag=e.iceUfrag,i.attributes.icePwd=e.icePwd})}predictReceivingMids(e){const i=[];for(let n=0;n<e;n++)i.push((this.currentMidIndex+n+1).toString(10));return i}mungRecvMediaDsec(e,i){const n=te(e);return ba(n,i),Lm(n,i),n}updateRecvMedia(e,i){const n=this.sessionDesc.mediaDescriptions.findIndex(r=>r.attributes.mid===e);if(n!==-1){const r=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[n],i);this.sessionDesc.mediaDescriptions[n]=r}}bumpMid(e){this.currentMidIndex+=e}updateTrackLabel(e,i,n){const r=this.sessionDesc.mediaDescriptions.find(s=>e===q.VIDEO?s.attributes.mid==="video":s.attributes.mid==="audio");if(r){const s=r.attributes.ssrcs.find(a=>a.attributes.label===i);var o;s&&(s.attributes.label=n,(o=s.attributes.msid)===null||o===void 0||o.replace(i,n))}}mungMediaDesc(e){const i=te(e);return Pm(i),function(n){const r=n.attributes.extmaps.find(o=>Bu(o.extensionName));r&&n.attributes.extmaps.splice(n.attributes.extmaps.indexOf(r),1),n.attributes.payloads.forEach