livekit-client 1.9.3 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/dist/livekit-client.esm.mjs +125 -908
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +2 -3
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +1 -2
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +1 -0
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +0 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/timers.d.ts +4 -5
- package/dist/src/room/timers.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/utils/AsyncQueue.d.ts +23 -0
- package/dist/src/utils/AsyncQueue.d.ts.map +1 -0
- package/dist/src/utils/browserParser.d.ts +10 -0
- package/dist/src/utils/browserParser.d.ts.map +1 -0
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -3
- package/dist/ts4.2/src/room/PCTransport.d.ts +1 -2
- package/dist/ts4.2/src/room/Room.d.ts +1 -0
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +0 -1
- package/dist/ts4.2/src/room/timers.d.ts +4 -5
- package/dist/ts4.2/src/utils/AsyncQueue.d.ts +23 -0
- package/dist/ts4.2/src/utils/browserParser.d.ts +10 -0
- package/package.json +11 -22
- package/src/api/SignalClient.ts +4 -5
- package/src/connectionHelper/ConnectionCheck.ts +1 -1
- package/src/room/PCTransport.ts +1 -1
- package/src/room/Room.ts +5 -2
- package/src/room/participant/LocalParticipant.ts +0 -1
- package/src/room/utils.ts +17 -16
- package/src/utils/AsyncQueue.test.ts +99 -0
- package/src/utils/AsyncQueue.ts +57 -0
- package/src/utils/browserParser.test.ts +58 -0
- package/src/utils/browserParser.ts +72 -0
@@ -6978,158 +6978,6 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
6978
6978
|
}
|
6979
6979
|
}
|
6980
6980
|
var eventsExports = events.exports;
|
6981
|
-
var EventEmitter$1 = /*@__PURE__*/getDefaultExportFromCjs(eventsExports);
|
6982
|
-
|
6983
|
-
class Queue {
|
6984
|
-
/**
|
6985
|
-
* @class Queue
|
6986
|
-
*
|
6987
|
-
* Priority queue with rate limiting<br>
|
6988
|
-
* See the medium article:<br>
|
6989
|
-
* https://mmomtchev.medium.com/parallelizing-download-loops-in-js-with-async-await-queue-670420880cd6
|
6990
|
-
*
|
6991
|
-
* @param {number} [_maxConcurrent=1] Number of tasks allowed to run simultaneously
|
6992
|
-
* @param {number} [_minCycle=0] Minimum number of milliseconds between two consecutive tasks
|
6993
|
-
*/
|
6994
|
-
constructor(_maxConcurrent, _minCycle) {
|
6995
|
-
this.maxConcurrent = _maxConcurrent || 1;
|
6996
|
-
this.minCycle = _minCycle || 0;
|
6997
|
-
this.queueRunning = [];
|
6998
|
-
this.queueWaiting = {};
|
6999
|
-
this.lastRun = 0;
|
7000
|
-
}
|
7001
|
-
|
7002
|
-
/** @private */
|
7003
|
-
dequeue(hash) {
|
7004
|
-
const q = this.queueRunning;
|
7005
|
-
const idx = q.findIndex(x => x.hash === hash);
|
7006
|
-
if (idx == -1) throw 'queue desync';
|
7007
|
-
const o = q[idx];
|
7008
|
-
q.splice(idx, 1);
|
7009
|
-
return o;
|
7010
|
-
}
|
7011
|
-
|
7012
|
-
/** @private */
|
7013
|
-
getFirstWaiting() {
|
7014
|
-
for (let p of Object.keys(this.queueWaiting).sort((a, b) => a - b)) if (this.queueWaiting[p] !== undefined && this.queueWaiting[p].length > 0) return this.queueWaiting[p];
|
7015
|
-
return undefined;
|
7016
|
-
}
|
7017
|
-
|
7018
|
-
/**
|
7019
|
-
* Signal that the task `hash` has finished.<br>
|
7020
|
-
* Frees its slot in the queue
|
7021
|
-
*
|
7022
|
-
* @method end
|
7023
|
-
* @param {any} hash Unique hash identifying the task, Symbol() works very well
|
7024
|
-
*/
|
7025
|
-
end(hash) {
|
7026
|
-
const me = this.dequeue(hash);
|
7027
|
-
me.resolve();
|
7028
|
-
/* Choose the next task to run and unblock its promise */
|
7029
|
-
const q = this.getFirstWaiting();
|
7030
|
-
if (q !== undefined) {
|
7031
|
-
const next = q.shift();
|
7032
|
-
next.resolve();
|
7033
|
-
}
|
7034
|
-
}
|
7035
|
-
|
7036
|
-
/**
|
7037
|
-
* Wait for a slot in the queue
|
7038
|
-
*
|
7039
|
-
* @method wait
|
7040
|
-
* @param {any} hash Unique hash identifying the task
|
7041
|
-
* @param {number} [priority=0] Optional priority, -1 is higher priority than 1
|
7042
|
-
* @return {Promise<void>} Resolved when the task is ready to run
|
7043
|
-
*/
|
7044
|
-
async wait(hash, _priority) {
|
7045
|
-
const priority = _priority === undefined ? 0 : _priority;
|
7046
|
-
/* Us on the queue */
|
7047
|
-
let me = {
|
7048
|
-
hash,
|
7049
|
-
priority
|
7050
|
-
};
|
7051
|
-
/* Create priorities on the fly */
|
7052
|
-
if (this.queueWaiting[priority] == undefined) this.queueWaiting[priority] = [];
|
7053
|
-
|
7054
|
-
/* Are we allowed to run? */
|
7055
|
-
if (this.queueRunning.length >= this.maxConcurrent) {
|
7056
|
-
/* This promise will be unlocked from the outside */
|
7057
|
-
/* and it cannot reject */
|
7058
|
-
me.promise = new Promise(resolve => {
|
7059
|
-
me.resolve = resolve;
|
7060
|
-
});
|
7061
|
-
/* Get in the line */
|
7062
|
-
this.queueWaiting[priority].push(me);
|
7063
|
-
await me.promise;
|
7064
|
-
}
|
7065
|
-
this.queueRunning.push(me);
|
7066
|
-
me.promise = new Promise(resolve => {
|
7067
|
-
me.resolve = resolve;
|
7068
|
-
});
|
7069
|
-
/* Wait if it is too soon */
|
7070
|
-
while (Date.now() - this.lastRun < this.minCycle) {
|
7071
|
-
await new Promise(resolve => setTimeout(resolve, this.minCycle - Date.now() + this.lastRun));
|
7072
|
-
}
|
7073
|
-
this.lastRun = Date.now();
|
7074
|
-
}
|
7075
|
-
|
7076
|
-
/**
|
7077
|
-
* Run a job (equivalent to calling Queue.wait(), fn() and then Queue.end())<br>
|
7078
|
-
* fn can be both synchronous or asynchronous function
|
7079
|
-
*
|
7080
|
-
* @method run
|
7081
|
-
* @param {Function} fn The job
|
7082
|
-
* @param {number} [priority=0] Optional priority, -1 is higher priority than 1
|
7083
|
-
* @return {Promise<any>} Resolved when the task has finished with the return value of fn
|
7084
|
-
*/
|
7085
|
-
run(job, _priority) {
|
7086
|
-
const priority = _priority === undefined ? 0 : _priority;
|
7087
|
-
const id = Symbol();
|
7088
|
-
return this.wait(id, priority).then(() => job()).finally(() => {
|
7089
|
-
this.end(id);
|
7090
|
-
});
|
7091
|
-
}
|
7092
|
-
|
7093
|
-
/**
|
7094
|
-
* @interface QueueStats {running: number, waiting: number, last: number}
|
7095
|
-
*/
|
7096
|
-
|
7097
|
-
/**
|
7098
|
-
* Return the number of running and waiting jobs
|
7099
|
-
*
|
7100
|
-
* @method stat
|
7101
|
-
* @return {QueueStats} running, waiting, last
|
7102
|
-
*/
|
7103
|
-
stat() {
|
7104
|
-
return {
|
7105
|
-
running: this.queueRunning.length,
|
7106
|
-
waiting: Object.keys(this.queueWaiting).reduce((t, x) => t += this.queueWaiting[x].length, 0),
|
7107
|
-
last: this.lastRun
|
7108
|
-
};
|
7109
|
-
}
|
7110
|
-
|
7111
|
-
/**
|
7112
|
-
* Returns a promise that resolves when the queue is empty
|
7113
|
-
*
|
7114
|
-
* @method flush
|
7115
|
-
* @return {Promise<void>}
|
7116
|
-
*/
|
7117
|
-
async flush() {
|
7118
|
-
/* Aways wait on the lowest priority in the queue */
|
7119
|
-
while (this.stat().waiting > 0) {
|
7120
|
-
for (let p of Object.keys(this.queueWaiting).sort((a, b) => b - a)) {
|
7121
|
-
const qp = this.queueWaiting[p];
|
7122
|
-
if (qp !== undefined && qp.length > 0) {
|
7123
|
-
await qp[qp.length - 1].promise;
|
7124
|
-
}
|
7125
|
-
}
|
7126
|
-
}
|
7127
|
-
/* And then finish on the running queue */
|
7128
|
-
while (this.queueRunning.length > 0) {
|
7129
|
-
await Promise.allSettled(this.queueRunning.map(x => x.promise));
|
7130
|
-
}
|
7131
|
-
}
|
7132
|
-
}
|
7133
6981
|
|
7134
6982
|
/*
|
7135
6983
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
@@ -14153,745 +14001,66 @@ CriticalTimers.clearInterval = function () {
|
|
14153
14001
|
return clearInterval(...arguments);
|
14154
14002
|
};
|
14155
14003
|
|
14156
|
-
|
14157
|
-
|
14158
|
-
|
14159
|
-
|
14160
|
-
|
14161
|
-
|
14162
|
-
|
14163
|
-
|
14164
|
-
|
14165
|
-
|
14166
|
-
|
14167
|
-
|
14168
|
-
|
14169
|
-
|
14170
|
-
|
14171
|
-
|
14172
|
-
|
14173
|
-
|
14174
|
-
|
14175
|
-
|
14176
|
-
|
14177
|
-
|
14178
|
-
|
14179
|
-
|
14180
|
-
|
14181
|
-
|
14182
|
-
|
14183
|
-
|
14184
|
-
|
14185
|
-
|
14186
|
-
VERSION = 'version',
|
14187
|
-
ARCHITECTURE = 'architecture',
|
14188
|
-
CONSOLE = 'console',
|
14189
|
-
MOBILE = 'mobile',
|
14190
|
-
TABLET = 'tablet',
|
14191
|
-
SMARTTV = 'smarttv',
|
14192
|
-
WEARABLE = 'wearable',
|
14193
|
-
EMBEDDED = 'embedded',
|
14194
|
-
UA_MAX_LENGTH = 350;
|
14195
|
-
var AMAZON = 'Amazon',
|
14196
|
-
APPLE = 'Apple',
|
14197
|
-
ASUS = 'ASUS',
|
14198
|
-
BLACKBERRY = 'BlackBerry',
|
14199
|
-
BROWSER = 'Browser',
|
14200
|
-
CHROME = 'Chrome',
|
14201
|
-
EDGE = 'Edge',
|
14202
|
-
FIREFOX = 'Firefox',
|
14203
|
-
GOOGLE = 'Google',
|
14204
|
-
HUAWEI = 'Huawei',
|
14205
|
-
LG = 'LG',
|
14206
|
-
MICROSOFT = 'Microsoft',
|
14207
|
-
MOTOROLA = 'Motorola',
|
14208
|
-
OPERA = 'Opera',
|
14209
|
-
SAMSUNG = 'Samsung',
|
14210
|
-
SHARP = 'Sharp',
|
14211
|
-
SONY = 'Sony',
|
14212
|
-
XIAOMI = 'Xiaomi',
|
14213
|
-
ZEBRA = 'Zebra',
|
14214
|
-
FACEBOOK = 'Facebook',
|
14215
|
-
CHROMIUM_OS = 'Chromium OS',
|
14216
|
-
MAC_OS = 'Mac OS';
|
14217
|
-
|
14218
|
-
///////////
|
14219
|
-
// Helper
|
14220
|
-
//////////
|
14221
|
-
|
14222
|
-
var extend = function (regexes, extensions) {
|
14223
|
-
var mergedRegexes = {};
|
14224
|
-
for (var i in regexes) {
|
14225
|
-
if (extensions[i] && extensions[i].length % 2 === 0) {
|
14226
|
-
mergedRegexes[i] = extensions[i].concat(regexes[i]);
|
14227
|
-
} else {
|
14228
|
-
mergedRegexes[i] = regexes[i];
|
14229
|
-
}
|
14230
|
-
}
|
14231
|
-
return mergedRegexes;
|
14232
|
-
},
|
14233
|
-
enumerize = function (arr) {
|
14234
|
-
var enums = {};
|
14235
|
-
for (var i = 0; i < arr.length; i++) {
|
14236
|
-
enums[arr[i].toUpperCase()] = arr[i];
|
14237
|
-
}
|
14238
|
-
return enums;
|
14239
|
-
},
|
14240
|
-
has = function (str1, str2) {
|
14241
|
-
return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
|
14242
|
-
},
|
14243
|
-
lowerize = function (str) {
|
14244
|
-
return str.toLowerCase();
|
14245
|
-
},
|
14246
|
-
majorize = function (version) {
|
14247
|
-
return typeof version === STR_TYPE ? version.replace(/[^\d\.]/g, EMPTY).split('.')[0] : undefined$1;
|
14248
|
-
},
|
14249
|
-
trim = function (str, len) {
|
14250
|
-
if (typeof str === STR_TYPE) {
|
14251
|
-
str = str.replace(/^\s\s*/, EMPTY);
|
14252
|
-
return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
|
14253
|
-
}
|
14254
|
-
};
|
14255
|
-
|
14256
|
-
///////////////
|
14257
|
-
// Map helper
|
14258
|
-
//////////////
|
14259
|
-
|
14260
|
-
var rgxMapper = function (ua, arrays) {
|
14261
|
-
var i = 0,
|
14262
|
-
j,
|
14263
|
-
k,
|
14264
|
-
p,
|
14265
|
-
q,
|
14266
|
-
matches,
|
14267
|
-
match;
|
14268
|
-
|
14269
|
-
// loop through all regexes maps
|
14270
|
-
while (i < arrays.length && !matches) {
|
14271
|
-
var regex = arrays[i],
|
14272
|
-
// even sequence (0,2,4,..)
|
14273
|
-
props = arrays[i + 1]; // odd sequence (1,3,5,..)
|
14274
|
-
j = k = 0;
|
14275
|
-
|
14276
|
-
// try matching uastring with regexes
|
14277
|
-
while (j < regex.length && !matches) {
|
14278
|
-
if (!regex[j]) {
|
14279
|
-
break;
|
14280
|
-
}
|
14281
|
-
matches = regex[j++].exec(ua);
|
14282
|
-
if (!!matches) {
|
14283
|
-
for (p = 0; p < props.length; p++) {
|
14284
|
-
match = matches[++k];
|
14285
|
-
q = props[p];
|
14286
|
-
// check if given property is actually array
|
14287
|
-
if (typeof q === OBJ_TYPE && q.length > 0) {
|
14288
|
-
if (q.length === 2) {
|
14289
|
-
if (typeof q[1] == FUNC_TYPE) {
|
14290
|
-
// assign modified match
|
14291
|
-
this[q[0]] = q[1].call(this, match);
|
14292
|
-
} else {
|
14293
|
-
// assign given value, ignore regex match
|
14294
|
-
this[q[0]] = q[1];
|
14295
|
-
}
|
14296
|
-
} else if (q.length === 3) {
|
14297
|
-
// check whether function or regex
|
14298
|
-
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
|
14299
|
-
// call function (usually string mapper)
|
14300
|
-
this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined$1;
|
14301
|
-
} else {
|
14302
|
-
// sanitize match using given regex
|
14303
|
-
this[q[0]] = match ? match.replace(q[1], q[2]) : undefined$1;
|
14304
|
-
}
|
14305
|
-
} else if (q.length === 4) {
|
14306
|
-
this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined$1;
|
14307
|
-
}
|
14308
|
-
} else {
|
14309
|
-
this[q] = match ? match : undefined$1;
|
14310
|
-
}
|
14311
|
-
}
|
14312
|
-
}
|
14313
|
-
}
|
14314
|
-
i += 2;
|
14315
|
-
}
|
14316
|
-
},
|
14317
|
-
strMapper = function (str, map) {
|
14318
|
-
for (var i in map) {
|
14319
|
-
// check if current value is array
|
14320
|
-
if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {
|
14321
|
-
for (var j = 0; j < map[i].length; j++) {
|
14322
|
-
if (has(map[i][j], str)) {
|
14323
|
-
return i === UNKNOWN ? undefined$1 : i;
|
14324
|
-
}
|
14325
|
-
}
|
14326
|
-
} else if (has(map[i], str)) {
|
14327
|
-
return i === UNKNOWN ? undefined$1 : i;
|
14328
|
-
}
|
14329
|
-
}
|
14330
|
-
return str;
|
14331
|
-
};
|
14332
|
-
|
14333
|
-
///////////////
|
14334
|
-
// String map
|
14335
|
-
//////////////
|
14336
|
-
|
14337
|
-
// Safari < 3.0
|
14338
|
-
var oldSafariMap = {
|
14339
|
-
'1.0': '/8',
|
14340
|
-
'1.2': '/1',
|
14341
|
-
'1.3': '/3',
|
14342
|
-
'2.0': '/412',
|
14343
|
-
'2.0.2': '/416',
|
14344
|
-
'2.0.3': '/417',
|
14345
|
-
'2.0.4': '/419',
|
14346
|
-
'?': '/'
|
14347
|
-
},
|
14348
|
-
windowsVersionMap = {
|
14349
|
-
'ME': '4.90',
|
14350
|
-
'NT 3.11': 'NT3.51',
|
14351
|
-
'NT 4.0': 'NT4.0',
|
14352
|
-
'2000': 'NT 5.0',
|
14353
|
-
'XP': ['NT 5.1', 'NT 5.2'],
|
14354
|
-
'Vista': 'NT 6.0',
|
14355
|
-
'7': 'NT 6.1',
|
14356
|
-
'8': 'NT 6.2',
|
14357
|
-
'8.1': 'NT 6.3',
|
14358
|
-
'10': ['NT 6.4', 'NT 10.0'],
|
14359
|
-
'RT': 'ARM'
|
14360
|
-
};
|
14361
|
-
|
14362
|
-
//////////////
|
14363
|
-
// Regex map
|
14364
|
-
/////////////
|
14365
|
-
|
14366
|
-
var regexes = {
|
14367
|
-
browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS
|
14368
|
-
], [VERSION, [NAME, 'Chrome']], [/edg(?:e|ios|a)?\/([\w\.]+)/i // Microsoft Edge
|
14369
|
-
], [VERSION, [NAME, 'Edge']], [
|
14370
|
-
// Presto based
|
14371
|
-
/(opera mini)\/([-\w\.]+)/i,
|
14372
|
-
// Opera Mini
|
14373
|
-
/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
|
14374
|
-
// Opera Mobi/Tablet
|
14375
|
-
/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i // Opera
|
14376
|
-
], [NAME, VERSION], [/opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0
|
14377
|
-
], [VERSION, [NAME, OPERA + ' Mini']], [/\bopr\/([\w\.]+)/i // Opera Webkit
|
14378
|
-
], [VERSION, [NAME, OPERA]], [
|
14379
|
-
// Mixed
|
14380
|
-
/(kindle)\/([\w\.]+)/i,
|
14381
|
-
// Kindle
|
14382
|
-
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
|
14383
|
-
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
14384
|
-
// Trident based
|
14385
|
-
/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,
|
14386
|
-
// Avant/IEMobile/SlimBrowser
|
14387
|
-
/(ba?idubrowser)[\/ ]?([\w\.]+)/i,
|
14388
|
-
// Baidu Browser
|
14389
|
-
/(?:ms|\()(ie) ([\w\.]+)/i,
|
14390
|
-
// Internet Explorer
|
14391
|
-
|
14392
|
-
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
14393
|
-
/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
14394
|
-
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
|
14395
|
-
/(heytap|ovi)browser\/([\d\.]+)/i,
|
14396
|
-
// Heytap/Ovi
|
14397
|
-
/(weibo)__([\d\.]+)/i // Weibo
|
14398
|
-
], [NAME, VERSION], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
|
14399
|
-
], [VERSION, [NAME, 'UC' + BROWSER]], [/microm.+\bqbcore\/([\w\.]+)/i,
|
14400
|
-
// WeChat Desktop for Windows Built-in Browser
|
14401
|
-
/\bqbcore\/([\w\.]+).+microm/i], [VERSION, [NAME, 'WeChat(Win) Desktop']], [/micromessenger\/([\w\.]+)/i // WeChat
|
14402
|
-
], [VERSION, [NAME, 'WeChat']], [/konqueror\/([\w\.]+)/i // Konqueror
|
14403
|
-
], [VERSION, [NAME, 'Konqueror']], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
|
14404
|
-
], [VERSION, [NAME, 'IE']], [/ya(?:search)?browser\/([\w\.]+)/i // Yandex
|
14405
|
-
], [VERSION, [NAME, 'Yandex']], [/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
|
14406
|
-
], [[NAME, /(.+)/, '$1 Secure ' + BROWSER], VERSION], [/\bfocus\/([\w\.]+)/i // Firefox Focus
|
14407
|
-
], [VERSION, [NAME, FIREFOX + ' Focus']], [/\bopt\/([\w\.]+)/i // Opera Touch
|
14408
|
-
], [VERSION, [NAME, OPERA + ' Touch']], [/coc_coc\w+\/([\w\.]+)/i // Coc Coc Browser
|
14409
|
-
], [VERSION, [NAME, 'Coc Coc']], [/dolfin\/([\w\.]+)/i // Dolphin
|
14410
|
-
], [VERSION, [NAME, 'Dolphin']], [/coast\/([\w\.]+)/i // Opera Coast
|
14411
|
-
], [VERSION, [NAME, OPERA + ' Coast']], [/miuibrowser\/([\w\.]+)/i // MIUI Browser
|
14412
|
-
], [VERSION, [NAME, 'MIUI ' + BROWSER]], [/fxios\/([-\w\.]+)/i // Firefox for iOS
|
14413
|
-
], [VERSION, [NAME, FIREFOX]], [/\bqihu|(qi?ho?o?|360)browser/i // 360
|
14414
|
-
], [[NAME, '360 ' + BROWSER]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[NAME, /(.+)/, '$1 ' + BROWSER], VERSION], [
|
14415
|
-
// Oculus/Samsung/Sailfish/Huawei Browser
|
14416
|
-
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
|
14417
|
-
], [[NAME, /_/g, ' '], VERSION], [/(electron)\/([\w\.]+) safari/i,
|
14418
|
-
// Electron-based App
|
14419
|
-
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
|
14420
|
-
// Tesla
|
14421
|
-
/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/Baidu App/2345 Browser
|
14422
|
-
], [NAME, VERSION], [/(metasr)[\/ ]?([\w\.]+)/i,
|
14423
|
-
// SouGouBrowser
|
14424
|
-
/(lbbrowser)/i,
|
14425
|
-
// LieBao Browser
|
14426
|
-
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android
|
14427
|
-
], [NAME], [
|
14428
|
-
// WebView
|
14429
|
-
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android
|
14430
|
-
], [[NAME, FACEBOOK], VERSION], [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
|
14431
|
-
// Kakao App
|
14432
|
-
/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
|
14433
|
-
// Naver InApp
|
14434
|
-
/safari (line)\/([\w\.]+)/i,
|
14435
|
-
// Line App for iOS
|
14436
|
-
/\b(line)\/([\w\.]+)\/iab/i,
|
14437
|
-
// Line App for Android
|
14438
|
-
/(chromium|instagram)[\/ ]([-\w\.]+)/i // Chromium/Instagram
|
14439
|
-
], [NAME, VERSION], [/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
|
14440
|
-
], [VERSION, [NAME, 'GSA']], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
|
14441
|
-
], [VERSION, [NAME, 'TikTok']], [/headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless
|
14442
|
-
], [VERSION, [NAME, CHROME + ' Headless']], [/ wv\).+(chrome)\/([\w\.]+)/i // Chrome WebView
|
14443
|
-
], [[NAME, CHROME + ' WebView'], VERSION], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i // Android Browser
|
14444
|
-
], [VERSION, [NAME, 'Android ' + BROWSER]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia
|
14445
|
-
], [NAME, VERSION], [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i // Mobile Safari
|
14446
|
-
], [VERSION, [NAME, 'Mobile Safari']], [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile
|
14447
|
-
], [VERSION, NAME], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i // Safari < 3.0
|
14448
|
-
], [NAME, [VERSION, strMapper, oldSafariMap]], [/(webkit|khtml)\/([\w\.]+)/i], [NAME, VERSION], [
|
14449
|
-
// Gecko based
|
14450
|
-
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
|
14451
|
-
], [[NAME, 'Netscape'], VERSION], [/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality
|
14452
|
-
], [VERSION, [NAME, FIREFOX + ' Reality']], [/ekiohf.+(flow)\/([\w\.]+)/i,
|
14453
|
-
// Flow
|
14454
|
-
/(swiftfox)/i,
|
14455
|
-
// Swiftfox
|
14456
|
-
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
|
14457
|
-
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
|
14458
|
-
/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
|
14459
|
-
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
14460
|
-
/(firefox)\/([\w\.]+)/i,
|
14461
|
-
// Other Firefox-based
|
14462
|
-
/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
|
14463
|
-
// Mozilla
|
14464
|
-
|
14465
|
-
// Other
|
14466
|
-
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
|
14467
|
-
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
|
14468
|
-
/(links) \(([\w\.]+)/i,
|
14469
|
-
// Links
|
14470
|
-
/panasonic;(viera)/i // Panasonic Viera
|
14471
|
-
], [NAME, VERSION], [/(cobalt)\/([\w\.]+)/i // Cobalt
|
14472
|
-
], [NAME, [VERSION, /master.|lts./, ""]]],
|
14473
|
-
cpu: [[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i // AMD64 (x64)
|
14474
|
-
], [[ARCHITECTURE, 'amd64']], [/(ia32(?=;))/i // IA32 (quicktime)
|
14475
|
-
], [[ARCHITECTURE, lowerize]], [/((?:i[346]|x)86)[;\)]/i // IA32 (x86)
|
14476
|
-
], [[ARCHITECTURE, 'ia32']], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i // ARM64
|
14477
|
-
], [[ARCHITECTURE, 'arm64']], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i // ARMHF
|
14478
|
-
], [[ARCHITECTURE, 'armhf']], [
|
14479
|
-
// PocketPC mistakenly identified as PowerPC
|
14480
|
-
/windows (ce|mobile); ppc;/i], [[ARCHITECTURE, 'arm']], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i // PowerPC
|
14481
|
-
], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [/(sun4\w)[;\)]/i // SPARC
|
14482
|
-
], [[ARCHITECTURE, 'sparc']], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
14483
|
-
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
14484
|
-
], [[ARCHITECTURE, lowerize]]],
|
14485
|
-
device: [[
|
14486
|
-
//////////////////////////
|
14487
|
-
// MOBILES & TABLETS
|
14488
|
-
/////////////////////////
|
14489
|
-
|
14490
|
-
// Samsung
|
14491
|
-
/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [
|
14492
|
-
// Apple
|
14493
|
-
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i // iPod/iPhone
|
14494
|
-
], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [/\((ipad);[-\w\),; ]+apple/i,
|
14495
|
-
// iPad
|
14496
|
-
/applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [/(macintosh);/i], [MODEL, [VENDOR, APPLE]], [
|
14497
|
-
// Sharp
|
14498
|
-
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [
|
14499
|
-
// Huawei
|
14500
|
-
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [
|
14501
|
-
// Xiaomi
|
14502
|
-
/\b(poco[\w ]+)(?: bui|\))/i,
|
14503
|
-
// Xiaomi POCO
|
14504
|
-
/\b; (\w+) build\/hm\1/i,
|
14505
|
-
// Xiaomi Hongmi 'numeric' models
|
14506
|
-
/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
|
14507
|
-
// Xiaomi Hongmi
|
14508
|
-
/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
|
14509
|
-
// Xiaomi Redmi
|
14510
|
-
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i // Xiaomi Mi
|
14511
|
-
], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i // Mi Pad tablets
|
14512
|
-
], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [
|
14513
|
-
// OPPO
|
14514
|
-
/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [
|
14515
|
-
// Vivo
|
14516
|
-
/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [
|
14517
|
-
// Realme
|
14518
|
-
/\b(rmx[12]\d{3})(?: bui|;|\))/i], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [
|
14519
|
-
// Motorola
|
14520
|
-
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [
|
14521
|
-
// LG
|
14522
|
-
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [
|
14523
|
-
// Lenovo
|
14524
|
-
/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
|
14525
|
-
// Nokia
|
14526
|
-
/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [
|
14527
|
-
// Google
|
14528
|
-
/(pixel c)\b/i // Google Pixel C
|
14529
|
-
], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i // Google Pixel
|
14530
|
-
], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [
|
14531
|
-
// Sony
|
14532
|
-
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [
|
14533
|
-
// OnePlus
|
14534
|
-
/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [
|
14535
|
-
// Amazon
|
14536
|
-
/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,
|
14537
|
-
// Kindle Fire without Silk / Echo Show
|
14538
|
-
/(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD
|
14539
|
-
], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone
|
14540
|
-
], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [
|
14541
|
-
// BlackBerry
|
14542
|
-
/(playbook);[-\w\),; ]+(rim)/i // BlackBerry PlayBook
|
14543
|
-
], [MODEL, VENDOR, [TYPE, TABLET]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i // BlackBerry 10
|
14544
|
-
], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [
|
14545
|
-
// Asus
|
14546
|
-
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [
|
14547
|
-
// HTC
|
14548
|
-
/(nexus 9)/i // HTC Nexus 9
|
14549
|
-
], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
|
14550
|
-
// HTC
|
14551
|
-
|
14552
|
-
// ZTE
|
14553
|
-
/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
|
14554
|
-
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
14555
|
-
// Acer
|
14556
|
-
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [
|
14557
|
-
// Meizu
|
14558
|
-
/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [
|
14559
|
-
// MIXED
|
14560
|
-
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,
|
14561
|
-
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
|
14562
|
-
/(hp) ([\w ]+\w)/i,
|
14563
|
-
// HP iPAQ
|
14564
|
-
/(asus)-?(\w+)/i,
|
14565
|
-
// Asus
|
14566
|
-
/(microsoft); (lumia[\w ]+)/i,
|
14567
|
-
// Microsoft Lumia
|
14568
|
-
/(lenovo)[-_ ]?([-\w]+)/i,
|
14569
|
-
// Lenovo
|
14570
|
-
/(jolla)/i,
|
14571
|
-
// Jolla
|
14572
|
-
/(oppo) ?([\w ]+) bui/i // OPPO
|
14573
|
-
], [VENDOR, MODEL, [TYPE, MOBILE]], [/(kobo)\s(ereader|touch)/i,
|
14574
|
-
// Kobo
|
14575
|
-
/(archos) (gamepad2?)/i,
|
14576
|
-
// Archos
|
14577
|
-
/(hp).+(touchpad(?!.+tablet)|tablet)/i,
|
14578
|
-
// HP TouchPad
|
14579
|
-
/(kindle)\/([\w\.]+)/i,
|
14580
|
-
// Kindle
|
14581
|
-
/(nook)[\w ]+build\/(\w+)/i,
|
14582
|
-
// Nook
|
14583
|
-
/(dell) (strea[kpr\d ]*[\dko])/i,
|
14584
|
-
// Dell Streak
|
14585
|
-
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
|
14586
|
-
// Le Pan Tablets
|
14587
|
-
/(trinity)[- ]*(t\d{3}) bui/i,
|
14588
|
-
// Trinity Tablets
|
14589
|
-
/(gigaset)[- ]+(q\w{1,9}) bui/i,
|
14590
|
-
// Gigaset Tablets
|
14591
|
-
/(vodafone) ([\w ]+)(?:\)| bui)/i // Vodafone
|
14592
|
-
], [VENDOR, MODEL, [TYPE, TABLET]], [/(surface duo)/i // Surface Duo
|
14593
|
-
], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i // Fairphone
|
14594
|
-
], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [/(u304aa)/i // AT&T
|
14595
|
-
], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [/\bsie-(\w*)/i // Siemens
|
14596
|
-
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [/\b(rct\w+) b/i // RCA Tablets
|
14597
|
-
], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [/\b(venue[\d ]{2,7}) b/i // Dell Venue Tablets
|
14598
|
-
], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [/\b(q(?:mv|ta)\w+) b/i // Verizon Tablet
|
14599
|
-
], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i // Barnes & Noble Tablet
|
14600
|
-
], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [/\b(tm\d{3}\w+) b/i], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [/\b(k88) b/i // ZTE K Series Tablet
|
14601
|
-
], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [/\b(nx\d{3}j) b/i // ZTE Nubia
|
14602
|
-
], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [/\b(gen\d{3}) b.+49h/i // Swiss GEN Mobile
|
14603
|
-
], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [/\b(zur\d{3}) b/i // Swiss ZUR Tablet
|
14604
|
-
], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [/\b((zeki)?tb.*\b) b/i // Zeki Tablets
|
14605
|
-
], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i // Dragon Touch Tablet
|
14606
|
-
], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [/\b(ns-?\w{0,9}) b/i // Insignia Tablets
|
14607
|
-
], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [/\b((nxa|next)-?\w{0,9}) b/i // NextBook Tablets
|
14608
|
-
], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones
|
14609
|
-
], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [/\b(lvtel\-)?(v1[12]) b/i // LvTel Phones
|
14610
|
-
], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [/\b(ph-1) /i // Essential PH-1
|
14611
|
-
], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [/\b(v(100md|700na|7011|917g).*\b) b/i // Envizen Tablets
|
14612
|
-
], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [/\b(trio[-\w\. ]+) b/i // MachSpeed Tablets
|
14613
|
-
], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [/\btu_(1491) b/i // Rotor Tablets
|
14614
|
-
], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [/(shield[\w ]+) b/i // Nvidia Shield Tablets
|
14615
|
-
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [/(sprint) (\w+)/i // Sprint Phones
|
14616
|
-
], [VENDOR, MODEL, [TYPE, MOBILE]], [/(kin\.[onetw]{3})/i // Microsoft Kin
|
14617
|
-
], [[MODEL, /\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i // Zebra
|
14618
|
-
], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [
|
14619
|
-
///////////////////
|
14620
|
-
// SMARTTVS
|
14621
|
-
///////////////////
|
14622
|
-
|
14623
|
-
/smart-tv.+(samsung)/i // Samsung
|
14624
|
-
], [VENDOR, [TYPE, SMARTTV]], [/hbbtv.+maple;(\d+)/i], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i // LG SmartTV
|
14625
|
-
], [[VENDOR, LG], [TYPE, SMARTTV]], [/(apple) ?tv/i // Apple TV
|
14626
|
-
], [VENDOR, [MODEL, APPLE + ' TV'], [TYPE, SMARTTV]], [/crkey/i // Google Chromecast
|
14627
|
-
], [[MODEL, CHROME + 'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [/droid.+aft(\w)( bui|\))/i // Fire TV
|
14628
|
-
], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i // Sharp
|
14629
|
-
], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]], [/(bravia[\w ]+)( bui|\))/i // Sony
|
14630
|
-
], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [/(mitv-\w{5}) bui/i // Xiaomi
|
14631
|
-
], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [/Hbbtv.*(technisat) (.*);/i // TechniSAT
|
14632
|
-
], [VENDOR, MODEL, [TYPE, SMARTTV]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
14633
|
-
// Roku
|
14634
|
-
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i // HbbTV devices
|
14635
|
-
], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i // SmartTV from Unidentified Vendors
|
14636
|
-
], [[TYPE, SMARTTV]], [
|
14637
|
-
///////////////////
|
14638
|
-
// CONSOLES
|
14639
|
-
///////////////////
|
14640
|
-
|
14641
|
-
/(ouya)/i,
|
14642
|
-
// Ouya
|
14643
|
-
/(nintendo) ([wids3utch]+)/i // Nintendo
|
14644
|
-
], [VENDOR, MODEL, [TYPE, CONSOLE]], [/droid.+; (shield) bui/i // Nvidia
|
14645
|
-
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [/(playstation [345portablevi]+)/i // Playstation
|
14646
|
-
], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i // Microsoft Xbox
|
14647
|
-
], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [
|
14648
|
-
///////////////////
|
14649
|
-
// WEARABLES
|
14650
|
-
///////////////////
|
14651
|
-
|
14652
|
-
/((pebble))app/i // Pebble
|
14653
|
-
], [VENDOR, MODEL, [TYPE, WEARABLE]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch
|
14654
|
-
], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [/droid.+; (glass) \d/i // Google Glass
|
14655
|
-
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [/droid.+; (wt63?0{2,3})\)/i], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [/(quest( 2| pro)?)/i // Oculus Quest
|
14656
|
-
], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [
|
14657
|
-
///////////////////
|
14658
|
-
// EMBEDDED
|
14659
|
-
///////////////////
|
14660
|
-
|
14661
|
-
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla
|
14662
|
-
], [VENDOR, [TYPE, EMBEDDED]], [/(aeobc)\b/i // Echo Dot
|
14663
|
-
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
|
14664
|
-
////////////////////
|
14665
|
-
// MIXED (GENERIC)
|
14666
|
-
///////////////////
|
14667
|
-
|
14668
|
-
/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors
|
14669
|
-
], [MODEL, [TYPE, MOBILE]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors
|
14670
|
-
], [MODEL, [TYPE, TABLET]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i // Unidentifiable Tablet
|
14671
|
-
], [[TYPE, TABLET]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile
|
14672
|
-
], [[TYPE, MOBILE]], [/(android[-\w\. ]{0,9});.+buil/i // Generic Android Device
|
14673
|
-
], [MODEL, [VENDOR, 'Generic']]],
|
14674
|
-
engine: [[/windows.+ edge\/([\w\.]+)/i // EdgeHTML
|
14675
|
-
], [VERSION, [NAME, EDGE + 'HTML']], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink
|
14676
|
-
], [VERSION, [NAME, 'Blink']], [/(presto)\/([\w\.]+)/i,
|
14677
|
-
// Presto
|
14678
|
-
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
|
14679
|
-
// WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
14680
|
-
/ekioh(flow)\/([\w\.]+)/i,
|
14681
|
-
// Flow
|
14682
|
-
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
|
14683
|
-
// KHTML/Tasman/Links
|
14684
|
-
/(icab)[\/ ]([23]\.[\d\.]+)/i,
|
14685
|
-
// iCab
|
14686
|
-
/\b(libweb)/i], [NAME, VERSION], [/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
|
14687
|
-
], [VERSION, NAME]],
|
14688
|
-
os: [[
|
14689
|
-
// Windows
|
14690
|
-
/microsoft (windows) (vista|xp)/i // Windows (iTunes)
|
14691
|
-
], [NAME, VERSION], [/(windows) nt 6\.2; (arm)/i,
|
14692
|
-
// Windows RT
|
14693
|
-
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,
|
14694
|
-
// Windows Phone
|
14695
|
-
/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i], [NAME, [VERSION, strMapper, windowsVersionMap]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [
|
14696
|
-
// iOS/macOS
|
14697
|
-
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
14698
|
-
// iOS
|
14699
|
-
/ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS
|
14700
|
-
], [[NAME, MAC_OS], [VERSION, /_/g, '.']], [
|
14701
|
-
// Mobile OSes
|
14702
|
-
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS
|
14703
|
-
], [VERSION, NAME], [
|
14704
|
-
// Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
|
14705
|
-
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i,
|
14706
|
-
// Blackberry
|
14707
|
-
/(tizen|kaios)[\/ ]([\w\.]+)/i,
|
14708
|
-
// Tizen/KaiOS
|
14709
|
-
/\((series40);/i // Series 40
|
14710
|
-
], [NAME, VERSION], [/\(bb(10);/i // BlackBerry 10
|
14711
|
-
], [VERSION, [NAME, BLACKBERRY]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i // Symbian
|
14712
|
-
], [VERSION, [NAME, 'Symbian']], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i // Firefox OS
|
14713
|
-
], [VERSION, [NAME, FIREFOX + ' OS']], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS
|
14714
|
-
], [VERSION, [NAME, 'webOS']], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i // watchOS
|
14715
|
-
], [VERSION, [NAME, 'watchOS']], [
|
14716
|
-
// Google Chromecast
|
14717
|
-
/crkey\/([\d\.]+)/i // Google Chromecast
|
14718
|
-
], [VERSION, [NAME, CHROME + 'cast']], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS
|
14719
|
-
], [[NAME, CHROMIUM_OS], VERSION], [
|
14720
|
-
// Smart TVs
|
14721
|
-
/panasonic;(viera)/i,
|
14722
|
-
// Panasonic Viera
|
14723
|
-
/(netrange)mmh/i,
|
14724
|
-
// Netrange
|
14725
|
-
/(nettv)\/(\d+\.[\w\.]+)/i,
|
14726
|
-
// NetTV
|
14727
|
-
|
14728
|
-
// Console
|
14729
|
-
/(nintendo|playstation) ([wids345portablevuch]+)/i,
|
14730
|
-
// Nintendo/Playstation
|
14731
|
-
/(xbox); +xbox ([^\);]+)/i,
|
14732
|
-
// Microsoft Xbox (360, One, X, S, Series X, Series S)
|
14733
|
-
|
14734
|
-
// Other
|
14735
|
-
/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
|
14736
|
-
// Joli/Palm
|
14737
|
-
/(mint)[\/\(\) ]?(\w*)/i,
|
14738
|
-
// Mint
|
14739
|
-
/(mageia|vectorlinux)[; ]/i,
|
14740
|
-
// Mageia/VectorLinux
|
14741
|
-
/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
|
14742
|
-
// Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
|
14743
|
-
/(hurd|linux) ?([\w\.]*)/i,
|
14744
|
-
// Hurd/Linux
|
14745
|
-
/(gnu) ?([\w\.]*)/i,
|
14746
|
-
// GNU
|
14747
|
-
/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
|
14748
|
-
// FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
|
14749
|
-
/(haiku) (\w+)/i // Haiku
|
14750
|
-
], [NAME, VERSION], [/(sunos) ?([\w\.\d]*)/i // Solaris
|
14751
|
-
], [[NAME, 'Solaris'], VERSION], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
|
14752
|
-
// Solaris
|
14753
|
-
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
|
14754
|
-
// AIX
|
14755
|
-
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,
|
14756
|
-
// BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
|
14757
|
-
/(unix) ?([\w\.]*)/i // UNIX
|
14758
|
-
], [NAME, VERSION]]
|
14004
|
+
// tiny, simplified version of https://github.com/lancedikson/bowser/blob/master/src/parser-browsers.js
|
14005
|
+
// reduced to only differentiate Chrome(ium) based browsers / Firefox / Safari
|
14006
|
+
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
14007
|
+
let browserDetails;
|
14008
|
+
/**
|
14009
|
+
* @internal
|
14010
|
+
*/
|
14011
|
+
function getBrowser(userAgent) {
|
14012
|
+
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
14013
|
+
if (userAgent === undefined && (typeof document !== 'undefined' || typeof navigator === 'undefined')) {
|
14014
|
+
return;
|
14015
|
+
}
|
14016
|
+
const ua = (userAgent !== null && userAgent !== void 0 ? userAgent : navigator.userAgent).toLowerCase();
|
14017
|
+
if (browserDetails === undefined || force) {
|
14018
|
+
const browser = browsersList.find(_ref => {
|
14019
|
+
let {
|
14020
|
+
test
|
14021
|
+
} = _ref;
|
14022
|
+
return test.test(ua);
|
14023
|
+
});
|
14024
|
+
browserDetails = browser === null || browser === void 0 ? void 0 : browser.describe(ua);
|
14025
|
+
}
|
14026
|
+
return browserDetails;
|
14027
|
+
}
|
14028
|
+
const browsersList = [{
|
14029
|
+
test: /firefox|iceweasel|fxios/i,
|
14030
|
+
describe(ua) {
|
14031
|
+
const browser = {
|
14032
|
+
name: 'Firefox',
|
14033
|
+
version: getMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua)
|
14759
14034
|
};
|
14760
|
-
|
14761
|
-
|
14762
|
-
|
14763
|
-
|
14764
|
-
|
14765
|
-
|
14766
|
-
|
14767
|
-
|
14768
|
-
ua = undefined$1;
|
14769
|
-
}
|
14770
|
-
if (!(this instanceof UAParser)) {
|
14771
|
-
return new UAParser(ua, extensions).getResult();
|
14772
|
-
}
|
14773
|
-
var _navigator = typeof window !== UNDEF_TYPE && window.navigator ? window.navigator : undefined$1;
|
14774
|
-
var _ua = ua || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY);
|
14775
|
-
var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined$1;
|
14776
|
-
var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
|
14777
|
-
var _isSelfNav = _navigator && _navigator.userAgent == _ua;
|
14778
|
-
this.getBrowser = function () {
|
14779
|
-
var _browser = {};
|
14780
|
-
_browser[NAME] = undefined$1;
|
14781
|
-
_browser[VERSION] = undefined$1;
|
14782
|
-
rgxMapper.call(_browser, _ua, _rgxmap.browser);
|
14783
|
-
_browser[MAJOR] = majorize(_browser[VERSION]);
|
14784
|
-
// Brave-specific detection
|
14785
|
-
if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
14786
|
-
_browser[NAME] = 'Brave';
|
14787
|
-
}
|
14788
|
-
return _browser;
|
14789
|
-
};
|
14790
|
-
this.getCPU = function () {
|
14791
|
-
var _cpu = {};
|
14792
|
-
_cpu[ARCHITECTURE] = undefined$1;
|
14793
|
-
rgxMapper.call(_cpu, _ua, _rgxmap.cpu);
|
14794
|
-
return _cpu;
|
14795
|
-
};
|
14796
|
-
this.getDevice = function () {
|
14797
|
-
var _device = {};
|
14798
|
-
_device[VENDOR] = undefined$1;
|
14799
|
-
_device[MODEL] = undefined$1;
|
14800
|
-
_device[TYPE] = undefined$1;
|
14801
|
-
rgxMapper.call(_device, _ua, _rgxmap.device);
|
14802
|
-
if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {
|
14803
|
-
_device[TYPE] = MOBILE;
|
14804
|
-
}
|
14805
|
-
// iPadOS-specific detection: identified as Mac, but has some iOS-only properties
|
14806
|
-
if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
14807
|
-
_device[MODEL] = 'iPad';
|
14808
|
-
_device[TYPE] = TABLET;
|
14809
|
-
}
|
14810
|
-
return _device;
|
14811
|
-
};
|
14812
|
-
this.getEngine = function () {
|
14813
|
-
var _engine = {};
|
14814
|
-
_engine[NAME] = undefined$1;
|
14815
|
-
_engine[VERSION] = undefined$1;
|
14816
|
-
rgxMapper.call(_engine, _ua, _rgxmap.engine);
|
14817
|
-
return _engine;
|
14818
|
-
};
|
14819
|
-
this.getOS = function () {
|
14820
|
-
var _os = {};
|
14821
|
-
_os[NAME] = undefined$1;
|
14822
|
-
_os[VERSION] = undefined$1;
|
14823
|
-
rgxMapper.call(_os, _ua, _rgxmap.os);
|
14824
|
-
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
14825
|
-
_os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS); // backward compatibility
|
14826
|
-
}
|
14827
|
-
|
14828
|
-
return _os;
|
14829
|
-
};
|
14830
|
-
this.getResult = function () {
|
14831
|
-
return {
|
14832
|
-
ua: this.getUA(),
|
14833
|
-
browser: this.getBrowser(),
|
14834
|
-
engine: this.getEngine(),
|
14835
|
-
os: this.getOS(),
|
14836
|
-
device: this.getDevice(),
|
14837
|
-
cpu: this.getCPU()
|
14838
|
-
};
|
14839
|
-
};
|
14840
|
-
this.getUA = function () {
|
14841
|
-
return _ua;
|
14842
|
-
};
|
14843
|
-
this.setUA = function (ua) {
|
14844
|
-
_ua = typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH ? trim(ua, UA_MAX_LENGTH) : ua;
|
14845
|
-
return this;
|
14846
|
-
};
|
14847
|
-
this.setUA(_ua);
|
14848
|
-
return this;
|
14035
|
+
return browser;
|
14036
|
+
}
|
14037
|
+
}, {
|
14038
|
+
test: /chrom|crios|crmo/i,
|
14039
|
+
describe(ua) {
|
14040
|
+
const browser = {
|
14041
|
+
name: 'Chrome',
|
14042
|
+
version: getMatch(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua)
|
14849
14043
|
};
|
14850
|
-
|
14851
|
-
|
14852
|
-
|
14853
|
-
|
14854
|
-
|
14855
|
-
|
14856
|
-
|
14857
|
-
|
14858
|
-
|
14859
|
-
|
14860
|
-
|
14861
|
-
|
14862
|
-
|
14863
|
-
|
14864
|
-
|
14865
|
-
|
14866
|
-
|
14867
|
-
|
14868
|
-
|
14869
|
-
// jQuery/Zepto specific (optional)
|
14870
|
-
// Note:
|
14871
|
-
// In AMD env the global scope should be kept clean, but jQuery is an exception.
|
14872
|
-
// jQuery always exports to global scope, unless jQuery.noConflict(true) is used,
|
14873
|
-
// and we should catch that.
|
14874
|
-
var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto);
|
14875
|
-
if ($ && !$.ua) {
|
14876
|
-
var parser = new UAParser();
|
14877
|
-
$.ua = parser.getResult();
|
14878
|
-
$.ua.get = function () {
|
14879
|
-
return parser.getUA();
|
14880
|
-
};
|
14881
|
-
$.ua.set = function (ua) {
|
14882
|
-
parser.setUA(ua);
|
14883
|
-
var result = parser.getResult();
|
14884
|
-
for (var prop in result) {
|
14885
|
-
$.ua[prop] = result[prop];
|
14886
|
-
}
|
14887
|
-
};
|
14888
|
-
}
|
14889
|
-
})(typeof window === 'object' ? window : commonjsGlobal);
|
14890
|
-
})(uaParser, uaParser.exports);
|
14891
|
-
var uaParserExports = uaParser.exports;
|
14892
|
-
var UAParser = /*@__PURE__*/getDefaultExportFromCjs(uaParserExports);
|
14044
|
+
return browser;
|
14045
|
+
}
|
14046
|
+
}, /* Safari */
|
14047
|
+
{
|
14048
|
+
test: /safari|applewebkit/i,
|
14049
|
+
describe(ua) {
|
14050
|
+
const browser = {
|
14051
|
+
name: 'Safari',
|
14052
|
+
version: getMatch(commonVersionIdentifier, ua)
|
14053
|
+
};
|
14054
|
+
return browser;
|
14055
|
+
}
|
14056
|
+
}];
|
14057
|
+
function getMatch(exp, ua) {
|
14058
|
+
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
14059
|
+
const match = ua.match(exp);
|
14060
|
+
return match && match.length >= id && match[id] || '';
|
14061
|
+
}
|
14893
14062
|
|
14894
|
-
var version$1 = "1.9.
|
14063
|
+
var version$1 = "1.9.5";
|
14895
14064
|
|
14896
14065
|
const version = version$1;
|
14897
14066
|
const protocolVersion = 9;
|
@@ -15065,11 +14234,8 @@ function supportsSetSinkId(elm) {
|
|
15065
14234
|
}
|
15066
14235
|
const setCodecPreferencesVersions = {
|
15067
14236
|
Chrome: '100',
|
15068
|
-
Chromium: '100',
|
15069
14237
|
Safari: '15',
|
15070
|
-
Firefox: '100'
|
15071
|
-
Edge: '100',
|
15072
|
-
Brave: '1.40'
|
14238
|
+
Firefox: '100'
|
15073
14239
|
};
|
15074
14240
|
function supportsSetCodecPreferences(transceiver) {
|
15075
14241
|
if (!isWeb()) {
|
@@ -15078,14 +14244,14 @@ function supportsSetCodecPreferences(transceiver) {
|
|
15078
14244
|
if (!('setCodecPreferences' in transceiver)) {
|
15079
14245
|
return false;
|
15080
14246
|
}
|
15081
|
-
const
|
15082
|
-
if (!
|
14247
|
+
const browser = getBrowser();
|
14248
|
+
if (!(browser === null || browser === void 0 ? void 0 : browser.name) || !browser.version) {
|
15083
14249
|
// version is required
|
15084
14250
|
return false;
|
15085
14251
|
}
|
15086
|
-
const v = setCodecPreferencesVersions[
|
14252
|
+
const v = setCodecPreferencesVersions[browser.name];
|
15087
14253
|
if (v) {
|
15088
|
-
return compareVersions(
|
14254
|
+
return compareVersions(browser.version, v) >= 0;
|
15089
14255
|
}
|
15090
14256
|
return false;
|
15091
14257
|
}
|
@@ -15093,16 +14259,16 @@ function isBrowserSupported() {
|
|
15093
14259
|
return supportsTransceiver() || supportsAddTrack();
|
15094
14260
|
}
|
15095
14261
|
function isFireFox() {
|
15096
|
-
|
15097
|
-
return
|
14262
|
+
var _a;
|
14263
|
+
return ((_a = getBrowser()) === null || _a === void 0 ? void 0 : _a.name) === 'Firefox';
|
15098
14264
|
}
|
15099
14265
|
function isChromiumBased() {
|
15100
|
-
|
15101
|
-
return
|
14266
|
+
var _a;
|
14267
|
+
return ((_a = getBrowser()) === null || _a === void 0 ? void 0 : _a.name) === 'Chrome';
|
15102
14268
|
}
|
15103
14269
|
function isSafari() {
|
15104
|
-
|
15105
|
-
return
|
14270
|
+
var _a;
|
14271
|
+
return ((_a = getBrowser()) === null || _a === void 0 ? void 0 : _a.name) === 'Safari';
|
15106
14272
|
}
|
15107
14273
|
function isMobile() {
|
15108
14274
|
if (!isWeb()) return false;
|
@@ -15152,12 +14318,18 @@ function getDevicePixelRatio() {
|
|
15152
14318
|
function compareVersions(v1, v2) {
|
15153
14319
|
const parts1 = v1.split('.');
|
15154
14320
|
const parts2 = v2.split('.');
|
15155
|
-
const k = Math.min(
|
14321
|
+
const k = Math.min(parts1.length, parts2.length);
|
15156
14322
|
for (let i = 0; i < k; ++i) {
|
15157
14323
|
const p1 = parseInt(parts1[i], 10);
|
15158
14324
|
const p2 = parseInt(parts2[i], 10);
|
15159
14325
|
if (p1 > p2) return 1;
|
15160
14326
|
if (p1 < p2) return -1;
|
14327
|
+
if (i === k - 1 && p1 === p2) return 0;
|
14328
|
+
}
|
14329
|
+
if (v1 === '' && v2 !== '') {
|
14330
|
+
return -1;
|
14331
|
+
} else if (v2 === '') {
|
14332
|
+
return 1;
|
15161
14333
|
}
|
15162
14334
|
return parts1.length == parts2.length ? 0 : parts1.length < parts2.length ? -1 : 1;
|
15163
14335
|
}
|
@@ -15333,9 +14505,51 @@ class Mutex {
|
|
15333
14505
|
}
|
15334
14506
|
}
|
15335
14507
|
|
14508
|
+
var QueueTaskStatus;
|
14509
|
+
(function (QueueTaskStatus) {
|
14510
|
+
QueueTaskStatus[QueueTaskStatus["WAITING"] = 0] = "WAITING";
|
14511
|
+
QueueTaskStatus[QueueTaskStatus["RUNNING"] = 1] = "RUNNING";
|
14512
|
+
QueueTaskStatus[QueueTaskStatus["COMPLETED"] = 2] = "COMPLETED";
|
14513
|
+
})(QueueTaskStatus || (QueueTaskStatus = {}));
|
14514
|
+
class AsyncQueue {
|
14515
|
+
constructor() {
|
14516
|
+
this.pendingTasks = new Map();
|
14517
|
+
this.taskMutex = new Mutex();
|
14518
|
+
this.nextTaskIndex = 0;
|
14519
|
+
}
|
14520
|
+
run(task) {
|
14521
|
+
return __awaiter(this, void 0, void 0, function* () {
|
14522
|
+
const taskInfo = {
|
14523
|
+
id: this.nextTaskIndex++,
|
14524
|
+
enqueuedAt: Date.now(),
|
14525
|
+
status: QueueTaskStatus.WAITING
|
14526
|
+
};
|
14527
|
+
this.pendingTasks.set(taskInfo.id, taskInfo);
|
14528
|
+
const unlock = yield this.taskMutex.lock();
|
14529
|
+
try {
|
14530
|
+
taskInfo.executedAt = Date.now();
|
14531
|
+
taskInfo.status = QueueTaskStatus.RUNNING;
|
14532
|
+
return yield task();
|
14533
|
+
} finally {
|
14534
|
+
taskInfo.status = QueueTaskStatus.COMPLETED;
|
14535
|
+
this.pendingTasks.delete(taskInfo.id);
|
14536
|
+
unlock();
|
14537
|
+
}
|
14538
|
+
});
|
14539
|
+
}
|
14540
|
+
flush() {
|
14541
|
+
return __awaiter(this, void 0, void 0, function* () {
|
14542
|
+
return this.run(() => __awaiter(this, void 0, void 0, function* () {}));
|
14543
|
+
});
|
14544
|
+
}
|
14545
|
+
snapshot() {
|
14546
|
+
return Array.from(this.pendingTasks.values());
|
14547
|
+
}
|
14548
|
+
}
|
14549
|
+
|
15336
14550
|
const passThroughQueueSignals = ['syncState', 'trickle', 'offer', 'answer', 'simulate', 'leave'];
|
15337
14551
|
function canPassThroughQueue(req) {
|
15338
|
-
const canPass = passThroughQueueSignals.
|
14552
|
+
const canPass = passThroughQueueSignals.indexOf(req.$case) >= 0;
|
15339
14553
|
livekitLogger.trace('request allowed to bypass queue:', {
|
15340
14554
|
canPass,
|
15341
14555
|
req
|
@@ -15351,7 +14565,7 @@ class SignalClient {
|
|
15351
14565
|
this.isConnected = false;
|
15352
14566
|
this.isReconnecting = false;
|
15353
14567
|
this.useJSON = useJSON;
|
15354
|
-
this.requestQueue = new
|
14568
|
+
this.requestQueue = new AsyncQueue();
|
15355
14569
|
this.queuedRequests = [];
|
15356
14570
|
this.closingLock = new Mutex();
|
15357
14571
|
}
|
@@ -16671,7 +15885,7 @@ const PCEvents = {
|
|
16671
15885
|
NegotiationComplete: 'negotiationComplete'
|
16672
15886
|
};
|
16673
15887
|
/** @internal */
|
16674
|
-
class PCTransport extends EventEmitter
|
15888
|
+
class PCTransport extends eventsExports.EventEmitter {
|
16675
15889
|
constructor(config) {
|
16676
15890
|
let mediaConstraints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
16677
15891
|
super();
|
@@ -23528,7 +22742,10 @@ class Room extends eventsExports.EventEmitter {
|
|
23528
22742
|
livekitLogger.warn('detected connection state mismatch', {
|
23529
22743
|
numFailures: consecutiveFailures
|
23530
22744
|
});
|
23531
|
-
if (consecutiveFailures >= 3)
|
22745
|
+
if (consecutiveFailures >= 3) {
|
22746
|
+
this.recreateEngine();
|
22747
|
+
this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, DisconnectReason.STATE_MISMATCH);
|
22748
|
+
}
|
23532
22749
|
} else {
|
23533
22750
|
consecutiveFailures = 0;
|
23534
22751
|
}
|
@@ -24092,7 +23309,7 @@ class WebSocketCheck extends Checker {
|
|
24092
23309
|
}
|
24093
23310
|
}
|
24094
23311
|
|
24095
|
-
class ConnectionCheck extends EventEmitter
|
23312
|
+
class ConnectionCheck extends eventsExports.EventEmitter {
|
24096
23313
|
constructor(url, token) {
|
24097
23314
|
super();
|
24098
23315
|
this.checkResults = new Map();
|