index.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. /******/ (function() { // webpackBootstrap
  2. /******/ "use strict";
  3. /******/ var __webpack_modules__ = ({
  4. /***/ "./client-src/modules/logger/tapable.js":
  5. /*!**********************************************!*\
  6. !*** ./client-src/modules/logger/tapable.js ***!
  7. \**********************************************/
  8. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  9. __webpack_require__.r(__webpack_exports__);
  10. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  11. /* harmony export */ SyncBailHook: function() { return /* binding */ SyncBailHook; }
  12. /* harmony export */ });
  13. function SyncBailHook() {
  14. return {
  15. call: function call() {}
  16. };
  17. }
  18. /**
  19. * Client stub for tapable SyncBailHook
  20. */
  21. // eslint-disable-next-line import/prefer-default-export
  22. /***/ }),
  23. /***/ "./node_modules/webpack/lib/logging/Logger.js":
  24. /*!****************************************************!*\
  25. !*** ./node_modules/webpack/lib/logging/Logger.js ***!
  26. \****************************************************/
  27. /***/ (function(module) {
  28. /*
  29. MIT License http://www.opensource.org/licenses/mit-license.php
  30. Author Tobias Koppers @sokra
  31. */
  32. function _typeof(o) {
  33. "@babel/helpers - typeof";
  34. return _typeof = "function" == typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && "symbol" == typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator ? function (o) {
  35. return typeof o;
  36. } : function (o) {
  37. return o && "function" == typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && o.constructor === (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && o !== (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).prototype ? "symbol" : typeof o;
  38. }, _typeof(o);
  39. }
  40. function _toConsumableArray(r) {
  41. return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
  42. }
  43. function _nonIterableSpread() {
  44. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  45. }
  46. function _unsupportedIterableToArray(r, a) {
  47. if (r) {
  48. if ("string" == typeof r) return _arrayLikeToArray(r, a);
  49. var t = {}.toString.call(r).slice(8, -1);
  50. return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  51. }
  52. }
  53. function _iterableToArray(r) {
  54. if ("undefined" != typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && null != r[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || null != r["@@iterator"]) return Array.from(r);
  55. }
  56. function _arrayWithoutHoles(r) {
  57. if (Array.isArray(r)) return _arrayLikeToArray(r);
  58. }
  59. function _arrayLikeToArray(r, a) {
  60. (null == a || a > r.length) && (a = r.length);
  61. for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  62. return n;
  63. }
  64. function _classCallCheck(a, n) {
  65. if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
  66. }
  67. function _defineProperties(e, r) {
  68. for (var t = 0; t < r.length; t++) {
  69. var o = r[t];
  70. o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
  71. }
  72. }
  73. function _createClass(e, r, t) {
  74. return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
  75. writable: !1
  76. }), e;
  77. }
  78. function _toPropertyKey(t) {
  79. var i = _toPrimitive(t, "string");
  80. return "symbol" == _typeof(i) ? i : i + "";
  81. }
  82. function _toPrimitive(t, r) {
  83. if ("object" != _typeof(t) || !t) return t;
  84. var e = t[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).toPrimitive];
  85. if (void 0 !== e) {
  86. var i = e.call(t, r || "default");
  87. if ("object" != _typeof(i)) return i;
  88. throw new TypeError("@@toPrimitive must return a primitive value.");
  89. }
  90. return ("string" === r ? String : Number)(t);
  91. }
  92. var LogType = Object.freeze({
  93. error: (/** @type {"error"} */"error"),
  94. // message, c style arguments
  95. warn: (/** @type {"warn"} */"warn"),
  96. // message, c style arguments
  97. info: (/** @type {"info"} */"info"),
  98. // message, c style arguments
  99. log: (/** @type {"log"} */"log"),
  100. // message, c style arguments
  101. debug: (/** @type {"debug"} */"debug"),
  102. // message, c style arguments
  103. trace: (/** @type {"trace"} */"trace"),
  104. // no arguments
  105. group: (/** @type {"group"} */"group"),
  106. // [label]
  107. groupCollapsed: (/** @type {"groupCollapsed"} */"groupCollapsed"),
  108. // [label]
  109. groupEnd: (/** @type {"groupEnd"} */"groupEnd"),
  110. // [label]
  111. profile: (/** @type {"profile"} */"profile"),
  112. // [profileName]
  113. profileEnd: (/** @type {"profileEnd"} */"profileEnd"),
  114. // [profileName]
  115. time: (/** @type {"time"} */"time"),
  116. // name, time as [seconds, nanoseconds]
  117. clear: (/** @type {"clear"} */"clear"),
  118. // no arguments
  119. status: (/** @type {"status"} */"status") // message, arguments
  120. });
  121. module.exports.LogType = LogType;
  122. /** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */
  123. var LOG_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger raw log method");
  124. var TIMERS_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger times");
  125. var TIMERS_AGGREGATES_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger aggregated times");
  126. var WebpackLogger = /*#__PURE__*/function () {
  127. /**
  128. * @param {(type: LogTypeEnum, args?: EXPECTED_ANY[]) => void} log log function
  129. * @param {(name: string | (() => string)) => WebpackLogger} getChildLogger function to create child logger
  130. */
  131. function WebpackLogger(log, getChildLogger) {
  132. _classCallCheck(this, WebpackLogger);
  133. this[LOG_SYMBOL] = log;
  134. this.getChildLogger = getChildLogger;
  135. }
  136. /**
  137. * @param {...EXPECTED_ANY} args args
  138. */
  139. return _createClass(WebpackLogger, [{
  140. key: "error",
  141. value: function error() {
  142. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  143. args[_key] = arguments[_key];
  144. }
  145. this[LOG_SYMBOL](LogType.error, args);
  146. }
  147. /**
  148. * @param {...EXPECTED_ANY} args args
  149. */
  150. }, {
  151. key: "warn",
  152. value: function warn() {
  153. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  154. args[_key2] = arguments[_key2];
  155. }
  156. this[LOG_SYMBOL](LogType.warn, args);
  157. }
  158. /**
  159. * @param {...EXPECTED_ANY} args args
  160. */
  161. }, {
  162. key: "info",
  163. value: function info() {
  164. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  165. args[_key3] = arguments[_key3];
  166. }
  167. this[LOG_SYMBOL](LogType.info, args);
  168. }
  169. /**
  170. * @param {...EXPECTED_ANY} args args
  171. */
  172. }, {
  173. key: "log",
  174. value: function log() {
  175. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  176. args[_key4] = arguments[_key4];
  177. }
  178. this[LOG_SYMBOL](LogType.log, args);
  179. }
  180. /**
  181. * @param {...EXPECTED_ANY} args args
  182. */
  183. }, {
  184. key: "debug",
  185. value: function debug() {
  186. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  187. args[_key5] = arguments[_key5];
  188. }
  189. this[LOG_SYMBOL](LogType.debug, args);
  190. }
  191. /**
  192. * @param {EXPECTED_ANY} assertion assertion
  193. * @param {...EXPECTED_ANY} args args
  194. */
  195. }, {
  196. key: "assert",
  197. value: function assert(assertion) {
  198. if (!assertion) {
  199. for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
  200. args[_key6 - 1] = arguments[_key6];
  201. }
  202. this[LOG_SYMBOL](LogType.error, args);
  203. }
  204. }
  205. }, {
  206. key: "trace",
  207. value: function trace() {
  208. this[LOG_SYMBOL](LogType.trace, ["Trace"]);
  209. }
  210. }, {
  211. key: "clear",
  212. value: function clear() {
  213. this[LOG_SYMBOL](LogType.clear);
  214. }
  215. /**
  216. * @param {...EXPECTED_ANY} args args
  217. */
  218. }, {
  219. key: "status",
  220. value: function status() {
  221. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  222. args[_key7] = arguments[_key7];
  223. }
  224. this[LOG_SYMBOL](LogType.status, args);
  225. }
  226. /**
  227. * @param {...EXPECTED_ANY} args args
  228. */
  229. }, {
  230. key: "group",
  231. value: function group() {
  232. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  233. args[_key8] = arguments[_key8];
  234. }
  235. this[LOG_SYMBOL](LogType.group, args);
  236. }
  237. /**
  238. * @param {...EXPECTED_ANY} args args
  239. */
  240. }, {
  241. key: "groupCollapsed",
  242. value: function groupCollapsed() {
  243. for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
  244. args[_key9] = arguments[_key9];
  245. }
  246. this[LOG_SYMBOL](LogType.groupCollapsed, args);
  247. }
  248. }, {
  249. key: "groupEnd",
  250. value: function groupEnd() {
  251. this[LOG_SYMBOL](LogType.groupEnd);
  252. }
  253. /**
  254. * @param {string=} label label
  255. */
  256. }, {
  257. key: "profile",
  258. value: function profile(label) {
  259. this[LOG_SYMBOL](LogType.profile, [label]);
  260. }
  261. /**
  262. * @param {string=} label label
  263. */
  264. }, {
  265. key: "profileEnd",
  266. value: function profileEnd(label) {
  267. this[LOG_SYMBOL](LogType.profileEnd, [label]);
  268. }
  269. /**
  270. * @param {string} label label
  271. */
  272. }, {
  273. key: "time",
  274. value: function time(label) {
  275. /** @type {Map<string | undefined, [number, number]>} */
  276. this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map();
  277. this[TIMERS_SYMBOL].set(label, process.hrtime());
  278. }
  279. /**
  280. * @param {string=} label label
  281. */
  282. }, {
  283. key: "timeLog",
  284. value: function timeLog(label) {
  285. var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
  286. if (!prev) {
  287. throw new Error("No such label '".concat(label, "' for WebpackLogger.timeLog()"));
  288. }
  289. var time = process.hrtime(prev);
  290. this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
  291. }
  292. /**
  293. * @param {string=} label label
  294. */
  295. }, {
  296. key: "timeEnd",
  297. value: function timeEnd(label) {
  298. var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
  299. if (!prev) {
  300. throw new Error("No such label '".concat(label, "' for WebpackLogger.timeEnd()"));
  301. }
  302. var time = process.hrtime(prev);
  303. /** @type {Map<string | undefined, [number, number]>} */
  304. this[TIMERS_SYMBOL].delete(label);
  305. this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
  306. }
  307. /**
  308. * @param {string=} label label
  309. */
  310. }, {
  311. key: "timeAggregate",
  312. value: function timeAggregate(label) {
  313. var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
  314. if (!prev) {
  315. throw new Error("No such label '".concat(label, "' for WebpackLogger.timeAggregate()"));
  316. }
  317. var time = process.hrtime(prev);
  318. /** @type {Map<string | undefined, [number, number]>} */
  319. this[TIMERS_SYMBOL].delete(label);
  320. /** @type {Map<string | undefined, [number, number]>} */
  321. this[TIMERS_AGGREGATES_SYMBOL] = this[TIMERS_AGGREGATES_SYMBOL] || new Map();
  322. var current = this[TIMERS_AGGREGATES_SYMBOL].get(label);
  323. if (current !== undefined) {
  324. if (time[1] + current[1] > 1e9) {
  325. time[0] += current[0] + 1;
  326. time[1] = time[1] - 1e9 + current[1];
  327. } else {
  328. time[0] += current[0];
  329. time[1] += current[1];
  330. }
  331. }
  332. this[TIMERS_AGGREGATES_SYMBOL].set(label, time);
  333. }
  334. /**
  335. * @param {string=} label label
  336. */
  337. }, {
  338. key: "timeAggregateEnd",
  339. value: function timeAggregateEnd(label) {
  340. if (this[TIMERS_AGGREGATES_SYMBOL] === undefined) return;
  341. var time = this[TIMERS_AGGREGATES_SYMBOL].get(label);
  342. if (time === undefined) return;
  343. this[TIMERS_AGGREGATES_SYMBOL].delete(label);
  344. this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
  345. }
  346. }]);
  347. }();
  348. module.exports.Logger = WebpackLogger;
  349. /***/ }),
  350. /***/ "./node_modules/webpack/lib/logging/createConsoleLogger.js":
  351. /*!*****************************************************************!*\
  352. !*** ./node_modules/webpack/lib/logging/createConsoleLogger.js ***!
  353. \*****************************************************************/
  354. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  355. /*
  356. MIT License http://www.opensource.org/licenses/mit-license.php
  357. Author Tobias Koppers @sokra
  358. */
  359. function _slicedToArray(r, e) {
  360. return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
  361. }
  362. function _nonIterableRest() {
  363. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  364. }
  365. function _iterableToArrayLimit(r, l) {
  366. var t = null == r ? null : "undefined" != typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && r[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || r["@@iterator"];
  367. if (null != t) {
  368. var e,
  369. n,
  370. i,
  371. u,
  372. a = [],
  373. f = !0,
  374. o = !1;
  375. try {
  376. if (i = (t = t.call(r)).next, 0 === l) {
  377. if (Object(t) !== t) return;
  378. f = !1;
  379. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
  380. } catch (r) {
  381. o = !0, n = r;
  382. } finally {
  383. try {
  384. if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
  385. } finally {
  386. if (o) throw n;
  387. }
  388. }
  389. return a;
  390. }
  391. }
  392. function _arrayWithHoles(r) {
  393. if (Array.isArray(r)) return r;
  394. }
  395. function _toConsumableArray(r) {
  396. return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
  397. }
  398. function _nonIterableSpread() {
  399. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  400. }
  401. function _unsupportedIterableToArray(r, a) {
  402. if (r) {
  403. if ("string" == typeof r) return _arrayLikeToArray(r, a);
  404. var t = {}.toString.call(r).slice(8, -1);
  405. return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  406. }
  407. }
  408. function _iterableToArray(r) {
  409. if ("undefined" != typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && null != r[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] || null != r["@@iterator"]) return Array.from(r);
  410. }
  411. function _arrayWithoutHoles(r) {
  412. if (Array.isArray(r)) return _arrayLikeToArray(r);
  413. }
  414. function _arrayLikeToArray(r, a) {
  415. (null == a || a > r.length) && (a = r.length);
  416. for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  417. return n;
  418. }
  419. function _typeof(o) {
  420. "@babel/helpers - typeof";
  421. return _typeof = "function" == typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && "symbol" == typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator ? function (o) {
  422. return typeof o;
  423. } : function (o) {
  424. return o && "function" == typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && o.constructor === (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) && o !== (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).prototype ? "symbol" : typeof o;
  425. }, _typeof(o);
  426. }
  427. var _require = __webpack_require__(/*! ./Logger */ "./node_modules/webpack/lib/logging/Logger.js"),
  428. LogType = _require.LogType;
  429. /** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */
  430. /** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */
  431. /** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */
  432. /** @typedef {(item: string) => boolean} FilterFunction */
  433. /** @typedef {(value: string, type: LogTypeEnum, args?: EXPECTED_ANY[]) => void} LoggingFunction */
  434. /**
  435. * @typedef {object} LoggerConsole
  436. * @property {() => void} clear
  437. * @property {() => void} trace
  438. * @property {(...args: EXPECTED_ANY[]) => void} info
  439. * @property {(...args: EXPECTED_ANY[]) => void} log
  440. * @property {(...args: EXPECTED_ANY[]) => void} warn
  441. * @property {(...args: EXPECTED_ANY[]) => void} error
  442. * @property {(...args: EXPECTED_ANY[]) => void=} debug
  443. * @property {(...args: EXPECTED_ANY[]) => void=} group
  444. * @property {(...args: EXPECTED_ANY[]) => void=} groupCollapsed
  445. * @property {(...args: EXPECTED_ANY[]) => void=} groupEnd
  446. * @property {(...args: EXPECTED_ANY[]) => void=} status
  447. * @property {(...args: EXPECTED_ANY[]) => void=} profile
  448. * @property {(...args: EXPECTED_ANY[]) => void=} profileEnd
  449. * @property {(...args: EXPECTED_ANY[]) => void=} logTime
  450. */
  451. /**
  452. * @typedef {object} LoggerOptions
  453. * @property {false|true|"none"|"error"|"warn"|"info"|"log"|"verbose"} level loglevel
  454. * @property {FilterTypes|boolean} debug filter for debug logging
  455. * @property {LoggerConsole} console the console to log to
  456. */
  457. /**
  458. * @param {FilterItemTypes} item an input item
  459. * @returns {FilterFunction | undefined} filter function
  460. */
  461. var filterToFunction = function filterToFunction(item) {
  462. if (typeof item === "string") {
  463. var regExp = new RegExp("[\\\\/]".concat(item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&"), "([\\\\/]|$|!|\\?)"));
  464. return function (ident) {
  465. return regExp.test(ident);
  466. };
  467. }
  468. if (item && _typeof(item) === "object" && typeof item.test === "function") {
  469. return function (ident) {
  470. return item.test(ident);
  471. };
  472. }
  473. if (typeof item === "function") {
  474. return item;
  475. }
  476. if (typeof item === "boolean") {
  477. return function () {
  478. return item;
  479. };
  480. }
  481. };
  482. /**
  483. * @enum {number}
  484. */
  485. var LogLevel = {
  486. none: 6,
  487. false: 6,
  488. error: 5,
  489. warn: 4,
  490. info: 3,
  491. log: 2,
  492. true: 2,
  493. verbose: 1
  494. };
  495. /**
  496. * @param {LoggerOptions} options options object
  497. * @returns {LoggingFunction} logging function
  498. */
  499. module.exports = function (_ref) {
  500. var _ref$level = _ref.level,
  501. level = _ref$level === void 0 ? "info" : _ref$level,
  502. _ref$debug = _ref.debug,
  503. debug = _ref$debug === void 0 ? false : _ref$debug,
  504. console = _ref.console;
  505. var debugFilters = /** @type {FilterFunction[]} */
  506. typeof debug === "boolean" ? [function () {
  507. return debug;
  508. }] : /** @type {FilterItemTypes[]} */[].concat(debug).map(filterToFunction);
  509. var loglevel = LogLevel["".concat(level)] || 0;
  510. /**
  511. * @param {string} name name of the logger
  512. * @param {LogTypeEnum} type type of the log entry
  513. * @param {EXPECTED_ANY[]=} args arguments of the log entry
  514. * @returns {void}
  515. */
  516. var logger = function logger(name, type, args) {
  517. var labeledArgs = function labeledArgs() {
  518. if (Array.isArray(args)) {
  519. if (args.length > 0 && typeof args[0] === "string") {
  520. return ["[".concat(name, "] ").concat(args[0])].concat(_toConsumableArray(args.slice(1)));
  521. }
  522. return ["[".concat(name, "]")].concat(_toConsumableArray(args));
  523. }
  524. return [];
  525. };
  526. var debug = debugFilters.some(function (f) {
  527. return f(name);
  528. });
  529. switch (type) {
  530. case LogType.debug:
  531. if (!debug) return;
  532. if (typeof console.debug === "function") {
  533. console.debug.apply(console, _toConsumableArray(labeledArgs()));
  534. } else {
  535. console.log.apply(console, _toConsumableArray(labeledArgs()));
  536. }
  537. break;
  538. case LogType.log:
  539. if (!debug && loglevel > LogLevel.log) return;
  540. console.log.apply(console, _toConsumableArray(labeledArgs()));
  541. break;
  542. case LogType.info:
  543. if (!debug && loglevel > LogLevel.info) return;
  544. console.info.apply(console, _toConsumableArray(labeledArgs()));
  545. break;
  546. case LogType.warn:
  547. if (!debug && loglevel > LogLevel.warn) return;
  548. console.warn.apply(console, _toConsumableArray(labeledArgs()));
  549. break;
  550. case LogType.error:
  551. if (!debug && loglevel > LogLevel.error) return;
  552. console.error.apply(console, _toConsumableArray(labeledArgs()));
  553. break;
  554. case LogType.trace:
  555. if (!debug) return;
  556. console.trace();
  557. break;
  558. case LogType.groupCollapsed:
  559. if (!debug && loglevel > LogLevel.log) return;
  560. if (!debug && loglevel > LogLevel.verbose) {
  561. if (typeof console.groupCollapsed === "function") {
  562. console.groupCollapsed.apply(console, _toConsumableArray(labeledArgs()));
  563. } else {
  564. console.log.apply(console, _toConsumableArray(labeledArgs()));
  565. }
  566. break;
  567. }
  568. // falls through
  569. case LogType.group:
  570. if (!debug && loglevel > LogLevel.log) return;
  571. if (typeof console.group === "function") {
  572. console.group.apply(console, _toConsumableArray(labeledArgs()));
  573. } else {
  574. console.log.apply(console, _toConsumableArray(labeledArgs()));
  575. }
  576. break;
  577. case LogType.groupEnd:
  578. if (!debug && loglevel > LogLevel.log) return;
  579. if (typeof console.groupEnd === "function") {
  580. console.groupEnd();
  581. }
  582. break;
  583. case LogType.time:
  584. {
  585. if (!debug && loglevel > LogLevel.log) return;
  586. var _args = _slicedToArray(/** @type {[string, number, number]} */
  587. args, 3),
  588. label = _args[0],
  589. start = _args[1],
  590. end = _args[2];
  591. var ms = start * 1000 + end / 1000000;
  592. var msg = "[".concat(name, "] ").concat(label, ": ").concat(ms, " ms");
  593. if (typeof console.logTime === "function") {
  594. console.logTime(msg);
  595. } else {
  596. console.log(msg);
  597. }
  598. break;
  599. }
  600. case LogType.profile:
  601. if (typeof console.profile === "function") {
  602. console.profile.apply(console, _toConsumableArray(labeledArgs()));
  603. }
  604. break;
  605. case LogType.profileEnd:
  606. if (typeof console.profileEnd === "function") {
  607. console.profileEnd.apply(console, _toConsumableArray(labeledArgs()));
  608. }
  609. break;
  610. case LogType.clear:
  611. if (!debug && loglevel > LogLevel.log) return;
  612. if (typeof console.clear === "function") {
  613. console.clear();
  614. }
  615. break;
  616. case LogType.status:
  617. if (!debug && loglevel > LogLevel.info) return;
  618. if (typeof console.status === "function") {
  619. if (!args || args.length === 0) {
  620. console.status();
  621. } else {
  622. console.status.apply(console, _toConsumableArray(labeledArgs()));
  623. }
  624. } else if (args && args.length !== 0) {
  625. console.info.apply(console, _toConsumableArray(labeledArgs()));
  626. }
  627. break;
  628. default:
  629. throw new Error("Unexpected LogType ".concat(type));
  630. }
  631. };
  632. return logger;
  633. };
  634. /***/ }),
  635. /***/ "./node_modules/webpack/lib/logging/runtime.js":
  636. /*!*****************************************************!*\
  637. !*** ./node_modules/webpack/lib/logging/runtime.js ***!
  638. \*****************************************************/
  639. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  640. /*
  641. MIT License http://www.opensource.org/licenses/mit-license.php
  642. Author Tobias Koppers @sokra
  643. */
  644. function _extends() {
  645. return _extends = Object.assign ? Object.assign.bind() : function (n) {
  646. for (var e = 1; e < arguments.length; e++) {
  647. var t = arguments[e];
  648. for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
  649. }
  650. return n;
  651. }, _extends.apply(null, arguments);
  652. }
  653. var _require = __webpack_require__(/*! tapable */ "./client-src/modules/logger/tapable.js"),
  654. SyncBailHook = _require.SyncBailHook;
  655. var _require2 = __webpack_require__(/*! ./Logger */ "./node_modules/webpack/lib/logging/Logger.js"),
  656. Logger = _require2.Logger;
  657. var createConsoleLogger = __webpack_require__(/*! ./createConsoleLogger */ "./node_modules/webpack/lib/logging/createConsoleLogger.js");
  658. /** @type {createConsoleLogger.LoggerOptions} */
  659. var currentDefaultLoggerOptions = {
  660. level: "info",
  661. debug: false,
  662. console: console
  663. };
  664. var currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
  665. /**
  666. * @param {string} name name of the logger
  667. * @returns {Logger} a logger
  668. */
  669. module.exports.getLogger = function (name) {
  670. return new Logger(function (type, args) {
  671. if (module.exports.hooks.log.call(name, type, args) === undefined) {
  672. currentDefaultLogger(name, type, args);
  673. }
  674. }, function (childName) {
  675. return module.exports.getLogger("".concat(name, "/").concat(childName));
  676. });
  677. };
  678. /**
  679. * @param {createConsoleLogger.LoggerOptions} options new options, merge with old options
  680. * @returns {void}
  681. */
  682. module.exports.configureDefaultLogger = function (options) {
  683. _extends(currentDefaultLoggerOptions, options);
  684. currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
  685. };
  686. module.exports.hooks = {
  687. log: new SyncBailHook(["origin", "type", "args"])
  688. };
  689. /***/ })
  690. /******/ });
  691. /************************************************************************/
  692. /******/ // The module cache
  693. /******/ var __webpack_module_cache__ = {};
  694. /******/
  695. /******/ // The require function
  696. /******/ function __webpack_require__(moduleId) {
  697. /******/ // Check if module is in cache
  698. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  699. /******/ if (cachedModule !== undefined) {
  700. /******/ return cachedModule.exports;
  701. /******/ }
  702. /******/ // Create a new module (and put it into the cache)
  703. /******/ var module = __webpack_module_cache__[moduleId] = {
  704. /******/ // no module.id needed
  705. /******/ // no module.loaded needed
  706. /******/ exports: {}
  707. /******/ };
  708. /******/
  709. /******/ // Execute the module function
  710. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  711. /******/
  712. /******/ // Return the exports of the module
  713. /******/ return module.exports;
  714. /******/ }
  715. /******/
  716. /************************************************************************/
  717. /******/ /* webpack/runtime/define property getters */
  718. /******/ !function() {
  719. /******/ // define getter functions for harmony exports
  720. /******/ __webpack_require__.d = function(exports, definition) {
  721. /******/ for(var key in definition) {
  722. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  723. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  724. /******/ }
  725. /******/ }
  726. /******/ };
  727. /******/ }();
  728. /******/
  729. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  730. /******/ !function() {
  731. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  732. /******/ }();
  733. /******/
  734. /******/ /* webpack/runtime/make namespace object */
  735. /******/ !function() {
  736. /******/ // define __esModule on exports
  737. /******/ __webpack_require__.r = function(exports) {
  738. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  739. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  740. /******/ }
  741. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  742. /******/ };
  743. /******/ }();
  744. /******/
  745. /************************************************************************/
  746. var __webpack_exports__ = {};
  747. // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
  748. !function() {
  749. /*!********************************************!*\
  750. !*** ./client-src/modules/logger/index.js ***!
  751. \********************************************/
  752. __webpack_require__.r(__webpack_exports__);
  753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  754. /* harmony export */ "default": function() { return /* reexport default export from named module */ webpack_lib_logging_runtime_js__WEBPACK_IMPORTED_MODULE_0__; }
  755. /* harmony export */ });
  756. /* harmony import */ var webpack_lib_logging_runtime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webpack/lib/logging/runtime.js */ "./node_modules/webpack/lib/logging/runtime.js");
  757. }();
  758. var __webpack_export_target__ = exports;
  759. for(var __webpack_i__ in __webpack_exports__) __webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
  760. if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
  761. /******/ })()
  762. ;