UNPKG

@appliedblockchain/silentdatarollup-ethers-provider-fireblocks

Version:

Ethers.js provider for Silent Data [Rollup] with Fireblocks integration

1,360 lines (1,356 loc) 1.56 MB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // ../../node_modules/platform/platform.js var require_platform = __commonJS({ "../../node_modules/platform/platform.js"(exports, module) { "use strict"; (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 parse2(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" : "\u03B1"; var beta = java ? "b" : "\u03B2"; 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 version4 = 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(patterns, function(result, pattern) { return result || (RegExp(pattern + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(ua) || 0)[1] || null; }); } function toStringPlatform() { return this.description || ""; } layout && (layout = [layout]); if (/\bAndroid\b/.test(os) && !product && (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) { product = trim(data[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i, "") || null; } if (manufacturer && !product) { product = getProduct([manufacturer]); } else if (manufacturer && product) { product = product.replace(RegExp("^(" + qualify(manufacturer) + ")[-_.\\s]", "i"), manufacturer + " ").replace(RegExp("^(" + qualify(manufacturer) + ")[-_.]?(\\w)", "i"), manufacturer + " $2"); } if (data = /\bGoogle TV\b/.exec(product)) { product = data[0]; } if (/\bSimulator\b/i.test(ua)) { product = (product ? product + " " : "") + "Simulator"; } if (name == "Opera Mini" && /\bOPiOS\b/.test(ua)) { description.push("running in Turbo/Uncompressed mode"); } if (name == "IE" && /\blike iPhone OS\b/.test(ua)) { data = parse2(ua.replace(/like iPhone OS/, "")); manufacturer = data.manufacturer; product = data.product; } else if (/^iP/.test(product)) { name || (name = "Safari"); os = "iOS" + ((data = / OS ([\d_]+)/i.exec(ua)) ? " " + data[1].replace(/_/g, ".") : ""); } else if (name == "Konqueror" && /^Linux\b/i.test(os)) { os = "Kubuntu"; } else if (manufacturer && manufacturer != "Google" && (/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua) || /\bVita\b/.test(product)) || /\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua)) { name = "Android Browser"; os = /\bAndroid\b/.test(os) ? os : "Android"; } else if (name == "Silk") { if (!/\bMobi/i.test(ua)) { os = "Android"; description.unshift("desktop mode"); } if (/Accelerated *= *true/i.test(ua)) { description.unshift("accelerated"); } } else if (name == "UC Browser" && /\bUCWEB\b/.test(ua)) { description.push("speed mode"); } else if (name == "PaleMoon" && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) { description.push("identifying as Firefox " + data[1]); } else if (name == "Firefox" && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) { os || (os = "Firefox OS"); product || (product = data[1]); } else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) { if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + "/") + 8))) { name = null; } if ((data = product || manufacturer || os) && (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) { name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + " Browser"; } } else if (name == "Electron" && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) { description.push("Chromium " + data); } if (!version4) { version4 = getVersion([ "(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)", "Version", qualify(name), "(?:Firefox|Minefield|NetFront)" ]); } if (data = layout == "iCab" && parseFloat(version4) > 3 && "WebKit" || /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && "WebKit" || !layout && /\bMSIE\b/i.test(ua) && (os == "Mac OS" ? "Tasman" : "Trident") || layout == "WebKit" && /\bPlayStation\b(?! Vita\b)/i.test(name) && "NetFront") { layout = [data]; } if (name == "IE" && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) { name += " Mobile"; os = "Windows Phone " + (/\+$/.test(data) ? data : data + ".x"); description.unshift("desktop mode"); } else if (/\bWPDesktop\b/i.test(ua)) { name = "IE Mobile"; os = "Windows Phone 8.x"; description.unshift("desktop mode"); version4 || (version4 = (/\brv:([\d.]+)/.exec(ua) || 0)[1]); } else if (name != "IE" && layout == "Trident" && (data = /\brv:([\d.]+)/.exec(ua))) { if (name) { description.push("identifying as " + name + (version4 ? " " + version4 : "")); } name = "IE"; version4 = data[1]; } if (useFeatures) { if (isHostType(context, "global")) { if (java) { data = java.lang.System; arch = data.getProperty("os.arch"); os = os || data.getProperty("os.name") + " " + data.getProperty("os.version"); } if (rhino) { try { version4 = context.require("ringo/engine").version.join("."); name = "RingoJS"; } catch (e) { if ((data = context.system) && data.global.system == context.system) { name = "Narwhal"; os || (os = data[0].os || null); } } if (!name) { name = "Rhino"; } } else if (typeof context.process == "object" && !context.process.browser && (data = context.process)) { if (typeof data.versions == "object") { if (typeof data.versions.electron == "string") { description.push("Node " + data.versions.node); name = "Electron"; version4 = data.versions.electron; } else if (typeof data.versions.nw == "string") { description.push("Chromium " + version4, "Node " + data.versions.node); name = "NW.js"; version4 = data.versions.nw; } } if (!name) { name = "Node.js"; arch = data.arch; os = data.platform; version4 = /[\d.]+/.exec(data.version); version4 = version4 ? version4[0] : null; } } } else if (getClassOf(data = context.runtime) == airRuntimeClass) { name = "Adobe AIR"; os = data.flash.system.Capabilities.os; } else if (getClassOf(data = context.phantom) == phantomClass) { name = "PhantomJS"; version4 = (data = data.version || null) && data.major + "." + data.minor + "." + data.patch; } else if (typeof doc.documentMode == "number" && (data = /\bTrident\/(\d+)/i.exec(ua))) { version4 = [version4, doc.documentMode]; if ((data = +data[1] + 4) != version4[1]) { description.push("IE " + version4[1] + " mode"); layout && (layout[1] = ""); version4[1] = data; } version4 = name == "IE" ? String(version4[1].toFixed(1)) : version4[0]; } else if (typeof doc.documentMode == "number" && /^(?:Chrome|Firefox)\b/.test(name)) { description.push("masking as " + name + " " + version4); name = "IE"; version4 = "11.0"; layout = ["Trident"]; os = "Windows"; } os = os && format(os); } if (version4 && (data = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version4) || /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ";" + (useFeatures && nav.appMinorVersion)) || /\bMinefield\b/i.test(ua) && "a")) { prerelease = /b/i.test(data) ? "beta" : "alpha"; version4 = version4.replace(RegExp(data + "\\+?$"), "") + (prerelease == "beta" ? beta : alpha) + (/\d+\+?/.exec(data) || ""); } if (name == "Fennec" || name == "Firefox" && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) { name = "Firefox Mobile"; } else if (name == "Maxthon" && version4) { version4 = version4.replace(/\.[\d.]+/, ".x"); } else if (/\bXbox\b/i.test(product)) { if (product == "Xbox 360") { os = null; } if (product == "Xbox 360" && /\bIEMobile\b/.test(ua)) { description.unshift("mobile mode"); } } else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && (os == "Windows CE" || /Mobi/i.test(ua))) { name += " Mobile"; } else if (name == "IE" && useFeatures) { try { if (context.external === null) { description.unshift("platform preview"); } } catch (e) { description.unshift("embedded"); } } else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = (RegExp(product.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(ua) || 0)[1] || version4)) { data = [data, /BB10/.test(ua)]; os = (data[1] ? (product = null, manufacturer = "BlackBerry") : "Device Software") + " " + data[0]; version4 = null; } else if (this != forOwn && product != "Wii" && (useFeatures && opera || /Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua) || name == "Firefox" && /\bOS X (?:\d+\.){2,}/.test(os) || name == "IE" && (os && !/^Win/.test(os) && version4 > 5.5 || /\bWindows XP\b/.test(os) && version4 > 8 || version4 == 8 && !/\bTrident\b/.test(ua))) && !reOpera.test(data = parse2.call(forOwn, ua.replace(reOpera, "") + ";")) && data.name) { data = "ing as " + data.name + ((data = data.version) ? " " + data : ""); if (reOpera.test(name)) { if (/\bIE\b/.test(data) && os == "Mac OS") { os = null; } data = "identify" + data; } else { data = "mask" + data; if (operaClass) { name = format(operaClass.replace(/([a-z])([A-Z])/g, "$1 $2")); } else { name = "Opera"; } if (/\bIE\b/.test(data)) { os = null; } if (!useFeatures) { version4 = null; } } layout = ["Presto"]; description.push(data); } if (data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1]) { data = [parseFloat(data.replace(/\.(\d)$/, ".0$1")), data]; if (name == "Safari" && data[1].slice(-1) == "+") { name = "WebKit Nightly"; prerelease = "alpha"; version4 = data[1].slice(0, -1); } else if (version4 == data[1] || version4 == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { version4 = null; } data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1]; if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == "WebKit") { layout = ["Blink"]; } if (!useFeatures || !likeChrome && !data[1]) { layout && (layout[1] = "like Safari"); data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? "4+" : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : "12"); } else { layout && (layout[1] = "like Chrome"); data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.1 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.3 ? 11 : data < 535.01 ? 12 : data < 535.02 ? "13+" : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.1 ? 19 : data < 537.01 ? 20 : data < 537.11 ? "21+" : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != "Blink" ? "27" : "28"); } layout && (layout[1] += " " + (data += typeof data == "number" ? ".x" : /[.+]/.test(data) ? "" : "+")); if (name == "Safari" && (!version4 || parseInt(version4) > 45)) { version4 = data; } else if (name == "Chrome" && /\bHeadlessChrome/i.test(ua)) { description.unshift("headless"); } } if (name == "Opera" && (data = /\bzbov|zvav$/.exec(os))) { name += " "; description.unshift("desktop mode"); if (data == "zvav") { name += "Mini"; version4 = null; } else { name += "Mobile"; } os = os.replace(RegExp(" *" + data + "$"), ""); } else if (name == "Safari" && /\bChrome\b/.exec(layout && layout[1])) { description.unshift("desktop mode"); name = "Chrome Mobile"; version4 = null; if (/\bOS X\b/.test(os)) { manufacturer = "Apple"; os = "iOS 4.3+"; } else { os = null; } } else if (/\bSRWare Iron\b/.test(name) && !version4) { version4 = getVersion("Chrome"); } if (version4 && version4.indexOf(data = /[\d.]+$/.exec(os)) == 0 && ua.indexOf("/" + data + "-") > -1) { os = trim(os.replace(data, "")); } if (os && os.indexOf(name) != -1 && !RegExp(name + " OS").test(os)) { os = os.replace(RegExp(" *" + qualify(name) + " *"), ""); } if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (/Browser|Lunascape|Maxthon/.test(name) || name != "Safari" && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) { (data = layout[layout.length - 1]) && description.push(data); } if (description.length) { description = ["(" + description.join("; ") + ")"]; } if (manufacturer && product && product.indexOf(manufacturer) < 0) { description.push("on " + manufacturer); } if (product) { description.push((/^on /.test(description[description.length - 1]) ? "" : "on ") + product); } if (os) { data = / ([\d.+]+)$/.exec(os); isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == "/"; os = { "architecture": 32, "family": data && !isSpecialCasedOS ? os.replace(data[0], "") : os, "version": data ? data[1] : null, "toString": function() { var version5 = this.version; return this.family + (version5 && !isSpecialCasedOS ? " " + version5 : "") + (this.architecture == 64 ? " 64-bit" : ""); } }; } if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) { if (os) { os.architecture = 64; os.family = os.family.replace(RegExp(" *" + data), ""); } if (name && (/\bWOW64\b/i.test(ua) || useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) { description.unshift("32-bit"); } } else if (os && /^OS X/.test(os.family) && name == "Chrome" && parseFloat(version4) >= 39) { os.architecture = 64; } ua || (ua = null); var platform2 = {}; platform2.description = ua; platform2.layout = layout && layout[0]; platform2.manufacturer = manufacturer; platform2.name = name; platform2.prerelease = prerelease; platform2.product = product; platform2.ua = ua; platform2.version = name && version4; platform2.os = os || { /** * The CPU architecture the OS is built for. * * @memberOf platform.os * @type number|null */ "architecture": null, /** * The family of the OS. * * Common values include: * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista", * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat", * "SuSE", "Android", "iOS" and "Windows Phone" * * @memberOf platform.os * @type string|null */ "family": null, /** * The version of the OS. * * @memberOf platform.os * @type string|null */ "version": null, /** * Returns the OS string. * * @memberOf platform.os * @returns {string} The OS string. */ "toString": function() { return "null"; } }; platform2.parse = parse2; platform2.toString = toStringPlatform; if (platform2.version) { description.unshift(version4); } if (platform2.name) { description.unshift(name); } if (os && name && !(os == String(os).split(" ")[0] && (os == name.split(" ")[0] || product))) { description.push(product ? "(" + os + ")" : "on " + os); } if (description.length) { platform2.description = description.join(" "); } return platform2; } var platform = parse2(); if (typeof define == "function" && typeof define.amd == "object" && define.amd) { root.platform = platform; define(function() { return platform; }); } else if (freeExports && freeModule) { forOwn(platform, function(value, key) { freeExports[key] = value; }); } else { root.platform = platform; } }).call(exports); } }); // ../../node_modules/delayed-stream/lib/delayed_stream.js var require_delayed_stream = __commonJS({ "../../node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) { "use strict"; var Stream = __require("stream").Stream; var util = __require("util"); module.exports = DelayedStream; function DelayedStream() { this.source = null; this.dataSize = 0; this.maxDataSize = 1024 * 1024; this.pauseStream = true; this._maxDataSizeExceeded = false; this._released = false; this._bufferedEvents = []; } util.inherits(DelayedStream, Stream); DelayedStream.create = function(source, options) { var delayedStream = new this(); options = options || {}; for (var option in options) { delayedStream[option] = options[option]; } delayedStream.source = source; var realEmit = source.emit; source.emit = function() { delayedStream._handleEmit(arguments); return realEmit.apply(source, arguments); }; source.on("error", function() { }); if (delayedStream.pauseStream) { source.pause(); } return delayedStream; }; Object.defineProperty(DelayedStream.prototype, "readable", { configurable: true, enumerable: true, get: function() { return this.source.readable; } }); DelayedStream.prototype.setEncoding = function() { return this.source.setEncoding.apply(this.source, arguments); }; DelayedStream.prototype.resume = function() { if (!this._released) { this.release(); } this.source.resume(); }; DelayedStream.prototype.pause = function() { this.source.pause(); }; DelayedStream.prototype.release = function() { this._released = true; this._bufferedEvents.forEach(function(args) { this.emit.apply(this, args); }.bind(this)); this._bufferedEvents = []; }; DelayedStream.prototype.pipe = function() { var r = Stream.prototype.pipe.apply(this, arguments); this.resume(); return r; }; DelayedStream.prototype._handleEmit = function(args) { if (this._released) { this.emit.apply(this, args); return; } if (args[0] === "data") { this.dataSize += args[1].length; this._checkIfMaxDataSizeExceeded(); } this._bufferedEvents.push(args); }; DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { if (this._maxDataSizeExceeded) { return; } if (this.dataSize <= this.maxDataSize) { return; } this._maxDataSizeExceeded = true; var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; this.emit("error", new Error(message)); }; } }); // ../../node_modules/combined-stream/lib/combined_stream.js var require_combined_stream = __commonJS({ "../../node_modules/combined-stream/lib/combined_stream.js"(exports, module) { "use strict"; var util = __require("util"); var Stream = __require("stream").Stream; var DelayedStream = require_delayed_stream(); module.exports = CombinedStream; function CombinedStream() { this.writable = false; this.readable = true; this.dataSize = 0; this.maxDataSize = 2 * 1024 * 1024; this.pauseStreams = true; this._released = false; this._streams = []; this._currentStream = null; this._insideLoop = false; this._pendingNext = false; } util.inherits(CombinedStream, Stream); CombinedStream.create = function(options) { var combinedStream = new this(); options = options || {}; for (var option in options) { combinedStream[option] = options[option]; } return combinedStream; }; CombinedStream.isStreamLike = function(stream) { return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); }; CombinedStream.prototype.append = function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { if (!(stream instanceof DelayedStream)) { var newStream = DelayedStream.create(stream, { maxDataSize: Infinity, pauseStream: this.pauseStreams }); stream.on("data", this._checkDataSize.bind(this)); stream = newStream; } this._handleErrors(stream); if (this.pauseStreams) { stream.pause(); } } this._streams.push(stream); return this; }; CombinedStream.prototype.pipe = function(dest, options) { Stream.prototype.pipe.call(this, dest, options); this.resume(); return dest; }; CombinedStream.prototype._getNext = function() { this._currentStream = null; if (this._insideLoop) { this._pendingNext = true; return; } this._insideLoop = true; try { do { this._pendingNext = false; this._realGetNext(); } while (this._pendingNext); } finally { this._insideLoop = false; } }; CombinedStream.prototype._realGetNext = function() { var stream = this._streams.shift(); if (typeof stream == "undefined") { this.end(); return; } if (typeof stream !== "function") { this._pipeNext(stream); return; } var getStream = stream; getStream(function(stream2) { var isStreamLike = CombinedStream.isStreamLike(stream2); if (isStreamLike) { stream2.on("data", this._checkDataSize.bind(this)); this._handleErrors(stream2); } this._pipeNext(stream2); }.bind(this)); }; CombinedStream.prototype._pipeNext = function(stream) { this._currentStream = stream; var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { stream.on("end", this._getNext.bind(this)); stream.pipe(this, { end: false }); return; } var value = stream; this.write(value); this._getNext(); }; CombinedStream.prototype._handleErrors = function(stream) { var self2 = this; stream.on("error", function(err) { self2._emitError(err); }); }; CombinedStream.prototype.write = function(data) { this.emit("data", data); }; CombinedStream.prototype.pause = function() { if (!this.pauseStreams) { return; } if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause(); this.emit("pause"); }; CombinedStream.prototype.resume = function() { if (!this._released) { this._released = true; this.writable = true; this._getNext(); } if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume(); this.emit("resume"); }; CombinedStream.prototype.end = function() { this._reset(); this.emit("end"); }; CombinedStream.prototype.destroy = function() { this._reset(); this.emit("close"); }; CombinedStream.prototype._reset = function() { this.writable = false; this._streams = []; this._currentStream = null; }; CombinedStream.prototype._checkDataSize = function() { this._updateDataSize(); if (this.dataSize <= this.maxDataSize) { return; } var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded."; this._emitError(new Error(message)); }; CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self2 = this; this._streams.forEach(function(stream) { if (!stream.dataSize) { return; } self2.dataSize += stream.dataSize; }); if (this._currentStream && this._currentStream.dataSize) { this.dataSize += this._currentStream.dataSize; } }; CombinedStream.prototype._emitError = function(err) { this._reset(); this.emit("error", err); }; } }); // ../../node_modules/mime-db/db.json var require_db = __commonJS({ "../../node_modules/mime-db/db.json"(exports, module) { module.exports = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/3gpp-ims+xml": { source: "iana", compressible: true }, "application/3gpphal+json": { source: "iana", compressible: true }, "application/3gpphalforms+json": { source: "iana", compressible: true }, "application/a2l": { source: "iana" }, "application/ace+cbor": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: true }, "application/alto-costmap+json": { source: "iana", compressible: true }, "application/alto-costmapfilter+json": { source: "iana", compressible: true }, "application/alto-directory+json": { source: "iana", compressible: true }, "application/alto-endpointcost+json": { source: "iana", compressible: true }, "application/alto-endpointcostparams+json": { source: "iana", compressible: true }, "application/alto-endpointprop+json": { source: "iana", compressible: true }, "application/alto-endpointpropparams+json": { source: "iana", compressible: true }, "application/alto-error+json": { source: "iana", compressible: true }, "application/alto-networkmap+json": { source: "iana", compressible: true }, "application/alto-networkmapfilter+json": { source: "iana", compressible: true }, "application/alto-updatestreamcontrol+json": { source: "iana", compressible: true }, "application/alto-updatestreamparams+json": { source: "iana", compressible: true }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/at+jwt": { source: "iana" }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: true, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", compressible: true, extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana", compressible: true, extensions: ["atomdeleted"] }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: true, extensions: ["atomsvc"] }, "application/atsc-dwd+xml": { source: "iana", compressible: true, extensions: ["dwd"] }, "application/atsc-dynamic-event-message": { source: "iana" }, "application/atsc-held+xml": { source: "iana", compressible: true, extensions: ["held"] }, "application/atsc-rdt+json": { source: "iana", compressible: true }, "application/atsc-rsat+xml": { source: "iana", compressible: true, extensions: ["rsat"] }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: true }, "application/bacnet-xdd+zip": { source: "iana", compressible: false }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: false, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/calendar+json": { source: "iana", compressible: true }, "application/calendar+xml": { source: "iana", compressible: true, extensions: ["xcs"] }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/captive+json": { source: "iana", compressible: true }, "application/cbor": { source: "iana" }, "application/cbor-seq": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: true }, "application/ccxml+xml": { source: "iana", compressible: true, extensions: ["ccxml"] }, "application/cdfx+xml": { source: "iana", compressible: true, extensions: ["cdfx"] }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: true }, "application/cellml+xml": { source: "iana", compressible: true }, "application/cfw": { source: "iana" }, "application/city+json": { source: "iana", compressible: true }, "application/clr": { source: "iana" }, "application/clue+xml": { source: "iana", compressible: true }, "application/clue_info+xml": { source: "iana", compressible: true }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: true }, "application/coap-group+json": { source: "iana", compressible: true }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: true }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: true, extensions: ["cpl"] }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: true }, "application/cstadata+xml": { source: "iana", compressible: true }, "application/csvm+json": { source: "iana", compressible: true }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: true }, "application/dash+xml": { source: "iana", compressible: true, extensions: ["mpd"] }, "application/dash-patch+xml": { source: "iana", compressible: true, extensions: ["mpp"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: true, extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: true }, "application/dicom": { source: "iana" }, "application/dicom+json": {