mainsail/assets/JanusStreamer-caeac552.js

9 lines
222 KiB
JavaScript
Raw Normal View History

2024-08-14 21:10:58 +03:00
import{m as cv,B as fv,G as lv,P as Hu,W as dv,R as pv,C as hv,n as gv}from"./index-17a5ec1d.js";import{g as qu,c as Kn}from"./overlayscrollbars-44d87bcf.js";import{a4 as Uo,a5 as fi,a6 as li,a7 as er}from"./echarts-ff51454d.js";import{l as mv,m as vv,q as yv}from"./vuetify-4c65b4c3.js";function _v(i,s){for(var n=0;n<s.length;n++){const o=s[n];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in i)){const u=Object.getOwnPropertyDescriptor(o,a);u&&Object.defineProperty(i,a,u.get?u:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}f.sessions=new Map;f.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){let i=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),s=33;return window.navigator.userAgent.match("Linux")&&(s=35),i>=26&&i<=s?!0:f.extension.isInstalled()}else return!0};var Ju={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return document.querySelector("#janus-extension-installed")!==null},getScreen:function(i){let s=window.setTimeout(function(){let n=new Error("NavigatorUserMediaError");return n.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',i(n)},1e3);this.cache[s]=i,window.postMessage({type:"janusGetScreen",id:s},"*")},init:function(){let i={};this.cache=i,window.addEventListener("message",function(s){if(s.origin==window.location.origin)if(s.data.type=="janusGotScreen"&&i[s.data.id]){let n=i[s.data.id];if(delete i[s.data.id],s.data.sourceId===""){let o=new Error("NavigatorUserMediaError");o.name="You cancelled the request for permission, giving up...",n(o)}else n(null,s.data.sourceId)}else s.data.type=="janusGetScreenPending"&&window.clearTimeout(s.data.id)})}};f.useDefaultDependencies=function(i){let s=i&&i.fetch||fetch,n=i&&i.Promise||Promise,o=i&&i.WebSocket||WebSocket;return{newWebSocket:function(a,u){return new o(a,u)},extension:i&&i.extension||Ju,isArray:function(a){return Array.isArray(a)},webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(a,u){let p={method:u.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};u.verb==="POST"&&(p.headers["Content-Type"]="application/json"),typeof u.withCredentials<"u"&&(p.credentials=u.withCredentials===!0?"include":u.withCredentials?u.withCredentials:"omit"),u.body&&(p.body=JSON.stringify(u.body));let g=s(a,p).catch(function(T){return n.reject({message:"Probably a network error, is the server down?",error:T})});if(u.timeout){let T=new n(function(l,_){let D=setTimeout(function(){return clearTimeout(D),_({message:"Request timed out",timeout:u.timeout})},u.timeout)});g=n.race([g,T])}return g.then(function(T){if(T.ok){if(typeof u.success==typeof f.noop)return T.json().then(function(l){try{u.success(l)}catch(_){f.error("Unhandled httpAPICall success callback error",_)}},function(l){return n.reject({message:"Failed to parse response body",error:l,response:T})})}else return n.reject({message:"API call failed",response:T})}).catch(function(T){typeof u.error==typeof f.noop&&u.error(T.message||"<< internal error >>",T)}),g}}};f.useOldDependencies=function(i){let s=i&&i.jQuery||jQuery,n=i&&i.WebSocket||WebSocket;return{newWebSocket:function(o,a){return new n(o,a)},isArray:function(o){return s.isArray(o)},extension:i&&i.extension||Ju,webRTCAdapter:i&&i.adapter||adapter,httpAPICall:function(o,a){let u=typeof a.body<"u"?{contentType:"application/json",data:JSON.stringify(a.body)}:{},p=typeof a.withCredentials<"u"?{xhrFields:{withCredentials:a.withCredentials}}:{};return s.ajax(s.extend(u,p,{url:o,type:a.verb,cache:!1,dataType:"json",async:a.async,timeout:a.timeout,success:function(g){typeof a.success==typeof f.noop&&a.success(g)},error:function(g,T,l){typeof a.error==typeof f.noop&&a.error(T,l)}}))}}};f.mediaToTracks=function(i){let s=[];if(!i)s.push({type:"audio",capture:!0,recv:!0}),s.push({type:"video",capture:!0,recv:!0});else{
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/di.exports;(function(i,s){(function(){var n,o="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",g="Invalid `variable` option passed into `_.template`",T="__lodash_hash_undefined__",l=500,_="__lodash_placeholder__",D=1,H=2,z=4,j=1,ee=2,xe=1,Ye=2,_e=4,$=8,X=16,Oe=32,Ze=64,me=128,mt=256,Zt=512,nr=30,dn="...",gi=800,mi=16,rr=1,ir=2,or=3,at=1/0,ut=9007199254740991,sr=17976931348623157e292,Lt=0/0,Xe=4294967295,pn=Xe-1,ar=Xe>>>1,vi=[["ary",me],["bind",xe],["bindKey",Ye],["curry",$],["curryRight",X],["flip",Zt],["partial",Oe],["partialRight",Ze],["rearg",mt]],kt="[object Arguments]",hn="[object Array]",ur="[object AsyncFunction]",bt="[object Boolean]",Ut="[object Date]",cr="[object DOMException]",ct="[object Error]",Tt="[object Function]",ft="[object GeneratorFunction]",Ne="[object Map]",Ft="[object Number]",fr="[object Null]",qe="[object Object]",lr="[object Promise]",v="[object Proxy]",C="[object RegExp]",b="[object Set]",y="[object String]",O="[object Symbol]",I="[object Undefined]",w="[object WeakMap]",W="[object WeakSet]",F="[object ArrayBuffer]",x="[object DataView]",A="[object Float32Array]",B="[object Float64Array]",re="[object Int8Array]",fe="[object Int16Array]",lt="[object Int32Array]",N="[object Uint8Array]",ne="[object Uint8ClampedArray]",be="[object Uint16Array]",vt="[object Uint32Array]",yi=/\b__p \+= '';/g,Ac=/\b(__p \+=) '' \+/g,Ic=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,jo=/[&<>"']/g,Dc=RegExp($o.source),Mc=RegExp(jo.source),Lc=/<%-([\s\S]+?)%>/g,kc=/<%([\s\S]+?)%>/g,Ko=/<%=([\s\S]+?)%>/g,Uc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fc=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_i=/[\\^$.*+?()[\]{}|]/g,Gc=RegExp(_i.source),Si=/^\s+/,Wc=/\s/,Bc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hc=/\{\n\/\* \[wrapped with (.+)\] \*/,qc=/,? & /,Jc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zc=/[()=,{}\[\]\/\s]/,Vc=/\\(\\)?/g,$c=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yo=/\w*$/,jc=/^[-+]0x[0-9a-f]+$/i,Kc=/^0b[01]+$/i,Yc=/^\[object .+?Constructor\]$/,Zc=/^0o[0-7]+$/i,Xc=/^(?:0|[1-9]\d*)$/,Qc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr=/($^)/,ef=/['\n\r\u2028\u2029\\]/g,pr="\\ud800-\\udfff",tf="\\u0300-\\u036f",nf="\\ufe20-\\ufe2f",rf="\\u20d0-\\u20ff",Zo=tf+nf+rf,Xo="\\u2700-\\u27bf",Qo="a-z\\xdf-\\xf6\\xf8-\\xff",of="\\xac\\xb1\\xd7\\xf7",sf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",af="\\u2000-\\u206f",uf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",es="A-Z\\xc0-\\xd6\\xd8-\\xde",ts="\\ufe0e\\ufe0f",ns=of+sf+af+uf,Ci="[']",cf="["+pr+"]",rs="["+ns+"]",hr="["+Zo+"]",is="\\d+",ff="["+Xo+"]",os="["+Qo+"]",ss="[^"+pr+ns+is+Xo+Qo+es+"]",bi="\\ud83c[\\udffb-\\udfff]",lf="(?:"+hr+"|"+bi+")",as="[^"+pr+"]",Ti="(?:\\ud83c[\\udde6-\\uddff]){2}",Ri="[\\ud800-\\udbff][\\udc00-\\udfff]",gn="["+es+"]",us="\\u200d",cs="(?:"+os+"|"+ss+")",df="(?:"+gn+"|"+ss+")",fs="(?:"+Ci+"(?:d|ll|m|re|s|t|ve))?",ls="(?:"+Ci+"(?:D|LL|M|RE|S|T|VE))?",ds=lf+"?",ps="["+ts+"]?",pf="(?:"+us+"(?:"+[as,Ti,Ri].join("|")+")"+ps+ds+")*",hf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hs=ps+ds+pf,mf="(?:"+[ff,Ti,Ri].join("|")+")"+hs,vf="(?:"+[as+hr+"?",hr,Ti,Ri,cf].join("|")+")",yf=RegExp(Ci,"g"),_f=RegExp(hr,"g"),xi=RegExp(bi+"(?="+bi+")|"+vf+hs,"g"),Sf=RegExp([gn+"?"+os+"+"+fs+"(?="+[rs,gn,"$"].join("|")+")",df+"+"+ls+"(?="+[rs,gn+cs,"$"].join("|")+")",gn+"?"+cs+"+"+fs,gn+"+"+ls,gf,hf,is,mf].join("|"),"g"),Cf=RegExp("["+us+pr+Zo+ts+"]"),bf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Tf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTime