/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 2); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { // Unique ID creation requires a high quality random # generator. In the // browser this is a little complicated due to unknown quality of Math.random() // and inconsistent support for the `crypto` API. We do the best we can via // feature-detection // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) || (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto)); if (getRandomValues) { // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef module.exports = function whatwgRNG() { getRandomValues(rnds8); return rnds8; }; } else { // Math.random()-based (RNG) // // If all else fails, use Math.random(). It's fast, but is of unspecified // quality. var rnds = new Array(16); module.exports = function mathRNG() { for (var i = 0, r; i < 16; i++) { if ((i & 0x03) === 0) r = Math.random() * 0x100000000; rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; } return rnds; }; } /***/ }), /* 1 */ /***/ (function(module, exports) { /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ var byteToHex = []; for (var i = 0; i < 256; ++i) { byteToHex[i] = (i + 0x100).toString(16).substr(1); } function bytesToUuid(buf, offset) { var i = offset || 0; var bth = byteToHex; return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]]; } module.exports = bytesToUuid; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License Copyright (c) 2018 Bryan Hughes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; Object.defineProperty(exports, "__esModule", { value: true }); var common_1 = __webpack_require__(3); var uuid_1 = __webpack_require__(4); var serviceId = uuid_1.v4(); var options; var isInitialized = false; var oldXMLHttpRequest; function init(newOptions, cb) { options = newOptions; // Patch fetch if (window.fetch) { var oldFetch_1 = window.fetch; window.fetch = function fetch(input, fetchInit) { var requestId = uuid_1.v4(); if (fetchInit) { if (fetchInit.headers) { if (fetchInit.headers instanceof Headers) { fetchInit.headers.set(common_1.HEADER_NAME, requestId); } else { fetchInit.headers[common_1.HEADER_NAME] = requestId; } } else { fetchInit.headers = (_a = {}, _a[common_1.HEADER_NAME] = requestId, _a); } } else { fetchInit = { headers: (_b = {}, _b[common_1.HEADER_NAME] = requestId, _b) }; } var fetchEvent = begin(requestId, common_1.EVENT_NAMES.BROWSER_HTTP_FETCH_REQUEST, { url: typeof input === 'string' ? input : input.url }); var req = oldFetch_1(input, fetchInit); req.then(function (response) { end(fetchEvent); return response; }); return req; var _a, _b; }; } // Patch XHR oldXMLHttpRequest = window.XMLHttpRequest; window.XMLHttpRequest = function XMLHttpRequest() { var req = new oldXMLHttpRequest(arguments); var requestId = uuid_1.v4(); var xhrEvent; req.addEventListener('load', function () { end(xhrEvent); }); var method; var url; var oldOpen = req.open; req.open = function open(newMethod, newUrl) { method = newMethod; url = newUrl; var result = oldOpen.apply(this, arguments); req.setRequestHeader(common_1.HEADER_NAME, requestId); return result; }; var oldSend = req.send; req.send = function send() { xhrEvent = begin(requestId, common_1.EVENT_NAMES.BROWSER_HTTP_XHR_REQUEST, { url: url, method: method }); return oldSend.apply(this, arguments); }; return req; }; // Register with the server var service = { serviceId: serviceId, serviceName: 'client' }; var registerReq = new oldXMLHttpRequest(); registerReq.open('POST', "http://" + options.serverHostname + ":" + options.serverPort + "/api/register"); registerReq.addEventListener('load', function () { isInitialized = true; if (cb) { cb(undefined); } }); registerReq.addEventListener('error', function (e) { return cb && cb(e.error); }); registerReq.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); registerReq.send(JSON.stringify(service)); } exports.init = init; function sendEvent(event) { var req = new oldXMLHttpRequest(); req.open('POST', "http://" + options.serverHostname + ":" + options.serverPort + "/api/events"); req.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); req.send(JSON.stringify(event)); } function begin(requestId, type, details) { if (details === void 0) { details = {}; } if (!isInitialized) { throw new Error('"begin" was called before Request Inspector was finished initializing'); } if (typeof type !== 'string') { throw new Error('"name" must be a string'); } if (!requestId) { throw new Error('Internal Error: could not get request ID. ' + 'This is a bug in Request Inspector, please report it to the author.'); } var newEntry = { eventId: requestId, serviceId: serviceId, requestId: requestId, type: type, start: Date.now(), end: NaN, details: details }; sendEvent(newEntry); return newEntry; } exports.begin = begin; function end(event, details) { if (details === void 0) { details = {}; } if (!isInitialized) { throw new Error('"begin" was called before Request Inspector was finished initializing'); } if (!isNaN(event.end)) { throw new Error("\"end\" called twice for " + event.type + ":" + event.eventId); } event.end = Date.now(); event.details = __assign({}, event.details, details); sendEvent(event); } exports.end = end; window.requestInspector = { init: init, begin: begin, end: end }; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License Copyright (c) 2018 Bryan Hughes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.EVENT_NAMES = { NODE_HTTP_SERVER_REQUEST: 'builtin:node:server-request', BROWSER_HTTP_XHR_REQUEST: 'builtin:browser:xhr-request', BROWSER_HTTP_FETCH_REQUEST: 'builtin:browser:fetch-request' }; exports.HEADER_NAME = 'x-request-inspector-request-ID'; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { var v1 = __webpack_require__(5); var v4 = __webpack_require__(6); var uuid = v4; uuid.v1 = v1; uuid.v4 = v4; module.exports = uuid; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(0); var bytesToUuid = __webpack_require__(1); // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html var _nodeId; var _clockseq; // Previous uuid creation time var _lastMSecs = 0; var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not // specified. We do this lazily to minimize issues related to insufficient // system entropy. See #189 if (node == null || clockseq == null) { var seedBytes = rng(); if (node == null) { // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) node = _nodeId = [ seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] ]; } if (clockseq == null) { // Per 4.2.2, randomize (14 bit) clockseq clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; } } // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq === undefined) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } return buf ? buf : bytesToUuid(b); } module.exports = v1; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var rng = __webpack_require__(0); var bytesToUuid = __webpack_require__(1); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ++ii) { buf[i + ii] = rnds[ii]; } } return buf || bytesToUuid(rnds); } module.exports = v4; /***/ }) /******/ ]); //# sourceMappingURL=bundle.js.map