From cc14fbe36ec7ab89427d593f0f6aaefba6c153f5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 25 Nov 2019 12:45:53 +0000 Subject: [PATCH] Update to bowser 2.7.0 --- Vendorfile | 2 +- app/assets/javascripts/index.js | 5 +- vendor/assets/javascripts/bowser.js | 645 +--------------------------- 3 files changed, 5 insertions(+), 647 deletions(-) diff --git a/Vendorfile b/Vendorfile index ad59f91eb..cae3e295e 100644 --- a/Vendorfile +++ b/Vendorfile @@ -74,7 +74,7 @@ folder 'vendor/assets' do folder 'javascripts' do file 'html5shiv.js', 'https://raw.githubusercontent.com/aFarkas/html5shiv/master/src/html5shiv.js' - file 'bowser.js', 'https://github.com/lancedikson/bowser/releases/download/1.9.4/bowser.js' + file 'bowser.js', 'https://github.com/lancedikson/bowser/releases/download/2.7.0/es5.js' end folder 'swfobject' do diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 039cc0ef6..2087886fa 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -24,7 +24,8 @@ //= require querystring $(document).ready(function () { - var querystring = require("querystring-component"); + var querystring = require("querystring-component"), + browser = bowser.getParser(window.navigator.userAgent); var loaderTimeout; @@ -256,7 +257,7 @@ $(document).ready(function () { }; if (location.protocol === "http" || - bowser.check({ chrome: "53", firefox: "55" })) { + browser.satisfies({ chrome: ">=53", firefox: ">=55" })) { url = "http://127.0.0.1:8111/load_and_zoom?"; } else { url = "https://127.0.0.1:8112/load_and_zoom?"; diff --git a/vendor/assets/javascripts/bowser.js b/vendor/assets/javascripts/bowser.js index a06971f89..2f13003f0 100644 --- a/vendor/assets/javascripts/bowser.js +++ b/vendor/assets/javascripts/bowser.js @@ -1,644 +1 @@ -/*! - * Bowser - a browser detector - * https://github.com/ded/bowser - * MIT License | (c) Dustin Diaz 2015 - */ - -!function (root, name, definition) { - if (typeof module != 'undefined' && module.exports) module.exports = definition() - else if (typeof define == 'function' && define.amd) define(name, definition) - else root[name] = definition() -}(this, 'bowser', function () { - /** - * See useragents.js for examples of navigator.userAgent - */ - - var t = true - - function detect(ua) { - - function getFirstMatch(regex) { - var match = ua.match(regex); - return (match && match.length > 1 && match[1]) || ''; - } - - function getSecondMatch(regex) { - var match = ua.match(regex); - return (match && match.length > 1 && match[2]) || ''; - } - - var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() - , likeAndroid = /like android/i.test(ua) - , android = !likeAndroid && /android/i.test(ua) - , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) - , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) - , chromeos = /CrOS/.test(ua) - , silk = /silk/i.test(ua) - , sailfish = /sailfish/i.test(ua) - , tizen = /tizen/i.test(ua) - , webos = /(web|hpw)(o|0)s/i.test(ua) - , windowsphone = /windows phone/i.test(ua) - , samsungBrowser = /SamsungBrowser/i.test(ua) - , windows = !windowsphone && /windows/i.test(ua) - , mac = !iosdevice && !silk && /macintosh/i.test(ua) - , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) - , edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i) - , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) - , tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua) - , mobile = !tablet && /[^-]mobi/i.test(ua) - , xbox = /xbox/i.test(ua) - , result - - if (/opera/i.test(ua)) { - // an old Opera - result = { - name: 'Opera' - , opera: t - , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) - } - } else if (/opr\/|opios/i.test(ua)) { - // a new Opera - result = { - name: 'Opera' - , opera: t - , version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier - } - } - else if (/SamsungBrowser/i.test(ua)) { - result = { - name: 'Samsung Internet for Android' - , samsungBrowser: t - , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) - } - } - else if (/Whale/i.test(ua)) { - result = { - name: 'NAVER Whale browser' - , whale: t - , version: getFirstMatch(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/MZBrowser/i.test(ua)) { - result = { - name: 'MZ Browser' - , mzbrowser: t - , version: getFirstMatch(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/coast/i.test(ua)) { - result = { - name: 'Opera Coast' - , coast: t - , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) - } - } - else if (/focus/i.test(ua)) { - result = { - name: 'Focus' - , focus: t - , version: getFirstMatch(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/yabrowser/i.test(ua)) { - result = { - name: 'Yandex Browser' - , yandexbrowser: t - , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) - } - } - else if (/ucbrowser/i.test(ua)) { - result = { - name: 'UC Browser' - , ucbrowser: t - , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/mxios/i.test(ua)) { - result = { - name: 'Maxthon' - , maxthon: t - , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/epiphany/i.test(ua)) { - result = { - name: 'Epiphany' - , epiphany: t - , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/puffin/i.test(ua)) { - result = { - name: 'Puffin' - , puffin: t - , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) - } - } - else if (/sleipnir/i.test(ua)) { - result = { - name: 'Sleipnir' - , sleipnir: t - , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (/k-meleon/i.test(ua)) { - result = { - name: 'K-Meleon' - , kMeleon: t - , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) - } - } - else if (windowsphone) { - result = { - name: 'Windows Phone' - , osname: 'Windows Phone' - , windowsphone: t - } - if (edgeVersion) { - result.msedge = t - result.version = edgeVersion - } - else { - result.msie = t - result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) - } - } - else if (/msie|trident/i.test(ua)) { - result = { - name: 'Internet Explorer' - , msie: t - , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) - } - } else if (chromeos) { - result = { - name: 'Chrome' - , osname: 'Chrome OS' - , chromeos: t - , chromeBook: t - , chrome: t - , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) - } - } else if (/edg([ea]|ios)/i.test(ua)) { - result = { - name: 'Microsoft Edge' - , msedge: t - , version: edgeVersion - } - } - else if (/vivaldi/i.test(ua)) { - result = { - name: 'Vivaldi' - , vivaldi: t - , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier - } - } - else if (sailfish) { - result = { - name: 'Sailfish' - , osname: 'Sailfish OS' - , sailfish: t - , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) - } - } - else if (/seamonkey\//i.test(ua)) { - result = { - name: 'SeaMonkey' - , seamonkey: t - , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) - } - } - else if (/firefox|iceweasel|fxios/i.test(ua)) { - result = { - name: 'Firefox' - , firefox: t - , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) - } - if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { - result.firefoxos = t - result.osname = 'Firefox OS' - } - } - else if (silk) { - result = { - name: 'Amazon Silk' - , silk: t - , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) - } - } - else if (/phantom/i.test(ua)) { - result = { - name: 'PhantomJS' - , phantom: t - , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) - } - } - else if (/slimerjs/i.test(ua)) { - result = { - name: 'SlimerJS' - , slimer: t - , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) - } - } - else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { - result = { - name: 'BlackBerry' - , osname: 'BlackBerry OS' - , blackberry: t - , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) - } - } - else if (webos) { - result = { - name: 'WebOS' - , osname: 'WebOS' - , webos: t - , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) - }; - /touchpad\//i.test(ua) && (result.touchpad = t) - } - else if (/bada/i.test(ua)) { - result = { - name: 'Bada' - , osname: 'Bada' - , bada: t - , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) - }; - } - else if (tizen) { - result = { - name: 'Tizen' - , osname: 'Tizen' - , tizen: t - , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier - }; - } - else if (/qupzilla/i.test(ua)) { - result = { - name: 'QupZilla' - , qupzilla: t - , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier - } - } - else if (/chromium/i.test(ua)) { - result = { - name: 'Chromium' - , chromium: t - , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier - } - } - else if (/chrome|crios|crmo/i.test(ua)) { - result = { - name: 'Chrome' - , chrome: t - , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) - } - } - else if (android) { - result = { - name: 'Android' - , version: versionIdentifier - } - } - else if (/safari|applewebkit/i.test(ua)) { - result = { - name: 'Safari' - , safari: t - } - if (versionIdentifier) { - result.version = versionIdentifier - } - } - else if (iosdevice) { - result = { - name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' - } - // WTF: version is not part of user agent in web apps - if (versionIdentifier) { - result.version = versionIdentifier - } - } - else if(/googlebot/i.test(ua)) { - result = { - name: 'Googlebot' - , googlebot: t - , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier - } - } - else { - result = { - name: getFirstMatch(/^(.*)\/(.*) /), - version: getSecondMatch(/^(.*)\/(.*) /) - }; - } - - // set webkit or gecko flag for browsers based on these engines - if (!result.msedge && /(apple)?webkit/i.test(ua)) { - if (/(apple)?webkit\/537\.36/i.test(ua)) { - result.name = result.name || "Blink" - result.blink = t - } else { - result.name = result.name || "Webkit" - result.webkit = t - } - if (!result.version && versionIdentifier) { - result.version = versionIdentifier - } - } else if (!result.opera && /gecko\//i.test(ua)) { - result.name = result.name || "Gecko" - result.gecko = t - result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) - } - - // set OS flags for platforms that have multiple browsers - if (!result.windowsphone && (android || result.silk)) { - result.android = t - result.osname = 'Android' - } else if (!result.windowsphone && iosdevice) { - result[iosdevice] = t - result.ios = t - result.osname = 'iOS' - } else if (mac) { - result.mac = t - result.osname = 'macOS' - } else if (xbox) { - result.xbox = t - result.osname = 'Xbox' - } else if (windows) { - result.windows = t - result.osname = 'Windows' - } else if (linux) { - result.linux = t - result.osname = 'Linux' - } - - function getWindowsVersion (s) { - switch (s) { - case 'NT': return 'NT' - case 'XP': return 'XP' - case 'NT 5.0': return '2000' - case 'NT 5.1': return 'XP' - case 'NT 5.2': return '2003' - case 'NT 6.0': return 'Vista' - case 'NT 6.1': return '7' - case 'NT 6.2': return '8' - case 'NT 6.3': return '8.1' - case 'NT 10.0': return '10' - default: return undefined - } - } - - // OS version extraction - var osVersion = ''; - if (result.windows) { - osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i)) - } else if (result.windowsphone) { - osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); - } else if (result.mac) { - osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i); - osVersion = osVersion.replace(/[_\s]/g, '.'); - } else if (iosdevice) { - osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); - osVersion = osVersion.replace(/[_\s]/g, '.'); - } else if (android) { - osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); - } else if (result.webos) { - osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); - } else if (result.blackberry) { - osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); - } else if (result.bada) { - osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); - } else if (result.tizen) { - osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); - } - if (osVersion) { - result.osversion = osVersion; - } - - // device type extraction - var osMajorVersion = !result.windows && osVersion.split('.')[0]; - if ( - tablet - || nexusTablet - || iosdevice == 'ipad' - || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) - || result.silk - ) { - result.tablet = t - } else if ( - mobile - || iosdevice == 'iphone' - || iosdevice == 'ipod' - || android - || nexusMobile - || result.blackberry - || result.webos - || result.bada - ) { - result.mobile = t - } - - // Graded Browser Support - // http://developer.yahoo.com/yui/articles/gbs - if (result.msedge || - (result.msie && result.version >= 10) || - (result.yandexbrowser && result.version >= 15) || - (result.vivaldi && result.version >= 1.0) || - (result.chrome && result.version >= 20) || - (result.samsungBrowser && result.version >= 4) || - (result.whale && compareVersions([result.version, '1.0']) === 1) || - (result.mzbrowser && compareVersions([result.version, '6.0']) === 1) || - (result.focus && compareVersions([result.version, '1.0']) === 1) || - (result.firefox && result.version >= 20.0) || - (result.safari && result.version >= 6) || - (result.opera && result.version >= 10.0) || - (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || - (result.blackberry && result.version >= 10.1) - || (result.chromium && result.version >= 20) - ) { - result.a = t; - } - else if ((result.msie && result.version < 10) || - (result.chrome && result.version < 20) || - (result.firefox && result.version < 20.0) || - (result.safari && result.version < 6) || - (result.opera && result.version < 10.0) || - (result.ios && result.osversion && result.osversion.split(".")[0] < 6) - || (result.chromium && result.version < 20) - ) { - result.c = t - } else result.x = t - - return result - } - - var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '') - - bowser.test = function (browserList) { - for (var i = 0; i < browserList.length; ++i) { - var browserItem = browserList[i]; - if (typeof browserItem=== 'string') { - if (browserItem in bowser) { - return true; - } - } - } - return false; - } - - /** - * Get version precisions count - * - * @example - * getVersionPrecision("1.10.3") // 3 - * - * @param {string} version - * @return {number} - */ - function getVersionPrecision(version) { - return version.split(".").length; - } - - /** - * Array::map polyfill - * - * @param {Array} arr - * @param {Function} iterator - * @return {Array} - */ - function map(arr, iterator) { - var result = [], i; - if (Array.prototype.map) { - return Array.prototype.map.call(arr, iterator); - } - for (i = 0; i < arr.length; i++) { - result.push(iterator(arr[i])); - } - return result; - } - - /** - * Calculate browser version weight - * - * @example - * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 - * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 - * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 - * compareVersions(['1.10.2.1', '1.0800.2']); // -1 - * - * @param {Array} versions versions to compare - * @return {Number} comparison result - */ - function compareVersions(versions) { - // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 - var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); - var chunks = map(versions, function (version) { - var delta = precision - getVersionPrecision(version); - - // 2) "9" -> "9.0" (for precision = 2) - version = version + new Array(delta + 1).join(".0"); - - // 3) "9.0" -> ["000000000"", "000000009"] - return map(version.split("."), function (chunk) { - return new Array(20 - chunk.length).join("0") + chunk; - }).reverse(); - }); - - // iterate in reverse order by reversed chunks array - while (--precision >= 0) { - // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) - if (chunks[0][precision] > chunks[1][precision]) { - return 1; - } - else if (chunks[0][precision] === chunks[1][precision]) { - if (precision === 0) { - // all version chunks are same - return 0; - } - } - else { - return -1; - } - } - } - - /** - * Check if browser is unsupported - * - * @example - * bowser.isUnsupportedBrowser({ - * msie: "10", - * firefox: "23", - * chrome: "29", - * safari: "5.1", - * opera: "16", - * phantom: "534" - * }); - * - * @param {Object} minVersions map of minimal version to browser - * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map - * @param {String} [ua] user agent string - * @return {Boolean} - */ - function isUnsupportedBrowser(minVersions, strictMode, ua) { - var _bowser = bowser; - - // make strictMode param optional with ua param usage - if (typeof strictMode === 'string') { - ua = strictMode; - strictMode = void(0); - } - - if (strictMode === void(0)) { - strictMode = false; - } - if (ua) { - _bowser = detect(ua); - } - - var version = "" + _bowser.version; - for (var browser in minVersions) { - if (minVersions.hasOwnProperty(browser)) { - if (_bowser[browser]) { - if (typeof minVersions[browser] !== 'string') { - throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); - } - - // browser version and min supported version. - return compareVersions([version, minVersions[browser]]) < 0; - } - } - } - - return strictMode; // not found - } - - /** - * Check if browser is supported - * - * @param {Object} minVersions map of minimal version to browser - * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map - * @param {String} [ua] user agent string - * @return {Boolean} - */ - function check(minVersions, strictMode, ua) { - return !isUnsupportedBrowser(minVersions, strictMode, ua); - } - - bowser.isUnsupportedBrowser = isUnsupportedBrowser; - bowser.compareVersions = compareVersions; - bowser.check = check; - - /* - * Set our detect method to the main bowser object so we can - * reuse it to test other user agents. - * This is needed to implement future tests. - */ - bowser._detect = detect; - - /* - * Set our detect public method to the main bowser object - * This is needed to implement bowser in server side - */ - bowser.detect = detect; - return bowser -}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bowser=t():e.bowser=t()}(this,(function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var i=r(18),n=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,i){void 0===i&&(i=!1);var n=e.getVersionPrecision(t),s=e.getVersionPrecision(r),o=Math.max(n,s),a=0,u=e.map([t,r],(function(t){var r=o-e.getVersionPrecision(t),i=t+new Array(r+1).join(".0");return e.map(i.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(i&&(a=o-Math.min(n,s)),o-=1;o>=a;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===a)return 0;o-=1}else if(u[0][o]0){var o=Object.keys(r),a=o.find((function(e){return t.isOS(e)}));if(a){var u=this.satisfies(r[a]);if(void 0!==u)return u}var d=o.find((function(e){return t.isPlatform(e)}));if(d){var c=this.satisfies(r[d]);if(void 0!==c)return c}}if(s>0){var f=Object.keys(n).find((function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(n[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),n=a.default.getBrowserTypeByAlias(i);return t&&n&&(i=n.toLowerCase()),i===r},t.compareVersion=function(e){var t=[0],r=e,i=!1,n=this.getBrowserVersion();if("string"==typeof n)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(i=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(i=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(n,r,i))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e){return this.isBrowser(e)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i};var s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=n.default.getFirstMatch(s,e)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=n.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:n.default.getFirstMatch(t,e),version:n.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},s=r(18);var o=[{test:[/Roku\/DVP/],describe:function(e){var t=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows/i],describe:function(e){var t=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=n.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:r}}},{test:[/macintosh/i],describe:function(e){var t=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=n.default.getMacOSVersionName(t),i={name:s.OS_MAP.MacOS,version:t};return r&&(i.versionName=r),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=n.default.getAndroidVersionName(t),i={name:s.OS_MAP.Android,version:t};return r&&(i.versionName=r),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:s.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||n.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},s=r(18);var o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=n.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=n.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},s=r(18);var o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},r=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},r=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},r=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},r=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=o,e.exports=t.default}})})); \ No newline at end of file -- 2.39.5