@vrspace/babylonjs
Version:
vrspace.org babylonjs client
1 lines • 376 kB
JavaScript
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,(function(r){var n=e[i][1][r];return o(n||r)}),p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){"use strict";var R=typeof Reflect==="object"?Reflect:null;var ReflectApply=R&&typeof R.apply==="function"?R.apply:function ReflectApply(target,receiver,args){return Function.prototype.apply.call(target,receiver,args)};var ReflectOwnKeys;if(R&&typeof R.ownKeys==="function"){ReflectOwnKeys=R.ownKeys}else if(Object.getOwnPropertySymbols){ReflectOwnKeys=function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))}}else{ReflectOwnKeys=function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target)}}function ProcessEmitWarning(warning){if(console&&console.warn)console.warn(warning)}var NumberIsNaN=Number.isNaN||function NumberIsNaN(value){return value!==value};function EventEmitter(){EventEmitter.init.call(this)}module.exports=EventEmitter;module.exports.once=once;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=undefined;var defaultMaxListeners=10;function checkListener(listener){if(typeof listener!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener)}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:true,get:function(){return defaultMaxListeners},set:function(arg){if(typeof arg!=="number"||arg<0||NumberIsNaN(arg)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+arg+".")}defaultMaxListeners=arg}});EventEmitter.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};EventEmitter.prototype.setMaxListeners=function setMaxListeners(n){if(typeof n!=="number"||n<0||NumberIsNaN(n)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".")}this._maxListeners=n;return this};function _getMaxListeners(that){if(that._maxListeners===undefined)return EventEmitter.defaultMaxListeners;return that._maxListeners}EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this)};EventEmitter.prototype.emit=function emit(type){var args=[];for(var i=1;i<arguments.length;i++)args.push(arguments[i]);var doError=type==="error";var events=this._events;if(events!==undefined)doError=doError&&events.error===undefined;else if(!doError)return false;if(doError){var er;if(args.length>0)er=args[0];if(er instanceof Error){throw er}var err=new Error("Unhandled error."+(er?" ("+er.message+")":""));err.context=er;throw err}var handler=events[type];if(handler===undefined)return false;if(typeof handler==="function"){ReflectApply(handler,this,args)}else{var len=handler.length;var listeners=arrayClone(handler,len);for(var i=0;i<len;++i)ReflectApply(listeners[i],this,args)}return true};function _addListener(target,type,listener,prepend){var m;var events;var existing;checkListener(listener);events=target._events;if(events===undefined){events=target._events=Object.create(null);target._eventsCount=0}else{if(events.newListener!==undefined){target.emit("newListener",type,listener.listener?listener.listener:listener);events=target._events}existing=events[type]}if(existing===undefined){existing=events[type]=listener;++target._eventsCount}else{if(typeof existing==="function"){existing=events[type]=prepend?[listener,existing]:[existing,listener]}else if(prepend){existing.unshift(listener)}else{existing.push(listener)}m=_getMaxListeners(target);if(m>0&&existing.length>m&&!existing.warned){existing.warned=true;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");w.name="MaxListenersExceededWarning";w.emitter=target;w.type=type;w.count=existing.length;ProcessEmitWarning(w)}}return target}EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false)};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true)};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function _onceWrap(target,type,listener){var state={fired:false,wrapFn:undefined,target:target,type:type,listener:listener};var wrapped=onceWrapper.bind(state);wrapped.listener=listener;state.wrapFn=wrapped;return wrapped}EventEmitter.prototype.once=function once(type,listener){checkListener(listener);this.on(type,_onceWrap(this,type,listener));return this};EventEmitter.prototype.prependOnceListener=function prependOnceListener(type,listener){checkListener(listener);this.prependListener(type,_onceWrap(this,type,listener));return this};EventEmitter.prototype.removeListener=function removeListener(type,listener){var list,events,position,i,originalListener;checkListener(listener);events=this._events;if(events===undefined)return this;list=events[type];if(list===undefined)return this;if(list===listener||list.listener===listener){if(--this._eventsCount===0)this._events=Object.create(null);else{delete events[type];if(events.removeListener)this.emit("removeListener",type,list.listener||listener)}}else if(typeof list!=="function"){position=-1;for(i=list.length-1;i>=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break}}if(position<0)return this;if(position===0)list.shift();else{spliceOne(list,position)}if(list.length===1)events[type]=list[0];if(events.removeListener!==undefined)this.emit("removeListener",type,originalListener||listener)}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(events===undefined)return this;if(events.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(events[type]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete events[type]}return this}if(arguments.length===0){var keys=Object.keys(events);var key;for(i=0;i<keys.length;++i){key=keys[i];if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}listeners=events[type];if(typeof listeners==="function"){this.removeListener(type,listeners)}else if(listeners!==undefined){for(i=listeners.length-1;i>=0;i--){this.removeListener(type,listeners[i])}}return this};function _listeners(target,type,unwrap){var events=target._events;if(events===undefined)return[];var evlistener=events[type];if(evlistener===undefined)return[];if(typeof evlistener==="function")return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length)}EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true)};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false)};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==="function"){return emitter.listenerCount(type)}else{return listenerCount.call(emitter,type)}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events!==undefined){var evlistener=events[type];if(typeof evlistener==="function"){return 1}else if(evlistener!==undefined){return evlistener.length}}return 0}EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(arr,n){var copy=new Array(n);for(var i=0;i<n;++i)copy[i]=arr[i];return copy}function spliceOne(list,index){for(;index+1<list.length;index++)list[index]=list[index+1];list.pop()}function unwrapListeners(arr){var ret=new Array(arr.length);for(var i=0;i<ret.length;++i){ret[i]=arr[i].listener||arr[i]}return ret}function once(emitter,name){return new Promise((function(resolve,reject){function errorListener(err){emitter.removeListener(name,resolver);reject(err)}function resolver(){if(typeof emitter.removeListener==="function"){emitter.removeListener("error",errorListener)}resolve([].slice.call(arguments))}eventTargetAgnosticAddListener(emitter,name,resolver,{once:true});if(name!=="error"){addErrorHandlerIfEventEmitter(emitter,errorListener,{once:true})}}))}function addErrorHandlerIfEventEmitter(emitter,handler,flags){if(typeof emitter.on==="function"){eventTargetAgnosticAddListener(emitter,"error",handler,flags)}}function eventTargetAgnosticAddListener(emitter,name,listener,flags){if(typeof emitter.on==="function"){if(flags.once){emitter.once(name,listener)}else{emitter.on(name,listener)}}else if(typeof emitter.addEventListener==="function"){emitter.addEventListener(name,(function wrapListener(arg){if(flags.once){emitter.removeEventListener(name,wrapListener)}listener(arg)}))}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof emitter)}}},{}],2:[function(require,module,exports){"use strict";var normalice=require("normalice");var freeice=function(opts){var servers={stun:(opts||{}).stun||require("./stun.json"),turn:(opts||{}).turn||require("./turn.json")};var stunCount=(opts||{}).stunCount||2;var turnCount=(opts||{}).turnCount||0;var selected;function getServers(type,count){var out=[];var input=[].concat(servers[type]);var idx;while(input.length&&out.length<count){idx=Math.random()*input.length|0;out=out.concat(input.splice(idx,1))}return out.map((function(url){if(typeof url!=="string"&&!(url instanceof String)){return url}else{return normalice(type+":"+url)}}))}selected=[].concat(getServers("stun",stunCount));if(turnCount){selected=selected.concat(getServers("turn",turnCount))}return selected};module.exports=freeice},{"./stun.json":3,"./turn.json":4,normalice:11}],3:[function(require,module,exports){module.exports=["stun.l.google.com:19302","stun1.l.google.com:19302","stun2.l.google.com:19302","stun3.l.google.com:19302","stun4.l.google.com:19302","stun.ekiga.net","stun.ideasip.com","stun.schlund.de","stun.stunprotocol.org:3478","stun.voiparound.com","stun.voipbuster.com","stun.voipstunt.com","stun.voxgratia.org"]},{}],4:[function(require,module,exports){module.exports=[]},{}],5:[function(require,module,exports){var WildEmitter=require("wildemitter");function getMaxVolume(analyser,fftBins){var maxVolume=-Infinity;analyser.getFloatFrequencyData(fftBins);for(var i=4,ii=fftBins.length;i<ii;i++){if(fftBins[i]>maxVolume&&fftBins[i]<0){maxVolume=fftBins[i]}}return maxVolume}var audioContextType;if(typeof window!=="undefined"){audioContextType=window.AudioContext||window.webkitAudioContext}var audioContext=null;module.exports=function(stream,options){var harker=new WildEmitter;if(!audioContextType)return harker;var options=options||{},smoothing=options.smoothing||.1,interval=options.interval||50,threshold=options.threshold,play=options.play,history=options.history||10,running=true;audioContext=options.audioContext||audioContext||new audioContextType;var sourceNode,fftBins,analyser;analyser=audioContext.createAnalyser();analyser.fftSize=512;analyser.smoothingTimeConstant=smoothing;fftBins=new Float32Array(analyser.frequencyBinCount);if(stream.jquery)stream=stream[0];if(stream instanceof HTMLAudioElement||stream instanceof HTMLVideoElement){sourceNode=audioContext.createMediaElementSource(stream);if(typeof play==="undefined")play=true;threshold=threshold||-50}else{sourceNode=audioContext.createMediaStreamSource(stream);threshold=threshold||-50}sourceNode.connect(analyser);if(play)analyser.connect(audioContext.destination);harker.speaking=false;harker.suspend=function(){return audioContext.suspend()};harker.resume=function(){return audioContext.resume()};Object.defineProperty(harker,"state",{get:function(){return audioContext.state}});audioContext.onstatechange=function(){harker.emit("state_change",audioContext.state)};harker.setThreshold=function(t){threshold=t};harker.setInterval=function(i){interval=i};harker.stop=function(){running=false;harker.emit("volume_change",-100,threshold);if(harker.speaking){harker.speaking=false;harker.emit("stopped_speaking")}analyser.disconnect();sourceNode.disconnect()};harker.speakingHistory=[];for(var i=0;i<history;i++){harker.speakingHistory.push(0)}var looper=function(){setTimeout((function(){if(!running){return}var currentVolume=getMaxVolume(analyser,fftBins);harker.emit("volume_change",currentVolume,threshold);var history=0;if(currentVolume>threshold&&!harker.speaking){for(var i=harker.speakingHistory.length-3;i<harker.speakingHistory.length;i++){history+=harker.speakingHistory[i]}if(history>=2){harker.speaking=true;harker.emit("speaking")}}else if(currentVolume<threshold&&harker.speaking){for(var i=0;i<harker.speakingHistory.length;i++){history+=harker.speakingHistory[i]}if(history==0){harker.speaking=false;harker.emit("stopped_speaking")}}harker.speakingHistory.shift();harker.speakingHistory.push(0+(currentVolume>threshold));looper()}),interval)};looper();return harker}},{wildemitter:38}],6:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}}else{module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}}},{}],7:[function(require,module,exports){var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();function JL(loggerName){if(!loggerName){return JL.__}if(!Array.prototype.reduce){Array.prototype.reduce=function(callback,initialValue){var previousValue=initialValue;for(var i=0;i<this.length;i++){previousValue=callback(previousValue,this[i],i,this)}return previousValue}}var accumulatedLoggerName="";var logger=("."+loggerName).split(".").reduce((function(prev,curr,idx,arr){if(accumulatedLoggerName){accumulatedLoggerName+="."+curr}else{accumulatedLoggerName=curr}var currentLogger=prev["__"+accumulatedLoggerName];if(currentLogger===undefined){JL.Logger.prototype=prev;currentLogger=new JL.Logger(accumulatedLoggerName);prev["__"+accumulatedLoggerName]=currentLogger}return currentLogger}),JL.__);return logger}(function(JL){JL.requestId="";JL.entryId=0;JL._createXMLHttpRequest=function(){return new XMLHttpRequest};JL._getTime=function(){return(new Date).getTime()};JL._console=console;JL._appenderNames=[];function copyProperty(propertyName,from,to){if(from[propertyName]===undefined){return}if(from[propertyName]===null){delete to[propertyName];return}to[propertyName]=from[propertyName]}function allow(filters){if(!(JL.enabled==null)){if(!JL.enabled){return false}}try{if(filters.userAgentRegex){if(!new RegExp(filters.userAgentRegex).test(navigator.userAgent)){return false}}}catch(e){}try{if(filters.ipRegex&&JL.clientIP){if(!new RegExp(filters.ipRegex).test(JL.clientIP)){return false}}}catch(e){}return true}function allowMessage(filters,message){try{if(filters.disallow){if(new RegExp(filters.disallow).test(message)){return false}}}catch(e){}return true}function stringifyLogObjectFunction(logObject){if(typeof logObject=="function"){if(logObject instanceof RegExp){return logObject.toString()}else{return logObject()}}return logObject}var StringifiedLogObject=function(){function StringifiedLogObject(msg,meta,finalString){this.msg=msg;this.meta=meta;this.finalString=finalString}return StringifiedLogObject}();function stringifyLogObject(logObject){var actualLogObject=stringifyLogObjectFunction(logObject);var finalString;switch(typeof actualLogObject){case"string":return new StringifiedLogObject(actualLogObject,null,actualLogObject);case"number":finalString=actualLogObject.toString();return new StringifiedLogObject(finalString,null,finalString);case"boolean":finalString=actualLogObject.toString();return new StringifiedLogObject(finalString,null,finalString);case"undefined":return new StringifiedLogObject("undefined",null,"undefined");case"object":if(actualLogObject instanceof RegExp||actualLogObject instanceof String||actualLogObject instanceof Number||actualLogObject instanceof Boolean){finalString=actualLogObject.toString();return new StringifiedLogObject(finalString,null,finalString)}else{if(typeof JL.serialize==="function"){finalString=JL.serialize.call(this,actualLogObject)}else{finalString=JSON.stringify(actualLogObject)}return new StringifiedLogObject("",actualLogObject,finalString)}default:return new StringifiedLogObject("unknown",null,"unknown")}}function setOptions(options){copyProperty("enabled",options,this);copyProperty("maxMessages",options,this);copyProperty("defaultAjaxUrl",options,this);copyProperty("clientIP",options,this);copyProperty("requestId",options,this);copyProperty("defaultBeforeSend",options,this);copyProperty("serialize",options,this);return this}JL.setOptions=setOptions;function getAllLevel(){return-2147483648}JL.getAllLevel=getAllLevel;function getTraceLevel(){return 1e3}JL.getTraceLevel=getTraceLevel;function getDebugLevel(){return 2e3}JL.getDebugLevel=getDebugLevel;function getInfoLevel(){return 3e3}JL.getInfoLevel=getInfoLevel;function getWarnLevel(){return 4e3}JL.getWarnLevel=getWarnLevel;function getErrorLevel(){return 5e3}JL.getErrorLevel=getErrorLevel;function getFatalLevel(){return 6e3}JL.getFatalLevel=getFatalLevel;function getOffLevel(){return 2147483647}JL.getOffLevel=getOffLevel;function levelToString(level){if(level<=1e3){return"trace"}if(level<=2e3){return"debug"}if(level<=3e3){return"info"}if(level<=4e3){return"warn"}if(level<=5e3){return"error"}return"fatal"}var Exception=function(){function Exception(data,inner){this.inner=inner;this.name="JL.Exception";this.message=stringifyLogObject(data).finalString}return Exception}();JL.Exception=Exception;Exception.prototype=new Error;var LogItem=function(){function LogItem(l,m,n,t,u){this.l=l;this.m=m;this.n=n;this.t=t;this.u=u}return LogItem}();JL.LogItem=LogItem;function newLogItem(levelNbr,message,loggerName){JL.entryId++;return new LogItem(levelNbr,message,loggerName,JL._getTime(),JL.entryId)}function clearTimer(timer){if(timer.id){clearTimeout(timer.id);timer.id=null}}function setTimer(timer,timeoutMs,callback){var that=this;if(!timer.id){timer.id=setTimeout((function(){callback.call(that)}),timeoutMs)}}var Appender=function(){function Appender(appenderName,sendLogItems){this.appenderName=appenderName;this.sendLogItems=sendLogItems;this.level=JL.getTraceLevel();this.sendWithBufferLevel=2147483647;this.storeInBufferLevel=-2147483648;this.bufferSize=0;this.batchSize=1;this.maxBatchSize=20;this.batchTimeout=2147483647;this.sendTimeout=5e3;this.buffer=[];this.batchBuffer=[];this.batchTimeoutTimer={id:null};this.sendTimeoutTimer={id:null};this.nbrLogItemsSkipped=0;this.nbrLogItemsBeingSent=0;var emptyNameErrorMessage="Trying to create an appender without a name or with an empty name";if(appenderName==undefined){throw emptyNameErrorMessage}if(JL._appenderNames.indexOf(appenderName)!=-1){if(!appenderName){throw emptyNameErrorMessage}throw"Multiple appenders use the same name "+appenderName}JL._appenderNames.push(appenderName)}Appender.prototype.addLogItemsToBuffer=function(logItems){if(this.batchBuffer.length>=this.maxBatchSize){this.nbrLogItemsSkipped+=logItems.length;return}if(!(JL.maxMessages==null)){if(JL.maxMessages<1){return}JL.maxMessages-=logItems.length}this.batchBuffer=this.batchBuffer.concat(logItems);var that=this;setTimer(this.batchTimeoutTimer,this.batchTimeout,(function(){that.sendBatch.call(that)}))};Appender.prototype.batchBufferHasOverdueMessages=function(){for(var i=0;i<this.batchBuffer.length;i++){var messageAgeMs=JL._getTime()-this.batchBuffer[i].t;if(messageAgeMs>this.batchTimeout){return true}}return false};Appender.prototype.batchBufferHasStrandedMessage=function(){return!(JL.maxMessages==null)&&JL.maxMessages<1&&this.batchBuffer.length>0};Appender.prototype.sendBatchIfComplete=function(){if(this.batchBuffer.length>=this.batchSize||this.batchBufferHasOverdueMessages()||this.batchBufferHasStrandedMessage()){this.sendBatch()}};Appender.prototype.onSendingEnded=function(){clearTimer(this.sendTimeoutTimer);this.nbrLogItemsBeingSent=0;this.sendBatchIfComplete()};Appender.prototype.setOptions=function(options){copyProperty("level",options,this);copyProperty("ipRegex",options,this);copyProperty("userAgentRegex",options,this);copyProperty("disallow",options,this);copyProperty("sendWithBufferLevel",options,this);copyProperty("storeInBufferLevel",options,this);copyProperty("bufferSize",options,this);copyProperty("batchSize",options,this);copyProperty("maxBatchSize",options,this);copyProperty("batchTimeout",options,this);copyProperty("sendTimeout",options,this);if(this.bufferSize<this.buffer.length){this.buffer.length=this.bufferSize}if(this.maxBatchSize<this.batchSize){throw new JL.Exception({message:"maxBatchSize cannot be smaller than batchSize",maxBatchSize:this.maxBatchSize,batchSize:this.batchSize})}return this};Appender.prototype.log=function(level,msg,meta,callback,levelNbr,message,loggerName){var logItem;if(!allow(this)){return}if(!allowMessage(this,message)){return}if(levelNbr<this.storeInBufferLevel){return}logItem=newLogItem(levelNbr,message,loggerName);if(levelNbr<this.level){if(this.bufferSize>0){this.buffer.push(logItem);if(this.buffer.length>this.bufferSize){this.buffer.shift()}}return}this.addLogItemsToBuffer([logItem]);if(levelNbr>=this.sendWithBufferLevel){if(this.buffer.length){this.addLogItemsToBuffer(this.buffer);this.buffer.length=0}}this.sendBatchIfComplete()};Appender.prototype.sendBatch=function(){if(this.nbrLogItemsBeingSent>0){return}clearTimer(this.batchTimeoutTimer);if(this.batchBuffer.length==0){return}this.nbrLogItemsBeingSent=this.batchBuffer.length;var that=this;setTimer(this.sendTimeoutTimer,this.sendTimeout,(function(){that.onSendingEnded.call(that)}));this.sendLogItems(this.batchBuffer,(function(){that.batchBuffer.splice(0,that.nbrLogItemsBeingSent);if(that.nbrLogItemsSkipped>0){that.batchBuffer.push(newLogItem(getWarnLevel(),"Lost "+that.nbrLogItemsSkipped+" messages. Either connection with the server was down or logging was disabled via the enabled option. Reduce lost messages by increasing the ajaxAppender option maxBatchSize.",that.appenderName));that.nbrLogItemsSkipped=0}that.onSendingEnded.call(that)}))};return Appender}();JL.Appender=Appender;var AjaxAppender=function(_super){__extends(AjaxAppender,_super);function AjaxAppender(appenderName){return _super.call(this,appenderName,AjaxAppender.prototype.sendLogItemsAjax)||this}AjaxAppender.prototype.setOptions=function(options){copyProperty("url",options,this);copyProperty("beforeSend",options,this);_super.prototype.setOptions.call(this,options);return this};AjaxAppender.prototype.sendLogItemsAjax=function(logItems,successCallback){try{if(!allow(this)){return}if(this.xhr&&this.xhr.readyState!=0&&this.xhr.readyState!=4){this.xhr.abort()}this.xhr=JL._createXMLHttpRequest();var ajaxUrl="/jsnlog.logger";if(!(JL.defaultAjaxUrl==null)){ajaxUrl=JL.defaultAjaxUrl}if(this.url){ajaxUrl=this.url}this.xhr.open("POST",ajaxUrl);this.xhr.setRequestHeader("Content-Type","application/json");this.xhr.setRequestHeader("JSNLog-RequestId",JL.requestId);var that=this;this.xhr.onreadystatechange=function(){if(that.xhr.readyState==4&&(that.xhr.status>=200&&that.xhr.status<300)){successCallback()}};var json={r:JL.requestId,lg:logItems};if(typeof this.beforeSend==="function"){this.beforeSend.call(this,this.xhr,json)}else if(typeof JL.defaultBeforeSend==="function"){JL.defaultBeforeSend.call(this,this.xhr,json)}var finalmsg=JSON.stringify(json);this.xhr.send(finalmsg)}catch(e){}};return AjaxAppender}(Appender);JL.AjaxAppender=AjaxAppender;var ConsoleAppender=function(_super){__extends(ConsoleAppender,_super);function ConsoleAppender(appenderName){return _super.call(this,appenderName,ConsoleAppender.prototype.sendLogItemsConsole)||this}ConsoleAppender.prototype.clog=function(logEntry){JL._console.log(logEntry)};ConsoleAppender.prototype.cerror=function(logEntry){if(JL._console.error){JL._console.error(logEntry)}else{this.clog(logEntry)}};ConsoleAppender.prototype.cwarn=function(logEntry){if(JL._console.warn){JL._console.warn(logEntry)}else{this.clog(logEntry)}};ConsoleAppender.prototype.cinfo=function(logEntry){if(JL._console.info){JL._console.info(logEntry)}else{this.clog(logEntry)}};ConsoleAppender.prototype.cdebug=function(logEntry){if(JL._console.debug){JL._console.debug(logEntry)}else{this.cinfo(logEntry)}};ConsoleAppender.prototype.sendLogItemsConsole=function(logItems,successCallback){try{if(!allow(this)){return}if(!JL._console){return}var i;for(i=0;i<logItems.length;++i){var li=logItems[i];var msg=li.n+": "+li.m;if(typeof window==="undefined"){msg=new Date(li.t)+" | "+msg}if(li.l<=JL.getDebugLevel()){this.cdebug(msg)}else if(li.l<=JL.getInfoLevel()){this.cinfo(msg)}else if(li.l<=JL.getWarnLevel()){this.cwarn(msg)}else{this.cerror(msg)}}}catch(e){}successCallback()};return ConsoleAppender}(Appender);JL.ConsoleAppender=ConsoleAppender;var Logger=function(){function Logger(loggerName){this.loggerName=loggerName;this.seenRegexes=[]}Logger.prototype.setOptions=function(options){copyProperty("level",options,this);copyProperty("userAgentRegex",options,this);copyProperty("disallow",options,this);copyProperty("ipRegex",options,this);copyProperty("appenders",options,this);copyProperty("onceOnly",options,this);this.seenRegexes=[];return this};Logger.prototype.buildExceptionObject=function(e){var excObject={};if(e.stack){excObject.stack=e.stack}else{excObject.e=e}if(e.message){excObject.message=e.message}if(e.name){excObject.name=e.name}if(e.data){excObject.data=e.data}if(e.inner){excObject.inner=this.buildExceptionObject(e.inner)}return excObject};Logger.prototype.log=function(level,logObject,e){var i=0;var compositeMessage;var excObject;if(!this.appenders){return this}if(level>=this.level&&allow(this)){if(e){excObject=this.buildExceptionObject(e);excObject.logData=stringifyLogObjectFunction(logObject)}else{excObject=logObject}compositeMessage=stringifyLogObject(excObject);if(allowMessage(this,compositeMessage.finalString)){if(this.onceOnly){i=this.onceOnly.length-1;while(i>=0){if(new RegExp(this.onceOnly[i]).test(compositeMessage.finalString)){if(this.seenRegexes[i]){return this}this.seenRegexes[i]=true}i--}}compositeMessage.meta=compositeMessage.meta||{};i=this.appenders.length-1;while(i>=0){this.appenders[i].log(levelToString(level),compositeMessage.msg,compositeMessage.meta,(function(){}),level,compositeMessage.finalString,this.loggerName);i--}}}return this};Logger.prototype.trace=function(logObject){return this.log(getTraceLevel(),logObject)};Logger.prototype.debug=function(logObject){return this.log(getDebugLevel(),logObject)};Logger.prototype.info=function(logObject){return this.log(getInfoLevel(),logObject)};Logger.prototype.warn=function(logObject){return this.log(getWarnLevel(),logObject)};Logger.prototype.error=function(logObject){return this.log(getErrorLevel(),logObject)};Logger.prototype.fatal=function(logObject){return this.log(getFatalLevel(),logObject)};Logger.prototype.fatalException=function(logObject,e){return this.log(getFatalLevel(),logObject,e)};return Logger}();JL.Logger=Logger;function createAjaxAppender(appenderName){return new AjaxAppender(appenderName)}JL.createAjaxAppender=createAjaxAppender;function createConsoleAppender(appenderName){return new ConsoleAppender(appenderName)}JL.createConsoleAppender=createConsoleAppender;var defaultAppender;if(typeof window!=="undefined"){defaultAppender=new AjaxAppender("")}else{defaultAppender=new ConsoleAppender("")}JL.__=new JL.Logger("");JL.__.setOptions({level:JL.getDebugLevel(),appenders:[defaultAppender]})})(JL||(JL={}));if(typeof exports!=="undefined"){exports.__esModule=true;exports.JL=JL}var define;if(typeof define=="function"&&define.amd){define("jsnlog",[],(function(){return JL}))}if(typeof __jsnlog_configure=="function"){__jsnlog_configure(JL)}if(typeof window!=="undefined"&&!window.onerror){window.onerror=function(errorMsg,url,lineNumber,column,errorObj){JL("onerrorLogger").fatalException({msg:"Uncaught Exception",errorMsg:errorMsg?errorMsg.message||errorMsg:"",url:url,"line number":lineNumber,column:column},errorObj);return false}}if(typeof window!=="undefined"&&!window.onunhandledrejection){window.onunhandledrejection=function(event){JL("onerrorLogger").fatalException({msg:"unhandledrejection",errorMsg:event.reason?event.reason.message:event.message||null},event.reason)}}},{}],8:[function(require,module,exports){"use strict";function Mime(){this._types=Object.create(null);this._extensions=Object.create(null);for(let i=0;i<arguments.length;i++){this.define(arguments[i])}this.define=this.define.bind(this);this.getType=this.getType.bind(this);this.getExtension=this.getExtension.bind(this)}Mime.prototype.define=function(typeMap,force){for(let type in typeMap){let extensions=typeMap[type].map((function(t){return t.toLowerCase()}));type=type.toLowerCase();for(let i=0;i<extensions.length;i++){const ext=extensions[i];if(ext[0]==="*"){continue}if(!force&&ext in this._types){throw new Error('Attempt to change mapping for "'+ext+'" extension from "'+this._types[ext]+'" to "'+type+'". Pass `force=true` to allow this, otherwise remove "'+ext+'" from the list of extensions for "'+type+'".')}this._types[ext]=type}if(force||!this._extensions[type]){const ext=extensions[0];this._extensions[type]=ext[0]!=="*"?ext:ext.substr(1)}}};Mime.prototype.getType=function(path){path=String(path);let last=path.replace(/^.*[/\\]/,"").toLowerCase();let ext=last.replace(/^.*\./,"").toLowerCase();let hasPath=last.length<path.length;let hasDot=ext.length<last.length-1;return(hasDot||!hasPath)&&this._types[ext]||null};Mime.prototype.getExtension=function(type){type=/^\s*([^;\s]*)/.test(type)&&RegExp.$1;return type&&this._extensions[type.toLowerCase()]||null};module.exports=Mime},{}],9:[function(require,module,exports){"use strict";let Mime=require("./Mime");module.exports=new Mime(require("./types/standard"))},{"./Mime":8,"./types/standard":10}],10:[function(require,module,exports){module.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}],11:[function(require,module,exports){var protocols=["stun:","turn:"];module.exports=function(input){var url=(input||{}).url||input;var protocol;var parts;var output={};if(typeof url!="string"&&!(url instanceof String)){return input}url=url.trim();protocol=protocols[protocols.indexOf(url.slice(0,5))];if(!protocol){return input}url=url.slice(5);parts=url.split("@");output.username=input.username;output.credential=input.credential;if(parts.length>1){url=parts[1];parts=parts[0].split(":");output.username=parts[0];output.credential=(input||{}).credential||parts[1]||""}output.url=protocol+url;output.urls=[output.url];return output}},{}],12:[function(require,module,exports){(function(global){(function(){(function(){"use strict";var objectTypes={function:true,object:true};var root=objectTypes[typeof window]&&window||this;var oldRoot=root;var freeExports=objectTypes[typeof exports]&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)){root=freeGlobal}var maxSafeInteger=Math.pow(2,53)-1;var reOpera=/\bOpera/;var thisBinding=this;var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;var toString=objectProto.toString;function capitalize(string){string=String(string);return string.charAt(0).toUpperCase()+string.slice(1)}function cleanupOS(os,pattern,label){var data={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};if(pattern&&label&&/^Win/i.test(os)&&!/^Windows Phone /i.test(os)&&(data=data[/[\d.]+$/.exec(os)])){os="Windows "+data}os=String(os);if(pattern&&label){os=os.replace(RegExp(pattern,"i"),label)}os=format(os.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0]);return os}function each(object,callback){var index=-1,length=object?object.length:0;if(typeof length=="number"&&length>-1&&length<=maxSafeInteger){while(++index<length){callback(object[index],index,object)}}else{forOwn(object,callback)}}function format(string){string=trim(string);return/^(?:webOS|i(?:OS|P))/.test(string)?string:capitalize(string)}function forOwn(object,callback){for(var key in object){if(hasOwnProperty.call(object,key)){callback(object[key],key,object)}}}function getClassOf(value){return value==null?capitalize(value):toString.call(value).slice(8,-1)}function isHostType(object,property){var type=object!=null?typeof object[property]:"number";return!/^(?:boolean|number|string|undefined)$/.test(type)&&(type=="object"?!!object[property]:true)}function qualify(string){return String(string).replace(/([ -])(?!$)/g,"$1?")}function reduce(array,callback){var accumulator=null;each(array,(function(value,index){accumulator=callback(accumulator,value,index,array)}));return accumulator}function trim(string){return String(string).replace(/^ +| +$/g,"")}function parse(ua){var context=root;var isCustomContext=ua&&typeof ua=="object"&&getClassOf(ua)!="String";if(isCustomContext){context=ua;ua=null}var nav=context.navigator||{};var userAgent=nav.userAgent||"";ua||(ua=userAgent);var isModuleScope=isCustomContext||thisBinding==oldRoot;var likeChrome=isCustomContext?!!nav.likeChrome:/\bChrome\b/.test(ua)&&!/internal|\n/i.test(toString.toString());var objectClass="Object",airRuntimeClass=isCustomContext?objectClass:"ScriptBridgingProxyObject",enviroClass=isCustomContext?objectClass:"Environment",javaClass=isCustomContext&&context.java?"JavaPackage":getClassOf(context.java),phantomClass=isCustomContext?objectClass:"RuntimeObject";var java=/\bJava/.test(javaClass)&&context.java;var rhino=java&&getClassOf(context.environment)==enviroClass;var alpha=java?"a":"α";var beta=java?"b":"β";var doc=context.document||{};var opera=context.operamini||context.opera;var operaClass=reOpera.test(operaClass=isCustomContext&&opera?opera["[[Class]]"]:getClassOf(opera))?operaClass:opera=null;var data;var arch=ua;var description=[];var prerelease=null;var useFeatures=ua==userAgent;var version=useFeatures&&opera&&typeof opera.version=="function"&&opera.version();var isSpecialCasedOS;var layout=getLayout([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]);var name=getName(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]);var product=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]);var manufacturer=getManufacturer({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}});var os=getOS(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getLayout(guesses){return reduce(guesses,(function(result,guess){return result||RegExp("\\b"+(guess.pattern||qualify(guess))+"\\b","i").exec(ua)&&(guess.label||guess)}))}function getManufacturer(guesses){return reduce(guesses,(function(result,value,key){return result||(value[product]||value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)]||RegExp("\\b"+qualify(key)+"(?:\\b|\\w*\\d)","i").exec(ua))&&key}))}function getName(guesses){return reduce(guesses,(function(result,guess){return result||RegExp("\\b"+(guess.pattern||qualify(guess))+"\\b","i").exec(ua)&&(guess.label||guess)}))}function getOS(guesses){return reduce(guesses,(function(result,guess){var pattern=guess.pattern||qualify(guess);if(!result&&(result=RegExp("\\b"+pattern+"(?:/[\\d.]+|[ \\w.]*)","i").exec(ua))){result=cleanupOS(result,pattern,guess.label||guess)}return result}))}function getProduct(guesses){return reduce(guesses,(function(result,guess){var pattern=guess.pattern||qualify(guess);if(!result&&(result=RegExp("\\b"+pattern+" *\\d+[.\\w_]*","i").exec(ua)||RegExp("\\b"+pattern+" *\\w+-[\\w]*","i").exec(ua)||RegExp("\\b"+pattern+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(ua))){if((result=String(guess.label&&!RegExp(pattern,"i").test(guess.label)?guess.label:result).split("/"))[1]&&!/[\d.]+/.test(result[0])){result[0]+=" "+result[1]}guess=guess.label||guess;result=format(result[0].replace(RegExp(pattern,"i"),guess).replace(RegExp("; *(?:"+guess+"[_-])?","i")," ").replace(RegExp("("+guess+")[-_.]?(\\w)","i"),"$1 $2"))}return result}))}function getVersion(patterns){return reduce(pat