index.js 28 KB

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